Class RepairableBuilder
java.lang.Object
io.github.lucfr1746.llibrary.itemstack.ItemBuilder
io.github.lucfr1746.llibrary.itemstack.RepairableBuilder
The
RepairableBuilder class extends ItemBuilder to provide
additional functionality for modifying Repairable meta of an ItemStack.
This class allows setting repair costs for items repairable at an anvil.-
Constructor Summary
ConstructorsConstructorDescriptionRepairableBuilder(@NotNull org.bukkit.Material material, int amount) Constructs aRepairableBuilderwith the specifiedMaterialand amount.RepairableBuilder(@NotNull org.bukkit.inventory.ItemStack itemStack) Constructs aRepairableBuilderusing an existingItemStack. -
Method Summary
Modifier and TypeMethodDescriptionintGets the repair cost of the item.booleanChecks if the item has a repair cost set.setRepairCost(int cost) Sets the repair cost for the 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
-
RepairableBuilder
public RepairableBuilder(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) Constructs aRepairableBuilderusing an existingItemStack.- Parameters:
itemStack- the item stack to modify- Throws:
IllegalArgumentException- if the item's meta is not an instance ofRepairable
-
RepairableBuilder
public RepairableBuilder(@NotNull @NotNull org.bukkit.Material material, int amount) Constructs aRepairableBuilderwith the specifiedMaterialand 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 ofRepairable
-
-
Method Details
-
setRepairCost
Sets the repair cost for the item.- Parameters:
cost- the repair cost (penalty)- Returns:
- this
RepairableBuilderinstance for chaining
-
getRepairCost
public int getRepairCost()Gets the repair cost of the item.- Returns:
- the repair cost
-
hasRepairCost
public boolean hasRepairCost()Checks if the item has a repair cost set.- Returns:
- true if the item has a repair cost, false otherwise
-