diff options
author | bowser0000 <bowser0000@gmail.com> | 2020-09-24 23:14:56 -0400 |
---|---|---|
committer | bowser0000 <bowser0000@gmail.com> | 2020-09-24 23:14:56 -0400 |
commit | 050a1b2d8fbea8567de76d6515908470054d81c1 (patch) | |
tree | 17cc9ae40b32812031b13577aaa9c00d201a51ee /src/main/java/me/Danker/TheMod.java | |
parent | ba5deced2daac3e5be5651121be139cd0a9fb6b6 (diff) | |
download | SkyblockMod-050a1b2d8fbea8567de76d6515908470054d81c1.tar.gz SkyblockMod-050a1b2d8fbea8567de76d6515908470054d81c1.tar.bz2 SkyblockMod-050a1b2d8fbea8567de76d6515908470054d81c1.zip |
Add option for displaying total skill xp instead of progress to next level
Diffstat (limited to 'src/main/java/me/Danker/TheMod.java')
-rw-r--r-- | src/main/java/me/Danker/TheMod.java | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index 8c0660f..44cc938 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -96,6 +96,9 @@ public class TheMod public static int titleTimer = -1; public static boolean showTitle = false; public static String titleText = ""; + public static int skillTimer = -1; + public static boolean showSkill = false; + public static String skillText = ""; static int tickAmount = 1; public static String lastMaddoxCommand = "/cb placeholdervalue"; static KeyBinding[] keyBindings = new KeyBinding[1]; @@ -230,9 +233,29 @@ public class TheMod final ToggleCommand tc = new ToggleCommand(); String message = event.message.getUnformattedText(); - if (event.type == 2) return; if (!Utils.inSkyblock) return; + // Action Bar + if (event.type == 2) { + String[] actionBarSections = event.message.getUnformattedText().split(" {3,}"); + for (String section : actionBarSections) { + if (tc.skill50DisplayToggled) { + if (section.contains("(")) { + if (section.contains("Runecrafting")) return; + + 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(",", ""))); + + skillTimer = 40; + showSkill = true; + skillText = EnumChatFormatting.AQUA + xpGained + " (" + NumberFormat.getNumberInstance(Locale.US).format(currentXp + previousXp) + "/55,172,425)"; + } + } + } + return; + } + // Replace chat messages with Maddox command List<IChatComponent> chatSiblings = event.message.getSiblings(); for (IChatComponent sibling : chatSiblings) { @@ -1677,6 +1700,9 @@ public class TheMod if (showTitle) { Utils.drawTitle(titleText); } + if (showSkill) { + new TextRenderer(Minecraft.getMinecraft(), skillText, moc.skill50XY[0], moc.skill50XY[1], ScaleCommand.skill50Scale); + } } @SubscribeEvent(priority = EventPriority.HIGHEST) @@ -1783,6 +1809,12 @@ public class TheMod } titleTimer--; } + if (skillTimer >= 0) { + if (skillTimer == 0) { + showSkill = false; + } + skillTimer--; + } } @SubscribeEvent |