Class RepairableBuilder

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

public class RepairableBuilder extends ItemBuilder
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 Details

    • RepairableBuilder

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

      public RepairableBuilder(@NotNull @NotNull org.bukkit.Material material, int amount)
      Constructs a RepairableBuilder with the specified Material and amount.
      Parameters:
      material - the material for the item stack
      amount - the quantity of items in the stack
      Throws:
      IllegalArgumentException - if the item's meta is not an instance of Repairable
  • Method Details

    • setRepairCost

      public RepairableBuilder setRepairCost(int cost)
      Sets the repair cost for the item.
      Parameters:
      cost - the repair cost (penalty)
      Returns:
      this RepairableBuilder instance 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