Class ItemCategory.Builder

java.lang.Object
com.github.darksoulq.abyssallib.world.item.ItemCategory.Builder
Enclosing class:
ItemCategory

public static class ItemCategory.Builder extends Object
A fluent builder for creating ItemCategory instances.
  • Constructor Details

    • Builder

      public Builder(net.kyori.adventure.key.Key id)
      Constructs a builder with a mandatory Key.
      Parameters:
      id - The Key to assign to the category.
  • Method Details

    • icon

      public ItemCategory.Builder icon(Supplier<org.bukkit.inventory.ItemStack> icon)
      Sets the icon using a lazy supplier.
      Parameters:
      icon - A Supplier providing the ItemStack.
      Returns:
      This builder for chaining.
    • icon

      public ItemCategory.Builder icon(org.bukkit.inventory.ItemStack icon)
      Sets the icon using a static ItemStack.
      Parameters:
      icon - The ItemStack to use as an icon.
      Returns:
      This builder for chaining.
    • icon

      public ItemCategory.Builder icon(Item icon)
      Sets the icon using a specific Item instance.
      Parameters:
      icon - The Item to extract the stack from.
      Returns:
      This builder for chaining.
    • add

      public ItemCategory.Builder add(Item item)
      Adds a single item to the category.
      Parameters:
      item - The Item to add.
      Returns:
      This builder for chaining.
    • add

      public ItemCategory.Builder add(Item... items)
      Adds multiple items to the category.
      Parameters:
      items - The array of Items to add.
      Returns:
      This builder for chaining.
    • addAll

      public ItemCategory.Builder addAll(Collection<Item> items)
      Adds a collection of items to the category.
      Parameters:
      items - The collection of Items to add.
      Returns:
      This builder for chaining.
    • build

      public ItemCategory build()
      Finalizes the creation of the ItemCategory.
      Returns:
      A new ItemCategory instance.
      Throws:
      NullPointerException - If the icon has not been set prior to building.