Class ArmorBuilder
java.lang.Object
io.github.lucfr1746.llibrary.itemstack.ItemBuilder
io.github.lucfr1746.llibrary.itemstack.ArmorBuilder
The
ArmorMetaBuilder
class extends ItemBuilder
to provide
additional functionality for modifying ArmorMeta
of an ItemStack
.
This class allows setting and retrieving armor trims for supported armor items.-
Constructor Summary
ConstructorsConstructorDescriptionArmorBuilder
(@NotNull org.bukkit.Material material) Constructs anArmorMetaBuilder
with the specifiedMaterial
.ArmorBuilder
(@NotNull org.bukkit.Material material, int amount) Constructs anArmorMetaBuilder
with the specifiedMaterial
and amount.ArmorBuilder
(@NotNull org.bukkit.inventory.ItemStack itemStack) Constructs anArmorMetaBuilder
using an existingItemStack
. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.inventory.meta.trim.ArmorTrim
getTrim()
Retrieves theArmorTrim
applied to the armor item.boolean
hasTrim()
Checks whether the armor item has anArmorTrim
applied.setTrim
(org.bukkit.inventory.meta.trim.ArmorTrim trim) Sets theArmorTrim
for the armor item.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
-
ArmorBuilder
public ArmorBuilder(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) Constructs anArmorMetaBuilder
using an existingItemStack
.- Parameters:
itemStack
- the item stack to modify- Throws:
IllegalArgumentException
- if the item's meta is not an instance ofArmorMeta
-
ArmorBuilder
public ArmorBuilder(@NotNull @NotNull org.bukkit.Material material, int amount) Constructs anArmorMetaBuilder
with the specifiedMaterial
and amount.- Parameters:
material
- the material for the item stackamount
- the quantity of items in the stack- Throws:
IllegalArgumentException
- if the item's meta is not an instance ofArmorMeta
-
ArmorBuilder
public ArmorBuilder(@NotNull @NotNull org.bukkit.Material material) Constructs anArmorMetaBuilder
with the specifiedMaterial
.- Parameters:
material
- the material for the item stack- Throws:
IllegalArgumentException
- if the item's meta is not an instance ofArmorMeta
-
-
Method Details
-
getTrim
public org.bukkit.inventory.meta.trim.ArmorTrim getTrim()Retrieves theArmorTrim
applied to the armor item.- Returns:
- the armor trim, or
null
if none is set
-
hasTrim
public boolean hasTrim()Checks whether the armor item has anArmorTrim
applied.- Returns:
true
if the item has trim,false
otherwise
-
setTrim
Sets theArmorTrim
for the armor item.- Parameters:
trim
- the armor trim to apply- Returns:
- this
ArmorMetaBuilder
instance for method chaining
-