From 0284728bca326cf02e34800af772c0627da9729b Mon Sep 17 00:00:00 2001 From: astemus Date: Fri, 21 Aug 2015 12:11:35 -0400 Subject: [PATCH] Check for Unbreakable tag before handling durability changes Unsure if this is the best way to stop durability loss when an item is Unbreakable, or if this should be checked before each call to handleDurabilityChange. --- src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java b/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java index f4dbec446..f36c0022f 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java @@ -177,7 +177,9 @@ public class SkillUtils { } public static void handleDurabilityChange(ItemStack itemStack, int durabilityModifier) { - handleDurabilityChange(itemStack, durabilityModifier, 1.0); + if (!itemStack.isUnbreakable()) { + handleDurabilityChange(itemStack, durabilityModifier, 1.0); + } } /**