diff options
author | bowser0000 <bowser0000@gmail.com> | 2020-09-25 09:41:56 -0400 |
---|---|---|
committer | bowser0000 <bowser0000@gmail.com> | 2020-09-25 09:41:56 -0400 |
commit | 861a1b604991986963dde848c4a86c586408640b (patch) | |
tree | 89adcac03c1174ebd56071d159528ae7d619bbbd /src/main/java/me | |
parent | 050a1b2d8fbea8567de76d6515908470054d81c1 (diff) | |
download | SkyblockMod-861a1b604991986963dde848c4a86c586408640b.tar.gz SkyblockMod-861a1b604991986963dde848c4a86c586408640b.tar.bz2 SkyblockMod-861a1b604991986963dde848c4a86c586408640b.zip |
Add percentage to total skill xp display
Diffstat (limited to 'src/main/java/me')
-rw-r--r-- | src/main/java/me/Danker/TheMod.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index 44cc938..f4fb082 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -246,10 +246,11 @@ public class TheMod String xpGained = section.substring(section.indexOf("+"), section.indexOf("(") - 1); double currentXp = Double.parseDouble(section.substring(section.indexOf("(") + 1, section.indexOf("/")).replaceAll(",", "")); int previousXp = Utils.getPastXpEarned(Integer.parseInt(section.substring(section.indexOf("/") + 1, section.indexOf(")")).replaceAll(",", ""))); + double percentage = (double) Math.floor(((currentXp + previousXp) / 55172425) * 10000D) / 100D; skillTimer = 40; showSkill = true; - skillText = EnumChatFormatting.AQUA + xpGained + " (" + NumberFormat.getNumberInstance(Locale.US).format(currentXp + previousXp) + "/55,172,425)"; + skillText = EnumChatFormatting.AQUA + xpGained + " (" + NumberFormat.getNumberInstance(Locale.US).format(currentXp + previousXp) + "/55,172,425) " + percentage + "%"; } } } |