Class SimpleItemComponentBuilder<B extends SimpleItemComponentBuilder<B>>
java.lang.Object
io.github.toberocat.guiengine.components.AbstractGuiComponentBuilder<B>
io.github.toberocat.guiengine.components.provided.item.SimpleItemComponentBuilder<B>
- Type Parameters:
B
- The type of the builder, used for method chaining.
- All Implemented Interfaces:
GuiComponentBuilder
public class SimpleItemComponentBuilder<B extends SimpleItemComponentBuilder<B>>
extends AbstractGuiComponentBuilder<B>
A builder class for creating SimpleItemComponent instances.
This builder provides methods for setting various properties of the SimpleItemComponent.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected @NotNull String[]
protected @Nullable org.bukkit.Material
protected @NotNull String
protected @Nullable UUID
protected @Nullable String
Fields inherited from class io.github.toberocat.guiengine.components.AbstractGuiComponentBuilder
clickFunctions, closeFunctions, dragFunctions, hidden, id, priority, x, y
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull SimpleItemComponent
Create a new instance of the GUI component.void
deserialize
(@NotNull ParserContext node) Deserialize the properties of the GUI component from the provided ParserContext node.protected @NotNull org.bukkit.inventory.ItemStack
Creates the item stack represented by the builder's settingsSet the lore of the item.setMaterial
(@NotNull org.bukkit.Material material) Set the material of the item (e.g., DIAMOND, GOLD_INGOT, etc.).Set the name of the item.Set the owner UUID for the item (only applicable to PLAYER_HEAD or SKULL items).setTextureId
(@Nullable String textureId) Set the texture ID for the item (only applicable to PLAYER_HEAD or SKULL items).Methods inherited from class io.github.toberocat.guiengine.components.AbstractGuiComponentBuilder
getId, self, setClickFunctions, setCloseFunctions, setDragFunctions, setHidden, setId, setPriority, setX, setY
-
Field Details
-
name
-
material
@Nullable protected @Nullable org.bukkit.Material material -
lore
-
textureId
-
owner
-
-
Constructor Details
-
SimpleItemComponentBuilder
public SimpleItemComponentBuilder()
-
-
Method Details
-
setTextureId
Set the texture ID for the item (only applicable to PLAYER_HEAD or SKULL items).- Parameters:
textureId
- The texture ID for the item.- Returns:
- The builder instance (for method chaining).
-
setOwner
Set the owner UUID for the item (only applicable to PLAYER_HEAD or SKULL items).- Parameters:
owner
- The owner UUID for the item.- Returns:
- The builder instance (for method chaining).
-
setName
Set the name of the item.- Parameters:
name
- The name of the item.- Returns:
- The builder instance (for method chaining).
-
setMaterial
Set the material of the item (e.g., DIAMOND, GOLD_INGOT, etc.).- Parameters:
material
- The material of the item.- Returns:
- The builder instance (for method chaining).
-
setLore
Set the lore of the item.- Parameters:
lore
- The lore of the item as an array of strings.- Returns:
- The builder instance (for method chaining).
-
getItemStack
@NotNull protected @NotNull org.bukkit.inventory.ItemStack getItemStack()Creates the item stack represented by the builder's settings- Returns:
- The item-stack
-
createComponent
Description copied from interface:GuiComponentBuilder
Create a new instance of the GUI component.- Returns:
- A new instance of the GUI component.
-
deserialize
Description copied from class:AbstractGuiComponentBuilder
Deserialize the properties of the GUI component from the provided ParserContext node.- Specified by:
deserialize
in interfaceGuiComponentBuilder
- Overrides:
deserialize
in classAbstractGuiComponentBuilder<B extends SimpleItemComponentBuilder<B>>
- Parameters:
node
- The ParserContext node containing the properties of the GUI component.- Throws:
IOException
- If there is an error while deserializing the properties.
-