diff options
author | bowser0000 <bowser0000@gmail.com> | 2020-11-06 12:46:22 -0500 |
---|---|---|
committer | bowser0000 <bowser0000@gmail.com> | 2020-11-06 12:46:22 -0500 |
commit | 432ee590f73a08b184f0d0ec65b8549aa2f3e877 (patch) | |
tree | 2f45623e4528b20339ff9417666085243b1a039f /src/main/java/me/Danker/TheMod.java | |
parent | dfe29936c3bf3c7189a9a4d73d4d1ec33122f7ea (diff) | |
download | SkyblockMod-432ee590f73a08b184f0d0ec65b8549aa2f3e877.tar.gz SkyblockMod-432ee590f73a08b184f0d0ec65b8549aa2f3e877.tar.bz2 SkyblockMod-432ee590f73a08b184f0d0ec65b8549aa2f3e877.zip |
Add support for farming 60
Diffstat (limited to 'src/main/java/me/Danker/TheMod.java')
-rw-r--r-- | src/main/java/me/Danker/TheMod.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index bada8b8..e6cbfd0 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -328,12 +328,22 @@ 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; + int limit; + int totalXp; + if (section.contains("Farming")) { + limit = 60; + totalXp = 111672425; + } else { + limit = 50; + totalXp = 55172425; + } + int previousXp = Utils.getPastXpEarned(Integer.parseInt(section.substring(section.indexOf("/") + 1, section.indexOf(")")).replaceAll(",", "")), limit); + double percentage = (double) Math.floor(((currentXp + previousXp) / totalXp) * 10000D) / 100D; + NumberFormat nf = NumberFormat.getNumberInstance(Locale.US); skillTimer = SKILL_TIME; showSkill = true; - skillText = EnumChatFormatting.AQUA + xpGained + " (" + NumberFormat.getNumberInstance(Locale.US).format(currentXp + previousXp) + "/55,172,425) " + percentage + "%"; + skillText = EnumChatFormatting.AQUA + xpGained + " (" + nf.format(currentXp + previousXp) + "/" + nf.format(totalXp) + ") " + percentage + "%"; } } } |