Parenthesis are good.

This commit is contained in:
GJ 2013-11-06 14:52:19 -05:00
parent f20fa571f1
commit f17b5faaf6

View File

@ -182,7 +182,7 @@ public class SkillUtils {
public static void handleDurabilityChange(ItemStack itemStack, int durabilityModifier, double maxDamageModifier) { public static void handleDurabilityChange(ItemStack itemStack, int durabilityModifier, double maxDamageModifier) {
Material type = itemStack.getType(); Material type = itemStack.getType();
short maxDurability = mcMMO.getRepairableManager().isRepairable(type) ? mcMMO.getRepairableManager().getRepairable(type).getMaximumDurability() : type.getMaxDurability(); short maxDurability = mcMMO.getRepairableManager().isRepairable(type) ? mcMMO.getRepairableManager().getRepairable(type).getMaximumDurability() : type.getMaxDurability();
durabilityModifier = (int) Math.min(durabilityModifier / itemStack.getEnchantmentLevel(Enchantment.DURABILITY) + 1, maxDurability * maxDamageModifier); durabilityModifier = (int) Math.min(durabilityModifier / (itemStack.getEnchantmentLevel(Enchantment.DURABILITY) + 1), maxDurability * maxDamageModifier);
itemStack.setDurability((short) Math.min(itemStack.getDurability() + durabilityModifier, maxDurability)); itemStack.setDurability((short) Math.min(itemStack.getDurability() + durabilityModifier, maxDurability));
} }