Tools with durability enchant will be damaged properly by super

abilities again (at a reduced rated)
This commit is contained in:
nossr50
2019-06-24 17:49:02 -07:00
parent a135e08e12
commit 764b4c20f5
3 changed files with 17 additions and 9 deletions

View File

@ -243,8 +243,7 @@ public class SkillUtils {
* @param maxDamageModifier the amount to adjust the max damage by
*/
public static void handleDurabilityChange(ItemStack itemStack, double durabilityModifier, double maxDamageModifier) {
if((itemStack.getItemMeta().getEnchants().get(Enchantment.DURABILITY) != null && itemStack.getItemMeta().getEnchants().get(Enchantment.DURABILITY) >= 1)
|| (itemStack.getItemMeta() != null && itemStack.getItemMeta().isUnbreakable())) {
if(itemStack.getItemMeta() != null && itemStack.getItemMeta().isUnbreakable()) {
return;
}