mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Try/catch was stupid.
This commit is contained in:
parent
f87110749e
commit
5541c15753
@ -101,15 +101,7 @@ public class AxesManager extends SkillManager {
|
|||||||
Material armorType = armor.getType();
|
Material armorType = armor.getType();
|
||||||
double durabilityModifier = 1 / (armor.getEnchantmentLevel(Enchantment.DURABILITY) + 1); // Modifier to simulate the durability enchantment behavior
|
double durabilityModifier = 1 / (armor.getEnchantmentLevel(Enchantment.DURABILITY) + 1); // Modifier to simulate the durability enchantment behavior
|
||||||
double modifiedDurabilityDamage = durabilityDamage * durabilityModifier;
|
double modifiedDurabilityDamage = durabilityDamage * durabilityModifier;
|
||||||
short maxDurability;
|
short maxDurability = mcMMO.getRepairableManager().isRepairable(armorType) ? mcMMO.getRepairableManager().getRepairable(armorType).getMaximumDurability() : armorType.getMaxDurability();
|
||||||
|
|
||||||
try {
|
|
||||||
maxDurability = mcMMO.getRepairableManager().getRepairable(armorType).getMaximumDurability();
|
|
||||||
}
|
|
||||||
catch (NullPointerException e) {
|
|
||||||
maxDurability = armorType.getMaxDurability();
|
|
||||||
}
|
|
||||||
|
|
||||||
double maxDurabilityDamage = maxDurability * Axes.impactMaxDurabilityModifier;
|
double maxDurabilityDamage = maxDurability * Axes.impactMaxDurabilityModifier;
|
||||||
|
|
||||||
armor.setDurability((short) (Math.min(modifiedDurabilityDamage, maxDurabilityDamage) + armor.getDurability()));
|
armor.setDurability((short) (Math.min(modifiedDurabilityDamage, maxDurabilityDamage) + armor.getDurability()));
|
||||||
|
Loading…
Reference in New Issue
Block a user