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.
This commit is contained in:
astemus 2015-08-21 12:11:35 -04:00
parent 5b19e2e9d2
commit 0284728bca

View File

@ -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);
}
}
/**