Class BundleBuilder
java.lang.Object
io.github.lucfr1746.llibrary.itemstack.ItemBuilder
io.github.lucfr1746.llibrary.itemstack.BundleBuilder
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 Summary
ConstructorsConstructorDescriptionConstructs aBundleBuilderwith a new bundle item.BundleBuilder(@NotNull org.bukkit.inventory.ItemStack itemStack) Constructs aBundleBuilderusing an existingItemStack. -
Method Summary
Modifier and TypeMethodDescriptionaddItem(@NotNull org.bukkit.inventory.ItemStack item) Adds an item to the bundle.List<org.bukkit.inventory.ItemStack> getItems()Retrieves the items stored in the bundle.booleanhasItems()Checks if the bundle contains any items.Sets the items stored in the bundle.Methods inherited from class io.github.lucfr1746.llibrary.itemstack.ItemBuilder
addAttributeModifier, addEnchant, addEnchant, addEnchant, addItemFlags, addLore, build, getAmount, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getCustomModelData, getDamageResistant, getDisplayName, getEnchantable, getEnchantLevel, getEnchantmentGlintOverride, getEnchants, getEquippableComponent, getFoodComponent, getItemFlags, getItemMeta, getItemModel, getJukeboxPlayableComponent, getMaxStackSize, getRarity, getToolComponent, getTooltipStyle, getTranslationKey, getType, getUseCooldownComponent, getUseRemainder, hasAttributeModifiers, hasConflictingEnchant, hasCustomModelData, hasDamageResistant, hasEnchant, hasEnchantable, hasEnchantmentGlintOverride, hasEnchants, hasEquippableComponent, hasFoodComponent, hasItemFlag, hasItemModel, hasJukeboxPlayableComponent, hasMaxStackSize, hasRarity, hasToolComponent, hasTooltipStyle, hasUseCooldownComponent, hasUseRemainder, hideAllItemFlags, insertLore, isGlider, isHideTooltip, isUnbreakable, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeEnchants, removeItemFlags, replaceLore, setAmount, setAttributeModifiers, setCustomModelData, setDamageResistant, setDisplayName, setEnchantable, setEnchantmentGlintOverride, setEquippableComponent, setEquippableComponent, setFood, setFoodComponent, setGlider, setHideTooltip, setItemModel, setItemModel, setJukeboxPlayableComponent, setJukeboxPlayableComponent, setJukeboxPlayableComponent, setLores, setLores, setMaxStackSize, setRarity, setToolComponent, setToolComponent, setTooltipStyle, setTooltipStyle, setType, setUnbreakable, setUseCooldownComponent, setUseCooldownComponent, setUseCooldownComponent, setUseRemainder
-
Constructor Details
-
BundleBuilder
public BundleBuilder()Constructs aBundleBuilderwith a new bundle item. -
BundleBuilder
public BundleBuilder(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) Constructs aBundleBuilderusing an existingItemStack.- Parameters:
itemStack- the item stack to modify- Throws:
IllegalArgumentException- if the item's meta is not an instance ofBundleMeta
-
-
Method Details
-
addItem
Adds an item to the bundle.- Parameters:
item- the item to add- Returns:
- this
BundleBuilderinstance for method chaining
-
setItems
Sets the items stored in the bundle.- Parameters:
items- the list of items to store in the bundle- Returns:
- this
BundleBuilderinstance for method chaining
-
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:
trueif the bundle has items,falseotherwise
-