Package dev.sefiraat.sefilib.itemstacks
Class GeneralItemStackUtils
java.lang.Object
dev.sefiraat.sefilib.itemstacks.GeneralItemStackUtils
This class contains utility methods for working with
ItemStacks.-
Method Summary
Modifier and TypeMethodDescriptionstatic voidDamages the item by the provided amount.static voidDamages the item by the provided amount.static ItemStackgetAsQuantity(ItemStack itemStack, int amount) Gets a clone of anItemStackwith the provided amount.static voidRepairs the item by the provided amount.static voidRepairs the item by the provided amount.static voidsetItemDamage(ItemStack itemStack, int amount) Sets the damage of the item.static voidsetItemDamage(ItemStack itemStack, Player player, int amount) Sets the damage of the item.static voidsetItemDamage(ItemStack itemStack, ItemMeta itemMeta, Player player, int amount) Sets the damage of the item.
-
Method Details
-
damage
Damages the item by the provided amount.- Parameters:
itemStack- TheItemStackto damage.amount- The amount of damage to deal.
-
damage
Damages the item by the provided amount. -
repair
Repairs the item by the provided amount.- Parameters:
itemStack- TheItemStackto repair.amount- The amount of damage to repair.
-
repair
Repairs the item by the provided amount. -
setItemDamage
Sets the damage of the item.- Parameters:
itemStack- TheItemStackto set the damage of.amount- The amount of damage to set.
-
setItemDamage
Sets the damage of the item. -
setItemDamage
public static void setItemDamage(@Nonnull ItemStack itemStack, @Nonnull ItemMeta itemMeta, @Nullable Player player, int amount) Sets the damage of the item. -
getAsQuantity
Gets a clone of anItemStackwith the provided amount.
-