mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Parenthesis are good.
This commit is contained in:
parent
f20fa571f1
commit
f17b5faaf6
@ -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));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user