Adds some tests for the salvage helper

This commit is contained in:
2023-01-14 15:10:40 +01:00
parent 8e5d4c7a61
commit 7cc2aef9d4
8 changed files with 173 additions and 25 deletions

@ -17,6 +17,16 @@ public final class ItemHelper {
}
/**
* Gets whether the given item is repairable
*
* @param item <p>The item to check</p>
* @return <p>True if the item is repairable</p>
*/
public static boolean isRepairable(ItemStack item) {
return item.getItemMeta() instanceof Damageable && EnchantmentTarget.BREAKABLE.includes(item);
}
/**
* Gets the max durability of an item
*