Class BundleBuilder

java.lang.Object
io.github.lucfr1746.llibrary.itemstack.ItemBuilder
io.github.lucfr1746.llibrary.itemstack.BundleBuilder

public class BundleBuilder extends ItemBuilder
The BundleBuilder class extends ItemBuilder to provide additional functionality for modifying BundleMeta of an ItemStack. This class allows adding, retrieving, and setting items within a bundle.
  • Constructor Details

    • BundleBuilder

      public BundleBuilder()
      Constructs a BundleBuilder with a new bundle item.
    • BundleBuilder

      public BundleBuilder(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Constructs a BundleBuilder using an existing ItemStack.
      Parameters:
      itemStack - the item stack to modify
      Throws:
      IllegalArgumentException - if the item's meta is not an instance of BundleMeta
  • Method Details

    • addItem

      public BundleBuilder addItem(@NotNull @NotNull org.bukkit.inventory.ItemStack item)
      Adds an item to the bundle.
      Parameters:
      item - the item to add
      Returns:
      this BundleBuilder instance for method chaining
    • setItems

      public BundleBuilder setItems(@NotNull @NotNull List<org.bukkit.inventory.ItemStack> items)
      Sets the items stored in the bundle.
      Parameters:
      items - the list of items to store in the bundle
      Returns:
      this BundleBuilder instance for method chaining
    • getItems

      public List<org.bukkit.inventory.ItemStack> getItems()
      Retrieves the items stored in the bundle.
      Returns:
      a list of items in the bundle
    • hasItems

      public boolean hasItems()
      Checks if the bundle contains any items.
      Returns:
      true if the bundle has items, false otherwise