diff --git a/src/iguanaman/iguanatweakstconstruct/IguanaLevelingLogic.java b/src/iguanaman/iguanatweakstconstruct/IguanaLevelingLogic.java index 3a8dbaa..ee416ec 100644 --- a/src/iguanaman/iguanatweakstconstruct/IguanaLevelingLogic.java +++ b/src/iguanaman/iguanatweakstconstruct/IguanaLevelingLogic.java @@ -48,10 +48,11 @@ public class IguanaLevelingLogic { int requiredXp = getRequiredXp(tool, tags); long currentXp = tags.getLong("ToolEXP"); - String xpPercentage = Integer.toString((int)(tags.getLong("ToolEXP") / (long)getRequiredXp(tool, tags))) + "%"; + int xpPercentage = (int)((currentXp / (long)requiredXp) * 100); + String xpPercentageString = Integer.toString(xpPercentage) + "%"; if (IguanaConfig.detailedXpTooltip) - return "XP: " + Long.toString(currentXp) + " / " + Integer.toString(requiredXp) + " (" + xpPercentage + ")"; + return "XP: " + Long.toString(currentXp) + " / " + Integer.toString(requiredXp) + " (" + xpPercentageString + ")"; else return "XP: " + xpPercentage; } diff --git a/src/iguanaman/iguanatweakstconstruct/modifiers/IguanaModUpgrade.java b/src/iguanaman/iguanatweakstconstruct/modifiers/IguanaModUpgrade.java index 04af195..97e0843 100644 --- a/src/iguanaman/iguanatweakstconstruct/modifiers/IguanaModUpgrade.java +++ b/src/iguanaman/iguanatweakstconstruct/modifiers/IguanaModUpgrade.java @@ -151,15 +151,13 @@ public class IguanaModUpgrade extends ToolMod { int bonus = tags.getInteger("BonusDurability"); float modDur = tags.getFloat("ModDurability"); - int total = (int) ((base + bonus) * (modDur + 1f)); - if (total <= 0) - total = 1; + int total = Math.max((int) ((base + bonus) * (modDur + 1f)), 1); + tags.setInteger("BaseDurability", base); tags.setInteger("TotalDurability", total); if (tags.hasKey("HarvestLevelModified")) { - tags.setLong("HeadEXP", 0L); tags.removeTag("HarvestLevelModified"); if (tags.hasKey("MobHead"))