From 5541c157532dc64f72f17aab699b3a7bddf7961e Mon Sep 17 00:00:00 2001 From: GJ Date: Wed, 2 Oct 2013 09:07:30 -0400 Subject: [PATCH] Try/catch was stupid. --- .../com/gmail/nossr50/skills/axes/AxesManager.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/axes/AxesManager.java b/src/main/java/com/gmail/nossr50/skills/axes/AxesManager.java index 3fb509270..75627384d 100644 --- a/src/main/java/com/gmail/nossr50/skills/axes/AxesManager.java +++ b/src/main/java/com/gmail/nossr50/skills/axes/AxesManager.java @@ -101,15 +101,7 @@ public class AxesManager extends SkillManager { Material armorType = armor.getType(); double durabilityModifier = 1 / (armor.getEnchantmentLevel(Enchantment.DURABILITY) + 1); // Modifier to simulate the durability enchantment behavior double modifiedDurabilityDamage = durabilityDamage * durabilityModifier; - short maxDurability; - - try { - maxDurability = mcMMO.getRepairableManager().getRepairable(armorType).getMaximumDurability(); - } - catch (NullPointerException e) { - maxDurability = armorType.getMaxDurability(); - } - + short maxDurability = mcMMO.getRepairableManager().isRepairable(armorType) ? mcMMO.getRepairableManager().getRepairable(armorType).getMaximumDurability() : armorType.getMaxDurability(); double maxDurabilityDamage = maxDurability * Axes.impactMaxDurabilityModifier; armor.setDurability((short) (Math.min(modifiedDurabilityDamage, maxDurabilityDamage) + armor.getDurability()));