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 Details

    • name

      @NotNull protected @NotNull String name
    • material

      @Nullable protected @Nullable org.bukkit.Material material
    • lore

      @NotNull protected @NotNull String[] lore
    • textureId

      @Nullable protected @Nullable String textureId
    • owner

      @Nullable protected @Nullable UUID owner
  • Constructor Details

    • SimpleItemComponentBuilder

      public SimpleItemComponentBuilder()
  • Method Details

    • setTextureId

      @NotNull public B setTextureId(@Nullable @Nullable String textureId)
      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

      @NotNull public B setOwner(@Nullable @Nullable UUID owner)
      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

      @NotNull public B setName(@NotNull @NotNull String name)
      Set the name of the item.
      Parameters:
      name - The name of the item.
      Returns:
      The builder instance (for method chaining).
    • setMaterial

      @NotNull public B setMaterial(@NotNull @NotNull org.bukkit.Material material)
      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

      @NotNull public B setLore(@NotNull @NotNull String[] lore)
      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

      @NotNull public @NotNull SimpleItemComponent createComponent()
      Description copied from interface: GuiComponentBuilder
      Create a new instance of the GUI component.
      Returns:
      A new instance of the GUI component.
    • deserialize

      public void deserialize(@NotNull @NotNull ParserContext node) throws IOException
      Description copied from class: AbstractGuiComponentBuilder
      Deserialize the properties of the GUI component from the provided ParserContext node.
      Specified by:
      deserialize in interface GuiComponentBuilder
      Overrides:
      deserialize in class AbstractGuiComponentBuilder<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.