Package studio.mevera.lotus.api.item
Class AbstractItemBuilder<B extends AbstractItemBuilder<B,C>,C>
java.lang.Object
studio.mevera.lotus.api.item.AbstractItemBuilder<B,C>
- Type Parameters:
B- the concrete builder typeC- the display-name/lore component type
Abstract fluent builder for
ItemStack instances. Parameterized over:
B— the concrete builder type (self-type for fluent method chaining)C— the display-name/lore component type:Componenton Paper,Stringon Spigot
Each platform module provides a concrete ItemBuilder class (same simple name,
different package) extending this base:
studio.mevera.lotus.paper.ItemBuilder— Paper 1.21+: usesItemStack.of(),editMeta()lambda, AdventureComponentstudio.mevera.lotus.spigot.ItemBuilder— Spigot 1.8.8: usesnew ItemStack(Material), classicgetItemMeta()/setItemMeta(),StringwithChatColortranslation
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected final org.bukkit.Materialprotected boolean -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractItemBuilder(@NotNull org.bukkit.Material material) -
Method Summary
Modifier and TypeMethodDescriptionamount(int amount) Sets the item stack size.abstract @NotNull org.bukkit.inventory.ItemStackbuild()Builds and returns the configuredItemStack.abstract BdisplayName(C name) Sets the display name of the item.final Babstract BSets the lore of the item.protected final Bself()Returns this builder cast toB, enabling fluent method chaining in subclasses.unbreakable(boolean value) Sets whether this item is unbreakable.
-
Field Details
-
material
protected final org.bukkit.Material material -
amount
protected int amount -
unbreakable
protected boolean unbreakable
-
-
Constructor Details
-
AbstractItemBuilder
protected AbstractItemBuilder(@NotNull @NotNull org.bukkit.Material material)
-
-
Method Details
-
self
Returns this builder cast toB, enabling fluent method chaining in subclasses. -
amount
Sets the item stack size. -
unbreakable
Sets whether this item is unbreakable. -
displayName
Sets the display name of the item.- Parameters:
name- the display name in the platform's component type
-
lore
Sets the lore of the item.- Parameters:
lines- the lore lines in the platform's component type
-
lore
-
build
@NotNull public abstract @NotNull org.bukkit.inventory.ItemStack build()Builds and returns the configuredItemStack.
-