From 09291c4f8ee992d2b1c037dfeac84ee362e6288e Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Sat, 3 Apr 2021 19:59:46 +0200 Subject: added Completed Commission Highlighting --- src/main/java/me/Danker/DankersSkyblockMod.java | 4 ++- .../java/me/Danker/commands/ToggleCommand.java | 11 +++++-- .../me/Danker/features/HighlightCommissions.java | 37 ++++++++++++++++++++++ src/main/java/me/Danker/gui/DankerGui.java | 12 ++++--- .../java/me/Danker/handlers/ConfigHandler.java | 1 + 5 files changed, 57 insertions(+), 8 deletions(-) create mode 100644 src/main/java/me/Danker/features/HighlightCommissions.java (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 3aeb452..33c4e86 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -133,6 +133,8 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new WatcherReadyAlert()); MinecraftForge.EVENT_BUS.register(new WaterSolver()); + MinecraftForge.EVENT_BUS.register(new HighlightCommissions()); + ConfigHandler.reloadConfig(); GoldenEnchants.init(); TriviaSolver.init(); @@ -380,7 +382,7 @@ public class DankersSkyblockMod { @SubscribeEvent public void onGuiRender(GuiScreenEvent.BackgroundDrawnEvent event) { - if (!Utils.inSkyblock) return; + //if (!Utils.inSkyblock) return; if (event.gui instanceof GuiChest) { GuiChest inventory = (GuiChest) event.gui; Container containerChest = inventory.inventorySlots; diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index a6f20fc..b9c52e7 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -33,6 +33,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean cakeTimerToggled; public static boolean highlightSlayers; public static boolean highlightArachne; + public static boolean highlightCommissions; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; @@ -76,7 +77,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean bloodRoomMusic; public static boolean dungeonMusic; - @Override + @Override public String getCommandName() { return "toggle"; } @@ -93,7 +94,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "startswithterminal/selectallterminal/clickinorderterminal/" + "ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/" + "melodytooltips/highlightslayers/highlightarachne/dungeonbossmusic/bloodroommusic/" + - "dungeonmusic/list>"; + "dungeonmusic/highlightcommissions/list>"; } public static String usage(ICommandSender arg0) { @@ -121,7 +122,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "selectallterminal", "clickinorderterminal", "ultrasequencer", "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "melodytooltips", "highlightslayers", - "dungeonbossmusic", "bloodroommusic", "dungeonmusic", "list"); + "dungeonbossmusic", "bloodroommusic", "dungeonmusic", "highlightcommissions", "list"); } return null; } @@ -396,6 +397,10 @@ public class ToggleCommand extends CommandBase implements ICommand { highlightArachne = !highlightArachne; ConfigHandler.writeBooleanConfig("toggles", "HighlightArachne", highlightArachne); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Arachne " + DankersSkyblockMod.SECONDARY_COLOUR + highlightArachne + DankersSkyblockMod.MAIN_COLOUR + ".")); + case "highlightcommissions": + highlightCommissions = !highlightCommissions; + ConfigHandler.writeBooleanConfig("toggles", "HighlightCommissions", highlightCommissions); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Commissions " + DankersSkyblockMod.SECONDARY_COLOUR + highlightCommissions + DankersSkyblockMod.MAIN_COLOUR + ".")); case "dungeonbossmusic": dungeonBossMusic = !dungeonBossMusic; CustomMusic.dungeonboss.stop(); diff --git a/src/main/java/me/Danker/features/HighlightCommissions.java b/src/main/java/me/Danker/features/HighlightCommissions.java new file mode 100644 index 0000000..ae262c3 --- /dev/null +++ b/src/main/java/me/Danker/features/HighlightCommissions.java @@ -0,0 +1,37 @@ +package me.Danker.features; + +import me.Danker.commands.ToggleCommand; +import me.Danker.events.GuiChestBackgroundDrawnEvent; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.Utils; +import net.minecraft.inventory.Slot; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraft.item.ItemWritableBook; + +import org.lwjgl.util.Color; +import java.util.List; + +public class HighlightCommissions { + + @SubscribeEvent + public void onGuiRender(GuiChestBackgroundDrawnEvent event) { + if(!Utils.inSkyblock) return; + if(!ToggleCommand.highlightCommissions) return; + List slots = event.slots; + if (!event.displayName.equals("Commissions")) return; + + for (Slot slot : slots) { + if (slot != null && slot.getStack() == null) continue; + if (slot.getStack().getItem() instanceof ItemWritableBook) { + for (String line : Utils.getItemLore(slot.getStack())) { + if (line.contains("COMPLETED")) { + Utils.drawOnSlot(event.chestSize, slot.xDisplayPosition, slot.yDisplayPosition, 0x51FF51 + 0xD7000000); + break; + } + } + + } + } + } + +} diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 569f4d1..22cc001 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -6,10 +6,7 @@ import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.gui.*; import net.minecraft.util.StringUtils; import java.awt.*; @@ -60,6 +57,7 @@ public class DankerGui extends GuiScreen { private GuiButton autoSkillTracker; private GuiButton highlightArachne; private GuiButton highlightSlayer; + private GuiButton highlightCommissions; // Chat Messages private GuiButton sceptreMessages; private GuiButton midasStaffMessages; @@ -143,6 +141,7 @@ public class DankerGui extends GuiScreen { melodyTooltips = new GuiButton(0, 0, 0, "Hide tooltips in Melody's Harp: " + Utils.getColouredBoolean(ToggleCommand.melodyTooltips)); highlightArachne = new GuiButton(0, 0, 0, "Highlight Arachne: " + Utils.getColouredBoolean(ToggleCommand.highlightArachne)); highlightSlayer = new GuiButton(0, 0, 0, "Highlight Slayer: " + Utils.getColouredBoolean(ToggleCommand.highlightSlayers)); + highlightCommissions = new GuiButton(0, 0, 0, "Highlight Commissions: " + Utils.getColouredBoolean(ToggleCommand.highlightCommissions)); allButtons.add(changeDisplay); allButtons.add(puzzleSolvers); @@ -183,6 +182,7 @@ public class DankerGui extends GuiScreen { allButtons.add(melodyTooltips); allButtons.add(highlightArachne); allButtons.add(highlightSlayer); + allButtons.add(highlightCommissions); search.setText(initSearchText); search.setVisible(true); @@ -402,6 +402,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.highlightSlayers = !ToggleCommand.highlightSlayers; ConfigHandler.writeBooleanConfig("toggles", "HighlightSlayers", ToggleCommand.highlightSlayers); highlightSlayer.displayString = "Highlight Slayer: " + Utils.getColouredBoolean(ToggleCommand.highlightSlayers); + } else if (button == highlightCommissions) { + ToggleCommand.highlightCommissions = !ToggleCommand.highlightCommissions; + ConfigHandler.writeBooleanConfig("toggles", "HighlightCommissions", ToggleCommand.highlightCommissions); + highlightCommissions.displayString = "Highlight Commissions: " + Utils.getColouredBoolean(ToggleCommand.highlightCommissions); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index d3b7464..0fe7245 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -228,6 +228,7 @@ public class ConfigHandler { ToggleCommand.melodyTooltips = initBoolean("toggles", "MelodyTooltips", false); ToggleCommand.highlightSlayers = initBoolean("toggles", "HighlightSlayers", false); ToggleCommand.highlightArachne = initBoolean("toggles", "HighlightArachne", false); + ToggleCommand.highlightCommissions = initBoolean("toggles", "HighlightCommissions", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); -- cgit From a929ac303271b62e630a1c0d7c7602b321333291 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 9 Apr 2021 10:00:57 -0400 Subject: Add short descriptions to features in /dsm --- build.gradle | 2 +- src/main/java/me/Danker/DankersSkyblockMod.java | 2 +- src/main/java/me/Danker/gui/DankerGui.java | 77 ++++++++++++---------- .../java/me/Danker/gui/buttons/FeatureButton.java | 17 +++++ 4 files changed, 62 insertions(+), 36 deletions(-) create mode 100644 src/main/java/me/Danker/gui/buttons/FeatureButton.java (limited to 'src/main/java/me/Danker') diff --git a/build.gradle b/build.gradle index 59f72e9..d87c2a7 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ plugins { id "net.minecraftforge.gradle.forge" version "2.0.2" } */ -version = "1.8.6" +version = "1.8.7-beta1" group= "me.Danker.DankersSkyblockMod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Danker's Skyblock Mod" diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index ee24b84..76046e6 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -62,7 +62,7 @@ import java.util.Map; @Mod(modid = DankersSkyblockMod.MODID, version = DankersSkyblockMod.VERSION, clientSideOnly = true) public class DankersSkyblockMod { public static final String MODID = "Danker's Skyblock Mod"; - public static final String VERSION = "1.8.6"; + public static final String VERSION = "1.8.7-beta1"; public static int titleTimer = -1; public static boolean showTitle = false; public static String titleText = ""; diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 569f4d1..c5145e6 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -2,6 +2,7 @@ package me.Danker.gui; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; +import me.Danker.gui.buttons.FeatureButton; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; @@ -10,6 +11,7 @@ import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StringUtils; import java.awt.*; @@ -109,40 +111,40 @@ public class DankerGui extends GuiScreen { experimentationTableSolvers = new GuiButton(0, 0, 0, "Toggle Experimentation Table Solvers"); skillTracker = new GuiButton(0, 0, 0, "Toggle Skill XP/Hour Tracking"); customMusic = new GuiButton(0, 0, 0, "Custom Music"); - outlineText = new GuiButton(0, 0, 0, "Outline Displayed Text: " + Utils.getColouredBoolean(ToggleCommand.outlineTextToggled)); - pickBlock = new GuiButton(0, 0, 0, "Auto-Swap to Pick Block: " + Utils.getColouredBoolean(ToggleCommand.swapToPickBlockToggled)); - coords = new GuiButton(0, 0, 0, "Coordinate/Angle Display: " + Utils.getColouredBoolean(ToggleCommand.coordsToggled)); - chatMaddox = new GuiButton(0, 0, 0, "Click On-Screen to Open Maddox: " + Utils.getColouredBoolean(ToggleCommand.chatMaddoxToggled)); - cakeTimer = new GuiButton(0, 0, 0, "Cake Timer: " + Utils.getColouredBoolean(ToggleCommand.cakeTimerToggled)); - skill50Display = new GuiButton(0, 0, 0, "Display Progress To Skill Level 50: " + Utils.getColouredBoolean(ToggleCommand.skill50DisplayToggled)); - slayerCount = new GuiButton(0, 0, 0, "Count Total 20% Drops: " + Utils.getColouredBoolean(ToggleCommand.slayerCountTotal)); - spiritBearAlert = new GuiButton(0, 0, 0, "Spirit Bear Spawn Alerts: " + Utils.getColouredBoolean(ToggleCommand.spiritBearAlerts)); - sceptreMessages = new GuiButton(0, 0, 0, "Spirit Sceptre Messages: " + Utils.getColouredBoolean(ToggleCommand.sceptreMessages)); - midasStaffMessages = new GuiButton(0, 0, 0, "Midas Staff Messages: " + Utils.getColouredBoolean(ToggleCommand.midasStaffMessages)); - implosionMessages = new GuiButton(0, 0, 0, "Implosion Messages: " + Utils.getColouredBoolean(ToggleCommand.implosionMessages)); - healMessages = new GuiButton(0, 0, 0, "Heal Messages: " + Utils.getColouredBoolean(ToggleCommand.healMessages)); - cooldownMessages = new GuiButton(0, 0, 0, "Cooldown Messages: " + Utils.getColouredBoolean(ToggleCommand.cooldownMessages)); - manaMessages = new GuiButton(0, 0, 0, "Mana Messages: " + Utils.getColouredBoolean(ToggleCommand.manaMessages)); - killComboMessages = new GuiButton(0, 0, 0, "Kill Combo Messages: " + Utils.getColouredBoolean(ToggleCommand.killComboMessages)); - goldenEnch = new GuiButton(0, 0, 0, "Golden T10/T6/T4 Enchantments: " + Utils.getColouredBoolean(ToggleCommand.goldenToggled)); - petColours = new GuiButton(0, 0, 0, "Colour Pet Backgrounds: " + Utils.getColouredBoolean(ToggleCommand.petColoursToggled)); - expertiseLore = new GuiButton(0, 0, 0, "Expertise Kills In Lore: " + Utils.getColouredBoolean(ToggleCommand.expertiseLoreToggled)); - gparty = new GuiButton(0, 0, 0, "Guild Party Notifications: " + Utils.getColouredBoolean(ToggleCommand.gpartyToggled)); - golemAlerts = new GuiButton(0, 0, 0, "Golem Spawn Alert And Timer: " + Utils.getColouredBoolean(ToggleCommand.golemAlertToggled)); - rngesusAlert = new GuiButton(0, 0, 0, "RNGesus Alerts: " + Utils.getColouredBoolean(ToggleCommand.rngesusAlerts)); - splitFishing = new GuiButton(0, 0, 0, "Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing)); - lowHealthNotify = new GuiButton(0, 0, 0, "Low Health Notifications: " + Utils.getColouredBoolean(ToggleCommand.lowHealthNotifyToggled)); - lividSolver = new GuiButton(0, 0, 0, "Find Correct Livid: " + Utils.getColouredBoolean(ToggleCommand.lividSolverToggled)); - dungeonTimer = new GuiButton(0, 0, 0, "Display Dungeon Timers: " + Utils.getColouredBoolean(ToggleCommand.dungeonTimerToggled)); - stopSalvageStarred = new GuiButton(0, 0, 0, "Stop Salvaging Starred Items: " + Utils.getColouredBoolean(ToggleCommand.stopSalvageStarredToggled)); - watcherReadyMessage = new GuiButton(0, 0, 0, "Display Watcher Ready Message: " + Utils.getColouredBoolean(ToggleCommand.watcherReadyToggled)); - notifySlayerSlain = new GuiButton(0, 0, 0, "Notify when Slayer Slain: " + Utils.getColouredBoolean(ToggleCommand.notifySlayerSlainToggled)); - necronNotifications = new GuiButton(0, 0, 0, "Necron Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled)); - bonzoTimer = new GuiButton(0, 0, 0, "Bonzo's Mask Timer: " + Utils.getColouredBoolean(ToggleCommand.bonzoTimerToggled)); - autoSkillTracker = new GuiButton(0, 0, 0, "Auto Start/Stop Skill Tracker: " + Utils.getColouredBoolean(ToggleCommand.autoSkillTrackerToggled)); - melodyTooltips = new GuiButton(0, 0, 0, "Hide tooltips in Melody's Harp: " + Utils.getColouredBoolean(ToggleCommand.melodyTooltips)); - highlightArachne = new GuiButton(0, 0, 0, "Highlight Arachne: " + Utils.getColouredBoolean(ToggleCommand.highlightArachne)); - highlightSlayer = new GuiButton(0, 0, 0, "Highlight Slayer: " + Utils.getColouredBoolean(ToggleCommand.highlightSlayers)); + outlineText = new FeatureButton("Outline Displayed Text: " + Utils.getColouredBoolean(ToggleCommand.outlineTextToggled), "Adds bold outline to on-screen text."); + pickBlock = new FeatureButton("Auto-Swap to Pick Block: " + Utils.getColouredBoolean(ToggleCommand.swapToPickBlockToggled), "Automatically changes left clicks to middle clicks.\nHelpful when lagging."); + coords = new FeatureButton("Coordinate/Angle Display: " + Utils.getColouredBoolean(ToggleCommand.coordsToggled), "Displays coordinates and angle."); + chatMaddox = new FeatureButton("Click On-Screen to Open Maddox: " + Utils.getColouredBoolean(ToggleCommand.chatMaddoxToggled), "Open chat then click anywhere after calling Maddox to open the menu."); + cakeTimer = new FeatureButton("Cake Timer: " + Utils.getColouredBoolean(ToggleCommand.cakeTimerToggled), "Displays time until century cake buffs run out."); + skill50Display = new FeatureButton("Display Progress To Skill Level 50: " + Utils.getColouredBoolean(ToggleCommand.skill50DisplayToggled), "Display total progress to max skill level."); + slayerCount = new FeatureButton("Count Total 20% Drops: " + Utils.getColouredBoolean(ToggleCommand.slayerCountTotal), "Counts times dropped instead of amount dropped.\nE.x. Hamster Wheels: 40 -> Hamster Wheels: 10 times."); + spiritBearAlert = new FeatureButton("Spirit Bear Spawn Alerts: " + Utils.getColouredBoolean(ToggleCommand.spiritBearAlerts), "Alert when Spirit Bear spawns."); + sceptreMessages = new FeatureButton("Spirit Sceptre Messages: " + Utils.getColouredBoolean(ToggleCommand.sceptreMessages), "Turn " + EnumChatFormatting.RED + "off" + EnumChatFormatting.RESET + " to hide Spirit Sceptre messages."); + midasStaffMessages = new FeatureButton("Midas Staff Messages: " + Utils.getColouredBoolean(ToggleCommand.midasStaffMessages), "Turn " + EnumChatFormatting.RED + "off" + EnumChatFormatting.RESET + " to hide Midas Staff messages."); + implosionMessages = new FeatureButton("Implosion Messages: " + Utils.getColouredBoolean(ToggleCommand.implosionMessages), "Turn " + EnumChatFormatting.RED + "off" + EnumChatFormatting.RESET + " to hide Implosion messages."); + healMessages = new FeatureButton("Heal Messages: " + Utils.getColouredBoolean(ToggleCommand.healMessages), "Turn " + EnumChatFormatting.RED + "off" + EnumChatFormatting.RESET + " to hide healing messages."); + cooldownMessages = new FeatureButton("Cooldown Messages: " + Utils.getColouredBoolean(ToggleCommand.cooldownMessages), "Turn " + EnumChatFormatting.RED + "off" + EnumChatFormatting.RESET + " to hide cooldown messages."); + manaMessages = new FeatureButton("Mana Messages: " + Utils.getColouredBoolean(ToggleCommand.manaMessages), "Turn " + EnumChatFormatting.RED + "off" + EnumChatFormatting.RESET + " to hide out of mana messages."); + killComboMessages = new FeatureButton("Kill Combo Messages: " + Utils.getColouredBoolean(ToggleCommand.killComboMessages), "Turn " + EnumChatFormatting.RED + "off" + EnumChatFormatting.RESET + " to hide kill combo messages."); + goldenEnch = new FeatureButton("Golden T10/T6/T4 Enchantments: " + Utils.getColouredBoolean(ToggleCommand.goldenToggled), "Turns expensive enchants golden in tooltips."); + petColours = new FeatureButton("Colour Pet Backgrounds: " + Utils.getColouredBoolean(ToggleCommand.petColoursToggled), "Colors pets based on their level."); + expertiseLore = new FeatureButton("Expertise Kills In Lore: " + Utils.getColouredBoolean(ToggleCommand.expertiseLoreToggled), "Adds expertise kills to fishing rod tooltip."); + gparty = new FeatureButton("Guild Party Notifications: " + Utils.getColouredBoolean(ToggleCommand.gpartyToggled), "Creates desktop notification on guild party."); + golemAlerts = new FeatureButton("Golem Spawn Alert And Timer: " + Utils.getColouredBoolean(ToggleCommand.golemAlertToggled), "Creates alert with 20s countdown when golem is spawning."); + rngesusAlert = new FeatureButton("RNGesus Alerts: " + Utils.getColouredBoolean(ToggleCommand.rngesusAlerts), "Alerts when an RNGesus item is dropped."); + splitFishing = new FeatureButton("Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing), "Splits fishing display in half to save vertical space."); + lowHealthNotify = new FeatureButton("Low Health Notifications: " + Utils.getColouredBoolean(ToggleCommand.lowHealthNotifyToggled), "Alerts when dungeon teammate has low health."); + lividSolver = new FeatureButton("Find Correct Livid: " + Utils.getColouredBoolean(ToggleCommand.lividSolverToggled), "Shows health and color of correct Livid."); + dungeonTimer = new FeatureButton("Display Dungeon Timers: " + Utils.getColouredBoolean(ToggleCommand.dungeonTimerToggled), "Displays timing of certain dungeon objectives and other information."); + stopSalvageStarred = new FeatureButton("Stop Salvaging Starred Items: " + Utils.getColouredBoolean(ToggleCommand.stopSalvageStarredToggled), "Blocks salvaging starred items."); + watcherReadyMessage = new FeatureButton("Display Watcher Ready Message: " + Utils.getColouredBoolean(ToggleCommand.watcherReadyToggled), "Alerts when Watcher finishes spawning mobs."); + notifySlayerSlain = new FeatureButton("Notify when Slayer Slain: " + Utils.getColouredBoolean(ToggleCommand.notifySlayerSlainToggled), "Alerts when slayer boss has been slain."); + necronNotifications = new FeatureButton("Necron Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled), "Creates alert on different phases of the Necron fight."); + bonzoTimer = new FeatureButton("Bonzo's Mask Timer: " + Utils.getColouredBoolean(ToggleCommand.bonzoTimerToggled), "Displays cooldown of Bonzo Mask ability."); + autoSkillTracker = new FeatureButton("Auto Start/Stop Skill Tracker: " + Utils.getColouredBoolean(ToggleCommand.autoSkillTrackerToggled), "Automatically pauses skill tracker when opening a gui."); + melodyTooltips = new FeatureButton("Hide tooltips in Melody's Harp: " + Utils.getColouredBoolean(ToggleCommand.melodyTooltips), "Hides tooltips in Melody's Harp."); + highlightArachne = new FeatureButton("Highlight Arachne: " + Utils.getColouredBoolean(ToggleCommand.highlightArachne), "Highlights Arachne boss."); + highlightSlayer = new FeatureButton("Highlight Slayer: " + Utils.getColouredBoolean(ToggleCommand.highlightSlayers), "Highlights Slayer boss."); allButtons.add(changeDisplay); allButtons.add(puzzleSolvers); @@ -231,6 +233,13 @@ public class DankerGui extends GuiScreen { int pageWidth = mc.fontRendererObj.getStringWidth(pageText); new TextRenderer(mc, pageText, width / 2 - pageWidth / 2, 10, 1D); + for (GuiButton button : this.buttonList) { + if (button instanceof FeatureButton && button.isMouseOver()) { + FeatureButton feature = (FeatureButton) button; + drawHoveringText(feature.hoverText, mouseX - 5, mouseY); + } + } + search.drawTextBox(); } diff --git a/src/main/java/me/Danker/gui/buttons/FeatureButton.java b/src/main/java/me/Danker/gui/buttons/FeatureButton.java new file mode 100644 index 0000000..a997e09 --- /dev/null +++ b/src/main/java/me/Danker/gui/buttons/FeatureButton.java @@ -0,0 +1,17 @@ +package me.Danker.gui.buttons; + +import net.minecraft.client.gui.GuiButton; + +import java.util.Arrays; +import java.util.List; + +public class FeatureButton extends GuiButton { + + public List hoverText; + + public FeatureButton(String displayString, String hoverText) { + super(0, 0, 0, displayString); + this.hoverText = Arrays.asList(hoverText.split("\n")); + } + +} -- cgit From 5360b5ceb83feab156f1e70460b842ba7721544b Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 9 Apr 2021 10:25:27 -0400 Subject: Fix /dsm buttons duplicating when resizing window --- src/main/java/me/Danker/gui/DankerGui.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index c5145e6..1c839c3 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -146,6 +146,7 @@ public class DankerGui extends GuiScreen { highlightArachne = new FeatureButton("Highlight Arachne: " + Utils.getColouredBoolean(ToggleCommand.highlightArachne), "Highlights Arachne boss."); highlightSlayer = new FeatureButton("Highlight Slayer: " + Utils.getColouredBoolean(ToggleCommand.highlightSlayers), "Highlights Slayer boss."); + allButtons.clear(); allButtons.add(changeDisplay); allButtons.add(puzzleSolvers); allButtons.add(experimentationTableSolvers); @@ -424,6 +425,7 @@ public class DankerGui extends GuiScreen { protected void keyTyped(char typedChar, int keyCode) throws IOException { super.keyTyped(typedChar, keyCode); search.textboxKeyTyped(typedChar, keyCode); + initSearchText = search.getText(); reInit(); } -- cgit From d085f3fe3a18261785d93150fd99fac5ed312e69 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Tue, 13 Apr 2021 12:59:58 +0200 Subject: added warping commands for every mvp+ exclusive location --- src/main/java/me/Danker/DankersSkyblockMod.java | 11 +- src/main/java/me/Danker/commands/DHelpCommand.java | 1 - .../java/me/Danker/commands/DungeonsCommand.java | 152 --------------------- src/main/java/me/Danker/commands/warp/Crypt.java | 47 +++++++ .../java/me/Danker/commands/warp/DarkAuction.java | 48 +++++++ src/main/java/me/Danker/commands/warp/Dragon.java | 48 +++++++ .../java/me/Danker/commands/warp/DungeonHub.java | 48 +++++++ .../java/me/Danker/commands/warp/HowlingCave.java | 47 +++++++ src/main/java/me/Danker/commands/warp/Magma.java | 47 +++++++ .../java/me/Danker/commands/warp/SpidersNest.java | 47 +++++++ 10 files changed, 342 insertions(+), 154 deletions(-) delete mode 100644 src/main/java/me/Danker/commands/DungeonsCommand.java create mode 100644 src/main/java/me/Danker/commands/warp/Crypt.java create mode 100644 src/main/java/me/Danker/commands/warp/DarkAuction.java create mode 100644 src/main/java/me/Danker/commands/warp/Dragon.java create mode 100644 src/main/java/me/Danker/commands/warp/DungeonHub.java create mode 100644 src/main/java/me/Danker/commands/warp/HowlingCave.java create mode 100644 src/main/java/me/Danker/commands/warp/Magma.java create mode 100644 src/main/java/me/Danker/commands/warp/SpidersNest.java (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index deb5c3b..619b6e6 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -1,6 +1,7 @@ package me.Danker; import me.Danker.commands.*; +import me.Danker.commands.warp.*; import me.Danker.events.ChestSlotClickedEvent; import me.Danker.events.GuiChestBackgroundDrawnEvent; import me.Danker.events.RenderOverlay; @@ -157,7 +158,6 @@ public class DankersSkyblockMod { ClientCommandHandler.instance.registerCommand(new DHelpCommand()); ClientCommandHandler.instance.registerCommand(new DankerGuiCommand()); ClientCommandHandler.instance.registerCommand(new DisplayCommand()); - ClientCommandHandler.instance.registerCommand(new DungeonsCommand()); ClientCommandHandler.instance.registerCommand(new FairySoulsCommand()); ClientCommandHandler.instance.registerCommand(new GetkeyCommand()); ClientCommandHandler.instance.registerCommand(new GuildOfCommand()); @@ -177,6 +177,15 @@ public class DankersSkyblockMod { ClientCommandHandler.instance.registerCommand(new SlayerCommand()); ClientCommandHandler.instance.registerCommand(new ToggleCommand()); + + ClientCommandHandler.instance.registerCommand(new Crypt()); + ClientCommandHandler.instance.registerCommand(new DarkAuction()); + ClientCommandHandler.instance.registerCommand(new Dragon()); + ClientCommandHandler.instance.registerCommand(new DungeonHub()); + ClientCommandHandler.instance.registerCommand(new HowlingCave()); + ClientCommandHandler.instance.registerCommand(new Magma()); + ClientCommandHandler.instance.registerCommand(new SpidersNest()); + configDirectory = event.getModConfigurationDirectory().toString(); } diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 8d47576..c405d22 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -49,7 +49,6 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + PetsCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to get pets of a person. If no name is provided, it checks yours.\n" + EnumChatFormatting.GOLD + BankCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to get bank and purse coins of a person. If no name is provided, it checks yours.\n" + EnumChatFormatting.GOLD + ArmourCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to get armour of a person. If no name is provided, it checks yours.\n" + - EnumChatFormatting.GOLD + DungeonsCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to get dungeon levels of a person. If no name is provided, it checks yours.\n" + EnumChatFormatting.GOLD + ImportFishingCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Imports your fishing stats from your latest profile to your fishing tracker using the API.\n" + EnumChatFormatting.GOLD + SkyblockPlayersCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find how many players are on each Skyblock island.\n" + EnumChatFormatting.GOLD + SkillTrackerCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Text display for skill xp/hour.\n" + diff --git a/src/main/java/me/Danker/commands/DungeonsCommand.java b/src/main/java/me/Danker/commands/DungeonsCommand.java deleted file mode 100644 index 92779dc..0000000 --- a/src/main/java/me/Danker/commands/DungeonsCommand.java +++ /dev/null @@ -1,152 +0,0 @@ -package me.Danker.commands; - -import com.google.gson.JsonObject; -import me.Danker.DankersSkyblockMod; -import me.Danker.handlers.APIHandler; -import me.Danker.handlers.ConfigHandler; -import me.Danker.utils.Utils; -import net.minecraft.command.CommandBase; -import net.minecraft.command.CommandException; -import net.minecraft.command.ICommandSender; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.event.HoverEvent; -import net.minecraft.util.BlockPos; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; - -import java.util.List; - -public class DungeonsCommand extends CommandBase { - - @Override - public String getCommandName() { - return "dungeons"; - } - - @Override - public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " [name]"; - } - - public static String usage(ICommandSender arg0) { - return new DungeonsCommand().getCommandUsage(arg0); - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { - if (args.length == 1) { - return Utils.getMatchingPlayers(args[0]); - } - return null; - } - - @Override - public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { - // MULTI THREAD DRIFTING - new Thread(() -> { - EntityPlayer player = (EntityPlayer) arg0; - - // Check key - String key = ConfigHandler.getString("api", "APIKey"); - if (key.equals("")) { - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "API key not set. Use /setkey.")); - } - - // Get UUID for Hypixel API requests - String username; - String uuid; - if (arg1.length == 0) { - username = player.getName(); - uuid = player.getUniqueID().toString().replaceAll("[\\-]", ""); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking dungeon stats of " + DankersSkyblockMod.SECONDARY_COLOUR + username)); - } else { - username = arg1[0]; - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking dungeon stats of " + DankersSkyblockMod.SECONDARY_COLOUR + username)); - uuid = APIHandler.getUUID(username); - } - - // Find stats of latest profile - String latestProfile = APIHandler.getLatestProfileID(uuid, key); - if (latestProfile == null) return; - - String profileURL = "https://api.hypixel.net/skyblock/profile?profile=" + latestProfile + "&key=" + key; - System.out.println("Fetching profile..."); - JsonObject profileResponse = APIHandler.getResponse(profileURL); - if (!profileResponse.get("success").getAsBoolean()) { - String reason = profileResponse.get("cause").getAsString(); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); - return; - } - - String playerURL = "https://api.hypixel.net/player?uuid=" + uuid + "&key=" + key; - System.out.println("Fetching player data..."); - JsonObject playerResponse = APIHandler.getResponse(playerURL); - if(!playerResponse.get("success").getAsBoolean()){ - String reason = playerResponse.get("cause").getAsString(); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "This player has not played on Hypixel.")); - } - - System.out.println("Fetching dungeon stats..."); - JsonObject dungeonsObject = profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject().get("dungeons").getAsJsonObject(); - if (!dungeonsObject.get("dungeon_types").getAsJsonObject().get("catacombs").getAsJsonObject().has("experience")) { - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "This player has not played dungeons.")); - return; - } - - JsonObject catacombsObject = dungeonsObject.get("dungeon_types").getAsJsonObject().get("catacombs").getAsJsonObject(); - double catacombs = Utils.xpToDungeonsLevel(catacombsObject.get("experience").getAsDouble()); - double healer = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("healer").getAsJsonObject().get("experience").getAsDouble()); - double mage = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("mage").getAsJsonObject().get("experience").getAsDouble()); - double berserk = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("berserk").getAsJsonObject().get("experience").getAsDouble()); - double archer = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("archer").getAsJsonObject().get("experience").getAsDouble()); - double tank = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("tank").getAsJsonObject().get("experience").getAsDouble()); - String selectedClass = Utils.capitalizeString(dungeonsObject.get("selected_dungeon_class").getAsString()); - int secrets = playerResponse.get("player").getAsJsonObject().get("achievements").getAsJsonObject().get("skyblock_treasure_hunter").getAsInt(); - - int highestFloor = catacombsObject.get("highest_tier_completed").getAsInt(); - JsonObject completionObj = catacombsObject.get("tier_completions").getAsJsonObject(); - - String delimiter = DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------"; - - ChatComponentText classLevels = new ChatComponentText( - EnumChatFormatting.GOLD + " Selected Class: " + selectedClass + "\n\n" + - EnumChatFormatting.RED + " Catacombs Level: " + catacombs + "\n" + - EnumChatFormatting.YELLOW + " Healer Level: " + healer + "\n" + - EnumChatFormatting.LIGHT_PURPLE + " Mage Level: " + mage + "\n" + - EnumChatFormatting.RED + " Berserk Level: " + berserk + "\n" + - EnumChatFormatting.GREEN + " Archer Level: " + archer + "\n" + - EnumChatFormatting.BLUE + " Tank Level: " + tank + "\n\n" + - EnumChatFormatting.WHITE + " Secrets Found: " + secrets + "\n\n"); - - StringBuilder completionsHoverString = new StringBuilder(); - - for (int i = 0; i <= highestFloor; i++) { - completionsHoverString - .append(EnumChatFormatting.GOLD) - .append(i == 0 ? "Entrance: " : "Floor " + i + ": ") - .append(EnumChatFormatting.RESET) - .append(completionObj.get(String.valueOf(i)).getAsInt()) - .append(i < highestFloor ? "\n": ""); - } - - ChatComponentText completions = new ChatComponentText(EnumChatFormatting.GOLD + " Highest Floor Completed: " + highestFloor); - - completions.setChatStyle(completions.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(completionsHoverString.toString())))); - - - player.addChatMessage( - new ChatComponentText(delimiter) - .appendText("\n") - .appendSibling(classLevels) - .appendSibling(completions) - .appendText("\n") - .appendSibling(new ChatComponentText(delimiter)) - ); - }).start(); - } -} diff --git a/src/main/java/me/Danker/commands/warp/Crypt.java b/src/main/java/me/Danker/commands/warp/Crypt.java new file mode 100644 index 0000000..88f286b --- /dev/null +++ b/src/main/java/me/Danker/commands/warp/Crypt.java @@ -0,0 +1,47 @@ +package me.Danker.commands.warp; + +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; + +import java.util.List; + +public class Crypt extends CommandBase { + @Override + public String getCommandName() { + return "crypt"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "/" + getCommandName(); + } + + public static String usage(ICommandSender arg0) { + return new me.Danker.commands.warp.Crypt().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + return null; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + if (!Utils.inSkyblock) return; + EntityPlayer player = ((EntityPlayer) sender); + // MULTI THREAD DRIFTING + new Thread(() -> { + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp crypt"); + }).start(); + } +} diff --git a/src/main/java/me/Danker/commands/warp/DarkAuction.java b/src/main/java/me/Danker/commands/warp/DarkAuction.java new file mode 100644 index 0000000..40218d8 --- /dev/null +++ b/src/main/java/me/Danker/commands/warp/DarkAuction.java @@ -0,0 +1,48 @@ +package me.Danker.commands.warp; + +import me.Danker.DankersSkyblockMod; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; + +import java.util.List; + +public class DarkAuction extends CommandBase { + @Override + public String getCommandName() { + return "da"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "/" + getCommandName(); + } + + public static String usage(ICommandSender arg0) { + return new me.Danker.commands.warp.DarkAuction().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + return null; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + if (!Utils.inSkyblock) return; + EntityPlayer player = ((EntityPlayer) sender); + // MULTI THREAD DRIFTING + new Thread(() -> { + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp da"); + }).start(); + } +} diff --git a/src/main/java/me/Danker/commands/warp/Dragon.java b/src/main/java/me/Danker/commands/warp/Dragon.java new file mode 100644 index 0000000..f36bef1 --- /dev/null +++ b/src/main/java/me/Danker/commands/warp/Dragon.java @@ -0,0 +1,48 @@ +package me.Danker.commands.warp; + +import me.Danker.DankersSkyblockMod; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; + +import java.util.List; + +public class Dragon extends CommandBase { + @Override + public String getCommandName() { + return "drag"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "/" + getCommandName(); + } + + public static String usage(ICommandSender arg0) { + return new me.Danker.commands.warp.DarkAuction().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + return null; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + if (!Utils.inSkyblock) return; + EntityPlayer player = ((EntityPlayer) sender); + // MULTI THREAD DRIFTING + new Thread(() -> { + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp drag"); + }).start(); + } +} diff --git a/src/main/java/me/Danker/commands/warp/DungeonHub.java b/src/main/java/me/Danker/commands/warp/DungeonHub.java new file mode 100644 index 0000000..cc1c082 --- /dev/null +++ b/src/main/java/me/Danker/commands/warp/DungeonHub.java @@ -0,0 +1,48 @@ +package me.Danker.commands.warp; + +import me.Danker.DankersSkyblockMod; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; + +import java.util.List; + +public class DungeonHub extends CommandBase { + @Override + public String getCommandName() { + return "dun"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "/" + getCommandName(); + } + + public static String usage(ICommandSender arg0) { + return new me.Danker.commands.warp.DungeonHub().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + return null; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + if (!Utils.inSkyblock) return; + EntityPlayer player = ((EntityPlayer) sender); + // MULTI THREAD DRIFTING + new Thread(() -> { + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp dungeon_hub"); + }).start(); + } +} diff --git a/src/main/java/me/Danker/commands/warp/HowlingCave.java b/src/main/java/me/Danker/commands/warp/HowlingCave.java new file mode 100644 index 0000000..4cdcf97 --- /dev/null +++ b/src/main/java/me/Danker/commands/warp/HowlingCave.java @@ -0,0 +1,47 @@ +package me.Danker.commands.warp; + +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; + +import java.util.List; + +public class HowlingCave extends CommandBase { + @Override + public String getCommandName() { + return "howl"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "/" + getCommandName(); + } + + public static String usage(ICommandSender arg0) { + return new me.Danker.commands.warp.HowlingCave().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + return null; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + if (!Utils.inSkyblock) return; + EntityPlayer player = ((EntityPlayer) sender); + // MULTI THREAD DRIFTING + new Thread(() -> { + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp howl"); + }).start(); + } +} diff --git a/src/main/java/me/Danker/commands/warp/Magma.java b/src/main/java/me/Danker/commands/warp/Magma.java new file mode 100644 index 0000000..96ead00 --- /dev/null +++ b/src/main/java/me/Danker/commands/warp/Magma.java @@ -0,0 +1,47 @@ +package me.Danker.commands.warp; + +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; + +import java.util.List; + +public class Magma extends CommandBase { + @Override + public String getCommandName() { + return "magma"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "/" + getCommandName(); + } + + public static String usage(ICommandSender arg0) { + return new me.Danker.commands.warp.Magma().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + return null; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + if (!Utils.inSkyblock) return; + EntityPlayer player = ((EntityPlayer) sender); + // MULTI THREAD DRIFTING + new Thread(() -> { + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp magma"); + }).start(); + } +} diff --git a/src/main/java/me/Danker/commands/warp/SpidersNest.java b/src/main/java/me/Danker/commands/warp/SpidersNest.java new file mode 100644 index 0000000..2f091ad --- /dev/null +++ b/src/main/java/me/Danker/commands/warp/SpidersNest.java @@ -0,0 +1,47 @@ +package me.Danker.commands.warp; + +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; + +import java.util.List; + +public class SpidersNest extends CommandBase { + @Override + public String getCommandName() { + return "nest"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "/" + getCommandName(); + } + + public static String usage(ICommandSender arg0) { + return new me.Danker.commands.warp.SpidersNest().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + return null; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + if (!Utils.inSkyblock) return; + EntityPlayer player = ((EntityPlayer) sender); + // MULTI THREAD DRIFTING + new Thread(() -> { + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp nest"); + }).start(); + } +} -- cgit From 5b64838ea3f8b5c0de84700e540163a6c0a4eb70 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Tue, 13 Apr 2021 13:12:55 +0200 Subject: added the changes to the readme and dhelpcommand --- README.md | 10 ++++++++++ src/main/java/me/Danker/commands/DHelpCommand.java | 8 ++++++++ 2 files changed, 18 insertions(+) (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 1faef53..84b6e5f 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,16 @@ Discord Server: https://discord.gg/QsEkNQS - /lobbybank - Uses API to find the average bank total of the lobby, as well the three players with the highest total money in the bank (and purse). - /dsmmusic [dungeonboss/bloodroom/dungeon] [1-100] - Stops, reloads or changes the volume of custom music. +##Warps +Commands for to warp to the MVP+ exclusive warps +- /crypt - Warps you to the Crypt in the Hub. +- /da - Warps you to the Dark Auction in the Hub. +- /drag - Warps you to the Dragons Nest in the End. +- /dun - Warps you to the Dungeon Hub. +- /howl - Warps you to the Howling Cave in the Park. +- /magma - Warps you to the Magma Fields in the Blazing Fortress. +- /nest - Warps you to the Top of the Spider's Nest in the Spider's Den. + ## Keybinds - Open Maddox menu - M by default. - Regular Ability - Numpad 4 by default. diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index c405d22..d5f3617 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -1,6 +1,7 @@ package me.Danker.commands; import me.Danker.DankersSkyblockMod; +import me.Danker.commands.warp.*; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; @@ -55,6 +56,13 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + LobbyBankCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find the average bank total of the lobby, as well the three players with the highest total money in the bank(and purse).\n" + EnumChatFormatting.GOLD + RepartyCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Disbands and reparties all members in the party.\n" + EnumChatFormatting.GOLD + CustomMusicCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Stops or reloads the custom music.\n" + + EnumChatFormatting.GOLD + Crypt.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Crypt in the Hub. \n" + + EnumChatFormatting.GOLD + DarkAuction.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Dark Auction in the Hub. \n" + + EnumChatFormatting.GOLD + Dragon.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Dragons Nest in the End. \n" + + EnumChatFormatting.GOLD + DungeonHub.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Dungeon Hub. \n" + + EnumChatFormatting.GOLD + HowlingCave.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Howling Cave in the Park. \n" + + EnumChatFormatting.GOLD + Magma.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Magma Fields in the Blazing Fortress. \n" + + EnumChatFormatting.GOLD + SpidersNest.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Top of the Spider's Nest in the Spider's Den. \n" + EnumChatFormatting.GREEN + " Open Maddox Menu" + EnumChatFormatting.AQUA + " - M by default.\n" + EnumChatFormatting.GREEN + " Start/Stop Skill Tracker" + EnumChatFormatting.AQUA + " - Numpad 5 by default.\n")); } -- cgit From 6c870810d6798bd9e445f2586455311d1a817976 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sun, 18 Apr 2021 17:49:02 -0400 Subject: Add highlighting Skeleton Masters --- README.md | 4 +-- src/main/java/me/Danker/DankersSkyblockMod.java | 1 + .../java/me/Danker/commands/DankerGuiCommand.java | 5 ++- .../java/me/Danker/commands/ToggleCommand.java | 22 ++++++++---- .../Danker/features/HighlightSkeletonMasters.java | 42 ++++++++++++++++++++++ .../Danker/features/puzzlesolvers/LividSolver.java | 14 +------- src/main/java/me/Danker/gui/DankerGui.java | 11 ++++-- .../java/me/Danker/handlers/ConfigHandler.java | 2 ++ src/main/java/me/Danker/utils/Utils.java | 23 +++++++----- 9 files changed, 90 insertions(+), 34 deletions(-) create mode 100644 src/main/java/me/Danker/features/HighlightSkeletonMasters.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index f5f9786..d2ee9a7 100644 --- a/README.md +++ b/README.md @@ -51,12 +51,12 @@ Discord Server: https://discord.gg/QsEkNQS - Reparty command - Highlight Slayer Bosses - Highlight Arachne - +- Highlight Skeleton Masters ## Commands - /dhelp - Returns this message in-game. - /dsm - Opens the GUI for Danker's Skyblock Mod. -- /toggle - Toggles features. /toggle list returns values of every toggle. +- /toggle - Toggles features. /toggle list returns values of every toggle. - /setkey - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. - /loot [winter/festival/spooky/f(1-7)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 76046e6..cf5caee 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -105,6 +105,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new GolemSpawningAlert()); MinecraftForge.EVENT_BUS.register(new GpartyNotifications()); MinecraftForge.EVENT_BUS.register(new HideTooltipsInExperiments()); + MinecraftForge.EVENT_BUS.register(new HighlightSkeletonMasters()); MinecraftForge.EVENT_BUS.register(new IceWalkSolver()); MinecraftForge.EVENT_BUS.register(new LividSolver()); MinecraftForge.EVENT_BUS.register(new LootDisplay()); diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index 5076ef7..923fcbe 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -88,7 +88,10 @@ public class DankerGuiCommand extends CommandBase { debug.append("[superpairs][").append(ToggleCommand.superpairsToggled).append("]\n"); debug.append("[hidetooltipsinaddons][").append(ToggleCommand.hideTooltipsInExperimentAddonsToggled).append("]\n"); debug.append("[pickblock][").append(ToggleCommand.swapToPickBlockToggled).append("]\n"); - debug.append("[melodyTooltips][").append(ToggleCommand.melodyTooltips).append("]\n"); + debug.append("[melodytooltips][").append(ToggleCommand.melodyTooltips).append("]\n"); + debug.append("[highlightslayers][").append(ToggleCommand.highlightSlayers).append("]\n"); + debug.append("[highlightarachne][").append(ToggleCommand.highlightArachne).append("]\n"); + debug.append("[highlightskeletonmasters][").append(ToggleCommand.highlightSkeletonMasters).append("]\n"); debug.append("[dungeonbossmusic][").append(ToggleCommand.dungeonBossMusic).append("]\n"); debug.append("[bloodroommusic][").append(ToggleCommand.bloodRoomMusic).append("]\n"); debug.append("[dungeonmusic][").append(ToggleCommand.dungeonMusic).append("]\n"); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index a6f20fc..528f376 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -33,6 +33,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean cakeTimerToggled; public static boolean highlightSlayers; public static boolean highlightArachne; + public static boolean highlightSkeletonMasters; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; @@ -92,7 +93,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "creeperpuzzle/waterpuzzle/tictactoepuzzle/boulderpuzzle/silverfishpuzzle/icewalkpuzzle/watchermessage/" + "startswithterminal/selectallterminal/clickinorderterminal/" + "ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/" + - "melodytooltips/highlightslayers/highlightarachne/dungeonbossmusic/bloodroommusic/" + + "melodytooltips/highlightslayers/highlightarachne/highlightskeletonmasters/dungeonbossmusic/bloodroommusic/" + "dungeonmusic/list>"; } @@ -121,7 +122,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "selectallterminal", "clickinorderterminal", "ultrasequencer", "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "melodytooltips", "highlightslayers", - "dungeonbossmusic", "bloodroommusic", "dungeonmusic", "list"); + "highlightskeletonmasters", "dungeonbossmusic", "bloodroommusic", "dungeonmusic", "list"); } return null; } @@ -392,10 +393,16 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "HighlightSlayers", highlightSlayers); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Slayer Bosses " + DankersSkyblockMod.SECONDARY_COLOUR + highlightSlayers + DankersSkyblockMod.MAIN_COLOUR + ".")); break; - case "highlightArachne": + case "highlightarachne": highlightArachne = !highlightArachne; ConfigHandler.writeBooleanConfig("toggles", "HighlightArachne", highlightArachne); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Arachne " + DankersSkyblockMod.SECONDARY_COLOUR + highlightArachne + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "highlightskeletonmasters": + highlightSkeletonMasters = !highlightSkeletonMasters; + ConfigHandler.writeBooleanConfig("toggles", "HighlightSkeletonMasters", highlightSkeletonMasters); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Skeleton Masters " + DankersSkyblockMod.SECONDARY_COLOUR + highlightSkeletonMasters + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "dungeonbossmusic": dungeonBossMusic = !dungeonBossMusic; CustomMusic.dungeonboss.stop(); @@ -455,10 +462,11 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Chronomatron solver: " + DankersSkyblockMod.VALUE_COLOUR + chronomatronToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Superpairs solver: " + DankersSkyblockMod.VALUE_COLOUR + superpairsToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Hide tooltips in experiment addons: " + DankersSkyblockMod.VALUE_COLOUR + hideTooltipsInExperimentAddonsToggled + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Auto-swap to pick block " + DankersSkyblockMod.VALUE_COLOUR + swapToPickBlockToggled + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Hide tooltips in Melody's Harp " + DankersSkyblockMod.VALUE_COLOUR + melodyTooltips + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Highlight Slayer Bosses " + DankersSkyblockMod.VALUE_COLOUR + highlightSlayers + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Highlight Arachne Boss " + DankersSkyblockMod.VALUE_COLOUR + highlightArachne + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Auto-swap to pick block: " + DankersSkyblockMod.VALUE_COLOUR + swapToPickBlockToggled + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Hide tooltips in Melody's Harp: " + DankersSkyblockMod.VALUE_COLOUR + melodyTooltips + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Highlight Slayer Bosses: " + DankersSkyblockMod.VALUE_COLOUR + highlightSlayers + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Highlight Arachne Boss: " + DankersSkyblockMod.VALUE_COLOUR + highlightArachne + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Highlight Skeleton Masters: " + DankersSkyblockMod.VALUE_COLOUR + highlightSkeletonMasters + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon boss music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonBossMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom blood room music: " + DankersSkyblockMod.VALUE_COLOUR + bloodRoomMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonMusic diff --git a/src/main/java/me/Danker/features/HighlightSkeletonMasters.java b/src/main/java/me/Danker/features/HighlightSkeletonMasters.java new file mode 100644 index 0000000..f97699c --- /dev/null +++ b/src/main/java/me/Danker/features/HighlightSkeletonMasters.java @@ -0,0 +1,42 @@ +package me.Danker.features; + +import me.Danker.commands.ToggleCommand; +import me.Danker.utils.Utils; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.item.ItemStack; +import net.minecraftforge.client.event.RenderLivingEvent; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.util.ArrayList; +import java.util.List; + +public class HighlightSkeletonMasters { + + static List skeletonMasters = new ArrayList<>(); + public static int SKELETON_MASTER_COLOUR; + + @SubscribeEvent + public void onRenderEntity(RenderLivingEvent.Pre event) { + if (ToggleCommand.highlightSkeletonMasters && event.entity instanceof EntitySkeleton && Utils.inDungeons) { + ItemStack helmet = event.entity.getCurrentArmor(3); + if (helmet != null && helmet.getDisplayName().endsWith("Skeleton Master Helmet")) { + skeletonMasters.add(event.entity); + } + } + } + + @SubscribeEvent + public void onWorldRender(RenderWorldLastEvent event) { + if (ToggleCommand.highlightSkeletonMasters) { + for (Entity skeletonMaster : skeletonMasters) { + if (!skeletonMaster.isDead) + Utils.draw3DBox(skeletonMaster.getEntityBoundingBox(), SKELETON_MASTER_COLOUR, event.partialTicks); + } + skeletonMasters.clear(); + } + } + +} diff --git a/src/main/java/me/Danker/features/puzzlesolvers/LividSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/LividSolver.java index b537198..6f02982 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/LividSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/LividSolver.java @@ -5,7 +5,6 @@ import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; import me.Danker.commands.ToggleCommand; import me.Danker.events.RenderOverlay; -import me.Danker.handlers.ScoreboardHandler; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; @@ -39,18 +38,7 @@ public class LividSolver { World world = Minecraft.getMinecraft().theWorld; if (DankersSkyblockMod.tickAmount % 20 == 0) { if (ToggleCommand.lividSolverToggled && Utils.inDungeons && !foundLivid && world != null) { - boolean inF5 = false; - - List scoreboard = ScoreboardHandler.getSidebarLines(); - for (String s : scoreboard) { - String sCleaned = ScoreboardHandler.cleanSB(s); - if (sCleaned.contains("The Catacombs (F5)")) { - inF5 = true; - break; - } - } - - if (inF5) { + if (Utils.isInScoreboard("The Catacombs (F5)")) { List loadedLivids = new ArrayList<>(); List entities = world.getLoadedEntityList(); for (Entity entity : entities) { diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 1c839c3..68d1017 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -62,6 +62,7 @@ public class DankerGui extends GuiScreen { private GuiButton autoSkillTracker; private GuiButton highlightArachne; private GuiButton highlightSlayer; + private GuiButton highlightSkeletonMasters; // Chat Messages private GuiButton sceptreMessages; private GuiButton midasStaffMessages; @@ -143,8 +144,9 @@ public class DankerGui extends GuiScreen { bonzoTimer = new FeatureButton("Bonzo's Mask Timer: " + Utils.getColouredBoolean(ToggleCommand.bonzoTimerToggled), "Displays cooldown of Bonzo Mask ability."); autoSkillTracker = new FeatureButton("Auto Start/Stop Skill Tracker: " + Utils.getColouredBoolean(ToggleCommand.autoSkillTrackerToggled), "Automatically pauses skill tracker when opening a gui."); melodyTooltips = new FeatureButton("Hide tooltips in Melody's Harp: " + Utils.getColouredBoolean(ToggleCommand.melodyTooltips), "Hides tooltips in Melody's Harp."); - highlightArachne = new FeatureButton("Highlight Arachne: " + Utils.getColouredBoolean(ToggleCommand.highlightArachne), "Highlights Arachne boss."); - highlightSlayer = new FeatureButton("Highlight Slayer: " + Utils.getColouredBoolean(ToggleCommand.highlightSlayers), "Highlights Slayer boss."); + highlightArachne = new FeatureButton("Highlight Arachne: " + Utils.getColouredBoolean(ToggleCommand.highlightArachne), "Highlights Arachne bosses."); + highlightSlayer = new FeatureButton("Highlight Slayer: " + Utils.getColouredBoolean(ToggleCommand.highlightSlayers), "Highlights Slayer bosses."); + highlightSkeletonMasters = new FeatureButton("Highlight Skeleton Masters: " + Utils.getColouredBoolean(ToggleCommand.highlightSkeletonMasters), "Highlights Skeleton Masters."); allButtons.clear(); allButtons.add(changeDisplay); @@ -186,6 +188,7 @@ public class DankerGui extends GuiScreen { allButtons.add(melodyTooltips); allButtons.add(highlightArachne); allButtons.add(highlightSlayer); + allButtons.add(highlightSkeletonMasters); search.setText(initSearchText); search.setVisible(true); @@ -412,6 +415,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.highlightSlayers = !ToggleCommand.highlightSlayers; ConfigHandler.writeBooleanConfig("toggles", "HighlightSlayers", ToggleCommand.highlightSlayers); highlightSlayer.displayString = "Highlight Slayer: " + Utils.getColouredBoolean(ToggleCommand.highlightSlayers); + } else if (button == highlightSkeletonMasters) { + ToggleCommand.highlightSkeletonMasters = !ToggleCommand.highlightSkeletonMasters; + ConfigHandler.writeBooleanConfig("toggles", "HighlightSkeletonMasters", ToggleCommand.highlightSkeletonMasters); + highlightSkeletonMasters.displayString = "Highlight Skeleton Masters: " + Utils.getColouredBoolean(ToggleCommand.highlightSkeletonMasters); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index d3b7464..5668953 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -228,6 +228,7 @@ public class ConfigHandler { ToggleCommand.melodyTooltips = initBoolean("toggles", "MelodyTooltips", false); ToggleCommand.highlightSlayers = initBoolean("toggles", "HighlightSlayers", false); ToggleCommand.highlightArachne = initBoolean("toggles", "HighlightArachne", false); + ToggleCommand.highlightSkeletonMasters = initBoolean("toggles", "HighlightSkeletonMasters", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); @@ -510,6 +511,7 @@ public class ConfigHandler { BlazeSolver.HIGHEST_BLAZE_COLOUR = initInt("colors", "blazeHighest", 0x40FF40); SlayerESP.SLAYER_COLOUR = initInt("colors", "slayerColor", 0x0000FF); ArachneESP.ARACHANE_COLOUR = initInt("colors", "arachneColor", 0x00FF00); + HighlightSkeletonMasters.SKELETON_MASTER_COLOUR = initInt("colors", "skeletonMaster", 0xFF0000); PetColours.PET_1_TO_9 = initInt("colors", "pet1To9", 0x999999); // Grey PetColours.PET_10_TO_19 = initInt("colors", "pet10To19", 0xD62440); // Red PetColours.PET_20_TO_29 = initInt("colors", "pet20To29", 0xEF5230); // Orange diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 1a24c69..160fc0a 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -145,17 +145,22 @@ public class Utils { } public static void checkForDungeons() { - if (inSkyblock) { - List scoreboard = ScoreboardHandler.getSidebarLines(); - for (String s : scoreboard) { - String sCleaned = ScoreboardHandler.cleanSB(s); - if (sCleaned.contains("The Catacombs")) { - inDungeons = true; - return; - } + if (inSkyblock) { + if (isInScoreboard("The Catacombs")) { + inDungeons = true; + return; } } - inDungeons = false; + inDungeons = false; + } + + public static boolean isInScoreboard(String text) { + List scoreboard = ScoreboardHandler.getSidebarLines(); + for (String s : scoreboard) { + String sCleaned = ScoreboardHandler.cleanSB(s); + if (sCleaned.contains(text)) return true; + } + return false; } public static String capitalizeString(String string) { -- cgit From be0594f3ce39b560d5d30fd9e463bd42304c440e Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Mon, 19 Apr 2021 11:10:14 -0400 Subject: Add display for teammates in 30 block radius --- README.md | 7 +-- src/main/java/me/Danker/DankersSkyblockMod.java | 1 + .../java/me/Danker/commands/DankerGuiCommand.java | 1 + src/main/java/me/Danker/commands/MoveCommand.java | 13 ++++- src/main/java/me/Danker/commands/ScaleCommand.java | 11 +++- .../java/me/Danker/commands/ToggleCommand.java | 22 +++++--- .../java/me/Danker/features/TetherDisplay.java | 60 ++++++++++++++++++++++ src/main/java/me/Danker/gui/DankerGui.java | 7 +++ src/main/java/me/Danker/gui/EditLocationsGui.java | 22 ++++++++ .../java/me/Danker/handlers/ConfigHandler.java | 4 ++ src/main/java/me/Danker/utils/Utils.java | 4 ++ 11 files changed, 138 insertions(+), 14 deletions(-) create mode 100644 src/main/java/me/Danker/features/TetherDisplay.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index d2ee9a7..db18e13 100644 --- a/README.md +++ b/README.md @@ -52,18 +52,19 @@ Discord Server: https://discord.gg/QsEkNQS - Highlight Slayer Bosses - Highlight Arachne - Highlight Skeleton Masters +- Show teammates in 30 block radius ## Commands - /dhelp - Returns this message in-game. - /dsm - Opens the GUI for Danker's Skyblock Mod. -- /toggle - Toggles features. /toggle list returns values of every toggle. +- /toggle - Toggles features. /toggle list returns values of every toggle. - /setkey - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. - /loot [winter/festival/spooky/f(1-7)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. - /display [winter/festival/spooky/f(1-7)/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active. - /resetloot - - Resets loot for trackers. /resetloot confirm confirms the reset. -- /move - Moves text display to specified X and Y coordinates. -- /scale - Scales text display to a specified multipler between 0.1x and 10x. +- /move - Moves text display to specified X and Y coordinates. +- /scale - Scales text display to a specified multipler between 0.1x and 10x. - /slayer [player] - Uses API to get slayer xp of a person. If no name is provided, it checks yours. - /skills [player] - Uses API to get skill levels of a person. If no name is provided, it checks yours. - /lobbyskills - Uses API to find the average skills of the lobby, as well the three players with the highest skill average. diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index cf5caee..3ffa0f1 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -126,6 +126,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new StartsWithSolver()); MinecraftForge.EVENT_BUS.register(new StopSalvagingStarredItems()); MinecraftForge.EVENT_BUS.register(new SuperpairsSolver()); + MinecraftForge.EVENT_BUS.register(new TetherDisplay()); MinecraftForge.EVENT_BUS.register(new ThreeManSolver()); MinecraftForge.EVENT_BUS.register(new TicTacToeSolver()); MinecraftForge.EVENT_BUS.register(new TriviaSolver()); diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index 923fcbe..6fede04 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -92,6 +92,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[highlightslayers][").append(ToggleCommand.highlightSlayers).append("]\n"); debug.append("[highlightarachne][").append(ToggleCommand.highlightArachne).append("]\n"); debug.append("[highlightskeletonmasters][").append(ToggleCommand.highlightSkeletonMasters).append("]\n"); + debug.append("[teammatesinradius][").append(ToggleCommand.teammatesInRadius).append("]\n"); debug.append("[dungeonbossmusic][").append(ToggleCommand.dungeonBossMusic).append("]\n"); debug.append("[bloodroommusic][").append(ToggleCommand.bloodRoomMusic).append("]\n"); debug.append("[dungeonmusic][").append(ToggleCommand.dungeonMusic).append("]\n"); diff --git a/src/main/java/me/Danker/commands/MoveCommand.java b/src/main/java/me/Danker/commands/MoveCommand.java index 6fe2939..33d1f78 100644 --- a/src/main/java/me/Danker/commands/MoveCommand.java +++ b/src/main/java/me/Danker/commands/MoveCommand.java @@ -23,6 +23,7 @@ public class MoveCommand extends CommandBase { public static int[] waterAnswerXY = {0, 0}; public static int[] bonzoTimerXY = {0, 0}; public static int[] golemTimerXY = {0 ,0}; + public static int[] teammatesInRadiusXY = {0, 0}; @Override public String getCommandName() { @@ -31,7 +32,7 @@ public class MoveCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " "; + return "/" + getCommandName() + " "; } public static String usage(ICommandSender arg0) { @@ -46,7 +47,8 @@ public class MoveCommand extends CommandBase { @Override public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", "skilltracker", "wateranswer", "bonzotimer", "golemtimer"); + return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", + "skilltracker", "wateranswer", "bonzotimer", "golemtimer", "teammatesinradius"); } return null; } @@ -131,6 +133,13 @@ public class MoveCommand extends CommandBase { ConfigHandler.writeIntConfig("locations", "golemTimerY", golemTimerXY[1]); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Golem timer has been moved to " + DankersSkyblockMod.SECONDARY_COLOUR + arg1[1] + ", " + arg1[2])); break; + case "teammatesinradius": + teammatesInRadiusXY[0] = Integer.parseInt(arg1[1]); + teammatesInRadiusXY[1] = Integer.parseInt(arg1[2]); + ConfigHandler.writeIntConfig("locations", "teammatesInRadiusX", teammatesInRadiusXY[0]); + ConfigHandler.writeIntConfig("locations", "teammatesInRadiusY", teammatesInRadiusXY[1]); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Teammates in radius has been moved to " + DankersSkyblockMod.SECONDARY_COLOUR + arg1[1] + ", " + arg1[2])); + break; default: player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); } diff --git a/src/main/java/me/Danker/commands/ScaleCommand.java b/src/main/java/me/Danker/commands/ScaleCommand.java index b27ac50..a95f1b1 100644 --- a/src/main/java/me/Danker/commands/ScaleCommand.java +++ b/src/main/java/me/Danker/commands/ScaleCommand.java @@ -23,6 +23,7 @@ public class ScaleCommand extends CommandBase { public static double waterAnswerScale; public static double bonzoTimerScale; public static double golemTimerScale; + public static double teammatesInRadiusScale; @Override public String getCommandName() { @@ -31,7 +32,7 @@ public class ScaleCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " "; + return "/" + getCommandName() + " "; } public static String usage(ICommandSender arg0) { @@ -46,7 +47,8 @@ public class ScaleCommand extends CommandBase { @Override public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", "skilltracker", "wateranswer", "bonzotimer", "golemtimer"); + return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", + "skilltracker", "wateranswer", "bonzotimer", "golemtimer", "teammatesinradius"); } return null; } @@ -117,6 +119,11 @@ public class ScaleCommand extends CommandBase { ConfigHandler.writeDoubleConfig("scales", "golemTimerScale", golemTimerScale); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Golem timer has been scaled to " + DankersSkyblockMod.SECONDARY_COLOUR + golemTimerScale + "x")); break; + case "teammatesinradius": + teammatesInRadiusScale = scaleAmount; + ConfigHandler.writeDoubleConfig("scales", "teammatesInRadiusScale", teammatesInRadiusScale); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Teammates in radius has been scaled to " + DankersSkyblockMod.SECONDARY_COLOUR + teammatesInRadiusScale + "x")); + break; default: player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); } diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 528f376..0eb52fd 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -34,6 +34,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean highlightSlayers; public static boolean highlightArachne; public static boolean highlightSkeletonMasters; + public static boolean teammatesInRadius; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; @@ -93,8 +94,8 @@ public class ToggleCommand extends CommandBase implements ICommand { "creeperpuzzle/waterpuzzle/tictactoepuzzle/boulderpuzzle/silverfishpuzzle/icewalkpuzzle/watchermessage/" + "startswithterminal/selectallterminal/clickinorderterminal/" + "ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/" + - "melodytooltips/highlightslayers/highlightarachne/highlightskeletonmasters/dungeonbossmusic/bloodroommusic/" + - "dungeonmusic/list>"; + "melodytooltips/highlightslayers/highlightarachne/highlightskeletonmasters/teammatesinradius/" + + "dungeonbossmusic/bloodroommusic/dungeonmusic/list>"; } public static String usage(ICommandSender arg0) { @@ -122,7 +123,8 @@ public class ToggleCommand extends CommandBase implements ICommand { "selectallterminal", "clickinorderterminal", "ultrasequencer", "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "melodytooltips", "highlightslayers", - "highlightskeletonmasters", "dungeonbossmusic", "bloodroommusic", "dungeonmusic", "list"); + "highlightskeletonmasters", "dungeonbossmusic", "bloodroommusic", "dungeonmusic", + "teammatesinradius", "list"); } return null; } @@ -386,22 +388,27 @@ public class ToggleCommand extends CommandBase implements ICommand { case "melodytooltips": melodyTooltips = !melodyTooltips; ConfigHandler.writeBooleanConfig("toggles", "MelodyTooltips", melodyTooltips); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Hide tooltips in Melody's Harp " + DankersSkyblockMod.SECONDARY_COLOUR + melodyTooltips + DankersSkyblockMod.MAIN_COLOUR + ".")); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Hide tooltips in Melody's Harp has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + melodyTooltips + DankersSkyblockMod.MAIN_COLOUR + ".")); break; case "highlightslayers": highlightSlayers = !highlightSlayers; ConfigHandler.writeBooleanConfig("toggles", "HighlightSlayers", highlightSlayers); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Slayer Bosses " + DankersSkyblockMod.SECONDARY_COLOUR + highlightSlayers + DankersSkyblockMod.MAIN_COLOUR + ".")); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Slayer Bosses has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + highlightSlayers + DankersSkyblockMod.MAIN_COLOUR + ".")); break; case "highlightarachne": highlightArachne = !highlightArachne; ConfigHandler.writeBooleanConfig("toggles", "HighlightArachne", highlightArachne); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Arachne " + DankersSkyblockMod.SECONDARY_COLOUR + highlightArachne + DankersSkyblockMod.MAIN_COLOUR + ".")); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Arachne has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + highlightArachne + DankersSkyblockMod.MAIN_COLOUR + ".")); break; case "highlightskeletonmasters": highlightSkeletonMasters = !highlightSkeletonMasters; ConfigHandler.writeBooleanConfig("toggles", "HighlightSkeletonMasters", highlightSkeletonMasters); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Skeleton Masters " + DankersSkyblockMod.SECONDARY_COLOUR + highlightSkeletonMasters + DankersSkyblockMod.MAIN_COLOUR + ".")); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Skeleton Masters has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + highlightSkeletonMasters + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "teammatesinradius": + teammatesInRadius = !teammatesInRadius; + ConfigHandler.writeBooleanConfig("toggles", "TeammatesInRadius", teammatesInRadius); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Teammates in radius has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + teammatesInRadius + DankersSkyblockMod.MAIN_COLOUR + ".")); break; case "dungeonbossmusic": dungeonBossMusic = !dungeonBossMusic; @@ -467,6 +474,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Highlight Slayer Bosses: " + DankersSkyblockMod.VALUE_COLOUR + highlightSlayers + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Highlight Arachne Boss: " + DankersSkyblockMod.VALUE_COLOUR + highlightArachne + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Highlight Skeleton Masters: " + DankersSkyblockMod.VALUE_COLOUR + highlightSkeletonMasters + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Teammates in radius: " + DankersSkyblockMod.VALUE_COLOUR + teammatesInRadius + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon boss music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonBossMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom blood room music: " + DankersSkyblockMod.VALUE_COLOUR + bloodRoomMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonMusic diff --git a/src/main/java/me/Danker/features/TetherDisplay.java b/src/main/java/me/Danker/features/TetherDisplay.java new file mode 100644 index 0000000..363b90f --- /dev/null +++ b/src/main/java/me/Danker/features/TetherDisplay.java @@ -0,0 +1,60 @@ +package me.Danker.features; + +import me.Danker.DankersSkyblockMod; +import me.Danker.commands.MoveCommand; +import me.Danker.commands.ScaleCommand; +import me.Danker.commands.ToggleCommand; +import me.Danker.events.RenderOverlay; +import me.Danker.handlers.TextRenderer; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityOtherPlayerMP; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + +import java.util.ArrayList; +import java.util.List; + +public class TetherDisplay { + + static List playersInRadius = new ArrayList<>(); + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + if (event.phase != TickEvent.Phase.START) return; + + Minecraft mc = Minecraft.getMinecraft(); + EntityPlayer player = mc.thePlayer; + World world = mc.theWorld; + if (DankersSkyblockMod.tickAmount % 10 == 0) { + if (ToggleCommand.teammatesInRadius && Utils.inDungeons && player != null && world != null) { + playersInRadius.clear(); + List teammates = world.getEntitiesWithinAABB(EntityOtherPlayerMP.class, new AxisAlignedBB(player.posX - 30, player.posY - 30, player.posZ - 30, player.posX + 30, player.posY + 30, player.posZ + 30)); + + for (EntityPlayer teammate : teammates) { + if (Utils.isRealPlayer(teammate) && !teammate.isInvisible() && player.getDistanceToEntity(teammate) <= 30F) { + playersInRadius.add(teammate.getDisplayName().getSiblings().get(0).getFormattedText()); + } + } + } + } + } + + @SubscribeEvent + public void renderPlayerInfo(RenderOverlay event) { + if (ToggleCommand.teammatesInRadius && Utils.inDungeons) { + String teammates; + if (playersInRadius.size() > 0) { + teammates = String.join("\n", playersInRadius); + } else { + teammates = EnumChatFormatting.RED + "NONE"; + } + new TextRenderer(Minecraft.getMinecraft(), EnumChatFormatting.AQUA + "Teammates In Radius:\n" + teammates, MoveCommand.teammatesInRadiusXY[0], MoveCommand.teammatesInRadiusXY[1], ScaleCommand.teammatesInRadiusScale); + } + } + +} diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 68d1017..4797343 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -63,6 +63,7 @@ public class DankerGui extends GuiScreen { private GuiButton highlightArachne; private GuiButton highlightSlayer; private GuiButton highlightSkeletonMasters; + private GuiButton teammatesInRadius; // Chat Messages private GuiButton sceptreMessages; private GuiButton midasStaffMessages; @@ -147,6 +148,7 @@ public class DankerGui extends GuiScreen { highlightArachne = new FeatureButton("Highlight Arachne: " + Utils.getColouredBoolean(ToggleCommand.highlightArachne), "Highlights Arachne bosses."); highlightSlayer = new FeatureButton("Highlight Slayer: " + Utils.getColouredBoolean(ToggleCommand.highlightSlayers), "Highlights Slayer bosses."); highlightSkeletonMasters = new FeatureButton("Highlight Skeleton Masters: " + Utils.getColouredBoolean(ToggleCommand.highlightSkeletonMasters), "Highlights Skeleton Masters."); + teammatesInRadius = new FeatureButton("Display Players in 30 Block Radius: " + Utils.getColouredBoolean(ToggleCommand.teammatesInRadius), "Displays dungeon teammates in 30 block radius for tether and diversion."); allButtons.clear(); allButtons.add(changeDisplay); @@ -189,6 +191,7 @@ public class DankerGui extends GuiScreen { allButtons.add(highlightArachne); allButtons.add(highlightSlayer); allButtons.add(highlightSkeletonMasters); + allButtons.add(teammatesInRadius); search.setText(initSearchText); search.setVisible(true); @@ -419,6 +422,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.highlightSkeletonMasters = !ToggleCommand.highlightSkeletonMasters; ConfigHandler.writeBooleanConfig("toggles", "HighlightSkeletonMasters", ToggleCommand.highlightSkeletonMasters); highlightSkeletonMasters.displayString = "Highlight Skeleton Masters: " + Utils.getColouredBoolean(ToggleCommand.highlightSkeletonMasters); + } else if (button == teammatesInRadius) { + ToggleCommand.teammatesInRadius = !ToggleCommand.teammatesInRadius; + ConfigHandler.writeBooleanConfig("toggles", "TeammatesInRadius", ToggleCommand.teammatesInRadius); + teammatesInRadius.displayString = "Display Players in 30 Block Radius: " + Utils.getColouredBoolean(ToggleCommand.teammatesInRadius); } } diff --git a/src/main/java/me/Danker/gui/EditLocationsGui.java b/src/main/java/me/Danker/gui/EditLocationsGui.java index 3a7c94b..c263d5a 100644 --- a/src/main/java/me/Danker/gui/EditLocationsGui.java +++ b/src/main/java/me/Danker/gui/EditLocationsGui.java @@ -13,6 +13,8 @@ import net.minecraft.client.gui.GuiScreen; import net.minecraft.util.EnumChatFormatting; import org.lwjgl.opengl.GL11; +import javax.xml.stream.Location; + public class EditLocationsGui extends GuiScreen { private String moving = null; @@ -29,6 +31,7 @@ public class EditLocationsGui extends GuiScreen { private LocationButton waterAnswer; private LocationButton bonzoTimer; private LocationButton golemTimer; + private LocationButton teammatesInRadius; @Override public boolean doesGuiPauseGame() { @@ -86,6 +89,13 @@ public class EditLocationsGui extends GuiScreen { EnumChatFormatting.GREEN + "Green: " + EnumChatFormatting.YELLOW + "Gold, " + EnumChatFormatting.GREEN + "Emerald\n" + EnumChatFormatting.RED + "Red: " + EnumChatFormatting.YELLOW + "Gold, " + EnumChatFormatting.AQUA + "Diamond, " + EnumChatFormatting.GREEN + "Emerald, " + EnumChatFormatting.RED + "Clay"; + String teammatesInRadiusText = EnumChatFormatting.AQUA + "Teammates In Radius:\n" + + EnumChatFormatting.GREEN + "NoticeMehSenpai\n" + + EnumChatFormatting.GREEN + "DeathStreeks\n" + + EnumChatFormatting.GREEN + "Not_A_Neko\n" + + EnumChatFormatting.GREEN + "Minikloon"; + + // ive lost my marbles display = new LocationButton(0, MoveCommand.displayXY[0], MoveCommand.displayXY[1], 145 * ScaleCommand.displayScale, 102 * ScaleCommand.displayScale, ScaleCommand.displayScale, displayText, displayNums, 110); dungeonTimer = new LocationButton(0, MoveCommand.dungeonTimerXY[0], MoveCommand.dungeonTimerXY[1], 113 * ScaleCommand.dungeonTimerScale, 57 * ScaleCommand.dungeonTimerScale, ScaleCommand.dungeonTimerScale, dungeonTimerText, dungeonTimerNums, 80); coords = new LocationButton(0, MoveCommand.coordsXY[0], MoveCommand.coordsXY[1], 141 * ScaleCommand.coordsScale, 12 * ScaleCommand.coordsScale, ScaleCommand.coordsScale, NoF3Coords.COORDS_COLOUR + "74 / 14 / -26 (141.1 / 6.7)", null, null); @@ -96,6 +106,7 @@ public class EditLocationsGui extends GuiScreen { waterAnswer = new LocationButton(0, MoveCommand.waterAnswerXY[0], MoveCommand.waterAnswerXY[1], 190 * ScaleCommand.waterAnswerScale, 54 * ScaleCommand.waterAnswerScale, ScaleCommand.waterAnswerScale, waterAnswerText, null, null); bonzoTimer = new LocationButton(0, MoveCommand.bonzoTimerXY[0], MoveCommand.bonzoTimerXY[1] + 5, 53 * ScaleCommand.bonzoTimerScale, 18 * ScaleCommand.bonzoTimerScale, ScaleCommand.bonzoTimerScale, BonzoMaskTimer.BONZO_COLOR + " 3m30s", null, null); golemTimer = new LocationButton(0, MoveCommand.golemTimerXY[0], MoveCommand.golemTimerXY[1] + 5, 42 * ScaleCommand.golemTimerScale, 18 * ScaleCommand.golemTimerScale, ScaleCommand.golemTimerScale, GolemSpawningAlert.GOLEM_COLOUR + " 20s", null, null); + teammatesInRadius = new LocationButton(0, MoveCommand.teammatesInRadiusXY[0], MoveCommand.teammatesInRadiusXY[1], 107 * ScaleCommand.teammatesInRadiusScale, 45 * ScaleCommand.teammatesInRadiusScale, ScaleCommand.teammatesInRadiusScale, teammatesInRadiusText, null, null); this.buttonList.add(coords); this.buttonList.add(dungeonTimer); @@ -107,6 +118,7 @@ public class EditLocationsGui extends GuiScreen { this.buttonList.add(display); this.buttonList.add(skill50); this.buttonList.add(golemTimer); + this.buttonList.add(teammatesInRadius); } @Override @@ -204,6 +216,12 @@ public class EditLocationsGui extends GuiScreen { golemTimer.xPosition = MoveCommand.golemTimerXY[0]; golemTimer.yPosition = MoveCommand.golemTimerXY[1]; break; + case "teammatesInRadius": + MoveCommand.teammatesInRadiusXY[0] += xMoved; + MoveCommand.teammatesInRadiusXY[1] += yMoved; + teammatesInRadius.xPosition = MoveCommand.teammatesInRadiusXY[0]; + teammatesInRadius.yPosition = MoveCommand.teammatesInRadiusXY[1]; + break; } this.buttonList.clear(); initGui(); @@ -236,6 +254,8 @@ public class EditLocationsGui extends GuiScreen { moving = "bonzoTimer"; } else if (button == golemTimer) { moving = "golemTimer"; + } else if (button == teammatesInRadius) { + moving = "teammatesInRadius"; } } } @@ -264,6 +284,8 @@ public class EditLocationsGui extends GuiScreen { ConfigHandler.writeIntConfig("locations", "bonzoTimerY", MoveCommand.bonzoTimerXY[1]); ConfigHandler.writeIntConfig("locations", "golemTimerX", MoveCommand.golemTimerXY[0]); ConfigHandler.writeIntConfig("locations", "golemTimerY", MoveCommand.golemTimerXY[1]); + ConfigHandler.writeIntConfig("locations", "teammatesInRadiusX", MoveCommand.teammatesInRadiusXY[0]); + ConfigHandler.writeIntConfig("locations", "teammatesInRadiusY", MoveCommand.teammatesInRadiusXY[1]); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 5668953..dcb2368 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -229,6 +229,7 @@ public class ConfigHandler { ToggleCommand.highlightSlayers = initBoolean("toggles", "HighlightSlayers", false); ToggleCommand.highlightArachne = initBoolean("toggles", "HighlightArachne", false); ToggleCommand.highlightSkeletonMasters = initBoolean("toggles", "HighlightSkeletonMasters", false); + ToggleCommand.teammatesInRadius = initBoolean("toggles", "TeammatesInRadius", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); @@ -478,6 +479,8 @@ public class ConfigHandler { MoveCommand.bonzoTimerXY[1] = initInt("locations", "bonzoTimerY", 80); MoveCommand.golemTimerXY[0] = initInt("locations", "golemTimerX", 100); MoveCommand.golemTimerXY[1] = initInt("locations", "golemTimerY", 30); + MoveCommand.teammatesInRadiusXY[0] = initInt("locations", "teammatesInRadiusX", 80); + MoveCommand.teammatesInRadiusXY[1] = initInt("locations", "teammatesInRadiusY", 100); // Scales ScaleCommand.coordsScale = initDouble("scales", "coordsScale", 1); @@ -490,6 +493,7 @@ public class ConfigHandler { ScaleCommand.waterAnswerScale = initDouble("scales", "waterAnswerScale", 1); ScaleCommand.bonzoTimerScale = initDouble("scales", "bonzoTimerScale", 1); ScaleCommand.golemTimerScale = initDouble("scales", "golemTimerScale", 1); + ScaleCommand.teammatesInRadiusScale = initDouble("scales", "teammatesInRadiusScale", 1); // Colours DankersSkyblockMod.MAIN_COLOUR = initString("colors", "main", EnumChatFormatting.GREEN.toString()); diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 160fc0a..b7927c3 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -538,5 +538,9 @@ public class Utils { return null; } } + + public static boolean isRealPlayer(EntityPlayer player) { + return player.getUniqueID().version() == 4 && !player.isPlayerSleeping(); + } } -- cgit From 4e4bc07819f595107ad23d2bb003f518d1344ec5 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 20 Apr 2021 00:06:48 -0400 Subject: Change /skills to /skill --- README.md | 2 +- src/main/java/me/Danker/commands/SkillsCommand.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index db18e13..5afaf0c 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ Discord Server: https://discord.gg/QsEkNQS - /move - Moves text display to specified X and Y coordinates. - /scale - Scales text display to a specified multipler between 0.1x and 10x. - /slayer [player] - Uses API to get slayer xp of a person. If no name is provided, it checks yours. -- /skills [player] - Uses API to get skill levels of a person. If no name is provided, it checks yours. +- /skill [player] - Uses API to get skill levels of a person. If no name is provided, it checks yours. - /lobbyskills - Uses API to find the average skills of the lobby, as well the three players with the highest skill average. - /guildof [player] - Uses API to get guild name and guild master of a person. If no name is provided, it checks yours. - /petsof [player] - Uses API to get pets of a person. If no name is provided, it checks yours. diff --git a/src/main/java/me/Danker/commands/SkillsCommand.java b/src/main/java/me/Danker/commands/SkillsCommand.java index a17fedb..6195e81 100644 --- a/src/main/java/me/Danker/commands/SkillsCommand.java +++ b/src/main/java/me/Danker/commands/SkillsCommand.java @@ -19,7 +19,7 @@ public class SkillsCommand extends CommandBase { @Override public String getCommandName() { - return "skills"; + return "skill"; } @Override -- cgit From c673d8bd0d9857ca0f04782d903208c5f8ec23d0 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Tue, 20 Apr 2021 12:17:07 +0200 Subject: fixed kill combo messages still displaying when above 50 --- src/main/java/me/Danker/features/SpamHider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/SpamHider.java b/src/main/java/me/Danker/features/SpamHider.java index a88d9e5..f1a40c9 100644 --- a/src/main/java/me/Danker/features/SpamHider.java +++ b/src/main/java/me/Danker/features/SpamHider.java @@ -49,7 +49,7 @@ public class SpamHider { } // Kill Combo if (!ToggleCommand.killComboMessages) { - if ((message.contains("+") && message.contains(" Kill Combo ")) || message.contains("Your Kill Combo has expired!")) { + if ((message.contains("+") && message.contains(" Kill Combo")) || message.contains("Your Kill Combo has expired!")) { event.setCanceled(true); } } -- cgit From e1fb5cf460f95fc7fadab9b167531b8380d0caf1 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 20 Apr 2021 09:00:05 -0400 Subject: Add /player --- README.md | 1 + src/main/java/me/Danker/DankersSkyblockMod.java | 1 + src/main/java/me/Danker/commands/DHelpCommand.java | 1 + .../java/me/Danker/commands/PlayerCommand.java | 252 +++++++++++++++++++++ src/main/java/me/Danker/handlers/APIHandler.java | 3 +- 5 files changed, 257 insertions(+), 1 deletion(-) create mode 100644 src/main/java/me/Danker/commands/PlayerCommand.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 5afaf0c..507f2d0 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,7 @@ Discord Server: https://discord.gg/QsEkNQS - /fairysouls - Check the fairysouls of a player - /lobbybank - Uses API to find the average bank total of the lobby, as well the three players with the highest total money in the bank (and purse). - /dsmmusic [dungeonboss/bloodroom/dungeon] [1-100] - Stops, reloads or changes the volume of custom music. +- /player [player] - Uses API to find skills, slayers, coins and weight of a player. ## Keybinds - Open Maddox menu - M by default. diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 3ffa0f1..2e49f55 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -167,6 +167,7 @@ public class DankersSkyblockMod { ClientCommandHandler.instance.registerCommand(new LootCommand()); ClientCommandHandler.instance.registerCommand(new MoveCommand()); ClientCommandHandler.instance.registerCommand(new PetsCommand()); + ClientCommandHandler.instance.registerCommand(new PlayerCommand()); ClientCommandHandler.instance.registerCommand(new ReloadConfigCommand()); ClientCommandHandler.instance.registerCommand(new ResetLootCommand()); ClientCommandHandler.instance.registerCommand(new ScaleCommand()); diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 8d47576..4d595e5 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -56,6 +56,7 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + LobbyBankCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find the average bank total of the lobby, as well the three players with the highest total money in the bank(and purse).\n" + EnumChatFormatting.GOLD + RepartyCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Disbands and reparties all members in the party.\n" + EnumChatFormatting.GOLD + CustomMusicCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Stops or reloads the custom music.\n" + + EnumChatFormatting.GOLD + PlayerCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find skills, slayers, coins and weight of a player.\n" + EnumChatFormatting.GREEN + " Open Maddox Menu" + EnumChatFormatting.AQUA + " - M by default.\n" + EnumChatFormatting.GREEN + " Start/Stop Skill Tracker" + EnumChatFormatting.AQUA + " - Numpad 5 by default.\n")); } diff --git a/src/main/java/me/Danker/commands/PlayerCommand.java b/src/main/java/me/Danker/commands/PlayerCommand.java new file mode 100644 index 0000000..ef0ed4c --- /dev/null +++ b/src/main/java/me/Danker/commands/PlayerCommand.java @@ -0,0 +1,252 @@ +package me.Danker.commands; + +import com.google.gson.JsonObject; +import me.Danker.DankersSkyblockMod; +import me.Danker.handlers.APIHandler; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.Utils; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +import java.text.NumberFormat; +import java.util.List; +import java.util.Locale; + +public class PlayerCommand extends CommandBase { + + @Override + public String getCommandName() { + return "player"; + } + + @Override + public String getCommandUsage(ICommandSender arg0) { + return "/" + getCommandName() + " [name]"; + } + + public static String usage(ICommandSender arg0) { + return new SkillsCommand().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + if (args.length == 1) { + return Utils.getMatchingPlayers(args[0]); + } + return null; + } + + @Override + public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { + // MULTI THREAD DRIFTING + new Thread(() -> { + EntityPlayer player = (EntityPlayer) arg0; + + // Check key + String key = ConfigHandler.getString("api", "APIKey"); + if (key.equals("")) { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "API key not set. Use /setkey.")); + return; + } + + // Get UUID for Hypixel API requests + String username; + String uuid; + if (arg1.length == 0) { + username = player.getName(); + uuid = player.getUniqueID().toString().replaceAll("[\\-]", ""); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking stats of " + DankersSkyblockMod.SECONDARY_COLOUR + username)); + } else { + username = arg1[0]; + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking stats of " + DankersSkyblockMod.SECONDARY_COLOUR + username)); + uuid = APIHandler.getUUID(username); + } + + // Find stats of latest profile + String latestProfile = APIHandler.getLatestProfileID(uuid, key); + if (latestProfile == null) return; + + String profileURL = "https://api.hypixel.net/skyblock/profile?profile=" + latestProfile + "&key=" + key; + System.out.println("Fetching profile..."); + JsonObject profileResponse = APIHandler.getResponse(profileURL); + if (!profileResponse.get("success").getAsBoolean()) { + String reason = profileResponse.get("cause").getAsString(); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); + return; + } + + // Skills + System.out.println("Fetching skills..."); + JsonObject userObject = profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject(); + + double farmingLevel = 0; + double miningLevel = 0; + double combatLevel = 0; + double foragingLevel = 0; + double fishingLevel = 0; + double enchantingLevel = 0; + double alchemyLevel = 0; + double tamingLevel = 0; + + if (userObject.has("experience_skill_farming") || userObject.has("experience_skill_mining") || userObject.has("experience_skill_combat") || userObject.has("experience_skill_foraging") || userObject.has("experience_skill_fishing") || userObject.has("experience_skill_enchanting") || userObject.has("experience_skill_alchemy")) { + if (userObject.has("experience_skill_farming")) { + farmingLevel = Utils.xpToSkillLevel(userObject.get("experience_skill_farming").getAsDouble(), 60); + farmingLevel = (double) Math.round(farmingLevel * 100) / 100; + } + if (userObject.has("experience_skill_mining")) { + miningLevel = Utils.xpToSkillLevel(userObject.get("experience_skill_mining").getAsDouble(), 60); + miningLevel = (double) Math.round(miningLevel * 100) / 100; + } + if (userObject.has("experience_skill_combat")) { + combatLevel = Utils.xpToSkillLevel(userObject.get("experience_skill_combat").getAsDouble(), 60); + combatLevel = (double) Math.round(combatLevel * 100) / 100; + } + if (userObject.has("experience_skill_foraging")) { + foragingLevel = Utils.xpToSkillLevel(userObject.get("experience_skill_foraging").getAsDouble(), 50); + foragingLevel = (double) Math.round(foragingLevel * 100) / 100; + } + if (userObject.has("experience_skill_fishing")) { + fishingLevel = Utils.xpToSkillLevel(userObject.get("experience_skill_fishing").getAsDouble(), 50); + fishingLevel = (double) Math.round(fishingLevel * 100) / 100; + } + if (userObject.has("experience_skill_enchanting")) { + enchantingLevel = Utils.xpToSkillLevel(userObject.get("experience_skill_enchanting").getAsDouble(), 60); + enchantingLevel = (double) Math.round(enchantingLevel * 100) / 100; + } + if (userObject.has("experience_skill_alchemy")) { + alchemyLevel = Utils.xpToSkillLevel(userObject.get("experience_skill_alchemy").getAsDouble(), 50); + alchemyLevel = (double) Math.round(alchemyLevel * 100) / 100; + } + if (userObject.has("experience_skill_taming")) { + tamingLevel = Utils.xpToSkillLevel(userObject.get("experience_skill_taming").getAsDouble(), 50); + tamingLevel = (double) Math.round(tamingLevel * 100) / 100; + } + } else { + // Get skills from achievement API, will be floored + + String playerURL = "https://api.hypixel.net/player?uuid=" + uuid + "&key=" + key; + System.out.println("Fetching skills from achievement API"); + JsonObject playerObject = APIHandler.getResponse(playerURL); + + if (!playerObject.get("success").getAsBoolean()) { + String reason = profileResponse.get("cause").getAsString(); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); + return; + } + + JsonObject achievementObject = playerObject.get("player").getAsJsonObject().get("achievements").getAsJsonObject(); + if (achievementObject.has("skyblock_harvester")) { + farmingLevel = achievementObject.get("skyblock_harvester").getAsInt(); + } + if (achievementObject.has("skyblock_excavator")) { + miningLevel = achievementObject.get("skyblock_excavator").getAsInt(); + } + if (achievementObject.has("skyblock_combat")) { + combatLevel = achievementObject.get("skyblock_combat").getAsInt(); + } + if (achievementObject.has("skyblock_gatherer")) { + foragingLevel = Math.min(achievementObject.get("skyblock_gatherer").getAsInt(), 50); + } + if (achievementObject.has("skyblock_angler")) { + fishingLevel = Math.min(achievementObject.get("skyblock_angler").getAsInt(), 50); + } + if (achievementObject.has("skyblock_augmentation")) { + enchantingLevel = achievementObject.get("skyblock_augmentation").getAsInt(); + } + if (achievementObject.has("skyblock_concoctor")) { + alchemyLevel = Math.min(achievementObject.get("skyblock_concoctor").getAsInt(), 50); + } + if (achievementObject.has("skyblock_domesticator")) { + tamingLevel = Math.min(achievementObject.get("skyblock_domesticator").getAsInt(), 50); + } + } + + double skillAvg = (farmingLevel + miningLevel + combatLevel + foragingLevel + fishingLevel + enchantingLevel + alchemyLevel + tamingLevel) / 8; + skillAvg = (double) Math.round(skillAvg * 100) / 100; + double trueAvg = (Math.floor(farmingLevel) + Math.floor(miningLevel) + Math.floor(combatLevel) + Math.floor(foragingLevel) + Math.floor(fishingLevel) + Math.floor(enchantingLevel) + Math.floor(alchemyLevel) + Math.floor(tamingLevel)) / 8; + + // Slayers + System.out.println("Fetching slayer stats..."); + JsonObject slayersObject = profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject().get("slayer_bosses").getAsJsonObject(); + // Zombie + int zombieXP = 0; + if (slayersObject.get("zombie").getAsJsonObject().has("xp")) { + zombieXP = slayersObject.get("zombie").getAsJsonObject().get("xp").getAsInt(); + } + // Spider + int spiderXP = 0; + if (slayersObject.get("spider").getAsJsonObject().has("xp")) { + spiderXP = slayersObject.get("spider").getAsJsonObject().get("xp").getAsInt(); + } + // Wolf + int wolfXP = 0; + if (slayersObject.get("wolf").getAsJsonObject().has("xp")) { + wolfXP = slayersObject.get("wolf").getAsJsonObject().get("xp").getAsInt(); + } + + // Bank + System.out.println("Fetching bank + purse coins..."); + double bankCoins = 0; + double purseCoins = profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject().get("coin_purse").getAsDouble(); + purseCoins = Math.floor(purseCoins * 100.0) / 100.0; + + // Check for bank api + if (profileResponse.get("profile").getAsJsonObject().has("banking")) { + bankCoins = profileResponse.get("profile").getAsJsonObject().get("banking").getAsJsonObject().get("balance").getAsDouble(); + bankCoins = Math.floor(bankCoins * 100.0) / 100.0; + } + + // Weight + System.out.println("Fetching weight from Senither API..."); + String weightURL = "https://hypixel-api.senither.com/v1/profiles/" + uuid + "/weight?key=" + key; + JsonObject weightResponse = APIHandler.getResponse(weightURL); + if (weightResponse.get("status").getAsInt() != 200) { + String reason = weightResponse.get("reason").getAsString(); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); + return; + } + + double weight = weightResponse.get("data").getAsJsonObject().get("weight").getAsDouble(); + double overflow = weightResponse.get("data").getAsJsonObject().get("weight_overflow").getAsDouble(); + + NumberFormat nf = NumberFormat.getIntegerInstance(Locale.US); + NumberFormat nfd = NumberFormat.getNumberInstance(Locale.US); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.AQUA + " " + username + "'s Skills:\n" + + DankersSkyblockMod.TYPE_COLOUR + " Farming: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + farmingLevel + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Mining: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + miningLevel + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Combat: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + combatLevel + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Foraging: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + foragingLevel + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Fishing: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + fishingLevel + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Enchanting: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + enchantingLevel + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Alchemy: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + alchemyLevel + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Taming: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + tamingLevel + "\n" + + EnumChatFormatting.AQUA + " Average Skill Level: " + DankersSkyblockMod.SKILL_AVERAGE_COLOUR + EnumChatFormatting.BOLD + skillAvg + "\n" + + EnumChatFormatting.AQUA + " True Average Skill Level: " + DankersSkyblockMod.SKILL_AVERAGE_COLOUR + EnumChatFormatting.BOLD + trueAvg + "\n\n" + + EnumChatFormatting.AQUA + " " + username + "'s Total Slayer XP: " + EnumChatFormatting.GOLD + EnumChatFormatting.BOLD + nf.format(zombieXP + spiderXP + wolfXP) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Zombie XP: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(zombieXP) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Spider XP: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(spiderXP) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Wolf XP: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(wolfXP) + "\n\n" + + EnumChatFormatting.AQUA + " " + username + "'s Coins:\n" + + DankersSkyblockMod.TYPE_COLOUR + " Bank: " + (bankCoins == 0 ? EnumChatFormatting.RED + "Bank API disabled." : EnumChatFormatting.GOLD + nf.format(bankCoins)) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Purse: " + EnumChatFormatting.GOLD + nf.format(purseCoins) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Total: " + EnumChatFormatting.GOLD + nf.format(bankCoins + purseCoins) + "\n\n" + + EnumChatFormatting.AQUA + " " + username + "'s Weight:\n" + + DankersSkyblockMod.TYPE_COLOUR + " Total Weight: " + DankersSkyblockMod.VALUE_COLOUR + nfd.format(weight + overflow) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Weight: " + DankersSkyblockMod.VALUE_COLOUR + nfd.format(weight) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Overflow: " + DankersSkyblockMod.VALUE_COLOUR + nfd.format(overflow) + "\n" + + DankersSkyblockMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------")); + }).start(); + } + +} diff --git a/src/main/java/me/Danker/handlers/APIHandler.java b/src/main/java/me/Danker/handlers/APIHandler.java index c9460fe..66001a3 100644 --- a/src/main/java/me/Danker/handlers/APIHandler.java +++ b/src/main/java/me/Danker/handlers/APIHandler.java @@ -25,6 +25,7 @@ public class APIHandler { URL url = new URL(urlString); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("GET"); + conn.setRequestProperty("User-Agent", "Dsm/1.0"); if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) { BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream())); @@ -40,7 +41,7 @@ public class APIHandler { return gson.fromJson(response.toString(), JsonObject.class); } else { - if (urlString.startsWith("https://api.hypixel.net/")) { + if (urlString.startsWith("https://api.hypixel.net/") || urlString.startsWith("https://hypixel-api.senither.com")) { InputStream errorStream = conn.getErrorStream(); try (Scanner scanner = new Scanner(errorStream)) { scanner.useDelimiter("\\Z"); -- cgit From b48dabaf8ab58773eb51a1c2077b880ee1f28675 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 22 Apr 2021 13:43:33 -0400 Subject: Fix dungeon boss music only playing the first time How did this work for me before? I have no idea. --- src/main/java/me/Danker/features/CustomMusic.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java index 4b1f6bb..342727b 100644 --- a/src/main/java/me/Danker/features/CustomMusic.java +++ b/src/main/java/me/Danker/features/CustomMusic.java @@ -66,6 +66,8 @@ public class CustomMusic { if (!prevInDungeonBossRoom) { dungeonboss.start(); } + } else { + inDungeonBossRoom = false; } } } -- cgit From 06565f0136aebc720b24d0c1b1b79c9043ed01bf Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Wed, 28 Apr 2021 12:48:15 +0200 Subject: added a command to set your yaw and pitch --- README.md | 1 + src/main/java/me/Danker/DankersSkyblockMod.java | 2 +- src/main/java/me/Danker/commands/DHelpCommand.java | 1 + .../java/me/Danker/commands/SetAngleCommand.java | 40 ++++++++++++++++++++++ 4 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 src/main/java/me/Danker/commands/SetAngleCommand.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 84b6e5f..2ab9fe0 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,7 @@ Discord Server: https://discord.gg/QsEkNQS - /fairysouls - Check the fairysouls of a player - /lobbybank - Uses API to find the average bank total of the lobby, as well the three players with the highest total money in the bank (and purse). - /dsmmusic [dungeonboss/bloodroom/dungeon] [1-100] - Stops, reloads or changes the volume of custom music. +- /setangle [yaw] [pitch] - Sets your yaw and pitch ##Warps Commands for to warp to the MVP+ exclusive warps diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 619b6e6..fe5d7ac 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -176,7 +176,7 @@ public class DankersSkyblockMod { ClientCommandHandler.instance.registerCommand(new SkyblockPlayersCommand()); ClientCommandHandler.instance.registerCommand(new SlayerCommand()); ClientCommandHandler.instance.registerCommand(new ToggleCommand()); - + ClientCommandHandler.instance.registerCommand(new SetAngleCommand()); ClientCommandHandler.instance.registerCommand(new Crypt()); ClientCommandHandler.instance.registerCommand(new DarkAuction()); diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index d5f3617..207e700 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -63,6 +63,7 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + HowlingCave.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Howling Cave in the Park. \n" + EnumChatFormatting.GOLD + Magma.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Magma Fields in the Blazing Fortress. \n" + EnumChatFormatting.GOLD + SpidersNest.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Top of the Spider's Nest in the Spider's Den. \n" + + EnumChatFormatting.GOLD + SetAngleCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Sets your yaw and pitch. \n" + EnumChatFormatting.GREEN + " Open Maddox Menu" + EnumChatFormatting.AQUA + " - M by default.\n" + EnumChatFormatting.GREEN + " Start/Stop Skill Tracker" + EnumChatFormatting.AQUA + " - Numpad 5 by default.\n")); } diff --git a/src/main/java/me/Danker/commands/SetAngleCommand.java b/src/main/java/me/Danker/commands/SetAngleCommand.java new file mode 100644 index 0000000..3b288c4 --- /dev/null +++ b/src/main/java/me/Danker/commands/SetAngleCommand.java @@ -0,0 +1,40 @@ +package me.Danker.commands; + +import me.Danker.DankersSkyblockMod; +import net.minecraft.client.Minecraft; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.util.ChatComponentText; + + +public class SetAngleCommand extends CommandBase { + + @Override + public String getCommandName() { + return "setangle"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "/" + getCommandName() + " [yaw] [pitch]"; + } + + public static String usage(ICommandSender arg0) { + return new SetAngleCommand().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + if (args.length < 2) return; + + Minecraft.getMinecraft().thePlayer.rotationPitch = Float.parseFloat(args[1]); + Minecraft.getMinecraft().thePlayer.rotationYaw = Float.parseFloat(args[0]); + sender.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Set your rotation to y=" + DankersSkyblockMod.SECONDARY_COLOUR + args[0] + DankersSkyblockMod.MAIN_COLOUR + ", x=" + DankersSkyblockMod.SECONDARY_COLOUR +args[1])); + } +} -- cgit From 09622e51e46d6772e9017bfa9bb544616ebba8b7 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Wed, 28 Apr 2021 12:55:17 +0200 Subject: typo --- src/main/java/me/Danker/commands/SetAngleCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/SetAngleCommand.java b/src/main/java/me/Danker/commands/SetAngleCommand.java index 3b288c4..6061621 100644 --- a/src/main/java/me/Danker/commands/SetAngleCommand.java +++ b/src/main/java/me/Danker/commands/SetAngleCommand.java @@ -35,6 +35,6 @@ public class SetAngleCommand extends CommandBase { Minecraft.getMinecraft().thePlayer.rotationPitch = Float.parseFloat(args[1]); Minecraft.getMinecraft().thePlayer.rotationYaw = Float.parseFloat(args[0]); - sender.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Set your rotation to y=" + DankersSkyblockMod.SECONDARY_COLOUR + args[0] + DankersSkyblockMod.MAIN_COLOUR + ", x=" + DankersSkyblockMod.SECONDARY_COLOUR +args[1])); + sender.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Set your rotation to yaw=" + DankersSkyblockMod.SECONDARY_COLOUR + args[0] + DankersSkyblockMod.MAIN_COLOUR + ", pitch=" + DankersSkyblockMod.SECONDARY_COLOUR +args[1])); } } -- cgit From 01822bff56d23b98885227943bd1e042e4f9e946 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 29 Apr 2021 01:06:57 -0400 Subject: Add giant hp display Also make LocationButton easy to add --- README.md | 7 ++- src/main/java/me/Danker/DankersSkyblockMod.java | 1 + .../java/me/Danker/commands/DankerGuiCommand.java | 1 + src/main/java/me/Danker/commands/MoveCommand.java | 13 +++- src/main/java/me/Danker/commands/ScaleCommand.java | 11 +++- .../java/me/Danker/commands/ToggleCommand.java | 11 +++- .../java/me/Danker/features/GiantHPDisplay.java | 71 ++++++++++++++++++++++ src/main/java/me/Danker/gui/DankerGui.java | 7 +++ src/main/java/me/Danker/gui/EditLocationsGui.java | 43 +++++++++---- .../java/me/Danker/gui/buttons/LocationButton.java | 27 ++++---- .../java/me/Danker/handlers/ConfigHandler.java | 10 +-- src/main/java/me/Danker/utils/Utils.java | 6 ++ 12 files changed, 171 insertions(+), 37 deletions(-) create mode 100644 src/main/java/me/Danker/features/GiantHPDisplay.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 507f2d0..da48eda 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ Discord Server: https://discord.gg/QsEkNQS - Watcher ready message - Catacombs F7 Stage 3 solvers (Starts with letter, select all colour) - Find correct Livid (with graphic display of HP) +- Catacombs F6 and F7 Giant HP display - Use custom music in supported locations - Experimentation solvers (Ultrasequencer, Chronomatron, Superpairs) - Hide tooltips in experiment addons @@ -57,14 +58,14 @@ Discord Server: https://discord.gg/QsEkNQS ## Commands - /dhelp - Returns this message in-game. - /dsm - Opens the GUI for Danker's Skyblock Mod. -- /toggle - Toggles features. /toggle list returns values of every toggle. +- /toggle - Toggles features. /toggle list returns values of every toggle. - /setkey - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. - /loot [winter/festival/spooky/f(1-7)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. - /display [winter/festival/spooky/f(1-7)/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active. - /resetloot - - Resets loot for trackers. /resetloot confirm confirms the reset. -- /move - Moves text display to specified X and Y coordinates. -- /scale - Scales text display to a specified multipler between 0.1x and 10x. +- /move - Moves text display to specified X and Y coordinates. +- /scale - Scales text display to a specified multipler between 0.1x and 10x. - /slayer [player] - Uses API to get slayer xp of a person. If no name is provided, it checks yours. - /skill [player] - Uses API to get skill levels of a person. If no name is provided, it checks yours. - /lobbyskills - Uses API to find the average skills of the lobby, as well the three players with the highest skill average. diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 2e49f55..bf71dda 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -101,6 +101,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new DungeonTimer()); MinecraftForge.EVENT_BUS.register(new ExpertiseLore()); MinecraftForge.EVENT_BUS.register(new FasterMaddoxCalling()); + MinecraftForge.EVENT_BUS.register(new GiantHPDisplay()); MinecraftForge.EVENT_BUS.register(new GoldenEnchants()); MinecraftForge.EVENT_BUS.register(new GolemSpawningAlert()); MinecraftForge.EVENT_BUS.register(new GpartyNotifications()); diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index 6fede04..2cc706e 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -93,6 +93,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[highlightarachne][").append(ToggleCommand.highlightArachne).append("]\n"); debug.append("[highlightskeletonmasters][").append(ToggleCommand.highlightSkeletonMasters).append("]\n"); debug.append("[teammatesinradius][").append(ToggleCommand.teammatesInRadius).append("]\n"); + debug.append("[gianthp][").append(ToggleCommand.giantHP).append("]\n"); debug.append("[dungeonbossmusic][").append(ToggleCommand.dungeonBossMusic).append("]\n"); debug.append("[bloodroommusic][").append(ToggleCommand.bloodRoomMusic).append("]\n"); debug.append("[dungeonmusic][").append(ToggleCommand.dungeonMusic).append("]\n"); diff --git a/src/main/java/me/Danker/commands/MoveCommand.java b/src/main/java/me/Danker/commands/MoveCommand.java index 33d1f78..b17794c 100644 --- a/src/main/java/me/Danker/commands/MoveCommand.java +++ b/src/main/java/me/Danker/commands/MoveCommand.java @@ -24,6 +24,7 @@ public class MoveCommand extends CommandBase { public static int[] bonzoTimerXY = {0, 0}; public static int[] golemTimerXY = {0 ,0}; public static int[] teammatesInRadiusXY = {0, 0}; + public static int[] giantHPXY = {0, 0}; @Override public String getCommandName() { @@ -32,7 +33,7 @@ public class MoveCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " "; + return "/" + getCommandName() + " "; } public static String usage(ICommandSender arg0) { @@ -48,7 +49,8 @@ public class MoveCommand extends CommandBase { public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", - "skilltracker", "wateranswer", "bonzotimer", "golemtimer", "teammatesinradius"); + "skilltracker", "wateranswer", "bonzotimer", "golemtimer", "teammatesinradius", + "gianthp"); } return null; } @@ -140,6 +142,13 @@ public class MoveCommand extends CommandBase { ConfigHandler.writeIntConfig("locations", "teammatesInRadiusY", teammatesInRadiusXY[1]); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Teammates in radius has been moved to " + DankersSkyblockMod.SECONDARY_COLOUR + arg1[1] + ", " + arg1[2])); break; + case "gianthp": + giantHPXY[0] = Integer.parseInt(arg1[1]); + giantHPXY[1] = Integer.parseInt(arg1[2]); + ConfigHandler.writeIntConfig("locations", "giantHPX", giantHPXY[0]); + ConfigHandler.writeIntConfig("locations", "giantHPY", giantHPXY[1]); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Giant HP has been moved to " + DankersSkyblockMod.SECONDARY_COLOUR + arg1[1] + ", " + arg1[2])); + break; default: player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); } diff --git a/src/main/java/me/Danker/commands/ScaleCommand.java b/src/main/java/me/Danker/commands/ScaleCommand.java index a95f1b1..def0e57 100644 --- a/src/main/java/me/Danker/commands/ScaleCommand.java +++ b/src/main/java/me/Danker/commands/ScaleCommand.java @@ -24,6 +24,7 @@ public class ScaleCommand extends CommandBase { public static double bonzoTimerScale; public static double golemTimerScale; public static double teammatesInRadiusScale; + public static double giantHPScale; @Override public String getCommandName() { @@ -32,7 +33,7 @@ public class ScaleCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " "; + return "/" + getCommandName() + " "; } public static String usage(ICommandSender arg0) { @@ -48,7 +49,8 @@ public class ScaleCommand extends CommandBase { public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", - "skilltracker", "wateranswer", "bonzotimer", "golemtimer", "teammatesinradius"); + "skilltracker", "wateranswer", "bonzotimer", "golemtimer", "teammatesinradius", + "gianthp"); } return null; } @@ -124,6 +126,11 @@ public class ScaleCommand extends CommandBase { ConfigHandler.writeDoubleConfig("scales", "teammatesInRadiusScale", teammatesInRadiusScale); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Teammates in radius has been scaled to " + DankersSkyblockMod.SECONDARY_COLOUR + teammatesInRadiusScale + "x")); break; + case "gianthp": + giantHPScale = scaleAmount; + ConfigHandler.writeDoubleConfig("scales", "giantHPScale", giantHPScale); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Giant hp has been scaled to " + DankersSkyblockMod.SECONDARY_COLOUR + giantHPScale + "x")); + break; default: player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); } diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 0eb52fd..a9fe663 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -35,6 +35,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean highlightArachne; public static boolean highlightSkeletonMasters; public static boolean teammatesInRadius; + public static boolean giantHP; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; @@ -95,7 +96,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "startswithterminal/selectallterminal/clickinorderterminal/" + "ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/" + "melodytooltips/highlightslayers/highlightarachne/highlightskeletonmasters/teammatesinradius/" + - "dungeonbossmusic/bloodroommusic/dungeonmusic/list>"; + "gianthp/dungeonbossmusic/bloodroommusic/dungeonmusic/list>"; } public static String usage(ICommandSender arg0) { @@ -124,7 +125,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "ultrasequencer", "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "melodytooltips", "highlightslayers", "highlightskeletonmasters", "dungeonbossmusic", "bloodroommusic", "dungeonmusic", - "teammatesinradius", "list"); + "teammatesinradius", "gianthp", "list"); } return null; } @@ -410,6 +411,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "TeammatesInRadius", teammatesInRadius); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Teammates in radius has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + teammatesInRadius + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "gianthp": + giantHP = !giantHP; + ConfigHandler.writeBooleanConfig("toggles", "GiantHP", giantHP); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Giant HP display has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + giantHP + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "dungeonbossmusic": dungeonBossMusic = !dungeonBossMusic; CustomMusic.dungeonboss.stop(); @@ -475,6 +481,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Highlight Arachne Boss: " + DankersSkyblockMod.VALUE_COLOUR + highlightArachne + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Highlight Skeleton Masters: " + DankersSkyblockMod.VALUE_COLOUR + highlightSkeletonMasters + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Teammates in radius: " + DankersSkyblockMod.VALUE_COLOUR + teammatesInRadius + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Giant HP display: " + DankersSkyblockMod.VALUE_COLOUR + giantHP + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon boss music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonBossMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom blood room music: " + DankersSkyblockMod.VALUE_COLOUR + bloodRoomMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonMusic diff --git a/src/main/java/me/Danker/features/GiantHPDisplay.java b/src/main/java/me/Danker/features/GiantHPDisplay.java new file mode 100644 index 0000000..07378dd --- /dev/null +++ b/src/main/java/me/Danker/features/GiantHPDisplay.java @@ -0,0 +1,71 @@ +package me.Danker.features; + +import me.Danker.DankersSkyblockMod; +import me.Danker.commands.ToggleCommand; +import me.Danker.events.RenderOverlay; +import me.Danker.handlers.ScoreboardHandler; +import me.Danker.handlers.TextRenderer; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.util.StringUtils; +import net.minecraft.world.World; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Pattern; + +public class GiantHPDisplay { + + static Pattern f6GiantPattern = Pattern.compile("(Jolly Pink Giant|L\\.A\\.S\\.R\\.|The Diamond Giant|Bigfoot).*"); + static List giants = new ArrayList<>(); + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + if (event.phase != TickEvent.Phase.START) return; + + World world = Minecraft.getMinecraft().theWorld; + if (DankersSkyblockMod.tickAmount % 20 == 0) { + if (ToggleCommand.giantHP && Utils.inDungeons && world != null) { + giants.clear(); + List scoreboard = ScoreboardHandler.getSidebarLines(); + String firstLine = ScoreboardHandler.cleanSB(scoreboard.get(scoreboard.size() - 1)); + + if (firstLine.contains("sadan")) { + List entities = world.getLoadedEntityList(); + + for (Entity entity : entities) { + String name = StringUtils.stripControlCodes(entity.getName()); + if (f6GiantPattern.matcher(name).find()) { + giants.add(entity); + } + } + } else if (firstLine.contains("138,30") || firstLine.contains("354,66") || firstLine.contains("138,66")) { + List entities = world.getLoadedEntityList(); + + for (Entity entity : entities) { + if (entity.getName().contains("Giant ")) { + giants.add(entity); + } + } + } + } + } + } + + @SubscribeEvent + public void renderPlayerInfo(RenderOverlay event) { + if (ToggleCommand.giantHP && Utils.inDungeons && giants.size() > 0) { + StringBuilder sb = new StringBuilder(); + + for (Entity giant : giants) { + if (!giant.isDead) sb.append(Utils.removeBold(giant.getDisplayName().getFormattedText())).append("\n"); + } + + new TextRenderer(Minecraft.getMinecraft(), sb.toString(), 100, 100, 1); + } + } + +} diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 4797343..cc33514 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -64,6 +64,7 @@ public class DankerGui extends GuiScreen { private GuiButton highlightSlayer; private GuiButton highlightSkeletonMasters; private GuiButton teammatesInRadius; + private GuiButton giantHP; // Chat Messages private GuiButton sceptreMessages; private GuiButton midasStaffMessages; @@ -149,6 +150,7 @@ public class DankerGui extends GuiScreen { highlightSlayer = new FeatureButton("Highlight Slayer: " + Utils.getColouredBoolean(ToggleCommand.highlightSlayers), "Highlights Slayer bosses."); highlightSkeletonMasters = new FeatureButton("Highlight Skeleton Masters: " + Utils.getColouredBoolean(ToggleCommand.highlightSkeletonMasters), "Highlights Skeleton Masters."); teammatesInRadius = new FeatureButton("Display Players in 30 Block Radius: " + Utils.getColouredBoolean(ToggleCommand.teammatesInRadius), "Displays dungeon teammates in 30 block radius for tether and diversion."); + giantHP = new FeatureButton("Display Giant HP: " + Utils.getColouredBoolean(ToggleCommand.giantHP), "Displays health of Sadan's giants during F6 bossfight and F7 blood room."); allButtons.clear(); allButtons.add(changeDisplay); @@ -192,6 +194,7 @@ public class DankerGui extends GuiScreen { allButtons.add(highlightSlayer); allButtons.add(highlightSkeletonMasters); allButtons.add(teammatesInRadius); + allButtons.add(giantHP); search.setText(initSearchText); search.setVisible(true); @@ -426,6 +429,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.teammatesInRadius = !ToggleCommand.teammatesInRadius; ConfigHandler.writeBooleanConfig("toggles", "TeammatesInRadius", ToggleCommand.teammatesInRadius); teammatesInRadius.displayString = "Display Players in 30 Block Radius: " + Utils.getColouredBoolean(ToggleCommand.teammatesInRadius); + } else if (button == giantHP) { + ToggleCommand.giantHP = !ToggleCommand.giantHP; + ConfigHandler.writeBooleanConfig("toggles", "GiantHP", ToggleCommand.giantHP); + giantHP.displayString = "Display Giant HP: " + Utils.getColouredBoolean(ToggleCommand.giantHP); } } diff --git a/src/main/java/me/Danker/gui/EditLocationsGui.java b/src/main/java/me/Danker/gui/EditLocationsGui.java index c263d5a..2c8b336 100644 --- a/src/main/java/me/Danker/gui/EditLocationsGui.java +++ b/src/main/java/me/Danker/gui/EditLocationsGui.java @@ -1,5 +1,6 @@ package me.Danker.gui; +import javafx.scene.transform.Scale; import me.Danker.DankersSkyblockMod; import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; @@ -32,6 +33,7 @@ public class EditLocationsGui extends GuiScreen { private LocationButton bonzoTimer; private LocationButton golemTimer; private LocationButton teammatesInRadius; + private LocationButton giantHP; @Override public boolean doesGuiPauseGame() { @@ -95,18 +97,24 @@ public class EditLocationsGui extends GuiScreen { EnumChatFormatting.GREEN + "Not_A_Neko\n" + EnumChatFormatting.GREEN + "Minikloon"; - // ive lost my marbles - display = new LocationButton(0, MoveCommand.displayXY[0], MoveCommand.displayXY[1], 145 * ScaleCommand.displayScale, 102 * ScaleCommand.displayScale, ScaleCommand.displayScale, displayText, displayNums, 110); - dungeonTimer = new LocationButton(0, MoveCommand.dungeonTimerXY[0], MoveCommand.dungeonTimerXY[1], 113 * ScaleCommand.dungeonTimerScale, 57 * ScaleCommand.dungeonTimerScale, ScaleCommand.dungeonTimerScale, dungeonTimerText, dungeonTimerNums, 80); - coords = new LocationButton(0, MoveCommand.coordsXY[0], MoveCommand.coordsXY[1], 141 * ScaleCommand.coordsScale, 12 * ScaleCommand.coordsScale, ScaleCommand.coordsScale, NoF3Coords.COORDS_COLOUR + "74 / 14 / -26 (141.1 / 6.7)", null, null); - skill50 = new LocationButton(0, MoveCommand.skill50XY[0], MoveCommand.skill50XY[1], 233 * ScaleCommand.skill50Scale, 12 * ScaleCommand.skill50Scale, ScaleCommand.skill50Scale, Skill50Display.SKILL_50_COLOUR + "+3.5 Farming (28,882,117.7/55,172,425) 52.34%", null, null); - lividHP = new LocationButton(0, MoveCommand.lividHpXY[0], MoveCommand.lividHpXY[1], 85 * ScaleCommand.lividHpScale, 12 * ScaleCommand.lividHpScale, ScaleCommand.lividHpScale, EnumChatFormatting.WHITE + "﴾ Livid " + EnumChatFormatting.YELLOW + "6.9M" + EnumChatFormatting.RED + "❤ " + EnumChatFormatting.WHITE + "﴿", null, null); - cakeTimer = new LocationButton(0, MoveCommand.cakeTimerXY[0], MoveCommand.cakeTimerXY[1] + 5, 85 * ScaleCommand.cakeTimerScale, 18 * ScaleCommand.cakeTimerScale, ScaleCommand.cakeTimerScale, CakeTimer.CAKE_COLOUR + " 11h16m", null, null); - skillTracker = new LocationButton(0, MoveCommand.skillTrackerXY[0], MoveCommand.skillTrackerXY[1], 150 * ScaleCommand.skillTrackerScale, 28 * ScaleCommand.skillTrackerScale, ScaleCommand.skillTrackerScale, skillTrackerText, null, null); - waterAnswer = new LocationButton(0, MoveCommand.waterAnswerXY[0], MoveCommand.waterAnswerXY[1], 190 * ScaleCommand.waterAnswerScale, 54 * ScaleCommand.waterAnswerScale, ScaleCommand.waterAnswerScale, waterAnswerText, null, null); - bonzoTimer = new LocationButton(0, MoveCommand.bonzoTimerXY[0], MoveCommand.bonzoTimerXY[1] + 5, 53 * ScaleCommand.bonzoTimerScale, 18 * ScaleCommand.bonzoTimerScale, ScaleCommand.bonzoTimerScale, BonzoMaskTimer.BONZO_COLOR + " 3m30s", null, null); - golemTimer = new LocationButton(0, MoveCommand.golemTimerXY[0], MoveCommand.golemTimerXY[1] + 5, 42 * ScaleCommand.golemTimerScale, 18 * ScaleCommand.golemTimerScale, ScaleCommand.golemTimerScale, GolemSpawningAlert.GOLEM_COLOUR + " 20s", null, null); - teammatesInRadius = new LocationButton(0, MoveCommand.teammatesInRadiusXY[0], MoveCommand.teammatesInRadiusXY[1], 107 * ScaleCommand.teammatesInRadiusScale, 45 * ScaleCommand.teammatesInRadiusScale, ScaleCommand.teammatesInRadiusScale, teammatesInRadiusText, null, null); + String giantHPText = EnumChatFormatting.DARK_RED + "L.A.S.R. " + EnumChatFormatting.GREEN + "25M" + EnumChatFormatting.RED + "❤\n" + + EnumChatFormatting.RED + "Bigfoot " + EnumChatFormatting.GREEN + "25M" + EnumChatFormatting.RED + "❤\n" + + EnumChatFormatting.LIGHT_PURPLE + "Jolly Pink Giant " + EnumChatFormatting.GREEN + "25M" + EnumChatFormatting.RED + "❤\n" + + EnumChatFormatting.DARK_AQUA + "The Diamond Giant " + EnumChatFormatting.GREEN + "25M" + EnumChatFormatting.RED + "❤"; + + + display = new LocationButton(MoveCommand.displayXY[0], MoveCommand.displayXY[1], ScaleCommand.displayScale, displayText, displayNums, 110); + dungeonTimer = new LocationButton(MoveCommand.dungeonTimerXY[0], MoveCommand.dungeonTimerXY[1], ScaleCommand.dungeonTimerScale, dungeonTimerText, dungeonTimerNums, 80); + coords = new LocationButton(MoveCommand.coordsXY[0], MoveCommand.coordsXY[1], ScaleCommand.coordsScale, NoF3Coords.COORDS_COLOUR + "74 / 14 / -26 (141.1 / 6.7)", null, null); + skill50 = new LocationButton(MoveCommand.skill50XY[0], MoveCommand.skill50XY[1], ScaleCommand.skill50Scale, Skill50Display.SKILL_50_COLOUR + "+3.5 Farming (28,882,117.7/55,172,425) 52.34%", null, null); + lividHP = new LocationButton(MoveCommand.lividHpXY[0], MoveCommand.lividHpXY[1], ScaleCommand.lividHpScale, EnumChatFormatting.WHITE + "﴾ Livid " + EnumChatFormatting.YELLOW + "6.9M" + EnumChatFormatting.RED + "❤ " + EnumChatFormatting.WHITE + "﴿", null, null); + cakeTimer = new LocationButton(MoveCommand.cakeTimerXY[0], MoveCommand.cakeTimerXY[1] + 5, ScaleCommand.cakeTimerScale, CakeTimer.CAKE_COLOUR + " 11h16m", null, null); + skillTracker = new LocationButton(MoveCommand.skillTrackerXY[0], MoveCommand.skillTrackerXY[1], ScaleCommand.skillTrackerScale, skillTrackerText, null, null); + waterAnswer = new LocationButton(MoveCommand.waterAnswerXY[0], MoveCommand.waterAnswerXY[1], ScaleCommand.waterAnswerScale, waterAnswerText, null, null); + bonzoTimer = new LocationButton(MoveCommand.bonzoTimerXY[0], MoveCommand.bonzoTimerXY[1] + 5, ScaleCommand.bonzoTimerScale, BonzoMaskTimer.BONZO_COLOR + " 3m30s", null, null); + golemTimer = new LocationButton(MoveCommand.golemTimerXY[0], MoveCommand.golemTimerXY[1] + 5, ScaleCommand.golemTimerScale, GolemSpawningAlert.GOLEM_COLOUR + " 20s", null, null); + teammatesInRadius = new LocationButton(MoveCommand.teammatesInRadiusXY[0], MoveCommand.teammatesInRadiusXY[1], ScaleCommand.teammatesInRadiusScale, teammatesInRadiusText, null, null); + giantHP = new LocationButton(MoveCommand.giantHPXY[0], MoveCommand.giantHPXY[1], ScaleCommand.giantHPScale, giantHPText, null, null); this.buttonList.add(coords); this.buttonList.add(dungeonTimer); @@ -119,6 +127,7 @@ public class EditLocationsGui extends GuiScreen { this.buttonList.add(skill50); this.buttonList.add(golemTimer); this.buttonList.add(teammatesInRadius); + this.buttonList.add(giantHP); } @Override @@ -222,6 +231,12 @@ public class EditLocationsGui extends GuiScreen { teammatesInRadius.xPosition = MoveCommand.teammatesInRadiusXY[0]; teammatesInRadius.yPosition = MoveCommand.teammatesInRadiusXY[1]; break; + case "giantHP": + MoveCommand.giantHPXY[0] += xMoved; + MoveCommand.giantHPXY[1] += yMoved; + giantHP.xPosition = MoveCommand.giantHPXY[0]; + giantHP.yPosition = MoveCommand.giantHPXY[1]; + break; } this.buttonList.clear(); initGui(); @@ -256,6 +271,8 @@ public class EditLocationsGui extends GuiScreen { moving = "golemTimer"; } else if (button == teammatesInRadius) { moving = "teammatesInRadius"; + } else if (button == giantHP) { + moving = "giantHP"; } } } @@ -286,6 +303,8 @@ public class EditLocationsGui extends GuiScreen { ConfigHandler.writeIntConfig("locations", "golemTimerY", MoveCommand.golemTimerXY[1]); ConfigHandler.writeIntConfig("locations", "teammatesInRadiusX", MoveCommand.teammatesInRadiusXY[0]); ConfigHandler.writeIntConfig("locations", "teammatesInRadiusY", MoveCommand.teammatesInRadiusXY[1]); + ConfigHandler.writeIntConfig("locations", "giantHPX", MoveCommand.giantHPXY[0]); + ConfigHandler.writeIntConfig("locations", "giantHPY", MoveCommand.giantHPXY[1]); } } diff --git a/src/main/java/me/Danker/gui/buttons/LocationButton.java b/src/main/java/me/Danker/gui/buttons/LocationButton.java index a8937fd..f328c58 100644 --- a/src/main/java/me/Danker/gui/buttons/LocationButton.java +++ b/src/main/java/me/Danker/gui/buttons/LocationButton.java @@ -13,21 +13,17 @@ public class LocationButton extends GuiButton { private String text; private String text2; private Integer text2Offset; + private int longestText; - public LocationButton(int buttonId, int x, int y, double width, double height, double scale, String text, String text2, Integer text2Offset) { - super(buttonId, x, y, text); + public LocationButton(int x, int y, double scale, String text, String text2, Integer text2Offset) { + super(0, x, y, text); this.x = x; this.y = y; - this.width = (int) width; - this.height = (int) height; this.scale = scale; this.text = text; this.text2 = text2; this.text2Offset = text2Offset; - } - - @Override - public void drawButton(Minecraft mc, int mouseX, int mouseY) { + String[] splitText; if (text2 == null) { splitText = text.split("\n"); @@ -37,16 +33,23 @@ public class LocationButton extends GuiButton { int longestText = -1; for (String s : splitText) { - int stringLength = mc.fontRendererObj.getStringWidth(s); + int stringLength = Minecraft.getMinecraft().fontRendererObj.getStringWidth(s); if (stringLength > longestText) { longestText = stringLength; } } - + + this.longestText = longestText; + this.height = (int) ((splitText.length * 9 + 3) * scale); + this.width = (int) ((this.longestText + 3) * scale); + } + + @Override + public void drawButton(Minecraft mc, int mouseX, int mouseY) { if (text2 == null) { - drawRect(x - 2, y - 2, (int) (x + longestText * scale + 3), (int) (y + (splitText.length * 9 + 3) * scale), 0x40D3D3D3); + drawRect(x - 2, y - 2, x + width, y + height, 0x40D3D3D3); } else { - drawRect(x - 2, y - 2, (int) (x + (longestText + text2Offset) * scale + 3), (int) (y + (splitText.length * 9 + 3) * scale), 0x40D3D3D3); + drawRect(x - 2, y - 2, (int) (x + (longestText + text2Offset + 3) * scale), y + height, 0x40D3D3D3); new TextRenderer(mc, text2, (int) (x + (text2Offset * scale)), y, scale); } new TextRenderer(mc, text, x, y, scale); diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index dcb2368..a200b01 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -105,9 +105,7 @@ public class ConfigHandler { } public static void writeDoubleConfig(String category, String key, double value) { - config = new Configuration(new File(file)); try { - config.load(); double set = config.get(category, key, value).getDouble(); config.getCategory(category).get(key).set(value); } catch (Exception ex) { @@ -131,9 +129,7 @@ public class ConfigHandler { } public static void writeBooleanConfig(String category, String key, boolean value) { - config = new Configuration(new File(file)); try { - config.load(); boolean set = config.get(category, key, value).getBoolean(); config.getCategory(category).get(key).set(value); } catch (Exception ex) { @@ -208,6 +204,8 @@ public class ConfigHandler { } public static void reloadConfig() { + init(); + // Toggles ToggleCommand.gpartyToggled = initBoolean("toggles", "GParty", false); ToggleCommand.coordsToggled = initBoolean("toggles", "Coords", false); @@ -230,6 +228,7 @@ public class ConfigHandler { ToggleCommand.highlightArachne = initBoolean("toggles", "HighlightArachne", false); ToggleCommand.highlightSkeletonMasters = initBoolean("toggles", "HighlightSkeletonMasters", false); ToggleCommand.teammatesInRadius = initBoolean("toggles", "TeammatesInRadius", false); + ToggleCommand.giantHP = initBoolean("toggles", "GiantHP", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); @@ -481,6 +480,8 @@ public class ConfigHandler { MoveCommand.golemTimerXY[1] = initInt("locations", "golemTimerY", 30); MoveCommand.teammatesInRadiusXY[0] = initInt("locations", "teammatesInRadiusX", 80); MoveCommand.teammatesInRadiusXY[1] = initInt("locations", "teammatesInRadiusY", 100); + MoveCommand.giantHPXY[0] = initInt("locations", "giantHPX", 80); + MoveCommand.giantHPXY[1] = initInt("locations", "giantHPY", 150); // Scales ScaleCommand.coordsScale = initDouble("scales", "coordsScale", 1); @@ -494,6 +495,7 @@ public class ConfigHandler { ScaleCommand.bonzoTimerScale = initDouble("scales", "bonzoTimerScale", 1); ScaleCommand.golemTimerScale = initDouble("scales", "golemTimerScale", 1); ScaleCommand.teammatesInRadiusScale = initDouble("scales", "teammatesInRadiusScale", 1); + ScaleCommand.giantHPScale = initDouble("scales", "giantHPScale", 1); // Colours DankersSkyblockMod.MAIN_COLOUR = initString("colors", "main", EnumChatFormatting.GREEN.toString()); diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index b7927c3..d3d6325 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -30,6 +30,7 @@ import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.regex.Matcher; +import java.util.regex.Pattern; public class Utils { @@ -45,6 +46,7 @@ public class Utils { 1065000, 1410000, 1900000, 2500000, 3300000, 4300000, 5600000, 7200000, 9200000, 12000000, 15000000, 19000000, 24000000, 30000000, 38000000, 48000000, 60000000, 75000000, 93000000, 116250000}; static int[] expertiseKills = {50, 100, 250, 500, 1000, 2500, 5500, 10000, 15000}; + static Pattern boldPattern = Pattern.compile("(?i)\\u00A7L"); public static int getItems(String item) { Minecraft mc = Minecraft.getMinecraft(); @@ -542,5 +544,9 @@ public class Utils { public static boolean isRealPlayer(EntityPlayer player) { return player.getUniqueID().version() == 4 && !player.isPlayerSleeping(); } + + public static String removeBold(String text) { + return boldPattern.matcher(text).replaceAll(""); + } } -- cgit From b07e3799b34616885a90586a0fa5291a75ecbbc5 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 29 Apr 2021 01:07:18 -0400 Subject: Reduce mod init time by 70% --- src/main/java/me/Danker/handlers/ConfigHandler.java | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index a200b01..810def2 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -32,9 +32,7 @@ public class ConfigHandler { } public static int getInt(String category, String key) { - config = new Configuration(new File(file)); try { - config.load(); if (config.getCategory(category).containsKey(key)) { return config.get(category, key, 0).getInt(); } @@ -47,9 +45,7 @@ public class ConfigHandler { } public static double getDouble(String category, String key) { - config = new Configuration(new File(file)); try { - config.load(); if (config.getCategory(category).containsKey(key)) { return config.get(category, key, 0D).getDouble(); } @@ -62,9 +58,7 @@ public class ConfigHandler { } public static String getString(String category, String key) { - config = new Configuration(new File(file)); try { - config.load(); if (config.getCategory(category).containsKey(key)) { return config.get(category, key, "").getString(); } @@ -77,9 +71,7 @@ public class ConfigHandler { } public static boolean getBoolean(String category, String key) { - config = new Configuration(new File(file)); try { - config.load(); if (config.getCategory(category).containsKey(key)) { return config.get(category, key, false).getBoolean(); } @@ -92,9 +84,7 @@ public class ConfigHandler { } public static void writeIntConfig(String category, String key, int value) { - config = new Configuration(new File(file)); try { - config.load(); int set = config.get(category, key, value).getInt(); config.getCategory(category).get(key).set(value); } catch (Exception ex) { @@ -116,9 +106,7 @@ public class ConfigHandler { } public static void writeStringConfig(String category, String key, String value) { - config = new Configuration(new File(file)); try { - config.load(); String set = config.get(category, key, value).getString(); config.getCategory(category).get(key).set(value); } catch (Exception ex) { @@ -140,9 +128,7 @@ public class ConfigHandler { } public static boolean hasKey(String category, String key) { - config = new Configuration(new File(file)); try { - config.load(); if (!config.hasCategory(category)) return false; return config.getCategory(category).containsKey(key); } catch (Exception ex) { @@ -154,9 +140,7 @@ public class ConfigHandler { } public static void deleteCategory(String category) { - config = new Configuration(new File(file)); try { - config.load(); if (config.hasCategory(category)) { config.removeCategory(new ConfigCategory(category)); } -- cgit From 1d0cfd9f652990c396d6c58be61797c792fba8a2 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 29 Apr 2021 01:26:03 -0400 Subject: Add hiding pet candy in pet tooltip --- README.md | 3 ++- src/main/java/me/Danker/DankersSkyblockMod.java | 1 + .../java/me/Danker/commands/DankerGuiCommand.java | 1 + .../java/me/Danker/commands/ToggleCommand.java | 11 +++++++-- src/main/java/me/Danker/features/HidePetCandy.java | 26 ++++++++++++++++++++++ src/main/java/me/Danker/gui/DankerGui.java | 7 ++++++ .../java/me/Danker/handlers/ConfigHandler.java | 1 + 7 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 src/main/java/me/Danker/features/HidePetCandy.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index da48eda..8e0e769 100644 --- a/README.md +++ b/README.md @@ -54,11 +54,12 @@ Discord Server: https://discord.gg/QsEkNQS - Highlight Arachne - Highlight Skeleton Masters - Show teammates in 30 block radius +- Hide pet candy in pet tooltip ## Commands - /dhelp - Returns this message in-game. - /dsm - Opens the GUI for Danker's Skyblock Mod. -- /toggle - Toggles features. /toggle list returns values of every toggle. +- /toggle - Toggles features. /toggle list returns values of every toggle. - /setkey - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. - /loot [winter/festival/spooky/f(1-7)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index bf71dda..b3701cb 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -105,6 +105,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new GoldenEnchants()); MinecraftForge.EVENT_BUS.register(new GolemSpawningAlert()); MinecraftForge.EVENT_BUS.register(new GpartyNotifications()); + MinecraftForge.EVENT_BUS.register(new HidePetCandy()); MinecraftForge.EVENT_BUS.register(new HideTooltipsInExperiments()); MinecraftForge.EVENT_BUS.register(new HighlightSkeletonMasters()); MinecraftForge.EVENT_BUS.register(new IceWalkSolver()); diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index 2cc706e..6f548fa 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -94,6 +94,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[highlightskeletonmasters][").append(ToggleCommand.highlightSkeletonMasters).append("]\n"); debug.append("[teammatesinradius][").append(ToggleCommand.teammatesInRadius).append("]\n"); debug.append("[gianthp][").append(ToggleCommand.giantHP).append("]\n"); + debug.append("[hidepetcandy][").append(ToggleCommand.hidePetCandy).append("]\n"); debug.append("[dungeonbossmusic][").append(ToggleCommand.dungeonBossMusic).append("]\n"); debug.append("[bloodroommusic][").append(ToggleCommand.bloodRoomMusic).append("]\n"); debug.append("[dungeonmusic][").append(ToggleCommand.dungeonMusic).append("]\n"); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index a9fe663..27167b6 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -36,6 +36,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean highlightSkeletonMasters; public static boolean teammatesInRadius; public static boolean giantHP; + public static boolean hidePetCandy; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; @@ -96,7 +97,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "startswithterminal/selectallterminal/clickinorderterminal/" + "ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/" + "melodytooltips/highlightslayers/highlightarachne/highlightskeletonmasters/teammatesinradius/" + - "gianthp/dungeonbossmusic/bloodroommusic/dungeonmusic/list>"; + "gianthp/hidepetcandy/dungeonbossmusic/bloodroommusic/dungeonmusic/list>"; } public static String usage(ICommandSender arg0) { @@ -125,7 +126,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "ultrasequencer", "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "melodytooltips", "highlightslayers", "highlightskeletonmasters", "dungeonbossmusic", "bloodroommusic", "dungeonmusic", - "teammatesinradius", "gianthp", "list"); + "teammatesinradius", "gianthp", "hidepetcandy", "list"); } return null; } @@ -416,6 +417,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "GiantHP", giantHP); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Giant HP display has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + giantHP + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "hidepetcandy": + hidePetCandy = !hidePetCandy; + ConfigHandler.writeBooleanConfig("toggles", "HidePetCandy", hidePetCandy); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Hide pet candy has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + hidePetCandy + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "dungeonbossmusic": dungeonBossMusic = !dungeonBossMusic; CustomMusic.dungeonboss.stop(); @@ -482,6 +488,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Highlight Skeleton Masters: " + DankersSkyblockMod.VALUE_COLOUR + highlightSkeletonMasters + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Teammates in radius: " + DankersSkyblockMod.VALUE_COLOUR + teammatesInRadius + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Giant HP display: " + DankersSkyblockMod.VALUE_COLOUR + giantHP + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Hide pet candy: " + DankersSkyblockMod.VALUE_COLOUR + hidePetCandy + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon boss music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonBossMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom blood room music: " + DankersSkyblockMod.VALUE_COLOUR + bloodRoomMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonMusic diff --git a/src/main/java/me/Danker/features/HidePetCandy.java b/src/main/java/me/Danker/features/HidePetCandy.java new file mode 100644 index 0000000..8ef28d2 --- /dev/null +++ b/src/main/java/me/Danker/features/HidePetCandy.java @@ -0,0 +1,26 @@ +package me.Danker.features; + +import me.Danker.commands.ToggleCommand; +import me.Danker.utils.Utils; +import net.minecraftforge.event.entity.player.ItemTooltipEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class HidePetCandy { + + @SubscribeEvent + public void onTooltip(ItemTooltipEvent event) { + if (!Utils.inSkyblock) return; + if (event.toolTip == null) return; + + if (ToggleCommand.hidePetCandy) { + for (int i = 0; i < event.toolTip.size(); i++) { + if (event.toolTip.get(i).endsWith("Pet Candy Used")) { + event.toolTip.remove(i); + event.toolTip.remove(i); + break; + } + } + } + } + +} diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index cc33514..16e0640 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -65,6 +65,7 @@ public class DankerGui extends GuiScreen { private GuiButton highlightSkeletonMasters; private GuiButton teammatesInRadius; private GuiButton giantHP; + private GuiButton hidePetCandy; // Chat Messages private GuiButton sceptreMessages; private GuiButton midasStaffMessages; @@ -151,6 +152,7 @@ public class DankerGui extends GuiScreen { highlightSkeletonMasters = new FeatureButton("Highlight Skeleton Masters: " + Utils.getColouredBoolean(ToggleCommand.highlightSkeletonMasters), "Highlights Skeleton Masters."); teammatesInRadius = new FeatureButton("Display Players in 30 Block Radius: " + Utils.getColouredBoolean(ToggleCommand.teammatesInRadius), "Displays dungeon teammates in 30 block radius for tether and diversion."); giantHP = new FeatureButton("Display Giant HP: " + Utils.getColouredBoolean(ToggleCommand.giantHP), "Displays health of Sadan's giants during F6 bossfight and F7 blood room."); + hidePetCandy = new FeatureButton("Hide Pet Candy: " + Utils.getColouredBoolean(ToggleCommand.hidePetCandy), "Hide pet candy in pet tooltips."); allButtons.clear(); allButtons.add(changeDisplay); @@ -195,6 +197,7 @@ public class DankerGui extends GuiScreen { allButtons.add(highlightSkeletonMasters); allButtons.add(teammatesInRadius); allButtons.add(giantHP); + allButtons.add(hidePetCandy); search.setText(initSearchText); search.setVisible(true); @@ -433,6 +436,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.giantHP = !ToggleCommand.giantHP; ConfigHandler.writeBooleanConfig("toggles", "GiantHP", ToggleCommand.giantHP); giantHP.displayString = "Display Giant HP: " + Utils.getColouredBoolean(ToggleCommand.giantHP); + } else if (button == hidePetCandy) { + ToggleCommand.hidePetCandy = !ToggleCommand.hidePetCandy; + ConfigHandler.writeBooleanConfig("toggles", "HidePetCandy", ToggleCommand.hidePetCandy); + hidePetCandy.displayString = "Hide Pet Candy: " + Utils.getColouredBoolean(ToggleCommand.hidePetCandy); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 810def2..db33cb2 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -213,6 +213,7 @@ public class ConfigHandler { ToggleCommand.highlightSkeletonMasters = initBoolean("toggles", "HighlightSkeletonMasters", false); ToggleCommand.teammatesInRadius = initBoolean("toggles", "TeammatesInRadius", false); ToggleCommand.giantHP = initBoolean("toggles", "GiantHP", false); + ToggleCommand.hidePetCandy = initBoolean("toggles", "HidePetCandy", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); -- cgit From 4e6be104aaa579abc06fff0613eb2dec991a7487 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 29 Apr 2021 21:44:00 -0400 Subject: Auto update trivia and three man solutions --- src/main/java/me/Danker/DankersSkyblockMod.java | 8 ++ .../features/puzzlesolvers/ThreeManSolver.java | 71 ++++++++++------ .../features/puzzlesolvers/TriviaSolver.java | 99 ++++++++++++++++------ src/main/java/me/Danker/gui/EditLocationsGui.java | 3 - 4 files changed, 127 insertions(+), 54 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index b3701cb..f176bbe 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -1,5 +1,6 @@ package me.Danker; +import com.google.gson.JsonObject; import me.Danker.commands.*; import me.Danker.events.ChestSlotClickedEvent; import me.Danker.events.GuiChestBackgroundDrawnEvent; @@ -9,6 +10,7 @@ import me.Danker.features.loot.LootDisplay; import me.Danker.features.loot.LootTracker; import me.Danker.features.puzzlesolvers.*; import me.Danker.gui.*; +import me.Danker.handlers.APIHandler; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.PacketHandler; import me.Danker.utils.Utils; @@ -74,6 +76,7 @@ public class DankersSkyblockMod { public static String guiToOpen = null; public static boolean firstLaunch = false; public static String configDirectory; + public static JsonObject data = null; public static String MAIN_COLOUR; public static String SECONDARY_COLOUR; @@ -149,6 +152,11 @@ public class DankersSkyblockMod { for (KeyBinding keyBinding : keyBindings) { ClientRegistry.registerKeyBinding(keyBinding); } + + new Thread(() -> { + DankersSkyblockMod.data = APIHandler.getResponse("https://raw.githubusercontent.com/bowser0000/SkyblockMod-REPO/main/data.json"); + System.out.println("Loaded data from GitHub?: " + (DankersSkyblockMod.data != null && DankersSkyblockMod.data.has("trivia"))); + }).start(); } @EventHandler diff --git a/src/main/java/me/Danker/features/puzzlesolvers/ThreeManSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/ThreeManSolver.java index 8f7de95..500c8eb 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/ThreeManSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/ThreeManSolver.java @@ -1,5 +1,6 @@ package me.Danker.features.puzzlesolvers; +import com.google.gson.JsonArray; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; import me.Danker.utils.Utils; @@ -16,6 +17,7 @@ import java.util.List; public class ThreeManSolver { + // Hard coded solutions if api call fails static String[] riddleSolutions = {"The reward is not in my chest!", "At least one of them is lying, and the reward is not in", "My chest doesn't have the reward. We are all telling the truth", "My chest has the reward and I'm telling the truth", "The reward isn't in any of our chests", "Both of them are telling the truth."}; @@ -33,33 +35,22 @@ public class ThreeManSolver { if (!Utils.inDungeons) return; if (ToggleCommand.threeManToggled && message.contains("[NPC]")) { - for (String solution : riddleSolutions) { - if (message.contains(solution)) { - Minecraft mc = Minecraft.getMinecraft(); - String npcName = message.substring(message.indexOf("]") + 2, message.indexOf(":")); - mc.thePlayer.addChatMessage(new ChatComponentText(DankersSkyblockMod.ANSWER_COLOUR + EnumChatFormatting.BOLD + StringUtils.stripControlCodes(npcName) + DankersSkyblockMod.MAIN_COLOUR + " has the blessing.")); - if (riddleChest == null) { - List entities = mc.theWorld.getLoadedEntityList(); - for (Entity entity : entities) { - if (entity == null || !entity.hasCustomName()) continue; - if (entity.getCustomNameTag().contains(npcName)) { - BlockPos npcLocation = new BlockPos(entity.posX, 69, entity.posZ); - if (mc.theWorld.getBlockState(npcLocation.north()).getBlock() == Blocks.chest) { - riddleChest = npcLocation.north(); - } else if (mc.theWorld.getBlockState(npcLocation.east()).getBlock() == Blocks.chest) { - riddleChest = npcLocation.east(); - } else if (mc.theWorld.getBlockState(npcLocation.south()).getBlock() == Blocks.chest) { - riddleChest = npcLocation.south(); - } else if (mc.theWorld.getBlockState(npcLocation.west()).getBlock() == Blocks.chest) { - riddleChest = npcLocation.west(); - } else { - System.out.print("Could not find correct riddle chest."); - } - break; - } - } + if (DankersSkyblockMod.data != null && DankersSkyblockMod.data.has("threeman")) { + JsonArray riddleSolutions = DankersSkyblockMod.data.get("threeman").getAsJsonArray(); + + for (int i = 0; i < riddleSolutions.size(); i++) { + String solution = riddleSolutions.get(i).getAsString(); + if (message.contains(solution)) { + answer(message); + break; + } + } + } else { + for (String solution : riddleSolutions) { + if (message.contains(solution)) { + answer(message); + break; } - break; } } } @@ -72,4 +63,32 @@ public class ThreeManSolver { } } + public static void answer(String message) { + Minecraft mc = Minecraft.getMinecraft(); + String npcName = message.substring(message.indexOf("]") + 2, message.indexOf(":")); + mc.thePlayer.addChatMessage(new ChatComponentText(DankersSkyblockMod.ANSWER_COLOUR + EnumChatFormatting.BOLD + StringUtils.stripControlCodes(npcName) + DankersSkyblockMod.MAIN_COLOUR + " has the blessing.")); + + if (riddleChest == null) { + List entities = mc.theWorld.getLoadedEntityList(); + for (Entity entity : entities) { + if (entity == null || !entity.hasCustomName()) continue; + if (entity.getCustomNameTag().contains(npcName)) { + BlockPos npcLocation = new BlockPos(entity.posX, 69, entity.posZ); + if (mc.theWorld.getBlockState(npcLocation.north()).getBlock() == Blocks.chest) { + riddleChest = npcLocation.north(); + } else if (mc.theWorld.getBlockState(npcLocation.east()).getBlock() == Blocks.chest) { + riddleChest = npcLocation.east(); + } else if (mc.theWorld.getBlockState(npcLocation.south()).getBlock() == Blocks.chest) { + riddleChest = npcLocation.south(); + } else if (mc.theWorld.getBlockState(npcLocation.west()).getBlock() == Blocks.chest) { + riddleChest = npcLocation.west(); + } else { + System.out.print("Could not find correct riddle chest."); + } + break; + } + } + } + } + } diff --git a/src/main/java/me/Danker/features/puzzlesolvers/TriviaSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/TriviaSolver.java index 9adc555..dd2c23e 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/TriviaSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/TriviaSolver.java @@ -1,5 +1,9 @@ package me.Danker.features.puzzlesolvers; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; +import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; import me.Danker.utils.Utils; import net.minecraft.util.ChatComponentText; @@ -9,16 +13,21 @@ import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; +import java.util.stream.Collectors; public class TriviaSolver { static Map triviaSolutions = new HashMap<>(); static String[] triviaAnswers = null; + static JsonArray triviaAnswersJson = null; public static String TRIVIA_WRONG_ANSWER_COLOUR; public static void init() { + // Hard coded solutions if api call fails triviaSolutions.put("What is the status of The Watcher?", new String[]{"Stalker"}); triviaSolutions.put("What is the status of Bonzo?", new String[]{"New Necromancer"}); triviaSolutions.put("What is the status of Scarf?", new String[]{"Apprentice Necromancer"}); @@ -30,11 +39,10 @@ public class TriviaSolver { triviaSolutions.put("What is the status of Goldor?", new String[]{"Wither Soldier"}); triviaSolutions.put("What is the status of Storm?", new String[]{"Elementalist"}); triviaSolutions.put("What is the status of Necron?", new String[]{"Wither Lord"}); - triviaSolutions.put("How many total Fairy Souls are there?", new String[]{"222 Fairy Souls"}); + triviaSolutions.put("How many total Fairy Souls are there?", new String[]{"227 Fairy Souls"}); triviaSolutions.put("How many Fairy Souls are there in Spider's Den?", new String[]{"19 Fairy Souls"}); triviaSolutions.put("How many Fairy Souls are there in The End?", new String[]{"12 Fairy Souls"}); - triviaSolutions.put("How many Fairy Souls are there in The Barn?", new String[]{"7 Fairy Souls"}); - triviaSolutions.put("How many Fairy Souls are there in Mushroom Desert?", new String[]{"8 Fairy Souls"}); + triviaSolutions.put("How many Fairy Souls are there in The Farming Islands?", new String[]{"20 Fairy Souls"}); triviaSolutions.put("How many Fairy Souls are there in Blazing Fortress?", new String[]{"19 Fairy Souls"}); triviaSolutions.put("How many Fairy Souls are there in The Park?", new String[]{"11 Fairy Souls"}); triviaSolutions.put("How many Fairy Souls are there in Jerry's Workshop?", new String[]{"5 Fairy Souls"}); @@ -65,35 +73,76 @@ public class TriviaSolver { if (event.type == 2) return; if (ToggleCommand.oruoToggled) { - if (message.contains("What SkyBlock year is it?")) { - double currentTime = System.currentTimeMillis() /1000L; + if (DankersSkyblockMod.data != null && DankersSkyblockMod.data.has("trivia")) { + if (message.contains("What SkyBlock year is it?")) { + double currentTime = System.currentTimeMillis() / 1000L; - double diff = Math.floor(currentTime - 1560276000); + double diff = Math.floor(currentTime - 1560276000); - int year = (int) (diff / 446400 + 1); - triviaAnswers = new String[]{"Year " + year}; - } else { - for (String question : triviaSolutions.keySet()) { - if (message.contains(question)) { - triviaAnswers = triviaSolutions.get(question); - break; + int year = (int) (diff / 446400 + 1); + triviaAnswersJson = new JsonArray(); + triviaAnswersJson.add(new JsonPrimitive("Year " + year)); + } else { + JsonObject triviaSolutions = DankersSkyblockMod.data.get("trivia").getAsJsonObject(); + + List triviaSolutionsList = triviaSolutions.entrySet().stream() + .map(Map.Entry::getKey) + .collect(Collectors.toCollection(ArrayList::new)); + for (String question : triviaSolutionsList) { + if (message.contains(question)) { + triviaAnswersJson = triviaSolutions.get(question).getAsJsonArray(); + break; + } } } - } - // Set wrong answers to red and remove click events - if (triviaAnswers != null && (message.contains("ⓐ") || message.contains("ⓑ") || message.contains("ⓒ"))) { - boolean isSolution = false; - for (String solution : triviaAnswers) { - if (message.contains(solution)) { - isSolution = true; - break; + // Set wrong answers to red and remove click events + if (triviaAnswersJson != null && (message.contains("ⓐ") || message.contains("ⓑ") || message.contains("ⓒ"))) { + boolean isSolution = false; + for (int i = 0; i < triviaAnswersJson.size(); i++) { + String solution = triviaAnswersJson.get(i).getAsString(); + if (message.contains(solution)) { + isSolution = true; + break; + } + } + if (!isSolution) { + char letter = message.charAt(5); + String option = message.substring(6); + event.message = new ChatComponentText(" " + EnumChatFormatting.GOLD + letter + TRIVIA_WRONG_ANSWER_COLOUR + option); + } + } + } else { + if (message.contains("What SkyBlock year is it?")) { + double currentTime = System.currentTimeMillis() / 1000L; + + double diff = Math.floor(currentTime - 1560276000); + + int year = (int) (diff / 446400 + 1); + triviaAnswers = new String[]{"Year " + year}; + } else { + for (String question : triviaSolutions.keySet()) { + if (message.contains(question)) { + triviaAnswers = triviaSolutions.get(question); + break; + } } } - if (!isSolution) { - char letter = message.charAt(5); - String option = message.substring(6); - event.message = new ChatComponentText(" " + EnumChatFormatting.GOLD + letter + TRIVIA_WRONG_ANSWER_COLOUR + option); + + // Set wrong answers to red and remove click events + if (triviaAnswers != null && (message.contains("ⓐ") || message.contains("ⓑ") || message.contains("ⓒ"))) { + boolean isSolution = false; + for (String solution : triviaAnswers) { + if (message.contains(solution)) { + isSolution = true; + break; + } + } + if (!isSolution) { + char letter = message.charAt(5); + String option = message.substring(6); + event.message = new ChatComponentText(" " + EnumChatFormatting.GOLD + letter + TRIVIA_WRONG_ANSWER_COLOUR + option); + } } } } diff --git a/src/main/java/me/Danker/gui/EditLocationsGui.java b/src/main/java/me/Danker/gui/EditLocationsGui.java index 2c8b336..fed6ee9 100644 --- a/src/main/java/me/Danker/gui/EditLocationsGui.java +++ b/src/main/java/me/Danker/gui/EditLocationsGui.java @@ -1,6 +1,5 @@ package me.Danker.gui; -import javafx.scene.transform.Scale; import me.Danker.DankersSkyblockMod; import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; @@ -14,8 +13,6 @@ import net.minecraft.client.gui.GuiScreen; import net.minecraft.util.EnumChatFormatting; import org.lwjgl.opengl.GL11; -import javax.xml.stream.Location; - public class EditLocationsGui extends GuiScreen { private String moving = null; -- cgit From d79def85f593605e0ac2ff59232449b4a8446bb8 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 29 Apr 2021 21:46:21 -0400 Subject: Colour blocks in creeper puzzle solver --- src/main/java/me/Danker/features/puzzlesolvers/CreeperSolver.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/puzzlesolvers/CreeperSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/CreeperSolver.java index 7ff7e7a..cd6bcf4 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/CreeperSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/CreeperSolver.java @@ -78,7 +78,12 @@ public class CreeperSolver { public void onWorldRender(RenderWorldLastEvent event) { if (ToggleCommand.creeperToggled && drawCreeperLines && !creeperLines.isEmpty()) { for (int i = 0; i < creeperLines.size(); i++) { - Utils.draw3DLine(creeperLines.get(i)[0], creeperLines.get(i)[1], CREEPER_COLOURS[i % 10], 2, true, event.partialTicks); + Vec3 pos1 = creeperLines.get(i)[0]; + Vec3 pos2 = creeperLines.get(i)[1]; + int colour = CREEPER_COLOURS[i % 10]; + Utils.draw3DLine(pos1, pos2, colour, 2, true, event.partialTicks); + Utils.drawFilled3DBox(new AxisAlignedBB(pos1.xCoord - 0.51, pos1.yCoord - 0.51, pos1.zCoord - 0.51, pos1.xCoord + 0.51, pos1.yCoord + 0.51, pos1.zCoord + 0.51), colour, true, true, event.partialTicks); + Utils.drawFilled3DBox(new AxisAlignedBB(pos2.xCoord - 0.51, pos2.yCoord - 0.51, pos2.zCoord - 0.51, pos2.xCoord + 0.51, pos2.yCoord + 0.51, pos2.zCoord + 0.51), colour, true, true, event.partialTicks); } } } -- cgit From efa2c0dd2c1500edff663a2efd0b1d1ea902ce34 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sun, 2 May 2021 20:24:51 -0400 Subject: Add custom name colours --- README.md | 5 +- build.gradle | 2 +- src/main/java/me/Danker/DankersSkyblockMod.java | 10 ++- .../java/me/Danker/commands/DankerGuiCommand.java | 1 + .../java/me/Danker/commands/ToggleCommand.java | 12 +++- .../java/me/Danker/features/ColouredNames.java | 78 ++++++++++++++++++++++ src/main/java/me/Danker/gui/DankerGui.java | 7 ++ .../java/me/Danker/handlers/ConfigHandler.java | 1 + 8 files changed, 110 insertions(+), 6 deletions(-) create mode 100644 src/main/java/me/Danker/features/ColouredNames.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 8e0e769..fbda774 100644 --- a/README.md +++ b/README.md @@ -55,11 +55,12 @@ Discord Server: https://discord.gg/QsEkNQS - Highlight Skeleton Masters - Show teammates in 30 block radius - Hide pet candy in pet tooltip +- Custom name colors ## Commands - /dhelp - Returns this message in-game. - /dsm - Opens the GUI for Danker's Skyblock Mod. -- /toggle - Toggles features. /toggle list returns values of every toggle. +- /toggle - Toggles features. /toggle list returns values of every toggle. - /setkey - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. - /loot [winter/festival/spooky/f(1-7)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. @@ -112,3 +113,5 @@ Software | License [SkyblockAddons](https://github.com/BiscuitDevelopment/SkyblockAddons/) | [MIT License](https://github.com/BiscuitDevelopment/SkyblockAddons/blob/master/LICENSE) [Zealot Counter](https://github.com/symt/zealot-counter/) | [Apache License](https://github.com/symt/zealot-counter/blob/master/LICENSE.md) [NotEnoughUpdates](https://github.com/Moulberry/NotEnoughUpdates/) | [Creative Commons Public License](https://github.com/Moulberry/NotEnoughUpdates/blob/master/LICENSE) +[HyChat](https://github.com/Moulberry/Hychat) | [Creative Commons Public License](https://github.com/Moulberry/Hychat/blob/master/LICENSE) +[SkyblockCatia](https://github.com/SteveKunG/SkyBlockcatia) | [MIT License](https://github.com/SteveKunG/SkyBlockcatia/blob/1.8.9/LICENSE.md) diff --git a/build.gradle b/build.gradle index d87c2a7..38434de 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ plugins { id "net.minecraftforge.gradle.forge" version "2.0.2" } */ -version = "1.8.7-beta1" +version = "1.8.7-beta2" group= "me.Danker.DankersSkyblockMod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Danker's Skyblock Mod" diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index f176bbe..d2b8017 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -58,13 +58,15 @@ import org.lwjgl.input.Mouse; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.UnsupportedAudioFileException; import java.io.IOException; +import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; @Mod(modid = DankersSkyblockMod.MODID, version = DankersSkyblockMod.VERSION, clientSideOnly = true) public class DankersSkyblockMod { public static final String MODID = "Danker's Skyblock Mod"; - public static final String VERSION = "1.8.7-beta1"; + public static final String VERSION = "1.8.7-beta2"; public static int titleTimer = -1; public static boolean showTitle = false; public static String titleText = ""; @@ -99,6 +101,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new CakeTimer()); MinecraftForge.EVENT_BUS.register(new ChronomatronSolver()); MinecraftForge.EVENT_BUS.register(new ClickInOrderSolver()); + MinecraftForge.EVENT_BUS.register(new ColouredNames()); MinecraftForge.EVENT_BUS.register(new CreeperSolver()); MinecraftForge.EVENT_BUS.register(new CustomMusic()); MinecraftForge.EVENT_BUS.register(new DungeonTimer()); @@ -154,8 +157,11 @@ public class DankersSkyblockMod { } new Thread(() -> { - DankersSkyblockMod.data = APIHandler.getResponse("https://raw.githubusercontent.com/bowser0000/SkyblockMod-REPO/main/data.json"); + data = APIHandler.getResponse("https://raw.githubusercontent.com/bowser0000/SkyblockMod-REPO/main/data.json"); System.out.println("Loaded data from GitHub?: " + (DankersSkyblockMod.data != null && DankersSkyblockMod.data.has("trivia"))); + ColouredNames.users = data.get("colourednames").getAsJsonObject().entrySet().stream() + .map(Map.Entry::getKey) + .collect(Collectors.toCollection(ArrayList::new)); }).start(); } diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index 6f548fa..a92cb80 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -95,6 +95,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[teammatesinradius][").append(ToggleCommand.teammatesInRadius).append("]\n"); debug.append("[gianthp][").append(ToggleCommand.giantHP).append("]\n"); debug.append("[hidepetcandy][").append(ToggleCommand.hidePetCandy).append("]\n"); + debug.append("[customcolourednames][").append(ToggleCommand.customColouredNames).append("]\n"); debug.append("[dungeonbossmusic][").append(ToggleCommand.dungeonBossMusic).append("]\n"); debug.append("[bloodroommusic][").append(ToggleCommand.bloodRoomMusic).append("]\n"); debug.append("[dungeonmusic][").append(ToggleCommand.dungeonMusic).append("]\n"); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 27167b6..1f2fe5c 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -37,6 +37,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean teammatesInRadius; public static boolean giantHP; public static boolean hidePetCandy; + public static boolean customColouredNames; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; @@ -97,7 +98,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "startswithterminal/selectallterminal/clickinorderterminal/" + "ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/" + "melodytooltips/highlightslayers/highlightarachne/highlightskeletonmasters/teammatesinradius/" + - "gianthp/hidepetcandy/dungeonbossmusic/bloodroommusic/dungeonmusic/list>"; + "gianthp/hidepetcandy/customcolorednames/dungeonbossmusic/bloodroommusic/dungeonmusic/list>"; } public static String usage(ICommandSender arg0) { @@ -126,7 +127,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "ultrasequencer", "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "melodytooltips", "highlightslayers", "highlightskeletonmasters", "dungeonbossmusic", "bloodroommusic", "dungeonmusic", - "teammatesinradius", "gianthp", "hidepetcandy", "list"); + "teammatesinradius", "gianthp", "hidepetcandy", "customcolorednames", "list"); } return null; } @@ -422,6 +423,12 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "HidePetCandy", hidePetCandy); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Hide pet candy has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + hidePetCandy + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "customcolorednames": + case "customcolourednames": + customColouredNames = !customColouredNames; + ConfigHandler.writeBooleanConfig("toggles", "CustomColouredNames", customColouredNames); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom name colors has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + customColouredNames + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "dungeonbossmusic": dungeonBossMusic = !dungeonBossMusic; CustomMusic.dungeonboss.stop(); @@ -489,6 +496,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Teammates in radius: " + DankersSkyblockMod.VALUE_COLOUR + teammatesInRadius + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Giant HP display: " + DankersSkyblockMod.VALUE_COLOUR + giantHP + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Hide pet candy: " + DankersSkyblockMod.VALUE_COLOUR + hidePetCandy + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Custom name colors: " + DankersSkyblockMod.VALUE_COLOUR + customColouredNames + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon boss music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonBossMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom blood room music: " + DankersSkyblockMod.VALUE_COLOUR + bloodRoomMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonMusic diff --git a/src/main/java/me/Danker/features/ColouredNames.java b/src/main/java/me/Danker/features/ColouredNames.java new file mode 100644 index 0000000..eec2d5c --- /dev/null +++ b/src/main/java/me/Danker/features/ColouredNames.java @@ -0,0 +1,78 @@ +package me.Danker.features; + +import me.Danker.DankersSkyblockMod; +import me.Danker.commands.ToggleCommand; +import me.Danker.utils.Utils; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.event.entity.player.ItemTooltipEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class ColouredNames { + + public static List users = new ArrayList<>(); + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent event) { + if (!ToggleCommand.customColouredNames || !Utils.inSkyblock || event.type != 0) return; + long startTime = System.currentTimeMillis(); + + for (String user : users) { + if (event.message.getFormattedText().contains(user)) { + event.message = replaceChat(event.message, user); + } + } + System.out.println("Chat time: " + ((System.currentTimeMillis() - startTime) / 1000D) + "s"); + } + + @SubscribeEvent + public void onTooltip(ItemTooltipEvent event) { + if (!ToggleCommand.customColouredNames || !Utils.inSkyblock) return; + + for (String user : users) { + for (int i = 0; i < event.toolTip.size(); i++) { + if (event.toolTip.get(i).contains(user)) { + event.toolTip.set(i, replaceName(event.toolTip.get(i), user, getColourFromName(user))); + } + } + } + } + + // https://github.com/SteveKunG/SkyBlockcatia/blob/1.8.9/src/main/java/com/stevekung/skyblockcatia/utils/SupporterUtils.java#L53 + public static String replaceName(String text, String name, String colour) { + String namePattern = "(?:(?:\\u00a7[0-9a-fbr])\\B(?:" + name + ")\\b)|(?:\\u00a7[rb]" + name + "\\u00a7r)|\\b" + name + "\\b"; + Matcher prevColourMat = Pattern.compile("(?:.*(?:(?\\u00a7[0-9a-fbr])" + name + ")\\b.*)").matcher(text); + + if (prevColourMat.matches()) { + return text.replaceAll(namePattern, colour + name + prevColourMat.group("colour")); + } + return text.replaceAll(namePattern, colour + name + EnumChatFormatting.WHITE); + } + + // https://github.com/Moulberry/Hychat/blob/master/src/main/java/io/github/moulberry/hychat/util/TextProcessing.java#L23 + public static IChatComponent replaceChat(IChatComponent component, String user) { + IChatComponent newComponent; + ChatComponentText text = (ChatComponentText) component; + + newComponent = new ChatComponentText(replaceName(text.getUnformattedTextForChat(), user, getColourFromName(user))); + newComponent.setChatStyle(text.getChatStyle().createShallowCopy()); + + for (IChatComponent sibling : text.getSiblings()) { + newComponent.appendSibling(replaceChat(sibling, user)); + } + + return newComponent; + } + + public static String getColourFromName(String name) { + return "§" + DankersSkyblockMod.data.get("colourednames").getAsJsonObject().get(name).getAsString(); + } + +} diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 16e0640..ce795f3 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -66,6 +66,7 @@ public class DankerGui extends GuiScreen { private GuiButton teammatesInRadius; private GuiButton giantHP; private GuiButton hidePetCandy; + private GuiButton customColouredNames; // Chat Messages private GuiButton sceptreMessages; private GuiButton midasStaffMessages; @@ -153,6 +154,7 @@ public class DankerGui extends GuiScreen { teammatesInRadius = new FeatureButton("Display Players in 30 Block Radius: " + Utils.getColouredBoolean(ToggleCommand.teammatesInRadius), "Displays dungeon teammates in 30 block radius for tether and diversion."); giantHP = new FeatureButton("Display Giant HP: " + Utils.getColouredBoolean(ToggleCommand.giantHP), "Displays health of Sadan's giants during F6 bossfight and F7 blood room."); hidePetCandy = new FeatureButton("Hide Pet Candy: " + Utils.getColouredBoolean(ToggleCommand.hidePetCandy), "Hide pet candy in pet tooltips."); + customColouredNames = new FeatureButton("Custom Name Colors: " + Utils.getColouredBoolean(ToggleCommand.customColouredNames), "Replaces some player's usernames with a custom color."); allButtons.clear(); allButtons.add(changeDisplay); @@ -198,6 +200,7 @@ public class DankerGui extends GuiScreen { allButtons.add(teammatesInRadius); allButtons.add(giantHP); allButtons.add(hidePetCandy); + allButtons.add(customColouredNames); search.setText(initSearchText); search.setVisible(true); @@ -440,6 +443,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.hidePetCandy = !ToggleCommand.hidePetCandy; ConfigHandler.writeBooleanConfig("toggles", "HidePetCandy", ToggleCommand.hidePetCandy); hidePetCandy.displayString = "Hide Pet Candy: " + Utils.getColouredBoolean(ToggleCommand.hidePetCandy); + } else if (button == customColouredNames) { + ToggleCommand.customColouredNames = !ToggleCommand.customColouredNames; + ConfigHandler.writeBooleanConfig("toggles", "CustomColouredNames", ToggleCommand.customColouredNames); + customColouredNames.displayString = "Custom Name Colors: " + Utils.getColouredBoolean(ToggleCommand.customColouredNames); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index db33cb2..6d32f99 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -214,6 +214,7 @@ public class ConfigHandler { ToggleCommand.teammatesInRadius = initBoolean("toggles", "TeammatesInRadius", false); ToggleCommand.giantHP = initBoolean("toggles", "GiantHP", false); ToggleCommand.hidePetCandy = initBoolean("toggles", "HidePetCandy", false); + ToggleCommand.customColouredNames = initBoolean("toggles", "CustomColouredNames", true); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); -- cgit From e14ea5b847e985e704b4fea643e93ed6100b8a64 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sun, 2 May 2021 20:39:34 -0400 Subject: Add /weight command --- src/main/java/me/Danker/DankersSkyblockMod.java | 1 + .../java/me/Danker/commands/WeightCommand.java | 105 +++++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 src/main/java/me/Danker/commands/WeightCommand.java (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index d2b8017..c9aaa26 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -193,6 +193,7 @@ public class DankersSkyblockMod { ClientCommandHandler.instance.registerCommand(new SkyblockPlayersCommand()); ClientCommandHandler.instance.registerCommand(new SlayerCommand()); ClientCommandHandler.instance.registerCommand(new ToggleCommand()); + ClientCommandHandler.instance.registerCommand(new WeightCommand()); configDirectory = event.getModConfigurationDirectory().toString(); } diff --git a/src/main/java/me/Danker/commands/WeightCommand.java b/src/main/java/me/Danker/commands/WeightCommand.java new file mode 100644 index 0000000..41c59d8 --- /dev/null +++ b/src/main/java/me/Danker/commands/WeightCommand.java @@ -0,0 +1,105 @@ +package me.Danker.commands; + +import com.google.gson.JsonObject; +import me.Danker.DankersSkyblockMod; +import me.Danker.handlers.APIHandler; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.Utils; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +import java.text.NumberFormat; +import java.util.List; +import java.util.Locale; + +public class WeightCommand extends CommandBase { + + @Override + public String getCommandName() { + return "weight"; + } + + @Override + public String getCommandUsage(ICommandSender arg0) { + return "/" + getCommandName() + " [name]"; + } + + public static String usage(ICommandSender arg0) { + return new WeightCommand().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + if (args.length == 1) { + return Utils.getMatchingPlayers(args[0]); + } + return null; + } + + @Override + public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { + // MULTI THREAD DRIFTING + new Thread(() -> { + EntityPlayer player = (EntityPlayer) arg0; + + // Check key + String key = ConfigHandler.getString("api", "APIKey"); + if (key.equals("")) { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "API key not set. Use /setkey.")); + return; + } + + // Get UUID for Hypixel API requests + String username; + String uuid; + if (arg1.length == 0) { + username = player.getName(); + uuid = player.getUniqueID().toString().replaceAll("[\\-]", ""); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking weight of " + DankersSkyblockMod.SECONDARY_COLOUR + username)); + } else { + username = arg1[0]; + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking weight of " + DankersSkyblockMod.SECONDARY_COLOUR + username)); + uuid = APIHandler.getUUID(username); + } + + System.out.println("Fetching weight from Senither API..."); + String weightURL = "https://hypixel-api.senither.com/v1/profiles/" + uuid + "/weight?key=" + key; + JsonObject weightResponse = APIHandler.getResponse(weightURL); + if (weightResponse.get("status").getAsInt() != 200) { + String reason = weightResponse.get("reason").getAsString(); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); + return; + } + + JsonObject data = weightResponse.get("data").getAsJsonObject(); + double weight = data.get("weight").getAsDouble(); + double overflow = data.get("weight_overflow").getAsDouble(); + double skillWeight = data.get("skills").getAsJsonObject().get("weight").getAsDouble(); + double skillOverflow = data.get("skills").getAsJsonObject().get("weight_overflow").getAsDouble(); + double slayerWeight = data.get("slayers").getAsJsonObject().get("weight").getAsDouble(); + double slayerOverflow = data.get("slayers").getAsJsonObject().get("weight_overflow").getAsDouble(); + double dungeonWeight = data.get("dungeons").getAsJsonObject().get("weight").getAsDouble(); + double dungeonOverflow = data.get("dungeons").getAsJsonObject().get("weight_overflow").getAsDouble(); + + NumberFormat nf = NumberFormat.getNumberInstance(Locale.US); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.AQUA + " " + username + "'s Weight:\n" + + DankersSkyblockMod.TYPE_COLOUR + " Total Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(weight + overflow) + " (" + nf.format(weight) + " + " + nf.format(overflow) + ")\n" + + DankersSkyblockMod.TYPE_COLOUR + " Skill Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(skillWeight + skillOverflow) + " (" + nf.format(skillWeight) + " + " + nf.format(skillOverflow) + ")\n" + + DankersSkyblockMod.TYPE_COLOUR + " Slayers Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(slayerWeight + slayerOverflow) + " (" + nf.format(slayerWeight) + " + " + nf.format(slayerOverflow) + ")\n" + + DankersSkyblockMod.TYPE_COLOUR + " Dungeons Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(dungeonWeight + dungeonOverflow) + " (" + nf.format(dungeonWeight) + " + " + nf.format(dungeonOverflow) + ")\n" + + DankersSkyblockMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------")); + }).start(); + } + +} -- cgit From 8cf11c262ec7c2ba89365671c1434799f862faa7 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 4 May 2021 17:07:41 -0400 Subject: Add master mode completions to /dungeons --- .../java/me/Danker/commands/DungeonsCommand.java | 63 +++++++++++++++------- 1 file changed, 43 insertions(+), 20 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/DungeonsCommand.java b/src/main/java/me/Danker/commands/DungeonsCommand.java index 92779dc..3391a08 100644 --- a/src/main/java/me/Danker/commands/DungeonsCommand.java +++ b/src/main/java/me/Danker/commands/DungeonsCommand.java @@ -86,9 +86,10 @@ public class DungeonsCommand extends CommandBase { String playerURL = "https://api.hypixel.net/player?uuid=" + uuid + "&key=" + key; System.out.println("Fetching player data..."); JsonObject playerResponse = APIHandler.getResponse(playerURL); - if(!playerResponse.get("success").getAsBoolean()){ + if (!playerResponse.get("success").getAsBoolean()) { String reason = playerResponse.get("cause").getAsString(); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "This player has not played on Hypixel.")); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); + return; } System.out.println("Fetching dungeon stats..."); @@ -111,42 +112,64 @@ public class DungeonsCommand extends CommandBase { int highestFloor = catacombsObject.get("highest_tier_completed").getAsInt(); JsonObject completionObj = catacombsObject.get("tier_completions").getAsJsonObject(); + JsonObject catacombsMasterObject = dungeonsObject.get("dungeon_types").getAsJsonObject().get("master_catacombs").getAsJsonObject(); + boolean hasPlayedMaster = catacombsMasterObject.has("highest_tier_completed"); + + int highestMasterFloor = 0; + JsonObject completionMasterObj = null; + if (hasPlayedMaster) { + highestMasterFloor = catacombsMasterObject.get("highest_tier_completed").getAsInt(); + completionMasterObj = catacombsMasterObject.get("tier_completions").getAsJsonObject(); + } + String delimiter = DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------"; - ChatComponentText classLevels = new ChatComponentText( - EnumChatFormatting.GOLD + " Selected Class: " + selectedClass + "\n\n" + - EnumChatFormatting.RED + " Catacombs Level: " + catacombs + "\n" + - EnumChatFormatting.YELLOW + " Healer Level: " + healer + "\n" + - EnumChatFormatting.LIGHT_PURPLE + " Mage Level: " + mage + "\n" + - EnumChatFormatting.RED + " Berserk Level: " + berserk + "\n" + - EnumChatFormatting.GREEN + " Archer Level: " + archer + "\n" + - EnumChatFormatting.BLUE + " Tank Level: " + tank + "\n\n" + - EnumChatFormatting.WHITE + " Secrets Found: " + secrets + "\n\n"); + ChatComponentText classLevels = new ChatComponentText(EnumChatFormatting.GOLD + " Selected Class: " + selectedClass + "\n\n" + + EnumChatFormatting.RED + " Catacombs Level: " + catacombs + "\n" + + EnumChatFormatting.YELLOW + " Healer Level: " + healer + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Mage Level: " + mage + "\n" + + EnumChatFormatting.RED + " Berserk Level: " + berserk + "\n" + + EnumChatFormatting.GREEN + " Archer Level: " + archer + "\n" + + EnumChatFormatting.BLUE + " Tank Level: " + tank + "\n\n" + + EnumChatFormatting.WHITE + " Secrets Found: " + secrets + "\n\n"); StringBuilder completionsHoverString = new StringBuilder(); - for (int i = 0; i <= highestFloor; i++) { completionsHoverString + .append(EnumChatFormatting.GOLD) + .append(i == 0 ? "Entrance: " : "Floor " + i + ": ") + .append(EnumChatFormatting.RESET) + .append(completionObj.get(String.valueOf(i)).getAsInt()) + .append(i < highestFloor || hasPlayedMaster ? "\n": ""); + } + for (int i = 1; i <= highestMasterFloor; i++) { + if (completionMasterObj != null && completionMasterObj.has(String.valueOf(i))) { + completionsHoverString .append(EnumChatFormatting.GOLD) - .append(i == 0 ? "Entrance: " : "Floor " + i + ": ") + .append("Master Floor ") + .append(i) + .append(": ") .append(EnumChatFormatting.RESET) - .append(completionObj.get(String.valueOf(i)).getAsInt()) - .append(i < highestFloor ? "\n": ""); + .append(completionMasterObj.get(String.valueOf(i)).getAsInt()) + .append(i < highestMasterFloor ? "\n": ""); + } } - ChatComponentText completions = new ChatComponentText(EnumChatFormatting.GOLD + " Highest Floor Completed: " + highestFloor); - + ChatComponentText completions; + if (hasPlayedMaster) { + completions = new ChatComponentText(EnumChatFormatting.GOLD + " Highest Floor Completed: Master " + highestMasterFloor); + } else { + completions = new ChatComponentText(EnumChatFormatting.GOLD + " Highest Floor Completed: " + highestFloor); + } completions.setChatStyle(completions.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(completionsHoverString.toString())))); - player.addChatMessage( new ChatComponentText(delimiter) .appendText("\n") .appendSibling(classLevels) .appendSibling(completions) .appendText("\n") - .appendSibling(new ChatComponentText(delimiter)) - ); + .appendSibling(new ChatComponentText(delimiter))); }).start(); } } -- cgit From e39dbceda13ee51064c893fe42a2a2856559940b Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Wed, 5 May 2021 18:32:30 -0400 Subject: Add fishing to auto display --- src/main/java/me/Danker/features/AutoDisplay.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/AutoDisplay.java b/src/main/java/me/Danker/features/AutoDisplay.java index 182c0b4..783c428 100644 --- a/src/main/java/me/Danker/features/AutoDisplay.java +++ b/src/main/java/me/Danker/features/AutoDisplay.java @@ -6,6 +6,8 @@ import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.ScoreboardHandler; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -65,6 +67,16 @@ public class AutoDisplay { if (hotbarItem.getDisplayName().contains("Ancestral Spade")) { LootDisplay.display = "mythological"; found = true; + break; + } else if (hotbarItem.getItem() == Items.fishing_rod) { + List lore = hotbarItem.getTooltip(player, mc.gameSettings.advancedItemTooltips); + for (int j = lore.size() - 1; j >= 0; j--) { // reverse + if (lore.get(j).contains("FISHING ROD")) { + LootDisplay.display = "fishing"; + found = true; + break; + } + } } } if (!found) LootDisplay.display = "off"; -- cgit From 1ca7e7a34464af3246b3d8f00c5486a357c7b1bc Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 6 May 2021 16:29:20 -0400 Subject: Add shuffling custom music Also fixed: Custom music no longer continues in dungeons if other custom music isn't enabled. File name ending with .wav.wav now registers. --- README.md | 7 +++ src/main/java/me/Danker/features/CustomMusic.java | 69 ++++++++++++++--------- 2 files changed, 49 insertions(+), 27 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 0e7f8d1..1c67f66 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,13 @@ Discord Server: https://discord.gg/QsEkNQS 3. Enable the custom music in `/dsm`. 4. (Optional) Change the volume of the music with `/dsmmusic volume`. +#### Shuffling +By adding numbers to the end of the file, you can have multiple music files for the same area. One of them will be randomly selected (the same song could play twice in a row). For example: +- dungeon.wav +- dungeon1.wav +- dungeon2.wav +- dungeon99.wav + ### Notes - Slayer tracker for token drops and 20% chance drops uses a 12x12x12 bounding box centered on the player to detect the drops. If you are out of the range of the item drop, it will not count on the tracker. - API commands may take a while depending on your internet connection. The API may also go down. diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java index 342727b..5080821 100644 --- a/src/main/java/me/Danker/features/CustomMusic.java +++ b/src/main/java/me/Danker/features/CustomMusic.java @@ -20,7 +20,9 @@ import net.minecraftforge.fml.common.gameevent.TickEvent; import javax.sound.sampled.*; import java.io.File; import java.io.IOException; +import java.util.ArrayList; import java.util.List; +import java.util.Random; public class CustomMusic { @@ -47,7 +49,7 @@ public class CustomMusic { EntityPlayerSP player = mc.thePlayer; World world = mc.theWorld; if (DankersSkyblockMod.tickAmount % 10 == 0) { - if (ToggleCommand.dungeonBossMusic && Utils.inDungeons && world != null && player != null) { + if (Utils.inDungeons && world != null && player != null) { prevInDungeonBossRoom = inDungeonBossRoom; List scoreboard = ScoreboardHandler.getSidebarLines(); if (scoreboard.size() > 2) { @@ -64,7 +66,8 @@ public class CustomMusic { inDungeonBossRoom = true; if (!prevInDungeonBossRoom) { - dungeonboss.start(); + bloodroom.stop(); + if (ToggleCommand.dungeonBossMusic) dungeonboss.start(); } } else { inDungeonBossRoom = false; @@ -91,8 +94,9 @@ public class CustomMusic { dungeonboss.stop(); bloodroom.stop(); dungeon.stop(); - } else if (ToggleCommand.bloodRoomMusic && message.contains("The BLOOD DOOR has been opened!")) { - bloodroom.start(); + } else if (message.contains("The BLOOD DOOR has been opened!")) { + dungeon.stop(); + if (ToggleCommand.bloodRoomMusic) bloodroom.start(); } } } @@ -111,17 +115,9 @@ public class CustomMusic { reset(); - File dungeonBossFile = new File(directory + "/dungeonboss.wav"); - System.out.println("dungeonboss.wav exists?: " + dungeonBossFile.exists()); - dungeonboss = new Song(dungeonBossFile, dungeonbossVolume); - - File bloodRoomFile = new File(directory + "/bloodroom.wav"); - System.out.println("bloodroom.wav exists?: " + bloodRoomFile.exists()); - bloodroom = new Song(bloodRoomFile, bloodroomVolume); - - File dungeonFile = new File(directory + "/dungeon.wav"); - System.out.println("dungeon.wav exists?: " + dungeonFile.exists()); - dungeon = new Song(dungeonFile, dungeonVolume); + dungeonboss = new Song(directory, "dungeonboss", dungeonbossVolume); + bloodroom = new Song(directory, "bloodroom", bloodroomVolume); + dungeon = new Song(directory, "dungeon", dungeonVolume); } public static void reset() { @@ -133,20 +129,33 @@ public class CustomMusic { public static class Song { public Clip music; + private final List playlist = new ArrayList<>(); + + public Song(File directory, String songName, int volume) throws IOException, UnsupportedAudioFileException, LineUnavailableException { + File[] files = directory.listFiles(); + if (files != null) { + for (File file : files) { + if (!file.isDirectory() && file.getName().matches(songName + "\\d*(?:\\.wav)?\\.wav")) { // .wav.wav moment + Clip music = AudioSystem.getClip(); + AudioInputStream ais = AudioSystem.getAudioInputStream(file); + music.open(ais); + playlist.add(music); + System.out.println("Added " + file.getName() + " to " + songName + " playlist."); + } + } + } - public Song(File file, int volume) throws IOException, UnsupportedAudioFileException, LineUnavailableException { - if (file.exists()) { - music = AudioSystem.getClip(); - AudioInputStream ais = AudioSystem.getAudioInputStream(file); - music.open(ais); + setVolume(volume); - setVolume(volume); + if (playlist.size() > 0) { + music = playlist.get(0); } } public void start() { reset(); if (music != null) { + shuffle(); cancelNotes = true; music.setMicrosecondPosition(0); music.start(); @@ -159,21 +168,27 @@ public class CustomMusic { if (music != null) music.stop(); } + public void shuffle() { + if (playlist.size() > 0) music = playlist.get(new Random().nextInt(playlist.size())); + } + public boolean setVolume(int volume) { - EntityPlayer player = Minecraft.getMinecraft().thePlayer; - if (music == null) return false; + if (playlist.size() < 1) return false; if (volume <= 0 || volume > 100) { + EntityPlayer player = Minecraft.getMinecraft().thePlayer; if (player != null) player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Volume can only be set between 0% and 100%.")); return false; } float decibels = (float) (20 * Math.log(volume / 100.0)); - FloatControl control = (FloatControl) music.getControl(FloatControl.Type.MASTER_GAIN); - if (decibels <= control.getMinimum() || decibels >= control.getMaximum()) { - return false; + for (Clip music : playlist) { + FloatControl control = (FloatControl) music.getControl(FloatControl.Type.MASTER_GAIN); + if (decibels <= control.getMinimum() || decibels >= control.getMaximum()) { + return false; + } + control.setValue(decibels); } - control.setValue(decibels); return true; } -- cgit From bcf86f8f76994cd31cd8ebecde855c4cfc5fd773 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 8 May 2021 23:55:28 -0400 Subject: Add option to hides lines in creeper solver --- README.md | 2 +- .../java/me/Danker/commands/DankerGuiCommand.java | 1 + .../java/me/Danker/commands/ToggleCommand.java | 11 ++++++++-- .../features/puzzlesolvers/CreeperSolver.java | 3 ++- src/main/java/me/Danker/gui/PuzzleSolversGui.java | 25 ++++++++++++++-------- .../java/me/Danker/handlers/ConfigHandler.java | 1 + 6 files changed, 30 insertions(+), 13 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 1c67f66..d737522 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Discord Server: https://discord.gg/QsEkNQS ## Commands - /dhelp - Returns this message in-game. - /dsm - Opens the GUI for Danker's Skyblock Mod. -- /toggle - Toggles features. /toggle list returns values of every toggle. +- /toggle - Toggles features. /toggle list returns values of every toggle. - /setkey - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. - /loot [winter/festival/spooky/f(1-7)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index a92cb80..edec93f 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -74,6 +74,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[oruopuzzle][").append(ToggleCommand.oruoToggled).append("]\n"); debug.append("[blazepuzzle][").append(ToggleCommand.blazeToggled).append("]\n"); debug.append("[creeperpuzzle][").append(ToggleCommand.creeperToggled).append("]\n"); + debug.append("[creeperlines][").append(ToggleCommand.creeperLinesToggled).append("]\n"); debug.append("[waterpuzzle][").append(ToggleCommand.waterToggled).append("]\n"); debug.append("[tictactoepuzzle][").append(ToggleCommand.ticTacToeToggled).append("]\n"); debug.append("[boulderpuzzle][").append(ToggleCommand.boulderToggled).append("]\n"); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 1f2fe5c..11b15f3 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -61,6 +61,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean oruoToggled; public static boolean blazeToggled; public static boolean creeperToggled; + public static boolean creeperLinesToggled; public static boolean waterToggled; public static boolean ticTacToeToggled; public static boolean boulderToggled; @@ -94,7 +95,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "skill50display/outlinetext/midasstaffmessages/implosionmessages/healmessages/cooldownmessages/" + "manamessages/killcombomessages/caketimer/lowhealthnotify/lividsolver/stopsalvagestarred/" + "notifyslayerslain/necronnotifications/bonzotimer/threemanpuzzle/oruopuzzle/blazepuzzle/" + - "creeperpuzzle/waterpuzzle/tictactoepuzzle/boulderpuzzle/silverfishpuzzle/icewalkpuzzle/watchermessage/" + + "creeperpuzzle/creeperlines/waterpuzzle/tictactoepuzzle/boulderpuzzle/silverfishpuzzle/icewalkpuzzle/watchermessage/" + "startswithterminal/selectallterminal/clickinorderterminal/" + "ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/" + "melodytooltips/highlightslayers/highlightarachne/highlightskeletonmasters/teammatesinradius/" + @@ -121,7 +122,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "killcombomessages", "caketimer", "lowhealthnotify", "autoskilltracker", "lividsolver", "stopsalvagestarred", "notifyslayerslain", "necronnotifications", "bonzotimer", "threemanpuzzle", "oruopuzzle", "blazepuzzle", - "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "boulderpuzzle", + "creeperpuzzle", "creeperlines", "waterpuzzle", "tictactoepuzzle", "boulderpuzzle", "silverfishpuzzle", "icewalkpuzzle", "watchermessage", "startswithterminal", "selectallterminal", "clickinorderterminal", "ultrasequencer", "chronomatron", "superpairs", @@ -318,6 +319,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "CreeperPuzzle", creeperToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Creeper puzzle solver has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + creeperToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "creeperlines": + creeperLinesToggled = !creeperLinesToggled; + ConfigHandler.writeBooleanConfig("toggles", "CreeperLines", creeperLinesToggled); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Creeper lines has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + creeperLinesToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "waterpuzzle": waterToggled = !waterToggled; ConfigHandler.writeBooleanConfig("toggles", "WaterPuzzle", waterToggled); @@ -476,6 +482,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Oruo trivia solver: " + DankersSkyblockMod.VALUE_COLOUR + oruoToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Blaze puzzle solver: " + DankersSkyblockMod.VALUE_COLOUR + blazeToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Creeper puzzle solver: " + DankersSkyblockMod.VALUE_COLOUR + creeperToggled + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Creeper lines: " + DankersSkyblockMod.VALUE_COLOUR + creeperLinesToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Water puzzle solver: " + DankersSkyblockMod.VALUE_COLOUR + waterToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Tic tac toe puzzle solver: " + DankersSkyblockMod.VALUE_COLOUR + ticTacToeToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Boulder puzzle solver: " + DankersSkyblockMod.VALUE_COLOUR + boulderToggled + "\n" + diff --git a/src/main/java/me/Danker/features/puzzlesolvers/CreeperSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/CreeperSolver.java index cd6bcf4..eb9e268 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/CreeperSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/CreeperSolver.java @@ -81,7 +81,8 @@ public class CreeperSolver { Vec3 pos1 = creeperLines.get(i)[0]; Vec3 pos2 = creeperLines.get(i)[1]; int colour = CREEPER_COLOURS[i % 10]; - Utils.draw3DLine(pos1, pos2, colour, 2, true, event.partialTicks); + + if (ToggleCommand.creeperLinesToggled) Utils.draw3DLine(pos1, pos2, colour, 2, true, event.partialTicks); Utils.drawFilled3DBox(new AxisAlignedBB(pos1.xCoord - 0.51, pos1.yCoord - 0.51, pos1.zCoord - 0.51, pos1.xCoord + 0.51, pos1.yCoord + 0.51, pos1.zCoord + 0.51), colour, true, true, event.partialTicks); Utils.drawFilled3DBox(new AxisAlignedBB(pos2.xCoord - 0.51, pos2.yCoord - 0.51, pos2.zCoord - 0.51, pos2.xCoord + 0.51, pos2.yCoord + 0.51, pos2.zCoord + 0.51), colour, true, true, event.partialTicks); } diff --git a/src/main/java/me/Danker/gui/PuzzleSolversGui.java b/src/main/java/me/Danker/gui/PuzzleSolversGui.java index 70cd982..f671f33 100644 --- a/src/main/java/me/Danker/gui/PuzzleSolversGui.java +++ b/src/main/java/me/Danker/gui/PuzzleSolversGui.java @@ -20,6 +20,7 @@ public class PuzzleSolversGui extends GuiScreen { private GuiButton trivia; private GuiButton blaze; private GuiButton creeper; + private GuiButton creeperLines; private GuiButton water; private GuiButton ticTacToe; private GuiButton boulder; @@ -55,15 +56,16 @@ public class PuzzleSolversGui extends GuiScreen { trivia = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Trivia Solver: " + Utils.getColouredBoolean(ToggleCommand.oruoToggled)); blaze = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Blaze Solver: " + Utils.getColouredBoolean(ToggleCommand.blazeToggled)); creeper = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Creeper Solver: " + Utils.getColouredBoolean(ToggleCommand.creeperToggled)); - water = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Water Solver: " + Utils.getColouredBoolean(ToggleCommand.waterToggled)); - ticTacToe = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Tic Tac Toe Solver: " + Utils.getColouredBoolean(ToggleCommand.ticTacToeToggled)); - boulder = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Boulder Solver: " + Utils.getColouredBoolean(ToggleCommand.boulderToggled)); + creeperLines = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Lines In Creeper Solver: " + Utils.getColouredBoolean(ToggleCommand.creeperLinesToggled)); + water = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Water Solver: " + Utils.getColouredBoolean(ToggleCommand.waterToggled)); + ticTacToe = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Tic Tac Toe Solver: " + Utils.getColouredBoolean(ToggleCommand.ticTacToeToggled)); // Page 2 - silverfish = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Silverfish Solver: " + Utils.getColouredBoolean(ToggleCommand.silverfishToggled)); - iceWalk = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Ice Walk Solver: " + Utils.getColouredBoolean(ToggleCommand.iceWalkToggled)); - startsWith = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Starts With Letter Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.startsWithToggled)); - selectAll = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Select All Color Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.selectAllToggled)); - clickOrder = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Click in Order Terminal Helper: " + Utils.getColouredBoolean(ToggleCommand.clickInOrderToggled)); + boulder = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Boulder Solver: " + Utils.getColouredBoolean(ToggleCommand.boulderToggled)); + silverfish = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Silverfish Solver: " + Utils.getColouredBoolean(ToggleCommand.silverfishToggled)); + iceWalk = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Ice Walk Solver: " + Utils.getColouredBoolean(ToggleCommand.iceWalkToggled)); + startsWith = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Starts With Letter Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.startsWithToggled)); + selectAll = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Select All Color Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.selectAllToggled)); + clickOrder = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Click in Order Terminal Helper: " + Utils.getColouredBoolean(ToggleCommand.clickInOrderToggled)); switch (page) { case 1: @@ -71,12 +73,13 @@ public class PuzzleSolversGui extends GuiScreen { this.buttonList.add(trivia); this.buttonList.add(blaze); this.buttonList.add(creeper); + this.buttonList.add(creeperLines); this.buttonList.add(water); this.buttonList.add(ticTacToe); - this.buttonList.add(boulder); this.buttonList.add(nextPage); break; case 2: + this.buttonList.add(boulder); this.buttonList.add(silverfish); this.buttonList.add(iceWalk); this.buttonList.add(startsWith); @@ -118,6 +121,10 @@ public class PuzzleSolversGui extends GuiScreen { ToggleCommand.creeperToggled = !ToggleCommand.creeperToggled; ConfigHandler.writeBooleanConfig("toggles", "CreeperPuzzle", ToggleCommand.creeperToggled); creeper.displayString = "Creeper Solver: " + Utils.getColouredBoolean(ToggleCommand.creeperToggled); + } else if (button == creeperLines) { + ToggleCommand.creeperLinesToggled = !ToggleCommand.creeperLinesToggled; + ConfigHandler.writeBooleanConfig("toggles", "CreeperLines", ToggleCommand.creeperLinesToggled); + creeperLines.displayString = "Lines In Creeper Solver: " + Utils.getColouredBoolean(ToggleCommand.creeperLinesToggled); } else if (button == water) { ToggleCommand.waterToggled = !ToggleCommand.waterToggled; ConfigHandler.writeBooleanConfig("toggles", "WaterPuzzle", ToggleCommand.waterToggled); diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 6d32f99..250c1f2 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -239,6 +239,7 @@ public class ConfigHandler { ToggleCommand.oruoToggled = initBoolean("toggles", "OruoPuzzle", false); ToggleCommand.blazeToggled = initBoolean("toggles", "BlazePuzzle", false); ToggleCommand.creeperToggled = initBoolean("toggles", "CreeperPuzzle", false); + ToggleCommand.creeperLinesToggled = initBoolean("toggles", "CreeperLines", true); ToggleCommand.waterToggled = initBoolean("toggles", "WaterPuzzle", false); ToggleCommand.ticTacToeToggled = initBoolean("toggles", "TicTacToePuzzle", false); ToggleCommand.boulderToggled = initBoolean("toggles", "BoulderPuzzle", false); -- cgit From dda757a8520d507cb0585408a68ad5bc216e6625 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Mon, 10 May 2021 19:07:28 +0200 Subject: implemented the changes requested by Danker --- .../java/me/Danker/commands/DungeonsCommand.java | 152 +++++++++++++++++++++ src/main/java/me/Danker/commands/warp/Crypt.java | 5 +- .../java/me/Danker/commands/warp/DarkAuction.java | 5 +- src/main/java/me/Danker/commands/warp/Dragon.java | 5 +- .../java/me/Danker/commands/warp/DungeonHub.java | 5 +- .../java/me/Danker/commands/warp/HowlingCave.java | 5 +- src/main/java/me/Danker/commands/warp/Magma.java | 5 +- .../java/me/Danker/commands/warp/SpidersNest.java | 5 +- .../me/Danker/features/HighlightCommissions.java | 4 +- .../java/me/Danker/handlers/ConfigHandler.java | 1 + 10 files changed, 163 insertions(+), 29 deletions(-) create mode 100644 src/main/java/me/Danker/commands/DungeonsCommand.java (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/DungeonsCommand.java b/src/main/java/me/Danker/commands/DungeonsCommand.java new file mode 100644 index 0000000..9924a9d --- /dev/null +++ b/src/main/java/me/Danker/commands/DungeonsCommand.java @@ -0,0 +1,152 @@ +package me.Danker.commands; + +import com.google.gson.JsonObject; +import me.Danker.DankersSkyblockMod; +import me.Danker.handlers.APIHandler; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.Utils; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.event.HoverEvent; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +import java.util.List; + +public class DungeonsCommand extends CommandBase { + + @Override + public String getCommandName() { + return "dungeons"; + } + + @Override + public String getCommandUsage(ICommandSender arg0) { + return "/" + getCommandName() + " [name]"; + } + + public static String usage(ICommandSender arg0) { + return new DungeonsCommand().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + if (args.length == 1) { + return Utils.getMatchingPlayers(args[0]); + } + return null; + } + + @Override + public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { + // MULTI THREAD DRIFTING + new Thread(() -> { + EntityPlayer player = (EntityPlayer) arg0; + + // Check key + String key = ConfigHandler.getString("api", "APIKey"); + if (key.equals("")) { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "API key not set. Use /setkey.")); + } + + // Get UUID for Hypixel API requests + String username; + String uuid; + if (arg1.length == 0) { + username = player.getName(); + uuid = player.getUniqueID().toString().replaceAll("[\\-]", ""); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking dungeon stats of " + DankersSkyblockMod.SECONDARY_COLOUR + username)); + } else { + username = arg1[0]; + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking dungeon stats of " + DankersSkyblockMod.SECONDARY_COLOUR + username)); + uuid = APIHandler.getUUID(username); + } + + // Find stats of latest profile + String latestProfile = APIHandler.getLatestProfileID(uuid, key); + if (latestProfile == null) return; + + String profileURL = "https://api.hypixel.net/skyblock/profile?profile=" + latestProfile + "&key=" + key; + System.out.println("Fetching profile..."); + JsonObject profileResponse = APIHandler.getResponse(profileURL); + if (!profileResponse.get("success").getAsBoolean()) { + String reason = profileResponse.get("cause").getAsString(); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); + return; + } + + String playerURL = "https://api.hypixel.net/player?uuid=" + uuid + "&key=" + key; + System.out.println("Fetching player data..."); + JsonObject playerResponse = APIHandler.getResponse(playerURL); + if(!playerResponse.get("success").getAsBoolean()){ + String reason = playerResponse.get("cause").getAsString(); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "This player has not played on Hypixel.")); + } + + System.out.println("Fetching dungeon stats..."); + JsonObject dungeonsObject = profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject().get("dungeons").getAsJsonObject(); + if (!dungeonsObject.get("dungeon_types").getAsJsonObject().get("catacombs").getAsJsonObject().has("experience")) { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "This player has not played dungeons.")); + return; + } + + JsonObject catacombsObject = dungeonsObject.get("dungeon_types").getAsJsonObject().get("catacombs").getAsJsonObject(); + double catacombs = Utils.xpToDungeonsLevel(catacombsObject.get("experience").getAsDouble()); + double healer = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("healer").getAsJsonObject().get("experience").getAsDouble()); + double mage = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("mage").getAsJsonObject().get("experience").getAsDouble()); + double berserk = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("berserk").getAsJsonObject().get("experience").getAsDouble()); + double archer = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("archer").getAsJsonObject().get("experience").getAsDouble()); + double tank = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("tank").getAsJsonObject().get("experience").getAsDouble()); + String selectedClass = Utils.capitalizeString(dungeonsObject.get("selected_dungeon_class").getAsString()); + int secrets = playerResponse.get("player").getAsJsonObject().get("achievements").getAsJsonObject().get("skyblock_treasure_hunter").getAsInt(); + + int highestFloor = catacombsObject.get("highest_tier_completed").getAsInt(); + JsonObject completionObj = catacombsObject.get("tier_completions").getAsJsonObject(); + + String delimiter = DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------"; + + ChatComponentText classLevels = new ChatComponentText( + EnumChatFormatting.GOLD + " Selected Class: " + selectedClass + "\n\n" + + EnumChatFormatting.RED + " Catacombs Level: " + catacombs + "\n" + + EnumChatFormatting.YELLOW + " Healer Level: " + healer + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Mage Level: " + mage + "\n" + + EnumChatFormatting.RED + " Berserk Level: " + berserk + "\n" + + EnumChatFormatting.GREEN + " Archer Level: " + archer + "\n" + + EnumChatFormatting.BLUE + " Tank Level: " + tank + "\n\n" + + EnumChatFormatting.WHITE + " Secrets Found: " + secrets + "\n\n"); + + StringBuilder completionsHoverString = new StringBuilder(); + + for (int i = 0; i <= highestFloor; i++) { + completionsHoverString + .append(EnumChatFormatting.GOLD) + .append(i == 0 ? "Entrance: " : "Floor " + i + ": ") + .append(EnumChatFormatting.RESET) + .append(completionObj.get(String.valueOf(i)).getAsInt()) + .append(i < highestFloor ? "\n": ""); + } + + ChatComponentText completions = new ChatComponentText(EnumChatFormatting.GOLD + " Highest Floor Completed: " + highestFloor); + + completions.setChatStyle(completions.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(completionsHoverString.toString())))); + + + player.addChatMessage( + new ChatComponentText(delimiter) + .appendText("\n") + .appendSibling(classLevels) + .appendSibling(completions) + .appendText("\n") + .appendSibling(new ChatComponentText(delimiter)) + ); + }).start(); + } +} \ No newline at end of file diff --git a/src/main/java/me/Danker/commands/warp/Crypt.java b/src/main/java/me/Danker/commands/warp/Crypt.java index 88f286b..463330a 100644 --- a/src/main/java/me/Danker/commands/warp/Crypt.java +++ b/src/main/java/me/Danker/commands/warp/Crypt.java @@ -39,9 +39,6 @@ public class Crypt extends CommandBase { public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; EntityPlayer player = ((EntityPlayer) sender); - // MULTI THREAD DRIFTING - new Thread(() -> { - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp crypt"); - }).start(); + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp crypt"); } } diff --git a/src/main/java/me/Danker/commands/warp/DarkAuction.java b/src/main/java/me/Danker/commands/warp/DarkAuction.java index 40218d8..88655f1 100644 --- a/src/main/java/me/Danker/commands/warp/DarkAuction.java +++ b/src/main/java/me/Danker/commands/warp/DarkAuction.java @@ -40,9 +40,6 @@ public class DarkAuction extends CommandBase { public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; EntityPlayer player = ((EntityPlayer) sender); - // MULTI THREAD DRIFTING - new Thread(() -> { - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp da"); - }).start(); + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp da"); } } diff --git a/src/main/java/me/Danker/commands/warp/Dragon.java b/src/main/java/me/Danker/commands/warp/Dragon.java index f36bef1..05be968 100644 --- a/src/main/java/me/Danker/commands/warp/Dragon.java +++ b/src/main/java/me/Danker/commands/warp/Dragon.java @@ -40,9 +40,6 @@ public class Dragon extends CommandBase { public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; EntityPlayer player = ((EntityPlayer) sender); - // MULTI THREAD DRIFTING - new Thread(() -> { - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp drag"); - }).start(); + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp drag"); } } diff --git a/src/main/java/me/Danker/commands/warp/DungeonHub.java b/src/main/java/me/Danker/commands/warp/DungeonHub.java index cc1c082..201e764 100644 --- a/src/main/java/me/Danker/commands/warp/DungeonHub.java +++ b/src/main/java/me/Danker/commands/warp/DungeonHub.java @@ -40,9 +40,6 @@ public class DungeonHub extends CommandBase { public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; EntityPlayer player = ((EntityPlayer) sender); - // MULTI THREAD DRIFTING - new Thread(() -> { - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp dungeon_hub"); - }).start(); + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp dungeon_hub"); } } diff --git a/src/main/java/me/Danker/commands/warp/HowlingCave.java b/src/main/java/me/Danker/commands/warp/HowlingCave.java index 4cdcf97..58e4ce7 100644 --- a/src/main/java/me/Danker/commands/warp/HowlingCave.java +++ b/src/main/java/me/Danker/commands/warp/HowlingCave.java @@ -39,9 +39,6 @@ public class HowlingCave extends CommandBase { public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; EntityPlayer player = ((EntityPlayer) sender); - // MULTI THREAD DRIFTING - new Thread(() -> { - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp howl"); - }).start(); + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp howl"); } } diff --git a/src/main/java/me/Danker/commands/warp/Magma.java b/src/main/java/me/Danker/commands/warp/Magma.java index 96ead00..5e747c3 100644 --- a/src/main/java/me/Danker/commands/warp/Magma.java +++ b/src/main/java/me/Danker/commands/warp/Magma.java @@ -39,9 +39,6 @@ public class Magma extends CommandBase { public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; EntityPlayer player = ((EntityPlayer) sender); - // MULTI THREAD DRIFTING - new Thread(() -> { - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp magma"); - }).start(); + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp magma"); } } diff --git a/src/main/java/me/Danker/commands/warp/SpidersNest.java b/src/main/java/me/Danker/commands/warp/SpidersNest.java index 2f091ad..cf80df8 100644 --- a/src/main/java/me/Danker/commands/warp/SpidersNest.java +++ b/src/main/java/me/Danker/commands/warp/SpidersNest.java @@ -39,9 +39,6 @@ public class SpidersNest extends CommandBase { public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; EntityPlayer player = ((EntityPlayer) sender); - // MULTI THREAD DRIFTING - new Thread(() -> { - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp nest"); - }).start(); + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp nest"); } } diff --git a/src/main/java/me/Danker/features/HighlightCommissions.java b/src/main/java/me/Danker/features/HighlightCommissions.java index ae262c3..f59951a 100644 --- a/src/main/java/me/Danker/features/HighlightCommissions.java +++ b/src/main/java/me/Danker/features/HighlightCommissions.java @@ -13,6 +13,8 @@ import java.util.List; public class HighlightCommissions { + public static int HIGHLIGHT_COLOUR; + @SubscribeEvent public void onGuiRender(GuiChestBackgroundDrawnEvent event) { if(!Utils.inSkyblock) return; @@ -25,7 +27,7 @@ public class HighlightCommissions { if (slot.getStack().getItem() instanceof ItemWritableBook) { for (String line : Utils.getItemLore(slot.getStack())) { if (line.contains("COMPLETED")) { - Utils.drawOnSlot(event.chestSize, slot.xDisplayPosition, slot.yDisplayPosition, 0x51FF51 + 0xD7000000); + Utils.drawOnSlot(event.chestSize, slot.xDisplayPosition, slot.yDisplayPosition, HIGHLIGHT_COLOUR + 0xD7000000); break; } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index ecd15f3..ce0df16 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -525,6 +525,7 @@ public class ConfigHandler { BoulderSolver.BOULDER_ARROW_COLOUR = initInt("colors", "boulderArrow", 0x006000); SilverfishSolver.SILVERFISH_LINE_COLOUR = initInt("colors", "silverfishLine", 0x40FF40); IceWalkSolver.ICE_WALK_LINE_COLOUR = initInt("colors", "iceWalkLine", 0x40FF40); + HighlightCommissions.HIGHLIGHT_COLOUR = initInt("colors", "highlight_colour", 0x51FF51); // Commands if (!hasKey("commands", "reparty")) writeBooleanConfig("commands", "reparty", false); -- cgit From c8aff00703e459542c9e10d0d208bb40fed47c22 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Mon, 10 May 2021 19:10:30 +0200 Subject: uncommented the Skyblock check --- src/main/java/me/Danker/DankersSkyblockMod.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index fe31d96..f7f488c 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -404,7 +404,7 @@ public class DankersSkyblockMod { @SubscribeEvent public void onGuiRender(GuiScreenEvent.BackgroundDrawnEvent event) { - //if (!Utils.inSkyblock) return; + if (!Utils.inSkyblock) return; if (event.gui instanceof GuiChest) { GuiChest inventory = (GuiChest) event.gui; Container containerChest = inventory.inventorySlots; -- cgit From fb830a18c63b00f96ac0fe0aa29099dfe308aa67 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Tue, 11 May 2021 16:17:12 +0200 Subject: removed unnecessary player --- src/main/java/me/Danker/commands/warp/Crypt.java | 1 - src/main/java/me/Danker/commands/warp/DarkAuction.java | 1 - src/main/java/me/Danker/commands/warp/Dragon.java | 1 - src/main/java/me/Danker/commands/warp/DungeonHub.java | 1 - src/main/java/me/Danker/commands/warp/HowlingCave.java | 1 - src/main/java/me/Danker/commands/warp/Magma.java | 1 - src/main/java/me/Danker/commands/warp/SpidersNest.java | 1 - 7 files changed, 7 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/warp/Crypt.java b/src/main/java/me/Danker/commands/warp/Crypt.java index 463330a..fd91790 100644 --- a/src/main/java/me/Danker/commands/warp/Crypt.java +++ b/src/main/java/me/Danker/commands/warp/Crypt.java @@ -38,7 +38,6 @@ public class Crypt extends CommandBase { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; - EntityPlayer player = ((EntityPlayer) sender); Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp crypt"); } } diff --git a/src/main/java/me/Danker/commands/warp/DarkAuction.java b/src/main/java/me/Danker/commands/warp/DarkAuction.java index 88655f1..d2cffe9 100644 --- a/src/main/java/me/Danker/commands/warp/DarkAuction.java +++ b/src/main/java/me/Danker/commands/warp/DarkAuction.java @@ -39,7 +39,6 @@ public class DarkAuction extends CommandBase { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; - EntityPlayer player = ((EntityPlayer) sender); Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp da"); } } diff --git a/src/main/java/me/Danker/commands/warp/Dragon.java b/src/main/java/me/Danker/commands/warp/Dragon.java index 05be968..a0cf9ab 100644 --- a/src/main/java/me/Danker/commands/warp/Dragon.java +++ b/src/main/java/me/Danker/commands/warp/Dragon.java @@ -39,7 +39,6 @@ public class Dragon extends CommandBase { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; - EntityPlayer player = ((EntityPlayer) sender); Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp drag"); } } diff --git a/src/main/java/me/Danker/commands/warp/DungeonHub.java b/src/main/java/me/Danker/commands/warp/DungeonHub.java index 201e764..3031fec 100644 --- a/src/main/java/me/Danker/commands/warp/DungeonHub.java +++ b/src/main/java/me/Danker/commands/warp/DungeonHub.java @@ -39,7 +39,6 @@ public class DungeonHub extends CommandBase { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; - EntityPlayer player = ((EntityPlayer) sender); Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp dungeon_hub"); } } diff --git a/src/main/java/me/Danker/commands/warp/HowlingCave.java b/src/main/java/me/Danker/commands/warp/HowlingCave.java index 58e4ce7..1d45ada 100644 --- a/src/main/java/me/Danker/commands/warp/HowlingCave.java +++ b/src/main/java/me/Danker/commands/warp/HowlingCave.java @@ -38,7 +38,6 @@ public class HowlingCave extends CommandBase { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; - EntityPlayer player = ((EntityPlayer) sender); Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp howl"); } } diff --git a/src/main/java/me/Danker/commands/warp/Magma.java b/src/main/java/me/Danker/commands/warp/Magma.java index 5e747c3..4f7459d 100644 --- a/src/main/java/me/Danker/commands/warp/Magma.java +++ b/src/main/java/me/Danker/commands/warp/Magma.java @@ -38,7 +38,6 @@ public class Magma extends CommandBase { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; - EntityPlayer player = ((EntityPlayer) sender); Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp magma"); } } diff --git a/src/main/java/me/Danker/commands/warp/SpidersNest.java b/src/main/java/me/Danker/commands/warp/SpidersNest.java index cf80df8..ecea275 100644 --- a/src/main/java/me/Danker/commands/warp/SpidersNest.java +++ b/src/main/java/me/Danker/commands/warp/SpidersNest.java @@ -38,7 +38,6 @@ public class SpidersNest extends CommandBase { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!Utils.inSkyblock) return; - EntityPlayer player = ((EntityPlayer) sender); Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp nest"); } } -- cgit From b1c294e151361f11c4449656a3400cff65e7edf7 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Sat, 15 May 2021 15:42:48 +0200 Subject: fine i removed it --- src/main/java/me/Danker/DankersSkyblockMod.java | 1 - .../java/me/Danker/commands/SetAngleCommand.java | 40 ---------------------- 2 files changed, 41 deletions(-) delete mode 100644 src/main/java/me/Danker/commands/SetAngleCommand.java (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index f7f488c..d26736b 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -189,7 +189,6 @@ public class DankersSkyblockMod { ClientCommandHandler.instance.registerCommand(new SkyblockPlayersCommand()); ClientCommandHandler.instance.registerCommand(new SlayerCommand()); ClientCommandHandler.instance.registerCommand(new ToggleCommand()); - ClientCommandHandler.instance.registerCommand(new SetAngleCommand()); ClientCommandHandler.instance.registerCommand(new Crypt()); ClientCommandHandler.instance.registerCommand(new DarkAuction()); diff --git a/src/main/java/me/Danker/commands/SetAngleCommand.java b/src/main/java/me/Danker/commands/SetAngleCommand.java deleted file mode 100644 index 6061621..0000000 --- a/src/main/java/me/Danker/commands/SetAngleCommand.java +++ /dev/null @@ -1,40 +0,0 @@ -package me.Danker.commands; - -import me.Danker.DankersSkyblockMod; -import net.minecraft.client.Minecraft; -import net.minecraft.command.CommandBase; -import net.minecraft.command.CommandException; -import net.minecraft.command.ICommandSender; -import net.minecraft.util.ChatComponentText; - - -public class SetAngleCommand extends CommandBase { - - @Override - public String getCommandName() { - return "setangle"; - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "/" + getCommandName() + " [yaw] [pitch]"; - } - - public static String usage(ICommandSender arg0) { - return new SetAngleCommand().getCommandUsage(arg0); - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public void processCommand(ICommandSender sender, String[] args) throws CommandException { - if (args.length < 2) return; - - Minecraft.getMinecraft().thePlayer.rotationPitch = Float.parseFloat(args[1]); - Minecraft.getMinecraft().thePlayer.rotationYaw = Float.parseFloat(args[0]); - sender.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Set your rotation to yaw=" + DankersSkyblockMod.SECONDARY_COLOUR + args[0] + DankersSkyblockMod.MAIN_COLOUR + ", pitch=" + DankersSkyblockMod.SECONDARY_COLOUR +args[1])); - } -} -- cgit From b443b1840760300d6a58951829911025b57f1bfb Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Mon, 17 May 2021 15:24:34 +0200 Subject: fixed a bug --- src/main/java/me/Danker/commands/DHelpCommand.java | 1 - 1 file changed, 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index f12d0ee..efbf52d 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -65,7 +65,6 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + HowlingCave.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Howling Cave in the Park. \n" + EnumChatFormatting.GOLD + Magma.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Magma Fields in the Blazing Fortress. \n" + EnumChatFormatting.GOLD + SpidersNest.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Top of the Spider's Nest in the Spider's Den. \n" + - EnumChatFormatting.GOLD + SetAngleCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Sets your yaw and pitch. \n" + EnumChatFormatting.GREEN + " Open Maddox Menu" + EnumChatFormatting.AQUA + " - M by default.\n" + EnumChatFormatting.GREEN + " Start/Stop Skill Tracker" + EnumChatFormatting.AQUA + " - Numpad 5 by default.\n")); } -- cgit From 848579b82d0d8edcde3e8e391a86a926a85b5a82 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Mon, 17 May 2021 15:47:13 -0400 Subject: Update bag of cash detection --- src/main/java/me/Danker/features/loot/LootTracker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/loot/LootTracker.java b/src/main/java/me/Danker/features/loot/LootTracker.java index 7919366..d26c104 100644 --- a/src/main/java/me/Danker/features/loot/LootTracker.java +++ b/src/main/java/me/Danker/features/loot/LootTracker.java @@ -1017,7 +1017,7 @@ public class LootTracker { ghostlyBootsSession++; ConfigHandler.writeIntConfig("ghosts", "ghostlyBoots", ghostlyBoots); } - if (message.contains("Bag of Cash")) { + if (message.contains("The ghost's death materialized ")) { bagOfCashs++; bagOfCashSession++; ConfigHandler.writeIntConfig("ghosts", "bagOfCash", bagOfCashs); -- cgit From e4ad455ed428eaaf79a005943cc1305b5de692d3 Mon Sep 17 00:00:00 2001 From: TotalledZebra <50877472+TotalledZebra@users.noreply.github.com> Date: Tue, 18 May 2021 01:33:11 +0300 Subject: Blaze solver change Suggested on Discord, the quality might be poor but it has worked on well over a hundred Dungeon runs so far... --- .../Danker/features/puzzlesolvers/BlazeSolver.java | 74 ++++++++++++++++++---- 1 file changed, 60 insertions(+), 14 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/puzzlesolvers/BlazeSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/BlazeSolver.java index 0910fc7..a2e3395 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/BlazeSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/BlazeSolver.java @@ -3,8 +3,11 @@ package me.Danker.features.puzzlesolvers; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; import me.Danker.utils.Utils; +import net.minecraft.block.Block; import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumChatFormatting; @@ -21,11 +24,15 @@ public class BlazeSolver { static Entity highestBlaze = null; static Entity lowestBlaze = null; + static boolean higherToLower = false; + static boolean foundChest = false; public static int LOWEST_BLAZE_COLOUR; public static int HIGHEST_BLAZE_COLOUR; @SubscribeEvent public void onWorldChange(WorldEvent.Load event) { + higherToLower = false; + foundChest = false; lowestBlaze = null; highestBlaze = null; } @@ -34,9 +41,13 @@ public class BlazeSolver { public void onTick(TickEvent.ClientTickEvent event) { if (event.phase != TickEvent.Phase.START) return; - World world = Minecraft.getMinecraft().theWorld; + Minecraft mc = Minecraft.getMinecraft(); + EntityPlayerSP player = mc.thePlayer; + World world = mc.theWorld; + if (DankersSkyblockMod.tickAmount % 4 == 0) { - if (ToggleCommand.blazeToggled && Utils.inDungeons && world != null) { + if (ToggleCommand.blazeToggled && Utils.inDungeons && world != null && player != null) { + List entities = world.getLoadedEntityList(); int highestHealth = 0; highestBlaze = null; @@ -61,6 +72,27 @@ public class BlazeSolver { } } } + + if (!foundChest) { + new Thread(() -> { + Iterable blocks = BlockPos.getAllInBox(new BlockPos(player.posX - 27, 69, player.posZ - 27), new BlockPos(player.posX + 27, 70, player.posZ + 27)); + for (BlockPos blockPos : blocks) { + Block block = world.getBlockState(blockPos).getBlock(); + if (block == Blocks.chest && world.getBlockState(blockPos.add(0, 1, 0)).getBlock() == Blocks.iron_bars) { + Block blockbelow = world.getBlockState(blockPos.add(0, -1, 0)).getBlock(); + if (blockbelow == Blocks.stone) { + higherToLower = false; + foundChest = true; + } else if (blockbelow == Blocks.air) { + higherToLower = true; + foundChest = true; + } else { + return; + } + } + } + }).start(); + } } } } @@ -68,19 +100,33 @@ public class BlazeSolver { @SubscribeEvent public void onWorldRender(RenderWorldLastEvent event) { if (ToggleCommand.blazeToggled && Utils.inDungeons) { - if (lowestBlaze != null) { - BlockPos stringPos = new BlockPos(lowestBlaze.posX, lowestBlaze.posY + 1, lowestBlaze.posZ); - Utils.draw3DString(stringPos, EnumChatFormatting.BOLD + "Smallest", LOWEST_BLAZE_COLOUR, event.partialTicks); - AxisAlignedBB aabb = new AxisAlignedBB(lowestBlaze.posX - 0.5, lowestBlaze.posY - 2, lowestBlaze.posZ - 0.5, lowestBlaze.posX + 0.5, lowestBlaze.posY, lowestBlaze.posZ + 0.5); - Utils.draw3DBox(aabb, LOWEST_BLAZE_COLOUR, event.partialTicks); - } - if (highestBlaze != null) { - BlockPos stringPos = new BlockPos(highestBlaze.posX, highestBlaze.posY + 1, highestBlaze.posZ); - Utils.draw3DString(stringPos, EnumChatFormatting.BOLD + "Biggest", HIGHEST_BLAZE_COLOUR, event.partialTicks); - AxisAlignedBB aabb = new AxisAlignedBB(highestBlaze.posX - 0.5, highestBlaze.posY - 2, highestBlaze.posZ - 0.5, highestBlaze.posX + 0.5, highestBlaze.posY, highestBlaze.posZ + 0.5); - Utils.draw3DBox(aabb, HIGHEST_BLAZE_COLOUR, event.partialTicks); + if (foundChest) { + if (lowestBlaze != null && !higherToLower) { + BlockPos stringPos = new BlockPos(lowestBlaze.posX, lowestBlaze.posY + 1, lowestBlaze.posZ); + Utils.draw3DString(stringPos, EnumChatFormatting.BOLD + "Shoot me!", LOWEST_BLAZE_COLOUR, event.partialTicks); + AxisAlignedBB aabb = new AxisAlignedBB(lowestBlaze.posX - 0.5, lowestBlaze.posY - 2, lowestBlaze.posZ - 0.5, lowestBlaze.posX + 0.5, lowestBlaze.posY, lowestBlaze.posZ + 0.5); + Utils.draw3DBox(aabb, LOWEST_BLAZE_COLOUR, event.partialTicks); + } + if (highestBlaze != null && higherToLower) { + BlockPos stringPos = new BlockPos(highestBlaze.posX, highestBlaze.posY + 1, highestBlaze.posZ); + Utils.draw3DString(stringPos, EnumChatFormatting.BOLD + "Shoot me!", LOWEST_BLAZE_COLOUR, event.partialTicks); + AxisAlignedBB aabb = new AxisAlignedBB(highestBlaze.posX - 0.5, highestBlaze.posY - 2, highestBlaze.posZ - 0.5, highestBlaze.posX + 0.5, highestBlaze.posY, highestBlaze.posZ + 0.5); + Utils.draw3DBox(aabb, LOWEST_BLAZE_COLOUR, event.partialTicks); + } + } else { + if (lowestBlaze != null) { + BlockPos stringPos = new BlockPos(lowestBlaze.posX, lowestBlaze.posY + 1, lowestBlaze.posZ); + Utils.draw3DString(stringPos, EnumChatFormatting.BOLD + "Smallest", LOWEST_BLAZE_COLOUR, event.partialTicks); + AxisAlignedBB aabb = new AxisAlignedBB(lowestBlaze.posX - 0.5, lowestBlaze.posY - 2, lowestBlaze.posZ - 0.5, lowestBlaze.posX + 0.5, lowestBlaze.posY, lowestBlaze.posZ + 0.5); + Utils.draw3DBox(aabb, LOWEST_BLAZE_COLOUR, event.partialTicks); + } + if (highestBlaze != null) { + BlockPos stringPos = new BlockPos(highestBlaze.posX, highestBlaze.posY + 1, highestBlaze.posZ); + Utils.draw3DString(stringPos, EnumChatFormatting.BOLD + "Biggest", HIGHEST_BLAZE_COLOUR, event.partialTicks); + AxisAlignedBB aabb = new AxisAlignedBB(highestBlaze.posX - 0.5, highestBlaze.posY - 2, highestBlaze.posZ - 0.5, highestBlaze.posX + 0.5, highestBlaze.posY, highestBlaze.posZ + 0.5); + Utils.draw3DBox(aabb, HIGHEST_BLAZE_COLOUR, event.partialTicks); + } } } } - } -- cgit From f121a983c474c2defc36c3dd5266e4d2808bc45f Mon Sep 17 00:00:00 2001 From: TotalledZebra <50877472+TotalledZebra@users.noreply.github.com> Date: Wed, 19 May 2021 00:03:26 +0300 Subject: Update BlazeSolver.java Added a couple messages for when the chest is detected. --- src/main/java/me/Danker/features/puzzlesolvers/BlazeSolver.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/puzzlesolvers/BlazeSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/BlazeSolver.java index a2e3395..e9d6f3f 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/BlazeSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/BlazeSolver.java @@ -83,9 +83,11 @@ public class BlazeSolver { if (blockbelow == Blocks.stone) { higherToLower = false; foundChest = true; + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Chest located. Sorting from lowest to highest.")); } else if (blockbelow == Blocks.air) { higherToLower = true; foundChest = true; + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Chest located. Sorting from highest to lowest.")); } else { return; } -- cgit From 88e9da119ef7dd0a5dda686f5781dc7328c584ce Mon Sep 17 00:00:00 2001 From: GodSaveTheDoge <51802433+GodSaveTheDoge@users.noreply.github.com> Date: Wed, 9 Jun 2021 00:35:35 +0200 Subject: Refractored Chronomatron Solver refractored src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java --- .../features/puzzlesolvers/ChronomatronSolver.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java index 208cf9b..1fff07a 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java @@ -67,19 +67,13 @@ public class ChronomatronSolver { Slot glassSlot = invSlots.get(i); - if (chronomatronMouseClicks + 1 < chronomatronPattern.size()) { - if (chronomatronPattern.get(chronomatronMouseClicks).equals(chronomatronPattern.get(chronomatronMouseClicks + 1))) { - if (glass.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks))) { - Utils.drawOnSlot(chestSize, glassSlot.xDisplayPosition, glassSlot.yDisplayPosition, CHRONOMATRON_NEXT + 0xE5000000); - } - } else if (glass.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks))) { - Utils.drawOnSlot(chestSize, glassSlot.xDisplayPosition, glassSlot.yDisplayPosition, CHRONOMATRON_NEXT + 0xE5000000); - } else if (glass.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks + 1))) { - Utils.drawOnSlot(chestSize, glassSlot.xDisplayPosition, glassSlot.yDisplayPosition, CHRONOMATRON_NEXT_TO_NEXT + 0XBE000000); - } - } else if (glass.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks))) { + + if (glass.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks))) { Utils.drawOnSlot(chestSize, glassSlot.xDisplayPosition, glassSlot.yDisplayPosition, CHRONOMATRON_NEXT + 0xE5000000); + } else if (chronomatronMouseClicks + 1 < chronomatronPattern.size() && glass.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks + 1))) { + Utils.drawOnSlot(chestSize, glassSlot.xDisplayPosition, glassSlot.yDisplayPosition, CHRONOMATRON_NEXT_TO_NEXT + 0XBE000000); } + } } } else if (invSlots.get(49).getStack().getDisplayName().equals("§aRemember the pattern!")) { -- cgit From d52c64ca20fa8df90f0e4496a954328335803725 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 15 Jun 2021 20:34:51 -0400 Subject: Add support for percentage skill bar --- src/main/java/me/Danker/DankersSkyblockMod.java | 80 +++++++++- src/main/java/me/Danker/features/AutoDisplay.java | 1 - .../java/me/Danker/features/ColouredNames.java | 2 - .../java/me/Danker/features/Skill50Display.java | 45 +++++- src/main/java/me/Danker/features/SkillTracker.java | 169 ++++++++++++--------- .../java/me/Danker/handlers/ConfigHandler.java | 10 ++ src/main/java/me/Danker/utils/Utils.java | 56 ++++++- 7 files changed, 280 insertions(+), 83 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index c9aaa26..f1c8c1c 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -60,6 +60,7 @@ import javax.sound.sampled.UnsupportedAudioFileException; import java.io.IOException; import java.util.ArrayList; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.stream.Collectors; @@ -79,6 +80,15 @@ public class DankersSkyblockMod { public static boolean firstLaunch = false; public static String configDirectory; public static JsonObject data = null; + + public static int farmingLevel; + public static int miningLevel; + public static int combatLevel; + public static int foragingLevel; + public static int fishingLevel; + public static int enchantingLevel; + public static int alchemyLevel; + public static int carpentryLevel; public static String MAIN_COLOUR; public static String SECONDARY_COLOUR; @@ -268,12 +278,47 @@ public class DankersSkyblockMod { @SubscribeEvent public void onChat(ClientChatReceivedEvent event) { - String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); if (message.startsWith("Your new API key is ") && Utils.isOnHypixel()) { String apiKey = event.message.getSiblings().get(0).getChatStyle().getChatClickEvent().getValue(); ConfigHandler.writeStringConfig("api", "APIKey", apiKey); Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Set API key to " + DankersSkyblockMod.SECONDARY_COLOUR + apiKey)); + } else if (Utils.inSkyblock && !message.contains(":") && message.contains(" SKILL LEVEL UP ")) { + // Handle skill level ups + String skill = message.substring(message.indexOf("UP") + 3, message.lastIndexOf(" ")); + int level = Utils.getIntFromString(message.substring(message.indexOf("➜") + 1), true); + + switch (skill) { + case "Farming": + DankersSkyblockMod.farmingLevel = level; + break; + case "Mining": + DankersSkyblockMod.miningLevel = level; + break; + case "Combat": + DankersSkyblockMod.combatLevel = level; + break; + case "Foraging": + DankersSkyblockMod.foragingLevel = level; + break; + case "Fishing": + DankersSkyblockMod.fishingLevel = level; + break; + case "Enchanting": + DankersSkyblockMod.enchantingLevel = level; + break; + case "Alchemy": + DankersSkyblockMod.alchemyLevel = level; + break; + case "Carpentry": + DankersSkyblockMod.carpentryLevel = level; + break; + default: + System.err.println("Unknown skill leveled up."); + } + + ConfigHandler.writeIntConfig("skills", skill.toLowerCase(Locale.US), level); } } @@ -306,7 +351,8 @@ public class DankersSkyblockMod { public void onTick(TickEvent.ClientTickEvent event) { if (event.phase != Phase.START) return; - EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + Minecraft mc = Minecraft.getMinecraft(); + EntityPlayerSP player = mc.thePlayer; tickAmount++; if (tickAmount % 20 == 0) { @@ -324,6 +370,36 @@ public class DankersSkyblockMod { } titleTimer--; } + + // New skill level detection + if (mc.currentScreen instanceof GuiChest && tickAmount % 5 == 0 && player != null) { + ContainerChest chest = (ContainerChest) player.openContainer; + String chestName = chest.getLowerChestInventory().getDisplayName().getUnformattedText().trim(); + + if (chestName.equals("Your Skills")) { + List invSlots = ((GuiChest) mc.currentScreen).inventorySlots.inventorySlots; + + farmingLevel = Utils.getIntFromString(invSlots.get(19).getStack().getDisplayName().substring(invSlots.get(19).getStack().getDisplayName().indexOf(" ") + 1), true); + miningLevel = Utils.getIntFromString(invSlots.get(20).getStack().getDisplayName().substring(invSlots.get(20).getStack().getDisplayName().indexOf(" ") + 1), true); + combatLevel = Utils.getIntFromString(invSlots.get(21).getStack().getDisplayName().substring(invSlots.get(21).getStack().getDisplayName().indexOf(" ") + 1), true); + foragingLevel = Utils.getIntFromString(invSlots.get(22).getStack().getDisplayName().substring(invSlots.get(22).getStack().getDisplayName().indexOf(" ") + 1), true); + fishingLevel = Utils.getIntFromString(invSlots.get(23).getStack().getDisplayName().substring(invSlots.get(23).getStack().getDisplayName().indexOf(" ") + 1), true); + enchantingLevel = Utils.getIntFromString(invSlots.get(24).getStack().getDisplayName().substring(invSlots.get(24).getStack().getDisplayName().indexOf(" ") + 1), true); + alchemyLevel = Utils.getIntFromString(invSlots.get(25).getStack().getDisplayName().substring(invSlots.get(25).getStack().getDisplayName().indexOf(" ") + 1), true); + carpentryLevel = Utils.getIntFromString(invSlots.get(29).getStack().getDisplayName().substring(invSlots.get(29).getStack().getDisplayName().indexOf(" ") + 1), true); + + ConfigHandler.writeIntConfig("skills", "farming", farmingLevel); + ConfigHandler.writeIntConfig("skills", "mining", miningLevel); + ConfigHandler.writeIntConfig("skills", "combat", combatLevel); + ConfigHandler.writeIntConfig("skills", "foraging", foragingLevel); + ConfigHandler.writeIntConfig("skills", "fishing", fishingLevel); + ConfigHandler.writeIntConfig("skills", "enchanting", enchantingLevel); + ConfigHandler.writeIntConfig("skills", "alchemy", alchemyLevel); + ConfigHandler.writeIntConfig("skills", "carpentry", carpentryLevel); + + System.out.println("Updated skill levels."); + } + } } // Delay GUI by 1 tick diff --git a/src/main/java/me/Danker/features/AutoDisplay.java b/src/main/java/me/Danker/features/AutoDisplay.java index 783c428..bead243 100644 --- a/src/main/java/me/Danker/features/AutoDisplay.java +++ b/src/main/java/me/Danker/features/AutoDisplay.java @@ -6,7 +6,6 @@ import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.ScoreboardHandler; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; -import net.minecraft.client.settings.GameSettings; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.world.World; diff --git a/src/main/java/me/Danker/features/ColouredNames.java b/src/main/java/me/Danker/features/ColouredNames.java index eec2d5c..478a47d 100644 --- a/src/main/java/me/Danker/features/ColouredNames.java +++ b/src/main/java/me/Danker/features/ColouredNames.java @@ -22,14 +22,12 @@ public class ColouredNames { @SubscribeEvent public void onChat(ClientChatReceivedEvent event) { if (!ToggleCommand.customColouredNames || !Utils.inSkyblock || event.type != 0) return; - long startTime = System.currentTimeMillis(); for (String user : users) { if (event.message.getFormattedText().contains(user)) { event.message = replaceChat(event.message, user); } } - System.out.println("Chat time: " + ((System.currentTimeMillis() - startTime) / 1000D) + "s"); } @SubscribeEvent diff --git a/src/main/java/me/Danker/features/Skill50Display.java b/src/main/java/me/Danker/features/Skill50Display.java index 3b73cf9..d7b759e 100644 --- a/src/main/java/me/Danker/features/Skill50Display.java +++ b/src/main/java/me/Danker/features/Skill50Display.java @@ -1,5 +1,6 @@ package me.Danker.features; +import me.Danker.DankersSkyblockMod; import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; import me.Danker.commands.ToggleCommand; @@ -7,6 +8,7 @@ import me.Danker.events.RenderOverlay; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; +import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -30,8 +32,8 @@ public class Skill50Display { String[] actionBarSections = event.message.getUnformattedText().split(" {3,}"); for (String section : actionBarSections) { - if (section.contains("+") && section.contains("/") && section.contains("(")) { - if (ToggleCommand.skill50DisplayToggled && !section.contains("Runecrafting")) { + if (ToggleCommand.skill50DisplayToggled && section.contains("+") && section.contains("(") && section.contains(")") && !section.contains("Runecrafting")) { + if (section.contains("/")) { String xpGained = section.substring(section.indexOf("+"), section.indexOf("(") - 1); double currentXp = Double.parseDouble(section.substring(section.indexOf("(") + 1, section.indexOf("/")).replace(",", "")); int limit; @@ -50,6 +52,40 @@ public class Skill50Display { skillTimer = SKILL_TIME; showSkill = true; skillText = SKILL_50_COLOUR + xpGained + " (" + nf.format(currentXp + previousXp) + "/" + nf.format(totalXp) + ") " + percentage + "%"; + } else { + if (!Utils.skillsInitialized()) { + return; + } + + String xpGained = section.substring(section.indexOf("+"), section.indexOf("(") - 1); + double percentage = Double.parseDouble(section.substring(section.indexOf("(") + 1, section.indexOf("%"))); + int level = 1; + if (section.contains("Farming")) { + level = DankersSkyblockMod.farmingLevel; + } else if (section.contains("Mining")) { + level = DankersSkyblockMod.miningLevel; + } else if (section.contains("Combat")) { + level = DankersSkyblockMod.combatLevel; + } else if (section.contains("Foraging")) { + level = DankersSkyblockMod.foragingLevel; + } else if (section.contains("Fishing")) { + level = DankersSkyblockMod.fishingLevel; + } else if (section.contains("Enchanting")) { + level = DankersSkyblockMod.enchantingLevel; + } else if (section.contains("Alchemy")) { + level = DankersSkyblockMod.alchemyLevel; + } else if (section.contains("Carpentry")) { + level = DankersSkyblockMod.carpentryLevel; + } + + double currentXp = Utils.getTotalXpEarned(level, percentage); + int totalXp = section.contains("Farming") || section.contains("Enchanting") || section.contains("Mining") || section.contains("Combat") ? 111672425 : 55172425; + double percentageTo50 = Math.floor((currentXp / totalXp) * 10000D) / 100D; + + NumberFormat nf = NumberFormat.getNumberInstance(Locale.US); + skillTimer = SKILL_TIME; + showSkill = true; + skillText = SKILL_50_COLOUR + xpGained + " (" + nf.format(currentXp) + "/" + nf.format(totalXp) + ") " + percentageTo50 + "%"; } } } @@ -69,6 +105,11 @@ public class Skill50Display { @SubscribeEvent public void renderPlayerInfo(RenderOverlay event) { + if (!Utils.skillsInitialized()) { + new TextRenderer(Minecraft.getMinecraft(), EnumChatFormatting.RED + "Please open the skill menu to use skill features.", MoveCommand.skill50XY[0], MoveCommand.skill50XY[0], ScaleCommand.skill50Scale); + return; + } + if (showSkill) { new TextRenderer(Minecraft.getMinecraft(), skillText, MoveCommand.skill50XY[0], MoveCommand.skill50XY[1], ScaleCommand.skill50Scale); } diff --git a/src/main/java/me/Danker/features/SkillTracker.java b/src/main/java/me/Danker/features/SkillTracker.java index 60eb632..a2f3249 100644 --- a/src/main/java/me/Danker/features/SkillTracker.java +++ b/src/main/java/me/Danker/features/SkillTracker.java @@ -52,78 +52,106 @@ public class SkillTracker { String[] actionBarSections = event.message.getUnformattedText().split(" {3,}"); for (String section : actionBarSections) { - if (section.contains("+") && section.contains("/") && section.contains("(")) { - if (!section.contains("Runecrafting") && !section.contains("Carpentry")) { - if (ToggleCommand.autoSkillTrackerToggled && System.currentTimeMillis() / 1000 - timeSinceGained <= 2) { - if (skillStopwatch.isStarted() && skillStopwatch.isSuspended()) { - skillStopwatch.resume(); - } else if (!skillStopwatch.isStarted()) { - skillStopwatch.start(); - } + if (section.contains("+") && section.contains("(") && section.contains(")") && !section.contains("Runecrafting") && !section.contains("Carpentry")) { + if (ToggleCommand.autoSkillTrackerToggled && System.currentTimeMillis() / 1000 - timeSinceGained <= 2) { + if (skillStopwatch.isStarted() && skillStopwatch.isSuspended()) { + skillStopwatch.resume(); + } else if (!skillStopwatch.isStarted()) { + skillStopwatch.start(); } - timeSinceGained = System.currentTimeMillis() / 1000; + } + timeSinceGained = System.currentTimeMillis() / 1000; + + String skill = section.substring(section.indexOf(" ") + 1, section.lastIndexOf(" ")); + double totalXP; + if (section.contains("/")) { int limit = section.contains("Farming") || section.contains("Enchanting") || section.contains("Mining") || section.contains("Combat") ? 60 : 50; double currentXP = Double.parseDouble(section.substring(section.indexOf("(") + 1, section.indexOf("/")).replace(",", "")); int xpToLevelUp = Integer.parseInt(section.substring(section.indexOf("/") + 1, section.indexOf(")")).replaceAll(",", "")); xpLeft = xpToLevelUp - currentXP; int previousXP = Utils.getPastXpEarned(xpToLevelUp, limit); - double totalXP = currentXP + previousXP; - - String skill = section.substring(section.indexOf(" ") + 1, section.lastIndexOf(" ")); - switch (skill) { - case "Farming": - lastSkill = "Farming"; - if (farmingXP != 0) { - if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) farmingXPGained += totalXP - farmingXP; - } - farmingXP = totalXP; - break; - case "Mining": - lastSkill = "Mining"; - if (miningXP != 0) { - if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) miningXPGained += totalXP - miningXP; - } - miningXP = totalXP; - break; - case "Combat": - lastSkill = "Combat"; - if (combatXP != 0) { - if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) combatXPGained += totalXP - combatXP; - } - combatXP = totalXP; - break; - case "Foraging": - lastSkill = "Foraging"; - if (foragingXP != 0) { - if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) foragingXPGained += totalXP - foragingXP; - } - foragingXP = totalXP; - break; - case "Fishing": - lastSkill = "Fishing"; - if (fishingXP != 0) { - if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) fishingXPGained += totalXP - fishingXP; - } - fishingXP = totalXP; - break; - case "Enchanting": - lastSkill = "Enchanting"; - if (enchantingXP != 0) { - if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) enchantingXPGained += totalXP - enchantingXP; - } - enchantingXP = totalXP; - break; - case "Alchemy": - lastSkill = "Alchemy"; - if (alchemyXP != 0) { - if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) alchemyXPGained += totalXP - alchemyXP; - } - alchemyXP = totalXP; - break; - default: - System.err.println("Unknown skill."); + totalXP = currentXP + previousXP; + } else { + if (!Utils.skillsInitialized()) { + return; + } + + int level = 1; + if (section.contains("Farming")) { + level = DankersSkyblockMod.farmingLevel; + } else if (section.contains("Mining")) { + level = DankersSkyblockMod.miningLevel; + } else if (section.contains("Combat")) { + level = DankersSkyblockMod.combatLevel; + } else if (section.contains("Foraging")) { + level = DankersSkyblockMod.foragingLevel; + } else if (section.contains("Fishing")) { + level = DankersSkyblockMod.fishingLevel; + } else if (section.contains("Enchanting")) { + level = DankersSkyblockMod.enchantingLevel; + } else if (section.contains("Alchemy")) { + level = DankersSkyblockMod.alchemyLevel; + } else if (section.contains("Carpentry")) { + level = DankersSkyblockMod.carpentryLevel; } + + totalXP = Utils.getTotalXpEarned(level, Double.parseDouble(section.substring(section.indexOf("(") + 1, section.indexOf("%")))); + xpLeft = Utils.getTotalXpEarned(level + 1, 0) - totalXP; + } + + switch (skill) { + case "Farming": + lastSkill = "Farming"; + if (farmingXP != 0) { + if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) farmingXPGained += totalXP - farmingXP; + } + farmingXP = totalXP; + break; + case "Mining": + lastSkill = "Mining"; + if (miningXP != 0) { + if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) miningXPGained += totalXP - miningXP; + } + miningXP = totalXP; + break; + case "Combat": + lastSkill = "Combat"; + if (combatXP != 0) { + if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) combatXPGained += totalXP - combatXP; + } + combatXP = totalXP; + break; + case "Foraging": + lastSkill = "Foraging"; + if (foragingXP != 0) { + if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) foragingXPGained += totalXP - foragingXP; + } + foragingXP = totalXP; + break; + case "Fishing": + lastSkill = "Fishing"; + if (fishingXP != 0) { + if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) fishingXPGained += totalXP - fishingXP; + } + fishingXP = totalXP; + break; + case "Enchanting": + lastSkill = "Enchanting"; + if (enchantingXP != 0) { + if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) enchantingXPGained += totalXP - enchantingXP; + } + enchantingXP = totalXP; + break; + case "Alchemy": + lastSkill = "Alchemy"; + if (alchemyXP != 0) { + if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) alchemyXPGained += totalXP - alchemyXP; + } + alchemyXP = totalXP; + break; + default: + System.err.println("Unknown skill."); } } } @@ -132,6 +160,11 @@ public class SkillTracker { @SubscribeEvent public void renderPlayerInfo(RenderOverlay event) { if (showSkillTracker && Utils.inSkyblock) { + if (!Utils.skillsInitialized()) { + new TextRenderer(Minecraft.getMinecraft(), EnumChatFormatting.RED + "Please open the skill menu to use skill features.", MoveCommand.skillTrackerXY[0], MoveCommand.skillTrackerXY[0], ScaleCommand.skillTrackerScale); + return; + } + int xpPerHour; double xpToShow = 0; switch (lastSkill) { @@ -196,12 +229,8 @@ public class SkillTracker { @SubscribeEvent public void onGuiOpen(GuiOpenEvent event) { - if (event.gui instanceof GuiChest) { - if (ToggleCommand.autoSkillTrackerToggled) { - if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) { - skillStopwatch.suspend(); - } - } + if (event.gui instanceof GuiChest && ToggleCommand.autoSkillTrackerToggled && skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) { + skillStopwatch.suspend(); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 250c1f2..c289dac 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -484,6 +484,16 @@ public class ConfigHandler { ScaleCommand.teammatesInRadiusScale = initDouble("scales", "teammatesInRadiusScale", 1); ScaleCommand.giantHPScale = initDouble("scales", "giantHPScale", 1); + // Skills + DankersSkyblockMod.farmingLevel = initInt("skills", "farming", -1); + DankersSkyblockMod.miningLevel = initInt("skills", "mining", -1); + DankersSkyblockMod.combatLevel = initInt("skills", "combat", -1); + DankersSkyblockMod.foragingLevel = initInt("skills", "foraging", -1); + DankersSkyblockMod.fishingLevel = initInt("skills", "fishing", -1); + DankersSkyblockMod.enchantingLevel = initInt("skills", "enchanting", -1); + DankersSkyblockMod.alchemyLevel = initInt("skills", "alchemy", -1); + DankersSkyblockMod.carpentryLevel = initInt("skills", "carpentry", -1); + // Colours DankersSkyblockMod.MAIN_COLOUR = initString("colors", "main", EnumChatFormatting.GREEN.toString()); DankersSkyblockMod.SECONDARY_COLOUR = initString("colors", "secondary", EnumChatFormatting.DARK_GREEN.toString()); diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index d3d6325..4acee7f 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -25,10 +25,8 @@ import net.minecraft.util.*; import org.lwjgl.opengl.GL11; import java.awt.*; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; import java.util.List; +import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -47,6 +45,15 @@ public class Utils { 19000000, 24000000, 30000000, 38000000, 48000000, 60000000, 75000000, 93000000, 116250000}; static int[] expertiseKills = {50, 100, 250, 500, 1000, 2500, 5500, 10000, 15000}; static Pattern boldPattern = Pattern.compile("(?i)\\u00A7L"); + static Map romanNumerals = new HashMap(){{ + put('I', 1); + put('V', 5); + put('X', 10); + put('L', 50); + put('C', 100); + put('D', 500); + put('M', 1000); + }}; public static int getItems(String item) { Minecraft mc = Minecraft.getMinecraft(); @@ -260,7 +267,8 @@ public class Utils { } return -1; } - + + // Only used when over limit public static int getPastXpEarned(int currentLevelXp, int limit) { if (currentLevelXp == 0) { int xpAdded = 0; @@ -275,6 +283,16 @@ public class Utils { } return 0; } + + public static double getTotalXpEarned(int currentLevel, double percentage) { + double progress = 0; + if (currentLevel < 60) progress = skillXPPerLevel[currentLevel + 1] * (percentage / 100D); + double xpAdded = 0; + for (int i = 1; i <= currentLevel; i++) { + xpAdded += skillXPPerLevel[i]; + } + return xpAdded + progress; + } public static String getColouredBoolean(boolean bool) { return bool ? EnumChatFormatting.GREEN + "On" : EnumChatFormatting.RED + "Off"; @@ -546,7 +564,33 @@ public class Utils { } public static String removeBold(String text) { - return boldPattern.matcher(text).replaceAll(""); + return boldPattern.matcher(text).replaceAll(""); } - + + public static int getIntFromString(String text, boolean romanNumeral) { + if (text.matches(".*\\d.*")) { + return Integer.parseInt(StringUtils.stripControlCodes(text).replaceAll("[^\\d]", "")); + } else if (romanNumeral) { + int number = 0; + + for (int i = 0; i < text.length(); i++) { + int roman = romanNumerals.get(text.charAt(i)); + + if (i != text.length() - 1 && roman < romanNumerals.get(text.charAt(i + 1))) { + number += romanNumerals.get(text.charAt(i + 1)) - roman; + i++; + } else { + number += roman; + } + } + + return number; + } + return -1; + } + + public static boolean skillsInitialized() { + return DankersSkyblockMod.miningLevel != -1; + } + } -- cgit From 9e5039be5c1f874a6622301daca2b6780dec02ca Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 17 Jun 2021 00:07:21 -0400 Subject: Add enderman slayer tracker Also add support for counting 20% drops in chat and tier 5 rev dropping viscera --- README.md | 6 +- .../java/me/Danker/commands/DisplayCommand.java | 11 +- src/main/java/me/Danker/commands/LootCommand.java | 92 ++++++++- .../java/me/Danker/commands/ResetLootCommand.java | 36 +++- src/main/java/me/Danker/features/AutoDisplay.java | 3 + .../java/me/Danker/features/loot/LootDisplay.java | 124 ++++++++++++ .../java/me/Danker/features/loot/LootTracker.java | 215 ++++++++++++++++++--- src/main/java/me/Danker/gui/DisplayGui.java | 11 +- .../java/me/Danker/handlers/ConfigHandler.java | 24 +++ 9 files changed, 485 insertions(+), 37 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index d737522..f6a4814 100644 --- a/README.md +++ b/README.md @@ -63,9 +63,9 @@ Discord Server: https://discord.gg/QsEkNQS - /toggle - Toggles features. /toggle list returns values of every toggle. - /setkey - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. -- /loot [winter/festival/spooky/f(1-7)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. -- /display [winter/festival/spooky/f(1-7)/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active. -- /resetloot - - Resets loot for trackers. /resetloot confirm confirms the reset. +- /loot [winter/festival/spooky/f(1-7)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. +- /display [winter/festival/spooky/f(1-7)/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active. +- /resetloot - - Resets loot for trackers. /resetloot confirm confirms the reset. - /move - Moves text display to specified X and Y coordinates. - /scale - Scales text display to a specified multipler between 0.1x and 10x. - /slayer [player] - Uses API to get slayer xp of a person. If no name is provided, it checks yours. diff --git a/src/main/java/me/Danker/commands/DisplayCommand.java b/src/main/java/me/Danker/commands/DisplayCommand.java index 990e9d1..e248888 100644 --- a/src/main/java/me/Danker/commands/DisplayCommand.java +++ b/src/main/java/me/Danker/commands/DisplayCommand.java @@ -21,7 +21,7 @@ public class DisplayCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " [winter/festival/spooky/session/f(1-7)]"; + return "/" + getCommandName() + " [winter/festival/spooky/session/f(1-7)]"; } public static String usage(ICommandSender arg0) { @@ -36,7 +36,7 @@ public class DisplayCommand extends CommandBase { @Override public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "fishing", "catacombs", "mythological", "ghost", "auto", "off"); + return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "enderman", "fishing", "catacombs", "mythological", "ghost", "auto", "off"); } else if (args.length == 2 && args[0].equalsIgnoreCase("fishing")) { return getListOfStringsMatchingLastWord(args, "winter", "festival", "spooky", "session"); } else if (args.length == 2 && args[0].equalsIgnoreCase("catacombs")) { @@ -82,6 +82,13 @@ public class DisplayCommand extends CommandBase { LootDisplay.display = "zombie"; } break; + case "enderman": + if (showSession) { + LootDisplay.display = "enderman_session"; + } else { + LootDisplay.display = "enderman"; + } + break; case "fishing": if (arg1.length > 1) { switch (arg1[1].toLowerCase()) { diff --git a/src/main/java/me/Danker/commands/LootCommand.java b/src/main/java/me/Danker/commands/LootCommand.java index 51347a3..d0b4272 100644 --- a/src/main/java/me/Danker/commands/LootCommand.java +++ b/src/main/java/me/Danker/commands/LootCommand.java @@ -24,7 +24,7 @@ public class LootCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " [winter/festival/spooky/f(1-7)/session]"; + return "/" + getCommandName() + " [winter/festival/spooky/f(1-7)/session]"; } public static String usage(ICommandSender arg0) { @@ -39,7 +39,7 @@ public class LootCommand extends CommandBase { @Override public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "fishing", "catacombs", "mythological"); + return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "enderman", "fishing", "catacombs", "mythological"); } else if (args.length == 2 && args[0].equalsIgnoreCase("fishing")) { return getListOfStringsMatchingLastWord(args, "winter", "festival", "spooky", "session"); } else if (args.length == 2 && args[0].equalsIgnoreCase("catacombs")) { @@ -223,6 +223,7 @@ public class LootCommand extends CommandBase { EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD + " Zombie Loot Summary (Current Session):\n" + EnumChatFormatting.GOLD + " Revs Killed: " + nf.format(LootTracker.zombieRevsSession) + "\n" + EnumChatFormatting.GREEN + " Revenant Flesh: " + nf.format(LootTracker.zombieRevFleshSession) + "\n" + + EnumChatFormatting.GREEN + " Revenant Viscera: " + nf.format(LootTracker.zombieRevVisceraSession) + "\n" + EnumChatFormatting.BLUE + " Foul Flesh: " + drop20 + "\n" + EnumChatFormatting.DARK_GREEN + " Pestilence Runes: " +LootTracker.zombiePestilencesSession + "\n" + EnumChatFormatting.WHITE + " Smite VI Books: " + LootTracker.zombieBooksSession + "\n" + @@ -259,6 +260,7 @@ public class LootCommand extends CommandBase { EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD + " Zombie Loot Summary:\n" + EnumChatFormatting.GOLD + " Revs Killed: " + nf.format(LootTracker.zombieRevs) + "\n" + EnumChatFormatting.GREEN + " Revenant Flesh: " + nf.format(LootTracker.zombieRevFlesh) + "\n" + + EnumChatFormatting.GREEN + " Revenant Viscera: " + nf.format(LootTracker.zombieRevViscera) + "\n" + EnumChatFormatting.BLUE + " Foul Flesh: " + drop20 + "\n" + EnumChatFormatting.DARK_GREEN + " Pestilence Runes: " + LootTracker.zombiePestilences + "\n" + EnumChatFormatting.WHITE + " Smite VI Books: " + LootTracker.zombieBooks + "\n" + @@ -273,6 +275,92 @@ public class LootCommand extends CommandBase { EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + EnumChatFormatting.GREEN + EnumChatFormatting.BOLD + " -------------------")); break; + case "enderman": + if (showSession) { + if (LootTracker.endermanTimeSession == -1) { + timeBetween = "Never"; + } else { + timeBetween = Utils.getTimeBetween(LootTracker.endermanTimeSession, timeNow); + } + if (LootTracker.endermanBossesSession == -1) { + bossesBetween = "Never"; + } else { + bossesBetween = nf.format(LootTracker.endermanBossesSession); + } + if (ToggleCommand.slayerCountTotal) { + drop20 = nf.format(LootTracker.endermanTAPSession); + } else { + drop20 = nf.format(LootTracker.endermanTAPDropsSession) + " times"; + } + + player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD + " Enderman Loot Summary (Current Session):\n" + + EnumChatFormatting.GOLD + " Voidglooms Killed: " + nf.format(LootTracker.endermanVoidgloomsSession) + "\n" + + EnumChatFormatting.DARK_GRAY + " Null Spheres: " + nf.format(LootTracker.endermanNullSpheresSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Arrow Poison: " + drop20 + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Endersnake Runes: " + LootTracker.endermanEndersnakesSession + "\n" + + EnumChatFormatting.DARK_GREEN + " Summoning Eyes: " + LootTracker.endermanSummoningEyesSession + "\n" + + EnumChatFormatting.AQUA + " Mana Steal Books: " + LootTracker.endermanManaBooksSession + "\n" + + EnumChatFormatting.BLUE + " Transmission Tuners: " + LootTracker.endermanTunersSession + "\n" + + EnumChatFormatting.YELLOW + " Null Atoms: " + LootTracker.endermanAtomsSession + "\n" + + EnumChatFormatting.AQUA + " Espresso Machines: " + LootTracker.endermanEspressoMachinesSession + "\n" + + EnumChatFormatting.WHITE + " Smarty Pants Books: " + LootTracker.endermanSmartyBooksSession + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " End Runes: " + LootTracker.endermanEndRunesSession + "\n" + + EnumChatFormatting.RED + " Blood Chalices: " + LootTracker.endermanChalicesSession + "\n" + + EnumChatFormatting.RED + " Sinful Dice: " + LootTracker.endermanDiceSession + "\n" + + EnumChatFormatting.DARK_PURPLE + " Artifact Upgrader: " + LootTracker.endermanArtifactsSession + "\n" + + EnumChatFormatting.DARK_PURPLE + " Enderman Skins: " + LootTracker.endermanSkinsSession + "\n" + + EnumChatFormatting.GRAY + " Enchant Runes: " + LootTracker.endermanEnchantRunesSession + "\n" + + EnumChatFormatting.GOLD + " Etherwarp Mergers: " + LootTracker.endermanMergersSession + "\n" + + EnumChatFormatting.GOLD + " Judgement Cores: " + LootTracker.endermanCoresSession + "\n" + + EnumChatFormatting.RED + " Ender Slayer VII Books: " + LootTracker.endermanEnderBooksSession + "\n" + + EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + + EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + + EnumChatFormatting.DARK_PURPLE + EnumChatFormatting.BOLD + " -------------------")); + return; + } + + if (LootTracker.endermanTime == -1) { + timeBetween = "Never"; + } else { + timeBetween = Utils.getTimeBetween(LootTracker.endermanTime, timeNow); + } + if (LootTracker.endermanBosses == -1) { + bossesBetween = "Never"; + } else { + bossesBetween = nf.format(LootTracker.endermanBosses); + } + if (ToggleCommand.slayerCountTotal) { + drop20 = nf.format(LootTracker.endermanTAP); + } else { + drop20 = nf.format(LootTracker.endermanTAPDrops) + " times"; + } + + player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD + " Enderman Loot Summary:\n" + + EnumChatFormatting.GOLD + " Voidglooms Killed: " + nf.format(LootTracker.endermanVoidglooms) + "\n" + + EnumChatFormatting.DARK_GRAY + " Null Spheres: " + nf.format(LootTracker.endermanNullSpheres) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Arrow Poison: " + drop20 + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Endersnake Runes: " + LootTracker.endermanEndersnakes + "\n" + + EnumChatFormatting.DARK_GREEN + " Summoning Eyes: " + LootTracker.endermanSummoningEyes + "\n" + + EnumChatFormatting.AQUA + " Mana Steal Books: " + LootTracker.endermanManaBooks + "\n" + + EnumChatFormatting.BLUE + " Transmission Tuners: " + LootTracker.endermanTuners + "\n" + + EnumChatFormatting.YELLOW + " Null Atoms: " + LootTracker.endermanAtoms + "\n" + + EnumChatFormatting.AQUA + " Espresso Machines: " + LootTracker.endermanEspressoMachines + "\n" + + EnumChatFormatting.WHITE + " Smarty Pants Books: " + LootTracker.endermanSmartyBooks + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " End Runes: " + LootTracker.endermanEndRunes + "\n" + + EnumChatFormatting.RED + " Blood Chalices: " + LootTracker.endermanChalices + "\n" + + EnumChatFormatting.RED + " Sinful Dice: " + LootTracker.endermanDice + "\n" + + EnumChatFormatting.DARK_PURPLE + " Artifact Upgrader: " + LootTracker.endermanArtifacts + "\n" + + EnumChatFormatting.DARK_PURPLE + " Enderman Skins: " + LootTracker.endermanSkins + "\n" + + EnumChatFormatting.GRAY + " Enchant Runes: " + LootTracker.endermanEnchantRunes + "\n" + + EnumChatFormatting.GOLD + " Etherwarp Mergers: " + LootTracker.endermanMergers + "\n" + + EnumChatFormatting.GOLD + " Judgement Cores: " + LootTracker.endermanCores + "\n" + + EnumChatFormatting.RED + " Ender Slayer VII Books: " + LootTracker.endermanEnderBooks + "\n" + + EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + + EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + + EnumChatFormatting.DARK_PURPLE + EnumChatFormatting.BOLD + " -------------------")); + break; case "fishing": if (arg1.length > 1) { if (arg1[1].equalsIgnoreCase("winter")) { diff --git a/src/main/java/me/Danker/commands/ResetLootCommand.java b/src/main/java/me/Danker/commands/ResetLootCommand.java index eac4c88..e13b1a5 100644 --- a/src/main/java/me/Danker/commands/ResetLootCommand.java +++ b/src/main/java/me/Danker/commands/ResetLootCommand.java @@ -25,7 +25,7 @@ public class ResetLootCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + ""; + return "/" + getCommandName() + ""; } public static String usage(ICommandSender arg0) { @@ -44,7 +44,7 @@ public class ResetLootCommand extends CommandBase { if (confirmReset) { return getListOfStringsMatchingLastWord(args, "confirm", "cancel"); } else { - return getListOfStringsMatchingLastWord(args, "zombie", "spider", "wolf", "fishing", "mythological", "catacombs"); + return getListOfStringsMatchingLastWord(args, "zombie", "spider", "wolf", "enderman", "fishing", "mythological", "catacombs"); } } @@ -72,6 +72,9 @@ public class ResetLootCommand extends CommandBase { case "wolf": resetWolf(); break; + case "enderman": + resetEnderman(); + break; case "fishing": resetFishing(); break; @@ -98,6 +101,7 @@ public class ResetLootCommand extends CommandBase { case "zombie": case "spider": case "wolf": + case "enderman": case "fishing": case "mythological": case "catacombs": @@ -120,6 +124,7 @@ public class ResetLootCommand extends CommandBase { static void resetZombie() { LootTracker.zombieRevsSession = 0; LootTracker.zombieRevFleshSession = 0; + LootTracker.zombieRevVisceraSession = 0; LootTracker.zombieFoulFleshSession = 0; LootTracker.zombieFoulFleshDropsSession = 0; LootTracker.zombiePestilencesSession = 0; @@ -168,6 +173,33 @@ public class ResetLootCommand extends CommandBase { ConfigHandler.deleteCategory("wolf"); ConfigHandler.reloadConfig(); } + + static void resetEnderman() { + LootTracker.endermanVoidgloomsSession = 0; + LootTracker.endermanNullSpheresSession = 0; + LootTracker.endermanTAPSession = 0; + LootTracker.endermanTAPDropsSession = 0; + LootTracker.endermanEndersnakesSession = 0; + LootTracker.endermanSummoningEyesSession = 0; + LootTracker.endermanManaBooksSession = 0; + LootTracker.endermanTunersSession = 0; + LootTracker.endermanAtomsSession = 0; + LootTracker.endermanEspressoMachinesSession = 0; + LootTracker.endermanSmartyBooksSession = 0; + LootTracker.endermanEndRunesSession = 0; + LootTracker.endermanChalicesSession = 0; + LootTracker.endermanDiceSession = 0; + LootTracker.endermanArtifactsSession = 0; + LootTracker.endermanSkinsSession = 0; + LootTracker.endermanMergersSession = 0; + LootTracker.endermanCoresSession = 0; + LootTracker.endermanEnchantRunesSession = 0; + LootTracker.endermanEnderBooksSession = 0; + LootTracker.endermanTimeSession = -1; + LootTracker.endermanBossesSession = -1; + ConfigHandler.deleteCategory("enderman"); + ConfigHandler.reloadConfig(); + } static void resetFishing() { LootTracker.seaCreaturesSession = 0; diff --git a/src/main/java/me/Danker/features/AutoDisplay.java b/src/main/java/me/Danker/features/AutoDisplay.java index bead243..89b1750 100644 --- a/src/main/java/me/Danker/features/AutoDisplay.java +++ b/src/main/java/me/Danker/features/AutoDisplay.java @@ -38,6 +38,9 @@ public class AutoDisplay { } else if (sCleaned.contains("Revenant Horror")) { LootDisplay.display = "zombie"; found = true; + } else if (sCleaned.contains("Voidgloom Seraph")) { + LootDisplay.display = "enderman"; + found = true; } else if (sCleaned.contains("The Mist")){ LootDisplay.display = "ghost"; found = true; diff --git a/src/main/java/me/Danker/features/loot/LootDisplay.java b/src/main/java/me/Danker/features/loot/LootDisplay.java index cd34da7..07a784a 100644 --- a/src/main/java/me/Danker/features/loot/LootDisplay.java +++ b/src/main/java/me/Danker/features/loot/LootDisplay.java @@ -213,6 +213,7 @@ public class LootDisplay { dropsText = EnumChatFormatting.GOLD + "Revs Killed:\n" + EnumChatFormatting.GREEN + "Revenant Flesh:\n" + + EnumChatFormatting.GREEN + "Revenant Viscera:\n" + EnumChatFormatting.BLUE + "Foul Flesh:\n" + EnumChatFormatting.DARK_GREEN + "Pestilence Runes:\n" + EnumChatFormatting.WHITE + "Smite VI Books:\n" + @@ -227,6 +228,7 @@ public class LootDisplay { EnumChatFormatting.AQUA + "Bosses Since RNG:"; countText = EnumChatFormatting.GOLD + nf.format(LootTracker.zombieRevs) + "\n" + EnumChatFormatting.GREEN + nf.format(LootTracker.zombieRevFlesh) + "\n" + + EnumChatFormatting.GREEN + nf.format(LootTracker.zombieRevViscera) + "\n" + EnumChatFormatting.BLUE + drop20 + "\n" + EnumChatFormatting.DARK_GREEN + LootTracker.zombiePestilences + "\n" + EnumChatFormatting.WHITE + LootTracker.zombieBooks + "\n" + @@ -259,6 +261,7 @@ public class LootDisplay { dropsText = EnumChatFormatting.GOLD + "Revs Killed:\n" + EnumChatFormatting.GREEN + "Revenant Flesh:\n" + + EnumChatFormatting.GREEN + "Revenant Viscera:\n" + EnumChatFormatting.BLUE + "Foul Flesh:\n" + EnumChatFormatting.DARK_GREEN + "Pestilence Runes:\n" + EnumChatFormatting.WHITE + "Smite VI Books:\n" + @@ -273,6 +276,7 @@ public class LootDisplay { EnumChatFormatting.AQUA + "Bosses Since RNG:"; countText = EnumChatFormatting.GOLD + nf.format(LootTracker.zombieRevsSession) + "\n" + EnumChatFormatting.GREEN + nf.format(LootTracker.zombieRevFleshSession) + "\n" + + EnumChatFormatting.GREEN + nf.format(LootTracker.zombieRevVisceraSession) + "\n" + EnumChatFormatting.BLUE + drop20 + "\n" + EnumChatFormatting.DARK_GREEN + LootTracker.zombiePestilencesSession + "\n" + EnumChatFormatting.WHITE + LootTracker.zombieBooksSession + "\n" + @@ -286,6 +290,126 @@ public class LootDisplay { EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; break; + case "enderman": + if (LootTracker.endermanTime == -1) { + timeBetween = "Never"; + } else { + timeBetween = Utils.getTimeBetween(LootTracker.endermanTime, timeNow); + } + if (LootTracker.endermanBosses == -1) { + bossesBetween = "Never"; + } else { + bossesBetween = nf.format(LootTracker.endermanBosses); + } + if (ToggleCommand.slayerCountTotal) { + drop20 = nf.format(LootTracker.endermanTAP); + } else { + drop20 = nf.format(LootTracker.endermanTAPDrops) + " times"; + } + + dropsText = EnumChatFormatting.GOLD + "Voidglooms Killed:\n" + + EnumChatFormatting.DARK_GRAY + "Null Spheres:\n" + + EnumChatFormatting.DARK_PURPLE + "Arrow Poison:\n" + + EnumChatFormatting.LIGHT_PURPLE + "Endersnake Runes:\n" + + EnumChatFormatting.DARK_GREEN + "Summoning Eyes:\n" + + EnumChatFormatting.AQUA + "Mana Steal Books:\n" + + EnumChatFormatting.BLUE + "Transmission Tuners:\n" + + EnumChatFormatting.YELLOW + "Null Atoms:\n" + + EnumChatFormatting.AQUA + "Espresso Machines:\n" + + EnumChatFormatting.WHITE + "Smarty Pants Books:\n" + + EnumChatFormatting.LIGHT_PURPLE + "End Runes:\n" + + EnumChatFormatting.RED + "Blood Chalices:\n" + + EnumChatFormatting.RED + "Sinful Dice:\n" + + EnumChatFormatting.DARK_PURPLE + "Artifact Upgrader:\n" + + EnumChatFormatting.DARK_PURPLE + "Enderman Skins:\n" + + EnumChatFormatting.GRAY + "Enchant Runes:\n" + + EnumChatFormatting.GOLD + "Etherwarp Mergers:\n" + + EnumChatFormatting.GOLD + "Judgement Cores:\n" + + EnumChatFormatting.RED + "Ender Slayer Books:\n" + + EnumChatFormatting.AQUA + "Time Since RNG:\n" + + EnumChatFormatting.AQUA + "Bosses Since RNG:"; + countText = EnumChatFormatting.GOLD + nf.format(LootTracker.endermanVoidglooms) + "\n" + + EnumChatFormatting.DARK_GRAY + nf.format(LootTracker.endermanNullSpheres) + "\n" + + EnumChatFormatting.DARK_PURPLE + drop20 + "\n" + + EnumChatFormatting.LIGHT_PURPLE + LootTracker.endermanEndersnakes + "\n" + + EnumChatFormatting.DARK_GREEN + LootTracker.endermanSummoningEyes + "\n" + + EnumChatFormatting.AQUA + LootTracker.endermanManaBooks + "\n" + + EnumChatFormatting.BLUE + LootTracker.endermanTuners + "\n" + + EnumChatFormatting.YELLOW + LootTracker.endermanAtoms + "\n" + + EnumChatFormatting.AQUA + LootTracker.endermanEspressoMachines + "\n" + + EnumChatFormatting.WHITE + LootTracker.endermanSmartyBooks + "\n" + + EnumChatFormatting.LIGHT_PURPLE + LootTracker.endermanEndRunes + "\n" + + EnumChatFormatting.RED + LootTracker.endermanChalices + "\n" + + EnumChatFormatting.RED + LootTracker.endermanDice + "\n" + + EnumChatFormatting.DARK_PURPLE + LootTracker.endermanArtifacts + "\n" + + EnumChatFormatting.DARK_PURPLE + LootTracker.endermanSkins + "\n" + + EnumChatFormatting.GRAY + LootTracker.endermanEnchantRunes + "\n" + + EnumChatFormatting.GOLD + LootTracker.endermanMergers + "\n" + + EnumChatFormatting.GOLD + LootTracker.endermanCores + "\n" + + EnumChatFormatting.RED + LootTracker.endermanEnderBooks + "\n" + + EnumChatFormatting.AQUA + timeBetween + "\n" + + EnumChatFormatting.AQUA + bossesBetween; + break; + case "enderman_session": + if (LootTracker.endermanTimeSession == -1) { + timeBetween = "Never"; + } else { + timeBetween = Utils.getTimeBetween(LootTracker.endermanTimeSession, timeNow); + } + if (LootTracker.endermanBossesSession == -1) { + bossesBetween = "Never"; + } else { + bossesBetween = nf.format(LootTracker.endermanBossesSession); + } + if (ToggleCommand.slayerCountTotal) { + drop20 = nf.format(LootTracker.endermanTAPSession); + } else { + drop20 = nf.format(LootTracker.endermanTAPDropsSession) + " times"; + } + + dropsText = EnumChatFormatting.GOLD + "Voidglooms Killed:\n" + + EnumChatFormatting.DARK_GRAY + "Null Spheres:\n" + + EnumChatFormatting.DARK_PURPLE + "Arrow Poison:\n" + + EnumChatFormatting.LIGHT_PURPLE + "Endersnake Runes:\n" + + EnumChatFormatting.DARK_GREEN + "Summoning Eyes:\n" + + EnumChatFormatting.AQUA + "Mana Steal Books:\n" + + EnumChatFormatting.BLUE + "Transmission Tuners:\n" + + EnumChatFormatting.YELLOW + "Null Atoms:\n" + + EnumChatFormatting.AQUA + "Espresso Machines:\n" + + EnumChatFormatting.WHITE + "Smarty Pants Books:\n" + + EnumChatFormatting.LIGHT_PURPLE + "End Runes:\n" + + EnumChatFormatting.RED + "Blood Chalices:\n" + + EnumChatFormatting.RED + "Sinful Dice:\n" + + EnumChatFormatting.DARK_PURPLE + "Artifact Upgrader:\n" + + EnumChatFormatting.DARK_PURPLE + "Enderman Skins:\n" + + EnumChatFormatting.GRAY + "Enchant Runes:\n" + + EnumChatFormatting.GOLD + "Etherwarp Mergers:\n" + + EnumChatFormatting.GOLD + "Judgement Cores:\n" + + EnumChatFormatting.RED + "Ender Slayer Books:\n" + + EnumChatFormatting.AQUA + "Time Since RNG:\n" + + EnumChatFormatting.AQUA + "Bosses Since RNG:"; + countText = EnumChatFormatting.GOLD + nf.format(LootTracker.endermanVoidgloomsSession) + "\n" + + EnumChatFormatting.DARK_GRAY + nf.format(LootTracker.endermanNullSpheresSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + drop20 + "\n" + + EnumChatFormatting.LIGHT_PURPLE + LootTracker.endermanEndersnakesSession + "\n" + + EnumChatFormatting.DARK_GREEN + LootTracker.endermanSummoningEyesSession + "\n" + + EnumChatFormatting.AQUA + LootTracker.endermanManaBooksSession + "\n" + + EnumChatFormatting.BLUE + LootTracker.endermanTunersSession + "\n" + + EnumChatFormatting.YELLOW + LootTracker.endermanAtomsSession + "\n" + + EnumChatFormatting.AQUA + LootTracker.endermanEspressoMachinesSession + "\n" + + EnumChatFormatting.WHITE + LootTracker.endermanSmartyBooksSession + "\n" + + EnumChatFormatting.LIGHT_PURPLE + LootTracker.endermanEndRunesSession + "\n" + + EnumChatFormatting.RED + LootTracker.endermanChalicesSession + "\n" + + EnumChatFormatting.RED + LootTracker.endermanDiceSession + "\n" + + EnumChatFormatting.DARK_PURPLE + LootTracker.endermanArtifactsSession + "\n" + + EnumChatFormatting.DARK_PURPLE + LootTracker.endermanSkinsSession + "\n" + + EnumChatFormatting.GRAY + LootTracker.endermanEnchantRunesSession + "\n" + + EnumChatFormatting.GOLD + LootTracker.endermanMergersSession + "\n" + + EnumChatFormatting.GOLD + LootTracker.endermanCoresSession + "\n" + + EnumChatFormatting.RED + LootTracker.endermanEnderBooksSession + "\n" + + EnumChatFormatting.AQUA + timeBetween + "\n" + + EnumChatFormatting.AQUA + bossesBetween; + break; case "fishing": if (LootTracker.empTime == -1) { timeBetween = "Never"; diff --git a/src/main/java/me/Danker/features/loot/LootTracker.java b/src/main/java/me/Danker/features/loot/LootTracker.java index d26c104..58f5a54 100644 --- a/src/main/java/me/Danker/features/loot/LootTracker.java +++ b/src/main/java/me/Danker/features/loot/LootTracker.java @@ -47,6 +47,7 @@ public class LootTracker { // Zombie public static int zombieRevs; public static int zombieRevFlesh; + public static int zombieRevViscera; public static int zombieFoulFlesh; public static int zombieFoulFleshDrops; public static int zombiePestilences; @@ -60,6 +61,29 @@ public class LootTracker { public static int zombieWardenHearts; public static double zombieTime; public static int zombieBosses; + // Enderman + public static int endermanVoidglooms; + public static int endermanNullSpheres; + public static int endermanTAP; + public static int endermanTAPDrops; + public static int endermanEndersnakes; + public static int endermanSummoningEyes; + public static int endermanManaBooks; + public static int endermanTuners; + public static int endermanAtoms; + public static int endermanEspressoMachines; + public static int endermanSmartyBooks; + public static int endermanEndRunes; + public static int endermanChalices; + public static int endermanDice; + public static int endermanArtifacts; + public static int endermanSkins; + public static int endermanMergers; + public static int endermanCores; + public static int endermanEnchantRunes; + public static int endermanEnderBooks; + public static double endermanTime; + public static int endermanBosses; // Fishing public static int seaCreatures; @@ -184,9 +208,7 @@ public class LootTracker { public static int voltas = 0; public static int plasmas = 0; public static int ghostlyBoots = 0; - // public static double ghostsTimeSpent = -1; - - + // public static double ghostsTimeSpent = -1; // Single sessions (No config saves) // Wolf @@ -218,6 +240,7 @@ public class LootTracker { // Zombie public static int zombieRevsSession = 0; public static int zombieRevFleshSession = 0; + public static int zombieRevVisceraSession = 0; public static int zombieFoulFleshSession = 0; public static int zombieFoulFleshDropsSession = 0; public static int zombiePestilencesSession = 0; @@ -231,6 +254,29 @@ public class LootTracker { public static int zombieWardenHeartsSession = 0; public static double zombieTimeSession = -1; public static int zombieBossesSession = -1; + // Enderman + public static int endermanVoidgloomsSession = 0; + public static int endermanNullSpheresSession = 0; + public static int endermanTAPSession = 0; + public static int endermanTAPDropsSession = 0; + public static int endermanEndersnakesSession = 0; + public static int endermanSummoningEyesSession = 0; + public static int endermanManaBooksSession = 0; + public static int endermanTunersSession = 0; + public static int endermanAtomsSession = 0; + public static int endermanEspressoMachinesSession = 0; + public static int endermanSmartyBooksSession = 0; + public static int endermanEndRunesSession = 0; + public static int endermanChalicesSession = 0; + public static int endermanDiceSession = 0; + public static int endermanArtifactsSession = 0; + public static int endermanSkinsSession = 0; + public static int endermanMergersSession = 0; + public static int endermanCoresSession = 0; + public static int endermanEnchantRunesSession = 0; + public static int endermanEnderBooksSession = 0; + public static double endermanTimeSession = -1; + public static int endermanBossesSession = -1; // Fishing public static int seaCreaturesSession = 0; @@ -355,8 +401,7 @@ public class LootTracker { public static int voltaSession = 0; public static int plasmaSession = 0; public static int ghostlyBootsSession = 0; - // public static double ghostsSecondsSinceStarts = 0; - + // public static double ghostsSecondsSinceStarts = 0; static double checkItemsNow = 0; static double itemsChecked = 0; @@ -365,7 +410,6 @@ public class LootTracker { public void onChat(ClientChatReceivedEvent event) { String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); - if (!Utils.inSkyblock) return; if (event.type == 2) return; if (message.contains(":")) return; @@ -373,8 +417,7 @@ public class LootTracker { boolean wolfRNG = false; boolean spiderRNG = false; boolean zombieRNG = false; - - + boolean endermanRNG = false; // Slayer tracker // T6 books @@ -409,9 +452,13 @@ public class LootTracker { } ConfigHandler.writeIntConfig("wolf", "svens", wolfSvens); ConfigHandler.writeIntConfig("wolf", "bossRNG", wolfBosses); - } else if (message.contains("RARE DROP! (Hamster Wheel)")) { + } else if (message.contains("RARE DROP! (") && message.contains("Hamster Wheel)")) { + int amount = getAmountfromMessage(message); + wolfWheels += amount; + wolfWheelsSession += amount; wolfWheelsDrops++; wolfWheelsDropsSession++; + ConfigHandler.writeIntConfig("wolf", "wheel", wolfWheels); ConfigHandler.writeIntConfig("wolf", "wheelDrops", wolfWheelsDrops); } else if (message.contains("VERY RARE DROP! (") && message.contains(" Spirit Rune I)")) { // Removing the unicode here *should* fix rune drops not counting wolfSpirits++; @@ -452,9 +499,13 @@ public class LootTracker { } ConfigHandler.writeIntConfig("spider", "tarantulas", spiderTarantulas); ConfigHandler.writeIntConfig("spider", "bossRNG", spiderBosses); - } else if (message.contains("RARE DROP! (Toxic Arrow Poison)")) { + } else if (message.contains("RARE DROP! (") && message.contains("Toxic Arrow Poison)")) { + int amount = getAmountfromMessage(message); + spiderTAP += amount; + spiderTAPSession += amount; spiderTAPDrops++; spiderTAPDropsSession++; + ConfigHandler.writeIntConfig("spider", "tap", spiderTAP); ConfigHandler.writeIntConfig("spider", "tapDrops", spiderTAPDrops); } else if (message.contains("VERY RARE DROP! (") && message.contains(" Bite Rune I)")) { spiderBites++; @@ -493,9 +544,18 @@ public class LootTracker { } ConfigHandler.writeIntConfig("zombie", "revs", zombieRevs); ConfigHandler.writeIntConfig("zombie", "bossRNG", zombieBosses); - } else if (message.contains("RARE DROP! (Foul Flesh)")) { + } else if (message.contains("RARE DROP! (") && message.contains("Revenant Viscera)")) { + int amount = getAmountfromMessage(message); + zombieRevViscera += amount; + zombieRevVisceraSession += amount; + ConfigHandler.writeIntConfig("zombie", "revViscera", zombieRevViscera); + } else if (message.contains("RARE DROP! (") && message.contains("Foul Flesh)")) { + int amount = getAmountfromMessage(message); + zombieFoulFlesh += amount; + zombieFoulFleshSession += amount; zombieFoulFleshDrops++; zombieFoulFleshDropsSession++; + ConfigHandler.writeIntConfig("zombie", "foulFlesh", zombieFoulFlesh); ConfigHandler.writeIntConfig("zombie", "foulFleshDrops", zombieFoulFleshDrops); } else if (message.contains("VERY RARE DROP! (Revenant Catalyst)")) { zombieRevCatas++; @@ -533,12 +593,109 @@ public class LootTracker { zombieShardsSession++; ConfigHandler.writeIntConfig("zombie", "shard", zombieShards); if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.RED + "SHARD OF THE SHREDDED!", 5); - } else if (message.contains("INSANE DROP! (Warden Heart)")) { + } else if (message.contains("INSANE DROP! (Warden Heart)") || message.contains("CRAZY RARE DROP! (Warden Heart)")) { zombieRNG = true; zombieWardenHearts++; zombieWardenHeartsSession++; ConfigHandler.writeIntConfig("zombie", "heart", zombieWardenHearts); if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.RED + "WARDEN HEART!", 5); + } else if (message.contains(" Enderman Slayer LVL ")) { + endermanVoidglooms++; + endermanVoidgloomsSession++; + if (endermanBosses != -1) { + endermanBosses++; + } + if (endermanBossesSession != -1) { + endermanBossesSession++; + } + ConfigHandler.writeIntConfig("enderman", "voidglooms", endermanVoidglooms); + ConfigHandler.writeIntConfig("enderman", "bossRNG", endermanBosses); + } else if (message.contains("RARE DROP! (") && message.contains("Twilight Arrow Poison)")) { + int amount = getAmountfromMessage(message); + endermanTAP += amount; + endermanTAPSession += amount; + endermanTAPDrops++; + endermanTAPDropsSession++; + ConfigHandler.writeIntConfig("enderman", "tap", endermanTAP); + ConfigHandler.writeIntConfig("enderman", "tapDrops", endermanTAPDrops); + } else if (message.contains("VERY RARE DROP! (") && message.contains(" Endersnake Rune I)")) { + endermanEndersnakes++; + endermanEndersnakesSession++; + ConfigHandler.writeIntConfig("enderman", "endersnakes", endermanEndersnakes); + } else if (message.contains("VERY RARE DROP! (Summoning Eye)")) { + endermanSummoningEyes++; + endermanSummoningEyesSession++; + ConfigHandler.writeIntConfig("enderman", "summoningEyes", endermanSummoningEyes); + } else if (message.contains("VERY RARE DROP! (Mana Steal I)")) { + endermanManaBooks++; + endermanManaBooksSession++; + ConfigHandler.writeIntConfig("enderman", "manaBooks", endermanManaBooks); + } else if (message.contains("VERY RARE DROP! (Transmission Tuner)")) { + endermanTuners++; + endermanTunersSession++; + ConfigHandler.writeIntConfig("enderman", "tuners", endermanTuners); + } else if (message.contains("VERY RARE DROP! (Null Atom)")) { + endermanAtoms++; + endermanAtomsSession++; + ConfigHandler.writeIntConfig("enderman", "atoms", endermanAtoms); + } else if (message.contains("CRAZY RARE DROP! (Pocket Espresso Machine)")) { + endermanRNG = true; + endermanEspressoMachines++; + endermanEspressoMachinesSession++; + ConfigHandler.writeIntConfig("enderman", "espressoMachines", endermanEspressoMachines); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.AQUA + "POCKET ESPRESSO MACHINE!", 3); + } else if (message.contains("VERY RARE DROP! (Smarty Pants I)")) { + endermanSmartyBooks++; + endermanSmartyBooksSession++; + ConfigHandler.writeIntConfig("enderman", "smartyBooks", endermanSmartyBooks); + } else if (message.contains("VERY RARE DROP! (") && message.contains(" End Rune I)")) { + endermanEndRunes++; + endermanEndRunesSession++; + ConfigHandler.writeIntConfig("enderman", "endRunes", endermanEndRunes); + } else if (message.contains("CRAZY RARE DROP! (Handy Blood Chalice)")) { + endermanRNG = true; + endermanChalices++; + endermanChalicesSession++; + ConfigHandler.writeIntConfig("enderman", "chalices", endermanChalices); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.RED + "HANDY BLOOD CHALICE!", 3); + } else if (message.contains("VERY RARE DROP! (Sinful Dice)")) { + endermanDice++; + endermanDiceSession++; + ConfigHandler.writeIntConfig("enderman", "dice", endermanDice); + } else if (message.contains("CRAZY RARE DROP! (Exceedingly Rare Ender Artifact Upgrader)")) { + endermanRNG = true; + endermanArtifacts++; + endermanArtifactsSession++; + ConfigHandler.writeIntConfig("enderman", "artifacts", endermanArtifacts); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "ENDER ARTIFACT UPGRADER!", 3); + } else if (message.contains("CRAZY RARE DROP! (Void Conqueror Enderman Skin)")) { + endermanRNG = true; + endermanSkins++; + endermanSkinsSession++; + ConfigHandler.writeIntConfig("enderman", "skins", endermanSkins); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "ENDERMAN SKIN!", 3); + } else if (message.contains("VERY RARE DROP! (Etherwarp Merger)")) { + endermanMergers++; + endermanMergersSession++; + ConfigHandler.writeIntConfig("enderman", "mergers", endermanMergers); + } else if (message.contains("CRAZY RARE DROP! (Judgement Core)")) { + endermanRNG = true; + endermanCores++; + endermanCoresSession++; + ConfigHandler.writeIntConfig("enderman", "cores", endermanCores); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GOLD + "JUDGEMENT CORE!", 5); + } else if (message.contains("CRAZY RARE DROP! (") && message.contains(" Enchant Rune I)")) { + endermanRNG = true; + endermanEnchantRunes++; + endermanEnchantRunesSession++; + ConfigHandler.writeIntConfig("enderman", "enchantRunes", endermanEnchantRunes); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GRAY + "ENCHANT RUNE!", 3); + } else if (message.contains("INSANE DROP! (Ender Slayer VII)") || message.contains("CRAZY RARE DROP! (Ender Slayer VII)")) { + endermanRNG = true; + endermanEnderBooks++; + endermanEnderBooksSession++; + ConfigHandler.writeIntConfig("enderman", "enderBooks", endermanEnderBooks); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.RED + "ENDER SLAYER VII!", 3); } if (wolfRNG) { @@ -565,6 +722,14 @@ public class LootTracker { ConfigHandler.writeDoubleConfig("zombie", "timeRNG", zombieTime); ConfigHandler.writeIntConfig("zombie", "bossRNG", 0); } + if (endermanRNG) { + endermanTime = System.currentTimeMillis() / 1000; + endermanBosses = 0; + endermanTimeSession = System.currentTimeMillis() / 1000; + endermanBossesSession = 0; + ConfigHandler.writeDoubleConfig("enderman", "timeRNG", endermanTime); + ConfigHandler.writeIntConfig("enderman", "bossRNG", 0); + } // Fishing tracker if (message.contains("GOOD CATCH!")) { @@ -1095,34 +1260,26 @@ public class LootTracker { // If Hypixel lags and scoreboard doesn't update if (cleanedLine.contains("Boss slain!") || cleanedLine.contains("Slay the boss!")) { int itemTeeth = Utils.getItems("Wolf Tooth"); - int itemWheels = Utils.getItems("Hamster Wheel"); int itemWebs = Utils.getItems("Tarantula Web"); - int itemTAP = Utils.getItems("Toxic Arrow Poison"); int itemRev = Utils.getItems("Revenant Flesh"); - int itemFoul = Utils.getItems("Foul Flesh"); + int itemNullSphere = Utils.getItems("Null Sphere"); // If no items, are detected, allow check again. Should fix items not being found - if (itemTeeth + itemWheels + itemWebs + itemTAP + itemRev + itemFoul > 0) { + if (itemTeeth + itemWebs + itemRev + itemNullSphere > 0) { itemsChecked = System.currentTimeMillis() / 1000; wolfTeeth += itemTeeth; - wolfWheels += itemWheels; spiderWebs += itemWebs; - spiderTAP += itemTAP; zombieRevFlesh += itemRev; - zombieFoulFlesh += itemFoul; + endermanNullSpheres += itemNullSphere; wolfTeethSession += itemTeeth; - wolfWheelsSession += itemWheels; spiderWebsSession += itemWebs; - spiderTAPSession += itemTAP; zombieRevFleshSession += itemRev; - zombieFoulFleshSession += itemFoul; + endermanNullSpheresSession += itemNullSphere; ConfigHandler.writeIntConfig("wolf", "teeth", wolfTeeth); - ConfigHandler.writeIntConfig("wolf", "wheel", wolfWheels); ConfigHandler.writeIntConfig("spider", "web", spiderWebs); - ConfigHandler.writeIntConfig("spider", "tap", spiderTAP); ConfigHandler.writeIntConfig("zombie", "revFlesh", zombieRevFlesh); - ConfigHandler.writeIntConfig("zombie", "foulFlesh", zombieFoulFlesh); + ConfigHandler.writeIntConfig("enderman", "nullSpheres", endermanNullSpheres); } } } @@ -1159,5 +1316,13 @@ public class LootTracker { ConfigHandler.writeIntConfig("fishing", "empSC", empSCs); ConfigHandler.writeIntConfig("fishing", "yetiSC", yetiSCs); } + + public int getAmountfromMessage(String message) { + if (message.charAt(message.indexOf("(") + 1) == 'x') { + return Integer.parseInt(message.substring(message.indexOf("(") + 1, message.indexOf("x"))); + } else { + return 1; + } + } } diff --git a/src/main/java/me/Danker/gui/DisplayGui.java b/src/main/java/me/Danker/gui/DisplayGui.java index 38459ee..e5a6641 100644 --- a/src/main/java/me/Danker/gui/DisplayGui.java +++ b/src/main/java/me/Danker/gui/DisplayGui.java @@ -20,6 +20,7 @@ public class DisplayGui extends GuiScreen { private GuiButton zombie; private GuiButton spider; private GuiButton wolf; + private GuiButton enderman; private GuiButton auto; private GuiButton fishing; private GuiButton fishingWinter; @@ -52,9 +53,10 @@ public class DisplayGui extends GuiScreen { showSession = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Current Session Only: " + Utils.getColouredBoolean(addSession)); off = new GuiButton(0, width / 2 - 210, (int) (height * 0.2), "Off"); auto = new GuiButton(0, width / 2 + 10, (int) (height * 0.2), "Auto"); - zombie = new GuiButton(0, width / 2 - 190, (int) (height * 0.3), 110, 20, "Zombie"); - spider = new GuiButton(0, width / 2 - 55, (int) (height * 0.3), 110, 20, "Spider"); - wolf = new GuiButton(0, width / 2 + 75, (int) (height * 0.3), 110, 20, "Wolf"); + zombie = new GuiButton(0, width / 2 - 230, (int) (height * 0.3), 100, 20, "Zombie"); + spider = new GuiButton(0, width / 2 - 110, (int) (height * 0.3), 100, 20, "Spider"); + wolf = new GuiButton(0, width / 2 + 10, (int) (height * 0.3), 100, 20, "Wolf"); + enderman = new GuiButton(0, width / 2 + 130, (int) (height * 0.3), 100, 20, "Enderman"); fishing = new GuiButton(0, width / 2 - 230, (int) (height * 0.4), 100, 20, "Fishing"); fishingWinter = new GuiButton(0, width / 2 - 110, (int) (height * 0.4), 100, 20, "Fishing Winter"); fishingFestival = new GuiButton(0, width / 2 + 10, (int) (height * 0.4), 100, 20, "Fishing Festival"); @@ -75,6 +77,7 @@ public class DisplayGui extends GuiScreen { this.buttonList.add(zombie); this.buttonList.add(spider); this.buttonList.add(wolf); + this.buttonList.add(enderman); this.buttonList.add(fishing); this.buttonList.add(fishingWinter); this.buttonList.add(fishingFestival); @@ -127,6 +130,8 @@ public class DisplayGui extends GuiScreen { setDisplay("spider", false); } else if (button == wolf) { setDisplay("wolf", false); + } else if (button == enderman) { + setDisplay("enderman", false); } else if (button == auto) { LootDisplay.auto = true; ConfigHandler.writeBooleanConfig("misc", "autoDisplay", true); diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index c289dac..002d9f7 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -294,6 +294,7 @@ public class ConfigHandler { // Zombie LootTracker.zombieRevs = initInt("zombie", "revs", 0); LootTracker.zombieRevFlesh = initInt("zombie", "revFlesh", 0); + LootTracker.zombieRevViscera = initInt("zombie", "revViscera", 0); LootTracker.zombieFoulFlesh = initInt("zombie", "foulFlesh", 0); LootTracker.zombieFoulFleshDrops = initInt("zombie", "foulFleshDrops", 0); LootTracker.zombiePestilences = initInt("zombie", "pestilence", 0); @@ -307,6 +308,29 @@ public class ConfigHandler { LootTracker.zombieWardenHearts = initInt("zombie", "heart", 0); LootTracker.zombieTime = initDouble("zombie", "timeRNG", -1); LootTracker.zombieBosses = initInt("zombie", "bossRNG", -1); + // Enderman + LootTracker.endermanVoidglooms = initInt("enderman", "voidglooms", 0); + LootTracker.endermanNullSpheres = initInt("enderman", "nullSpheres", 0); + LootTracker.endermanTAP = initInt("enderman", "tap", 0); + LootTracker.endermanTAPDrops = initInt("enderman", "tapDrops", 0); + LootTracker.endermanEndersnakes = initInt("enderman", "endersnakes", 0); + LootTracker.endermanSummoningEyes = initInt("enderman", "summoningEyes", 0); + LootTracker.endermanManaBooks = initInt("enderman", "manaBooks", 0); + LootTracker.endermanTuners = initInt("enderman", "tuners", 0); + LootTracker.endermanAtoms = initInt("enderman", "atoms", 0); + LootTracker.endermanEspressoMachines = initInt("enderman", "espressoMachines", 0); + LootTracker.endermanSmartyBooks = initInt("enderman", "smartyBooks", 0); + LootTracker.endermanEndRunes = initInt("enderman", "endRunes", 0); + LootTracker.endermanChalices = initInt("enderman", "chalices", 0); + LootTracker.endermanDice = initInt("enderman", "dice", 0); + LootTracker.endermanArtifacts = initInt("enderman", "artifacts", 0); + LootTracker.endermanSkins = initInt("enderman", "skins", 0); + LootTracker.endermanMergers = initInt("enderman", "mergers", 0); + LootTracker.endermanCores = initInt("enderman", "cores", 0); + LootTracker.endermanEnchantRunes = initInt("enderman", "enchantRunes", 0); + LootTracker.endermanEnderBooks = initInt("enderman", "enderBooks", 0); + LootTracker.endermanTime = initDouble("enderman", "timeRNG", -1); + LootTracker.endermanBosses = initInt("enderman", "bossRNG", -1); // Fishing LootTracker.seaCreatures = initInt("fishing", "seaCreature", 0); -- cgit From 5c7c3d0f5ca04df48c2b8f054a662300e9f0d14b Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 17 Jun 2021 00:31:22 -0400 Subject: Fix edit location buttons not having correct hitbox --- src/main/java/me/Danker/gui/buttons/LocationButton.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/gui/buttons/LocationButton.java b/src/main/java/me/Danker/gui/buttons/LocationButton.java index f328c58..8da1ab9 100644 --- a/src/main/java/me/Danker/gui/buttons/LocationButton.java +++ b/src/main/java/me/Danker/gui/buttons/LocationButton.java @@ -40,24 +40,19 @@ public class LocationButton extends GuiButton { } this.longestText = longestText; + int offset = text2Offset == null ? 0 : text2Offset; this.height = (int) ((splitText.length * 9 + 3) * scale); - this.width = (int) ((this.longestText + 3) * scale); + this.width = (int) ((this.longestText + offset + 3) * scale); } @Override public void drawButton(Minecraft mc, int mouseX, int mouseY) { - if (text2 == null) { - drawRect(x - 2, y - 2, x + width, y + height, 0x40D3D3D3); - } else { - drawRect(x - 2, y - 2, (int) (x + (longestText + text2Offset + 3) * scale), y + height, 0x40D3D3D3); - new TextRenderer(mc, text2, (int) (x + (text2Offset * scale)), y, scale); - } + drawRect(x - 2, y - 2, x + width, y + height, 0x40D3D3D3); + if (text2 != null) new TextRenderer(mc, text2, (int) (x + (text2Offset * scale)), y, scale); new TextRenderer(mc, text, x, y, scale); } @Override - public void playPressSound(SoundHandler soundHandler) { - - } + public void playPressSound(SoundHandler soundHandler) {} } -- cgit From 6e2a26294383a67691d837dbbdd00adffbe70a80 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 25 Jun 2021 23:27:34 -0400 Subject: Fix issues with skill features --- src/main/java/me/Danker/DankersSkyblockMod.java | 25 +++++++--------------- .../java/me/Danker/features/Skill50Display.java | 11 +++++++++- src/main/java/me/Danker/features/SkillTracker.java | 10 ++++++++- src/main/java/me/Danker/utils/Utils.java | 21 ++++++++++++++++++ 4 files changed, 48 insertions(+), 19 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index f1c8c1c..92c30e7 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -379,23 +379,14 @@ public class DankersSkyblockMod { if (chestName.equals("Your Skills")) { List invSlots = ((GuiChest) mc.currentScreen).inventorySlots.inventorySlots; - farmingLevel = Utils.getIntFromString(invSlots.get(19).getStack().getDisplayName().substring(invSlots.get(19).getStack().getDisplayName().indexOf(" ") + 1), true); - miningLevel = Utils.getIntFromString(invSlots.get(20).getStack().getDisplayName().substring(invSlots.get(20).getStack().getDisplayName().indexOf(" ") + 1), true); - combatLevel = Utils.getIntFromString(invSlots.get(21).getStack().getDisplayName().substring(invSlots.get(21).getStack().getDisplayName().indexOf(" ") + 1), true); - foragingLevel = Utils.getIntFromString(invSlots.get(22).getStack().getDisplayName().substring(invSlots.get(22).getStack().getDisplayName().indexOf(" ") + 1), true); - fishingLevel = Utils.getIntFromString(invSlots.get(23).getStack().getDisplayName().substring(invSlots.get(23).getStack().getDisplayName().indexOf(" ") + 1), true); - enchantingLevel = Utils.getIntFromString(invSlots.get(24).getStack().getDisplayName().substring(invSlots.get(24).getStack().getDisplayName().indexOf(" ") + 1), true); - alchemyLevel = Utils.getIntFromString(invSlots.get(25).getStack().getDisplayName().substring(invSlots.get(25).getStack().getDisplayName().indexOf(" ") + 1), true); - carpentryLevel = Utils.getIntFromString(invSlots.get(29).getStack().getDisplayName().substring(invSlots.get(29).getStack().getDisplayName().indexOf(" ") + 1), true); - - ConfigHandler.writeIntConfig("skills", "farming", farmingLevel); - ConfigHandler.writeIntConfig("skills", "mining", miningLevel); - ConfigHandler.writeIntConfig("skills", "combat", combatLevel); - ConfigHandler.writeIntConfig("skills", "foraging", foragingLevel); - ConfigHandler.writeIntConfig("skills", "fishing", fishingLevel); - ConfigHandler.writeIntConfig("skills", "enchanting", enchantingLevel); - ConfigHandler.writeIntConfig("skills", "alchemy", alchemyLevel); - ConfigHandler.writeIntConfig("skills", "carpentry", carpentryLevel); + farmingLevel = Utils.initializeSkill(invSlots.get(19).getStack(), "farming"); + miningLevel = Utils.initializeSkill(invSlots.get(20).getStack(), "mining"); + combatLevel = Utils.initializeSkill(invSlots.get(21).getStack(), "combat"); + foragingLevel = Utils.initializeSkill(invSlots.get(22).getStack(), "foraging"); + fishingLevel = Utils.initializeSkill(invSlots.get(23).getStack(), "fishing"); + enchantingLevel = Utils.initializeSkill(invSlots.get(24).getStack(), "enchanting"); + alchemyLevel = Utils.initializeSkill(invSlots.get(25).getStack(), "alchemy"); + carpentryLevel = Utils.initializeSkill(invSlots.get(29).getStack(), "carpentry"); System.out.println("Updated skill levels."); } diff --git a/src/main/java/me/Danker/features/Skill50Display.java b/src/main/java/me/Danker/features/Skill50Display.java index d7b759e..230189e 100644 --- a/src/main/java/me/Danker/features/Skill50Display.java +++ b/src/main/java/me/Danker/features/Skill50Display.java @@ -45,7 +45,16 @@ public class Skill50Display { limit = 50; totalXp = 55172425; } - int previousXp = Utils.getPastXpEarned(Integer.parseInt(section.substring(section.indexOf("/") + 1, section.indexOf(")")).replaceAll(",", "")), limit); + + int nextLevelXp; + String nextLevelXpString = section.substring(section.indexOf("/") + 1, section.indexOf(")")).replaceAll(",", ""); + if (nextLevelXpString.contains("k")) { + nextLevelXp = Integer.parseInt(nextLevelXpString.substring(0, nextLevelXpString.indexOf("k"))) * 1000; + } else { + nextLevelXp = Integer.parseInt(nextLevelXpString); + } + + int previousXp = Utils.getPastXpEarned(nextLevelXp, limit); double percentage = Math.floor(((currentXp + previousXp) / totalXp) * 10000D) / 100D; NumberFormat nf = NumberFormat.getNumberInstance(Locale.US); diff --git a/src/main/java/me/Danker/features/SkillTracker.java b/src/main/java/me/Danker/features/SkillTracker.java index a2f3249..e71e8d2 100644 --- a/src/main/java/me/Danker/features/SkillTracker.java +++ b/src/main/java/me/Danker/features/SkillTracker.java @@ -68,7 +68,15 @@ public class SkillTracker { if (section.contains("/")) { int limit = section.contains("Farming") || section.contains("Enchanting") || section.contains("Mining") || section.contains("Combat") ? 60 : 50; double currentXP = Double.parseDouble(section.substring(section.indexOf("(") + 1, section.indexOf("/")).replace(",", "")); - int xpToLevelUp = Integer.parseInt(section.substring(section.indexOf("/") + 1, section.indexOf(")")).replaceAll(",", "")); + + int xpToLevelUp; + String nextLevelXpString = section.substring(section.indexOf("/") + 1, section.indexOf(")")).replaceAll(",", ""); + if (nextLevelXpString.contains("k")) { + xpToLevelUp = Integer.parseInt(nextLevelXpString.substring(0, nextLevelXpString.indexOf("k"))) * 1000; + } else { + xpToLevelUp = Integer.parseInt(nextLevelXpString); + } + xpLeft = xpToLevelUp - currentXP; int previousXP = Utils.getPastXpEarned(xpToLevelUp, limit); totalXP = currentXP + previousXP; diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 4acee7f..b828146 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -2,6 +2,7 @@ package me.Danker.utils; import me.Danker.DankersSkyblockMod; import me.Danker.features.GoldenEnchants; +import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.ScoreboardHandler; import me.Danker.handlers.TextRenderer; import net.minecraft.block.Block; @@ -574,6 +575,7 @@ public class Utils { int number = 0; for (int i = 0; i < text.length(); i++) { + if (!romanNumerals.containsKey(text.charAt(i))) continue; int roman = romanNumerals.get(text.charAt(i)); if (i != text.length() - 1 && roman < romanNumerals.get(text.charAt(i + 1))) { @@ -586,6 +588,7 @@ public class Utils { return number; } + return -1; } @@ -593,4 +596,22 @@ public class Utils { return DankersSkyblockMod.miningLevel != -1; } + public static int initializeSkill(ItemStack skillStack, String configValue) { + int level = -1; + + if (skillStack != null) { + String display = skillStack.getDisplayName(); + if (display.startsWith("§a")) { + if (display.contains(" ")) { + level = Utils.getIntFromString(display.substring(display.indexOf(" ") + 1), true); + } else { + level = 0; + } + } + } + + ConfigHandler.writeIntConfig("skills", configValue, level); + return level; + } + } -- cgit From 1b1cb67e9ed9023b62095313297d510e73a44d53 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 29 Jun 2021 15:16:41 -0400 Subject: Add enderman slayer to commands --- src/main/java/me/Danker/commands/PlayerCommand.java | 10 ++++++++-- src/main/java/me/Danker/commands/SlayerCommand.java | 8 +++++++- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/PlayerCommand.java b/src/main/java/me/Danker/commands/PlayerCommand.java index ef0ed4c..6236168 100644 --- a/src/main/java/me/Danker/commands/PlayerCommand.java +++ b/src/main/java/me/Danker/commands/PlayerCommand.java @@ -193,6 +193,11 @@ public class PlayerCommand extends CommandBase { if (slayersObject.get("wolf").getAsJsonObject().has("xp")) { wolfXP = slayersObject.get("wolf").getAsJsonObject().get("xp").getAsInt(); } + // Enderman + int endermanXP = 0; + if (slayersObject.get("enderman").getAsJsonObject().has("xp")) { + endermanXP = slayersObject.get("enderman").getAsJsonObject().get("xp").getAsInt(); + } // Bank System.out.println("Fetching bank + purse coins..."); @@ -233,10 +238,11 @@ public class PlayerCommand extends CommandBase { DankersSkyblockMod.TYPE_COLOUR + " Taming: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + tamingLevel + "\n" + EnumChatFormatting.AQUA + " Average Skill Level: " + DankersSkyblockMod.SKILL_AVERAGE_COLOUR + EnumChatFormatting.BOLD + skillAvg + "\n" + EnumChatFormatting.AQUA + " True Average Skill Level: " + DankersSkyblockMod.SKILL_AVERAGE_COLOUR + EnumChatFormatting.BOLD + trueAvg + "\n\n" + - EnumChatFormatting.AQUA + " " + username + "'s Total Slayer XP: " + EnumChatFormatting.GOLD + EnumChatFormatting.BOLD + nf.format(zombieXP + spiderXP + wolfXP) + "\n" + + EnumChatFormatting.AQUA + " " + username + "'s Total Slayer XP: " + EnumChatFormatting.GOLD + EnumChatFormatting.BOLD + nf.format(zombieXP + spiderXP + wolfXP + endermanXP) + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Zombie XP: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(zombieXP) + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Spider XP: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(spiderXP) + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Wolf XP: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(wolfXP) + "\n\n" + + DankersSkyblockMod.TYPE_COLOUR + " Wolf XP: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(wolfXP) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Enderman XP: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(endermanXP) + "\n\n" + EnumChatFormatting.AQUA + " " + username + "'s Coins:\n" + DankersSkyblockMod.TYPE_COLOUR + " Bank: " + (bankCoins == 0 ? EnumChatFormatting.RED + "Bank API disabled." : EnumChatFormatting.GOLD + nf.format(bankCoins)) + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Purse: " + EnumChatFormatting.GOLD + nf.format(purseCoins) + "\n" + diff --git a/src/main/java/me/Danker/commands/SlayerCommand.java b/src/main/java/me/Danker/commands/SlayerCommand.java index 91a1a61..45d3548 100644 --- a/src/main/java/me/Danker/commands/SlayerCommand.java +++ b/src/main/java/me/Danker/commands/SlayerCommand.java @@ -107,13 +107,19 @@ public class SlayerCommand extends CommandBase { if (slayersObject.get("wolf").getAsJsonObject().has("xp")) { wolfXP = slayersObject.get("wolf").getAsJsonObject().get("xp").getAsInt(); } + // Enderman + int endermanXP = 0; + if (slayersObject.get("enderman").getAsJsonObject().has("xp")) { + endermanXP = slayersObject.get("enderman").getAsJsonObject().get("xp").getAsInt(); + } NumberFormat nf = NumberFormat.getIntegerInstance(Locale.US); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" + - EnumChatFormatting.AQUA + " " + username + "'s Total XP: " + EnumChatFormatting.GOLD + EnumChatFormatting.BOLD + nf.format(zombieXP + spiderXP + wolfXP) + "\n" + + EnumChatFormatting.AQUA + " " + username + "'s Total XP: " + EnumChatFormatting.GOLD + EnumChatFormatting.BOLD + nf.format(zombieXP + spiderXP + wolfXP + endermanXP) + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Zombie XP: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(zombieXP) + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Spider XP: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(spiderXP) + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Wolf XP: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(wolfXP) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Enderman XP: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(endermanXP) + "\n" + DankersSkyblockMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------")); }).start(); -- cgit From 647728fb3945fa4c3ac5e74026343d1a4d5024a7 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 29 Jun 2021 15:22:02 -0400 Subject: Add command to reload repo --- README.md | 2 + src/main/java/me/Danker/DankersSkyblockMod.java | 1 + src/main/java/me/Danker/commands/DHelpCommand.java | 2 + .../java/me/Danker/commands/ReloadRepoCommand.java | 53 ++++++++++++++++++++++ 4 files changed, 58 insertions(+) create mode 100644 src/main/java/me/Danker/commands/ReloadRepoCommand.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index f6a4814..3c8de13 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,8 @@ Discord Server: https://discord.gg/QsEkNQS - /lobbybank - Uses API to find the average bank total of the lobby, as well the three players with the highest total money in the bank (and purse). - /dsmmusic [dungeonboss/bloodroom/dungeon] [1-100] - Stops, reloads or changes the volume of custom music. - /player [player] - Uses API to find skills, slayers, coins and weight of a player. +- /reloadconfig - Reloads Danker's Skyblock Mod config. +- /reloaddsmrepo - Reloads Danker's Skyblock Mod repository. ## Keybinds - Open Maddox menu - M by default. diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 92c30e7..937b411 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -195,6 +195,7 @@ public class DankersSkyblockMod { ClientCommandHandler.instance.registerCommand(new PetsCommand()); ClientCommandHandler.instance.registerCommand(new PlayerCommand()); ClientCommandHandler.instance.registerCommand(new ReloadConfigCommand()); + ClientCommandHandler.instance.registerCommand(new ReloadRepoCommand()); ClientCommandHandler.instance.registerCommand(new ResetLootCommand()); ClientCommandHandler.instance.registerCommand(new ScaleCommand()); ClientCommandHandler.instance.registerCommand(new SetkeyCommand()); diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 4d595e5..42a82c4 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -57,6 +57,8 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + RepartyCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Disbands and reparties all members in the party.\n" + EnumChatFormatting.GOLD + CustomMusicCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Stops or reloads the custom music.\n" + EnumChatFormatting.GOLD + PlayerCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find skills, slayers, coins and weight of a player.\n" + + EnumChatFormatting.GOLD + ReloadConfigCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Reloads Danker's Skyblock Mod config.\n" + + EnumChatFormatting.GOLD + ReloadRepoCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Reloads Danker's Skyblock Mod repository.\n" + EnumChatFormatting.GREEN + " Open Maddox Menu" + EnumChatFormatting.AQUA + " - M by default.\n" + EnumChatFormatting.GREEN + " Start/Stop Skill Tracker" + EnumChatFormatting.AQUA + " - Numpad 5 by default.\n")); } diff --git a/src/main/java/me/Danker/commands/ReloadRepoCommand.java b/src/main/java/me/Danker/commands/ReloadRepoCommand.java new file mode 100644 index 0000000..1681971 --- /dev/null +++ b/src/main/java/me/Danker/commands/ReloadRepoCommand.java @@ -0,0 +1,53 @@ +package me.Danker.commands; + +import me.Danker.DankersSkyblockMod; +import me.Danker.features.ColouredNames; +import me.Danker.handlers.APIHandler; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ChatComponentText; + +import java.util.ArrayList; +import java.util.Map; +import java.util.stream.Collectors; + +public class ReloadRepoCommand extends CommandBase { + + @Override + public String getCommandName() { + return "reloaddsmrepo"; + } + + @Override + public String getCommandUsage(ICommandSender arg0) { + return "/" + getCommandName(); + } + + public static String usage(ICommandSender arg0) { + return new ReloadRepoCommand().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { + // MULTI THREAD DRIFTING + new Thread(() -> { + EntityPlayer player = (EntityPlayer) arg0; + + DankersSkyblockMod.data = APIHandler.getResponse("https://raw.githubusercontent.com/bowser0000/SkyblockMod-REPO/main/data.json"); + System.out.println("Loaded data from GitHub?: " + (DankersSkyblockMod.data != null && DankersSkyblockMod.data.has("trivia"))); + ColouredNames.users = DankersSkyblockMod.data.get("colourednames").getAsJsonObject().entrySet().stream() + .map(Map.Entry::getKey) + .collect(Collectors.toCollection(ArrayList::new)); + + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Refreshed Danker's Skyblock Mod repo.")); + }).start(); + } + +} -- cgit From 17d42cffb8264a604e93052ee146887ae7fd32cb Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Mon, 5 Jul 2021 11:44:21 -0400 Subject: More skill fixes --- src/main/java/me/Danker/features/Skill50Display.java | 2 +- src/main/java/me/Danker/features/SkillTracker.java | 2 +- src/main/java/me/Danker/utils/Utils.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/Skill50Display.java b/src/main/java/me/Danker/features/Skill50Display.java index 230189e..99b1d62 100644 --- a/src/main/java/me/Danker/features/Skill50Display.java +++ b/src/main/java/me/Danker/features/Skill50Display.java @@ -49,7 +49,7 @@ public class Skill50Display { int nextLevelXp; String nextLevelXpString = section.substring(section.indexOf("/") + 1, section.indexOf(")")).replaceAll(",", ""); if (nextLevelXpString.contains("k")) { - nextLevelXp = Integer.parseInt(nextLevelXpString.substring(0, nextLevelXpString.indexOf("k"))) * 1000; + nextLevelXp = (int) (Double.parseDouble(nextLevelXpString.substring(0, nextLevelXpString.indexOf("k"))) * 1000); } else { nextLevelXp = Integer.parseInt(nextLevelXpString); } diff --git a/src/main/java/me/Danker/features/SkillTracker.java b/src/main/java/me/Danker/features/SkillTracker.java index e71e8d2..9438b3d 100644 --- a/src/main/java/me/Danker/features/SkillTracker.java +++ b/src/main/java/me/Danker/features/SkillTracker.java @@ -72,7 +72,7 @@ public class SkillTracker { int xpToLevelUp; String nextLevelXpString = section.substring(section.indexOf("/") + 1, section.indexOf(")")).replaceAll(",", ""); if (nextLevelXpString.contains("k")) { - xpToLevelUp = Integer.parseInt(nextLevelXpString.substring(0, nextLevelXpString.indexOf("k"))) * 1000; + xpToLevelUp = (int) (Double.parseDouble(nextLevelXpString.substring(0, nextLevelXpString.indexOf("k"))) * 1000); } else { xpToLevelUp = Integer.parseInt(nextLevelXpString); } diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index b828146..e2dde4b 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -578,7 +578,7 @@ public class Utils { if (!romanNumerals.containsKey(text.charAt(i))) continue; int roman = romanNumerals.get(text.charAt(i)); - if (i != text.length() - 1 && roman < romanNumerals.get(text.charAt(i + 1))) { + if (i != text.length() - 1 && romanNumerals.containsKey(text.charAt(i + 1)) && roman < romanNumerals.get(text.charAt(i + 1))) { number += romanNumerals.get(text.charAt(i + 1)) - roman; i++; } else { -- cgit From a44dc53ce80e9914595d5b646dc5623ddd3450b1 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Mon, 5 Jul 2021 12:52:46 -0400 Subject: Add alert when reaching end of farm --- README.md | 1 + build.gradle | 2 +- src/main/java/me/Danker/DankersSkyblockMod.java | 4 +- src/main/java/me/Danker/commands/DHelpCommand.java | 1 + .../java/me/Danker/commands/DankerGuiCommand.java | 3 ++ .../java/me/Danker/commands/FarmLengthCommand.java | 50 ++++++++++++++++++++++ .../java/me/Danker/commands/ToggleCommand.java | 13 +++++- .../java/me/Danker/features/EndOfFarmAlert.java | 40 +++++++++++++++++ .../java/me/Danker/features/Skill50Display.java | 2 +- src/main/java/me/Danker/gui/DankerGui.java | 7 +++ .../java/me/Danker/handlers/ConfigHandler.java | 4 +- 11 files changed, 121 insertions(+), 6 deletions(-) create mode 100644 src/main/java/me/Danker/commands/FarmLengthCommand.java create mode 100644 src/main/java/me/Danker/features/EndOfFarmAlert.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 3c8de13..6cd9d90 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,7 @@ Discord Server: https://discord.gg/QsEkNQS - /player [player] - Uses API to find skills, slayers, coins and weight of a player. - /reloadconfig - Reloads Danker's Skyblock Mod config. - /reloaddsmrepo - Reloads Danker's Skyblock Mod repository. +- /dsmfarmlength - Sets coords to be used for end of farm alert. ## Keybinds - Open Maddox menu - M by default. diff --git a/build.gradle b/build.gradle index 38434de..a2bc00d 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ plugins { id "net.minecraftforge.gradle.forge" version "2.0.2" } */ -version = "1.8.7-beta2" +version = "1.8.7-beta3" group= "me.Danker.DankersSkyblockMod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Danker's Skyblock Mod" diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 937b411..1b736ca 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -67,7 +67,7 @@ import java.util.stream.Collectors; @Mod(modid = DankersSkyblockMod.MODID, version = DankersSkyblockMod.VERSION, clientSideOnly = true) public class DankersSkyblockMod { public static final String MODID = "Danker's Skyblock Mod"; - public static final String VERSION = "1.8.7-beta2"; + public static final String VERSION = "1.8.7-beta3"; public static int titleTimer = -1; public static boolean showTitle = false; public static String titleText = ""; @@ -115,6 +115,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new CreeperSolver()); MinecraftForge.EVENT_BUS.register(new CustomMusic()); MinecraftForge.EVENT_BUS.register(new DungeonTimer()); + MinecraftForge.EVENT_BUS.register(new EndOfFarmAlert()); MinecraftForge.EVENT_BUS.register(new ExpertiseLore()); MinecraftForge.EVENT_BUS.register(new FasterMaddoxCalling()); MinecraftForge.EVENT_BUS.register(new GiantHPDisplay()); @@ -185,6 +186,7 @@ public class DankersSkyblockMod { ClientCommandHandler.instance.registerCommand(new DisplayCommand()); ClientCommandHandler.instance.registerCommand(new DungeonsCommand()); ClientCommandHandler.instance.registerCommand(new FairySoulsCommand()); + ClientCommandHandler.instance.registerCommand(new FarmLengthCommand()); ClientCommandHandler.instance.registerCommand(new GetkeyCommand()); ClientCommandHandler.instance.registerCommand(new GuildOfCommand()); ClientCommandHandler.instance.registerCommand(new ImportFishingCommand()); diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 42a82c4..b88f6cc 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -59,6 +59,7 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + PlayerCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find skills, slayers, coins and weight of a player.\n" + EnumChatFormatting.GOLD + ReloadConfigCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Reloads Danker's Skyblock Mod config.\n" + EnumChatFormatting.GOLD + ReloadRepoCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Reloads Danker's Skyblock Mod repository.\n" + + EnumChatFormatting.GOLD + FarmLengthCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Sets coords to be used for end of farm alert.\n" + EnumChatFormatting.GREEN + " Open Maddox Menu" + EnumChatFormatting.AQUA + " - M by default.\n" + EnumChatFormatting.GREEN + " Start/Stop Skill Tracker" + EnumChatFormatting.AQUA + " - Numpad 5 by default.\n")); } diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index edec93f..4375d57 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -1,6 +1,7 @@ package me.Danker.commands; import me.Danker.DankersSkyblockMod; +import me.Danker.features.EndOfFarmAlert; import me.Danker.features.SkillTracker; import me.Danker.features.loot.LootDisplay; import net.minecraft.client.Minecraft; @@ -97,6 +98,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[gianthp][").append(ToggleCommand.giantHP).append("]\n"); debug.append("[hidepetcandy][").append(ToggleCommand.hidePetCandy).append("]\n"); debug.append("[customcolourednames][").append(ToggleCommand.customColouredNames).append("]\n"); + debug.append("[endoffarmalert][").append(ToggleCommand.endOfFarmAlert).append("]\n"); debug.append("[dungeonbossmusic][").append(ToggleCommand.dungeonBossMusic).append("]\n"); debug.append("[bloodroommusic][").append(ToggleCommand.bloodRoomMusic).append("]\n"); debug.append("[dungeonmusic][").append(ToggleCommand.dungeonMusic).append("]\n"); @@ -113,6 +115,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[Current Display][").append(LootDisplay.display).append("]\n"); debug.append("[Auto Display][").append(LootDisplay.auto).append("]\n"); debug.append("[Skill Tracker Visible][").append(SkillTracker.showSkillTracker).append("]\n"); + debug.append("[Farm Length][").append(EndOfFarmAlert.min).append(" to ").append(EndOfFarmAlert.max).append("]\n"); debug.append("# Problematic Mods\n"); debug.append("[LabyMod][").append(DankersSkyblockMod.usingLabymod).append("]\n"); debug.append("[OAM][").append(DankersSkyblockMod.usingOAM).append("]\n"); diff --git a/src/main/java/me/Danker/commands/FarmLengthCommand.java b/src/main/java/me/Danker/commands/FarmLengthCommand.java new file mode 100644 index 0000000..6a28430 --- /dev/null +++ b/src/main/java/me/Danker/commands/FarmLengthCommand.java @@ -0,0 +1,50 @@ +package me.Danker.commands; + +import me.Danker.DankersSkyblockMod; +import me.Danker.features.EndOfFarmAlert; +import me.Danker.handlers.ConfigHandler; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ChatComponentText; + +public class FarmLengthCommand extends CommandBase { + + @Override + public String getCommandName() { + return "dsmfarmlength"; + } + + @Override + public String getCommandUsage(ICommandSender arg0) { + return "/" + getCommandName() + " "; + } + + public static String usage(ICommandSender arg0) { + return new FarmLengthCommand().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { + EntityPlayer player = (EntityPlayer) arg0; + + if (arg1.length == 0) { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Current Range: " + DankersSkyblockMod.SECONDARY_COLOUR + EndOfFarmAlert.min + DankersSkyblockMod.MAIN_COLOUR + " to " + DankersSkyblockMod.SECONDARY_COLOUR + EndOfFarmAlert.max)); + } else if (arg1.length < 2) { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); + return; + } + + EndOfFarmAlert.min = Double.parseDouble(arg1[0]); + EndOfFarmAlert.max = Double.parseDouble(arg1[1]); + ConfigHandler.writeDoubleConfig("misc", "farmMin", EndOfFarmAlert.min); + ConfigHandler.writeDoubleConfig("misc", "farmMax", EndOfFarmAlert.max); + } + +} diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 11b15f3..44b1df2 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -1,7 +1,9 @@ package me.Danker.commands; +import jdk.nashorn.internal.runtime.regexp.joni.Config; import me.Danker.DankersSkyblockMod; import me.Danker.features.CustomMusic; +import me.Danker.features.EndOfFarmAlert; import me.Danker.handlers.ConfigHandler; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; @@ -38,6 +40,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean giantHP; public static boolean hidePetCandy; public static boolean customColouredNames; + public static boolean endOfFarmAlert; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; @@ -99,7 +102,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "startswithterminal/selectallterminal/clickinorderterminal/" + "ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/" + "melodytooltips/highlightslayers/highlightarachne/highlightskeletonmasters/teammatesinradius/" + - "gianthp/hidepetcandy/customcolorednames/dungeonbossmusic/bloodroommusic/dungeonmusic/list>"; + "gianthp/hidepetcandy/customcolorednames/endoffarmalert/dungeonbossmusic/bloodroommusic/dungeonmusic/list>"; } public static String usage(ICommandSender arg0) { @@ -128,7 +131,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "ultrasequencer", "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "melodytooltips", "highlightslayers", "highlightskeletonmasters", "dungeonbossmusic", "bloodroommusic", "dungeonmusic", - "teammatesinradius", "gianthp", "hidepetcandy", "customcolorednames", "list"); + "teammatesinradius", "gianthp", "hidepetcandy", "customcolorednames", "endoffarmalert", "list"); } return null; } @@ -435,6 +438,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "CustomColouredNames", customColouredNames); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom name colors has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + customColouredNames + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "endoffarmalert": + endOfFarmAlert = !endOfFarmAlert; + ConfigHandler.writeBooleanConfig("toggles", "EndOfFarmAlert", endOfFarmAlert); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "End of farm alert has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + endOfFarmAlert + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "dungeonbossmusic": dungeonBossMusic = !dungeonBossMusic; CustomMusic.dungeonboss.stop(); @@ -504,6 +512,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Giant HP display: " + DankersSkyblockMod.VALUE_COLOUR + giantHP + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Hide pet candy: " + DankersSkyblockMod.VALUE_COLOUR + hidePetCandy + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom name colors: " + DankersSkyblockMod.VALUE_COLOUR + customColouredNames + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " End of farm alert: " + DankersSkyblockMod.VALUE_COLOUR + endOfFarmAlert + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon boss music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonBossMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom blood room music: " + DankersSkyblockMod.VALUE_COLOUR + bloodRoomMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonMusic diff --git a/src/main/java/me/Danker/features/EndOfFarmAlert.java b/src/main/java/me/Danker/features/EndOfFarmAlert.java new file mode 100644 index 0000000..ecbf3ee --- /dev/null +++ b/src/main/java/me/Danker/features/EndOfFarmAlert.java @@ -0,0 +1,40 @@ +package me.Danker.features; + +import me.Danker.DankersSkyblockMod; +import me.Danker.commands.ToggleCommand; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + +public class EndOfFarmAlert { + + static boolean alerted = false; + public static double min = -78.5; + public static double max = 79.5; + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + if (event.phase != TickEvent.Phase.START) return; + + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + if (DankersSkyblockMod.tickAmount % 10 == 0) { + if (ToggleCommand.endOfFarmAlert && Utils.isInScoreboard("Your Island")) { + double x = player.posX; + double z = player.posZ; + + if (x <= min || x >= max || z <= min || z >= max) { + if (!alerted) { + alerted = true; + Utils.createTitle(EnumChatFormatting.RED + "END OF FARM", 1); + } + } else { + alerted = false; + } + } + } + } + +} diff --git a/src/main/java/me/Danker/features/Skill50Display.java b/src/main/java/me/Danker/features/Skill50Display.java index 99b1d62..54afb3a 100644 --- a/src/main/java/me/Danker/features/Skill50Display.java +++ b/src/main/java/me/Danker/features/Skill50Display.java @@ -114,7 +114,7 @@ public class Skill50Display { @SubscribeEvent public void renderPlayerInfo(RenderOverlay event) { - if (!Utils.skillsInitialized()) { + if (!Utils.skillsInitialized() && Utils.inSkyblock) { new TextRenderer(Minecraft.getMinecraft(), EnumChatFormatting.RED + "Please open the skill menu to use skill features.", MoveCommand.skill50XY[0], MoveCommand.skill50XY[0], ScaleCommand.skill50Scale); return; } diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index ce795f3..3f4ebe7 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -67,6 +67,7 @@ public class DankerGui extends GuiScreen { private GuiButton giantHP; private GuiButton hidePetCandy; private GuiButton customColouredNames; + private GuiButton endOfFarmAlert; // Chat Messages private GuiButton sceptreMessages; private GuiButton midasStaffMessages; @@ -155,6 +156,7 @@ public class DankerGui extends GuiScreen { giantHP = new FeatureButton("Display Giant HP: " + Utils.getColouredBoolean(ToggleCommand.giantHP), "Displays health of Sadan's giants during F6 bossfight and F7 blood room."); hidePetCandy = new FeatureButton("Hide Pet Candy: " + Utils.getColouredBoolean(ToggleCommand.hidePetCandy), "Hide pet candy in pet tooltips."); customColouredNames = new FeatureButton("Custom Name Colors: " + Utils.getColouredBoolean(ToggleCommand.customColouredNames), "Replaces some player's usernames with a custom color."); + endOfFarmAlert = new FeatureButton("Alert When Reaching End of Farm: " + Utils.getColouredBoolean(ToggleCommand.endOfFarmAlert), "Alerts when you go past coords set with /dsmfarmlength."); allButtons.clear(); allButtons.add(changeDisplay); @@ -201,6 +203,7 @@ public class DankerGui extends GuiScreen { allButtons.add(giantHP); allButtons.add(hidePetCandy); allButtons.add(customColouredNames); + allButtons.add(endOfFarmAlert); search.setText(initSearchText); search.setVisible(true); @@ -447,6 +450,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.customColouredNames = !ToggleCommand.customColouredNames; ConfigHandler.writeBooleanConfig("toggles", "CustomColouredNames", ToggleCommand.customColouredNames); customColouredNames.displayString = "Custom Name Colors: " + Utils.getColouredBoolean(ToggleCommand.customColouredNames); + } else if (button == endOfFarmAlert) { + ToggleCommand.endOfFarmAlert = !ToggleCommand.endOfFarmAlert; + ConfigHandler.writeBooleanConfig("toggles", "EndOfFarmAlert", ToggleCommand.endOfFarmAlert); + endOfFarmAlert.displayString = "Alert When Reaching End of Farm: " + Utils.getColouredBoolean(ToggleCommand.endOfFarmAlert); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 002d9f7..29fa882 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -215,6 +215,7 @@ public class ConfigHandler { ToggleCommand.giantHP = initBoolean("toggles", "GiantHP", false); ToggleCommand.hidePetCandy = initBoolean("toggles", "HidePetCandy", false); ToggleCommand.customColouredNames = initBoolean("toggles", "CustomColouredNames", true); + ToggleCommand.endOfFarmAlert = initBoolean("toggles", "EndOfFarmAlert", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); @@ -457,7 +458,6 @@ public class ConfigHandler { LootTracker.ghostlyBoots = initInt("ghosts", "ghostlyBoots", 0); LootTracker.bagOfCashs = initInt("ghosts", "bagOfCash", 0); - // Misc LootDisplay.display = initString("misc", "display", "off"); LootDisplay.auto = initBoolean("misc", "autoDisplay", false); @@ -465,6 +465,8 @@ public class ConfigHandler { CakeTimer.cakeTime = initDouble("misc", "cakeTime", 0); SkillTracker.showSkillTracker = initBoolean("misc", "showSkillTracker", false); DankersSkyblockMod.firstLaunch = initBoolean("misc", "firstLaunch", true); + EndOfFarmAlert.min = initDouble("misc", "farmMin", -78.5); + EndOfFarmAlert.max = initDouble("misc", "farmMax", 79.5); // Locations ScaledResolution scaled = new ScaledResolution(Minecraft.getMinecraft()); -- cgit From f8af37d28a9fce4e3b5483bed0a2677d010bf37b Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Mon, 5 Jul 2021 20:25:16 -0400 Subject: Auto reload repo every 1 hour --- src/main/java/me/Danker/DankersSkyblockMod.java | 19 +++++++++---------- .../java/me/Danker/commands/ReloadRepoCommand.java | 15 ++------------- src/main/java/me/Danker/commands/ToggleCommand.java | 2 -- src/main/java/me/Danker/utils/Utils.java | 12 ++++++++++++ 4 files changed, 23 insertions(+), 25 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 1b736ca..9ee1d33 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -10,7 +10,6 @@ import me.Danker.features.loot.LootDisplay; import me.Danker.features.loot.LootTracker; import me.Danker.features.puzzlesolvers.*; import me.Danker.gui.*; -import me.Danker.handlers.APIHandler; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.PacketHandler; import me.Danker.utils.Utils; @@ -58,11 +57,9 @@ import org.lwjgl.input.Mouse; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.UnsupportedAudioFileException; import java.io.IOException; -import java.util.ArrayList; import java.util.List; import java.util.Locale; import java.util.Map; -import java.util.stream.Collectors; @Mod(modid = DankersSkyblockMod.MODID, version = DankersSkyblockMod.VERSION, clientSideOnly = true) public class DankersSkyblockMod { @@ -72,6 +69,7 @@ public class DankersSkyblockMod { public static boolean showTitle = false; public static String titleText = ""; public static int tickAmount = 1; + public static int repoTickAmount = 1; public static KeyBinding[] keyBindings = new KeyBinding[3]; public static boolean usingLabymod = false; public static boolean usingOAM = false; @@ -167,13 +165,7 @@ public class DankersSkyblockMod { ClientRegistry.registerKeyBinding(keyBinding); } - new Thread(() -> { - data = APIHandler.getResponse("https://raw.githubusercontent.com/bowser0000/SkyblockMod-REPO/main/data.json"); - System.out.println("Loaded data from GitHub?: " + (DankersSkyblockMod.data != null && DankersSkyblockMod.data.has("trivia"))); - ColouredNames.users = data.get("colourednames").getAsJsonObject().entrySet().stream() - .map(Map.Entry::getKey) - .collect(Collectors.toCollection(ArrayList::new)); - }).start(); + new Thread(Utils::refreshRepo).start(); } @EventHandler @@ -359,6 +351,7 @@ public class DankersSkyblockMod { tickAmount++; if (tickAmount % 20 == 0) { + repoTickAmount++; if (player != null) { Utils.checkForSkyblock(); Utils.checkForDungeons(); @@ -367,6 +360,12 @@ public class DankersSkyblockMod { tickAmount = 0; } + if (repoTickAmount % 3601 == 0) { + // I didn't want to change everything so I just made a new tick variable + new Thread(Utils::refreshRepo).start(); + repoTickAmount = 1; + } + if (titleTimer >= 0) { if (titleTimer == 0) { showTitle = false; diff --git a/src/main/java/me/Danker/commands/ReloadRepoCommand.java b/src/main/java/me/Danker/commands/ReloadRepoCommand.java index 1681971..a50a5c8 100644 --- a/src/main/java/me/Danker/commands/ReloadRepoCommand.java +++ b/src/main/java/me/Danker/commands/ReloadRepoCommand.java @@ -1,18 +1,13 @@ package me.Danker.commands; import me.Danker.DankersSkyblockMod; -import me.Danker.features.ColouredNames; -import me.Danker.handlers.APIHandler; +import me.Danker.utils.Utils; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ChatComponentText; -import java.util.ArrayList; -import java.util.Map; -import java.util.stream.Collectors; - public class ReloadRepoCommand extends CommandBase { @Override @@ -39,13 +34,7 @@ public class ReloadRepoCommand extends CommandBase { // MULTI THREAD DRIFTING new Thread(() -> { EntityPlayer player = (EntityPlayer) arg0; - - DankersSkyblockMod.data = APIHandler.getResponse("https://raw.githubusercontent.com/bowser0000/SkyblockMod-REPO/main/data.json"); - System.out.println("Loaded data from GitHub?: " + (DankersSkyblockMod.data != null && DankersSkyblockMod.data.has("trivia"))); - ColouredNames.users = DankersSkyblockMod.data.get("colourednames").getAsJsonObject().entrySet().stream() - .map(Map.Entry::getKey) - .collect(Collectors.toCollection(ArrayList::new)); - + Utils.refreshRepo(); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Refreshed Danker's Skyblock Mod repo.")); }).start(); } diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 44b1df2..3770d8f 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -1,9 +1,7 @@ package me.Danker.commands; -import jdk.nashorn.internal.runtime.regexp.joni.Config; import me.Danker.DankersSkyblockMod; import me.Danker.features.CustomMusic; -import me.Danker.features.EndOfFarmAlert; import me.Danker.handlers.ConfigHandler; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index e2dde4b..e1a99ea 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -1,7 +1,9 @@ package me.Danker.utils; import me.Danker.DankersSkyblockMod; +import me.Danker.features.ColouredNames; import me.Danker.features.GoldenEnchants; +import me.Danker.handlers.APIHandler; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.ScoreboardHandler; import me.Danker.handlers.TextRenderer; @@ -30,6 +32,7 @@ import java.util.List; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.stream.Collectors; public class Utils { @@ -614,4 +617,13 @@ public class Utils { return level; } + public static void refreshRepo() { + DankersSkyblockMod.data = APIHandler.getResponse("https://raw.githubusercontent.com/bowser0000/SkyblockMod-REPO/main/data.json"); + System.out.println("Loaded data from GitHub?: " + (DankersSkyblockMod.data != null && DankersSkyblockMod.data.has("trivia"))); + ColouredNames.users = DankersSkyblockMod.data.get("colourednames").getAsJsonObject().entrySet().stream() + .map(Map.Entry::getKey) + .collect(Collectors.toCollection(ArrayList::new)); + System.out.println("Refreshed DSM repo at " + System.currentTimeMillis()); + } + } -- cgit From 4e70985c1b6cd71505ab6dc96c8abcd1600948df Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Wed, 7 Jul 2021 17:29:42 -0400 Subject: Actually add /slayers alias --- src/main/java/me/Danker/commands/SlayerCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/SlayerCommand.java b/src/main/java/me/Danker/commands/SlayerCommand.java index 45d3548..0efac3f 100644 --- a/src/main/java/me/Danker/commands/SlayerCommand.java +++ b/src/main/java/me/Danker/commands/SlayerCommand.java @@ -27,7 +27,7 @@ public class SlayerCommand extends CommandBase { @Override public List getCommandAliases() { - return Collections.singletonList("slayer"); + return Collections.singletonList("slayers"); } @Override -- cgit From 6eed0d48eeaa054392efe19dffaef691701c1356 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sun, 11 Jul 2021 17:18:07 -0400 Subject: Add custom colours to nametags Also fix Spider's Den detection and fix copy paste error in /toggle --- .../java/me/Danker/commands/ToggleCommand.java | 2 +- src/main/java/me/Danker/features/ArachneESP.java | 2 +- .../java/me/Danker/features/ColouredNames.java | 27 ++++++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 3770d8f..95c4d98 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -293,7 +293,7 @@ public class ToggleCommand extends CommandBase implements ICommand { case "bonzotimer": bonzoTimerToggled = !bonzoTimerToggled; ConfigHandler.writeBooleanConfig("toggles", "BonzoTimer", bonzoTimerToggled); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Bonzo's Mask timer has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + necronNotificationsToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Bonzo's Mask timer has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + bonzoTimerToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; case "autoskilltracker": autoSkillTrackerToggled = !autoSkillTrackerToggled; diff --git a/src/main/java/me/Danker/features/ArachneESP.java b/src/main/java/me/Danker/features/ArachneESP.java index c78c385..7e39a8f 100644 --- a/src/main/java/me/Danker/features/ArachneESP.java +++ b/src/main/java/me/Danker/features/ArachneESP.java @@ -32,7 +32,7 @@ public class ArachneESP { public boolean inSpidersDen(List scoreboard) { for (String s : scoreboard) { - if (ScoreboardHandler.cleanSB(s).contains("Spiders Den")) { + if (ScoreboardHandler.cleanSB(s).contains("Spider's Den")) { return true; } } diff --git a/src/main/java/me/Danker/features/ColouredNames.java b/src/main/java/me/Danker/features/ColouredNames.java index 478a47d..2156f3a 100644 --- a/src/main/java/me/Danker/features/ColouredNames.java +++ b/src/main/java/me/Danker/features/ColouredNames.java @@ -3,11 +3,15 @@ package me.Danker.features; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; import me.Danker.utils.Utils; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.client.event.RenderLivingEvent; import net.minecraftforge.event.entity.player.ItemTooltipEvent; +import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import java.util.ArrayList; @@ -43,6 +47,29 @@ public class ColouredNames { } } + @SubscribeEvent + public void onRenderNametag(PlayerEvent.NameFormat event) { + if (!ToggleCommand.customColouredNames || !Utils.inSkyblock) return; + + if (users.contains(event.username)) { + event.displayname = replaceName(event.displayname, event.username, getColourFromName(event.username)); + } + } + + @SubscribeEvent + public void onRenderLiving(RenderLivingEvent.Specials.Pre event) { + if (!ToggleCommand.customColouredNames || !Utils.inSkyblock) return; + + Entity entity = event.entity; + if (entity.hasCustomName()) { + for (String user : users) { + if (entity.getCustomNameTag().contains(user)) { + entity.setCustomNameTag(replaceName(entity.getCustomNameTag(), user, getColourFromName(user))); + } + } + } + } + // https://github.com/SteveKunG/SkyBlockcatia/blob/1.8.9/src/main/java/com/stevekung/skyblockcatia/utils/SupporterUtils.java#L53 public static String replaceName(String text, String name, String colour) { String namePattern = "(?:(?:\\u00a7[0-9a-fbr])\\B(?:" + name + ")\\b)|(?:\\u00a7[rb]" + name + "\\u00a7r)|\\b" + name + "\\b"; -- cgit From 37977ec66605e240533180ebacf4377fc3a55a15 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 17 Jul 2021 00:00:25 -0400 Subject: Show applied gemstones in item lore --- README.md | 3 +- build.gradle | 2 +- src/main/java/me/Danker/DankersSkyblockMod.java | 4 +- .../java/me/Danker/commands/DankerGuiCommand.java | 1 + .../java/me/Danker/commands/ToggleCommand.java | 13 +++- .../java/me/Danker/features/GemstonesLore.java | 77 ++++++++++++++++++++++ src/main/java/me/Danker/gui/DankerGui.java | 7 ++ .../java/me/Danker/handlers/ConfigHandler.java | 1 + 8 files changed, 103 insertions(+), 5 deletions(-) create mode 100644 src/main/java/me/Danker/features/GemstonesLore.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 6cd9d90..8dbda56 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ Discord Server: https://discord.gg/QsEkNQS - Slayer slain alert - Fishing, jerry fishing, fishing festival, spooky fishing trackers - Expertise kills in fishing rod lore +- Gemstones applied in item lore - Catacombs trackers - Dungeons puzzle solver (Riddle, trivia, blaze, creeper, water, tic tac toe, boulder, silverfish, ice walk) - Dungeons timer (watcher, boss, deaths, and puzzle fails) @@ -60,7 +61,7 @@ Discord Server: https://discord.gg/QsEkNQS ## Commands - /dhelp - Returns this message in-game. - /dsm - Opens the GUI for Danker's Skyblock Mod. -- /toggle - Toggles features. /toggle list returns values of every toggle. +- /toggle - Toggles features. /toggle list returns values of every toggle. - /setkey - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. - /loot [winter/festival/spooky/f(1-7)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. diff --git a/build.gradle b/build.gradle index a2bc00d..05a7231 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ plugins { id "net.minecraftforge.gradle.forge" version "2.0.2" } */ -version = "1.8.7-beta3" +version = "1.8.7-beta4" group= "me.Danker.DankersSkyblockMod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Danker's Skyblock Mod" diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 9ee1d33..b85c608 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -64,7 +64,7 @@ import java.util.Map; @Mod(modid = DankersSkyblockMod.MODID, version = DankersSkyblockMod.VERSION, clientSideOnly = true) public class DankersSkyblockMod { public static final String MODID = "Danker's Skyblock Mod"; - public static final String VERSION = "1.8.7-beta3"; + public static final String VERSION = "1.8.7-beta4"; public static int titleTimer = -1; public static boolean showTitle = false; public static String titleText = ""; @@ -116,6 +116,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new EndOfFarmAlert()); MinecraftForge.EVENT_BUS.register(new ExpertiseLore()); MinecraftForge.EVENT_BUS.register(new FasterMaddoxCalling()); + MinecraftForge.EVENT_BUS.register(new GemstonesLore()); MinecraftForge.EVENT_BUS.register(new GiantHPDisplay()); MinecraftForge.EVENT_BUS.register(new GoldenEnchants()); MinecraftForge.EVENT_BUS.register(new GolemSpawningAlert()); @@ -156,6 +157,7 @@ public class DankersSkyblockMod { GoldenEnchants.init(); TriviaSolver.init(); CustomMusic.init(configDirectory); + GemstonesLore.init(); keyBindings[0] = new KeyBinding("Open Maddox Menu", Keyboard.KEY_M, "Danker's Skyblock Mod"); keyBindings[1] = new KeyBinding("Regular Ability", Keyboard.KEY_NUMPAD4, "Danker's Skyblock Mod"); diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index 4375d57..9561074 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -99,6 +99,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[hidepetcandy][").append(ToggleCommand.hidePetCandy).append("]\n"); debug.append("[customcolourednames][").append(ToggleCommand.customColouredNames).append("]\n"); debug.append("[endoffarmalert][").append(ToggleCommand.endOfFarmAlert).append("]\n"); + debug.append("[gemstonelore][").append(ToggleCommand.gemstoneLore).append("]\n"); debug.append("[dungeonbossmusic][").append(ToggleCommand.dungeonBossMusic).append("]\n"); debug.append("[bloodroommusic][").append(ToggleCommand.bloodRoomMusic).append("]\n"); debug.append("[dungeonmusic][").append(ToggleCommand.dungeonMusic).append("]\n"); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 95c4d98..d52ee76 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -14,6 +14,7 @@ import net.minecraft.util.ChatComponentText; import java.util.List; public class ToggleCommand extends CommandBase implements ICommand { + // Some of these end with toggled and some don't, I don't want to go back and fix them all for consistency public static boolean gpartyToggled; public static boolean coordsToggled; public static boolean goldenToggled; @@ -39,6 +40,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean hidePetCandy; public static boolean customColouredNames; public static boolean endOfFarmAlert; + public static boolean gemstoneLore; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; @@ -100,7 +102,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "startswithterminal/selectallterminal/clickinorderterminal/" + "ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/" + "melodytooltips/highlightslayers/highlightarachne/highlightskeletonmasters/teammatesinradius/" + - "gianthp/hidepetcandy/customcolorednames/endoffarmalert/dungeonbossmusic/bloodroommusic/dungeonmusic/list>"; + "gianthp/hidepetcandy/customcolorednames/endoffarmalert/gemstonelore/dungeonbossmusic/bloodroommusic/dungeonmusic/list>"; } public static String usage(ICommandSender arg0) { @@ -129,7 +131,8 @@ public class ToggleCommand extends CommandBase implements ICommand { "ultrasequencer", "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "melodytooltips", "highlightslayers", "highlightskeletonmasters", "dungeonbossmusic", "bloodroommusic", "dungeonmusic", - "teammatesinradius", "gianthp", "hidepetcandy", "customcolorednames", "endoffarmalert", "list"); + "teammatesinradius", "gianthp", "hidepetcandy", "customcolorednames", "endoffarmalert", + "gemstonelore", "list"); } return null; } @@ -441,6 +444,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "EndOfFarmAlert", endOfFarmAlert); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "End of farm alert has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + endOfFarmAlert + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "gemstonelore": + gemstoneLore = !gemstoneLore; + ConfigHandler.writeBooleanConfig("toggles", "GemstoneLore", gemstoneLore); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Gemstone in lore has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + gemstoneLore + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "dungeonbossmusic": dungeonBossMusic = !dungeonBossMusic; CustomMusic.dungeonboss.stop(); @@ -511,6 +519,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Hide pet candy: " + DankersSkyblockMod.VALUE_COLOUR + hidePetCandy + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom name colors: " + DankersSkyblockMod.VALUE_COLOUR + customColouredNames + "\n" + DankersSkyblockMod.TYPE_COLOUR + " End of farm alert: " + DankersSkyblockMod.VALUE_COLOUR + endOfFarmAlert + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Gemstone in lore: " + DankersSkyblockMod.VALUE_COLOUR + gemstoneLore + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon boss music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonBossMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom blood room music: " + DankersSkyblockMod.VALUE_COLOUR + bloodRoomMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonMusic diff --git a/src/main/java/me/Danker/features/GemstonesLore.java b/src/main/java/me/Danker/features/GemstonesLore.java new file mode 100644 index 0000000..dfae746 --- /dev/null +++ b/src/main/java/me/Danker/features/GemstonesLore.java @@ -0,0 +1,77 @@ +package me.Danker.features; + +import me.Danker.commands.ToggleCommand; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.event.entity.player.ItemTooltipEvent; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +public class GemstonesLore { + + static Map gemstoneColours = new HashMap<>(); + + public static void init() { + gemstoneColours.put("Amber", EnumChatFormatting.GOLD); + gemstoneColours.put("Sapphire", EnumChatFormatting.AQUA); + gemstoneColours.put("Jasper", EnumChatFormatting.LIGHT_PURPLE); + gemstoneColours.put("Amethyst", EnumChatFormatting.DARK_PURPLE); + gemstoneColours.put("Topaz", EnumChatFormatting.YELLOW); + gemstoneColours.put("Jade", EnumChatFormatting.GREEN); + gemstoneColours.put("Ruby", EnumChatFormatting.RED); + } + + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onTooltip(ItemTooltipEvent event) { + if (!Utils.inSkyblock) return; + if (event.toolTip == null) return; + + ItemStack item = event.itemStack; + if (ToggleCommand.gemstoneLore) { + if (item.hasTagCompound()) { + NBTTagCompound tags = item.getSubCompound("ExtraAttributes", false); + if (tags != null) { + if (tags.hasKey("gems")) { + NBTTagCompound gems = tags.getCompoundTag("gems"); + Set set = gems.getKeySet(); + + if (set.size() == 0) return; + + int index = Minecraft.getMinecraft().gameSettings.advancedItemTooltips ? 4 : 2; + + event.toolTip.add(event.toolTip.size() - index, ""); + event.toolTip.add(event.toolTip.size() - index, "Gemstones Applied:"); + + for (String gem : set) { + char last = gem.charAt(gem.length() - 1); + if (!Character.isDigit(last)) continue; + + String gemstone = " " + Utils.capitalizeString(gems.getString(gem)) + " "; + if (gem.startsWith("UNIVERSAL_")) { + gemstone += Utils.capitalizeString(gems.getString(gem + "_gem")); + } else { + gemstone += Utils.capitalizeString(gem.substring(0, gem.indexOf("_"))); + } + + for (String colour : gemstoneColours.keySet()) { + if (gemstone.contains(colour)) { + gemstone = gemstoneColours.get(colour) + gemstone; + } + } + + event.toolTip.add(event.toolTip.size() - index, gemstone); + } + } + } + } + } + } + +} diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 3f4ebe7..d7e2c16 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -68,6 +68,7 @@ public class DankerGui extends GuiScreen { private GuiButton hidePetCandy; private GuiButton customColouredNames; private GuiButton endOfFarmAlert; + private GuiButton gemstoneLore; // Chat Messages private GuiButton sceptreMessages; private GuiButton midasStaffMessages; @@ -157,6 +158,7 @@ public class DankerGui extends GuiScreen { hidePetCandy = new FeatureButton("Hide Pet Candy: " + Utils.getColouredBoolean(ToggleCommand.hidePetCandy), "Hide pet candy in pet tooltips."); customColouredNames = new FeatureButton("Custom Name Colors: " + Utils.getColouredBoolean(ToggleCommand.customColouredNames), "Replaces some player's usernames with a custom color."); endOfFarmAlert = new FeatureButton("Alert When Reaching End of Farm: " + Utils.getColouredBoolean(ToggleCommand.endOfFarmAlert), "Alerts when you go past coords set with /dsmfarmlength."); + gemstoneLore = new FeatureButton("Applied Gemstones in Lore: " + Utils.getColouredBoolean(ToggleCommand.gemstoneLore), "Adds applied gemstones to item tooltip."); allButtons.clear(); allButtons.add(changeDisplay); @@ -204,6 +206,7 @@ public class DankerGui extends GuiScreen { allButtons.add(hidePetCandy); allButtons.add(customColouredNames); allButtons.add(endOfFarmAlert); + allButtons.add(gemstoneLore); search.setText(initSearchText); search.setVisible(true); @@ -454,6 +457,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.endOfFarmAlert = !ToggleCommand.endOfFarmAlert; ConfigHandler.writeBooleanConfig("toggles", "EndOfFarmAlert", ToggleCommand.endOfFarmAlert); endOfFarmAlert.displayString = "Alert When Reaching End of Farm: " + Utils.getColouredBoolean(ToggleCommand.endOfFarmAlert); + } else if (button == gemstoneLore) { + ToggleCommand.gemstoneLore = !ToggleCommand.gemstoneLore; + ConfigHandler.writeBooleanConfig("toggles", "GemstoneLore", ToggleCommand.gemstoneLore); + gemstoneLore.displayString = "Applied Gemstones in Lore: " + Utils.getColouredBoolean(ToggleCommand.gemstoneLore); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 29fa882..1d6311e 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -216,6 +216,7 @@ public class ConfigHandler { ToggleCommand.hidePetCandy = initBoolean("toggles", "HidePetCandy", false); ToggleCommand.customColouredNames = initBoolean("toggles", "CustomColouredNames", true); ToggleCommand.endOfFarmAlert = initBoolean("toggles", "EndOfFarmAlert", false); + ToggleCommand.gemstoneLore = initBoolean("toggles", "GemstoneLore", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); -- cgit From 6cd3683e30bc14898d076592d50082aeb11f3a96 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sun, 18 Jul 2021 17:31:30 -0400 Subject: Add crystal hollows to /sbplayers --- src/main/java/me/Danker/commands/SkyblockPlayersCommand.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java b/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java index f8db0af..2d05815 100644 --- a/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java +++ b/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java @@ -75,6 +75,7 @@ public class SkyblockPlayersCommand extends CommandBase { int goldMine = 0; // mining_1 int deepCaverns = 0; // mining_2 int dwarvenMines = 0; // mining_3 + int crystalHollows = 0; // crystal_hollows int spidersDen = 0; // combat_1 int blazingFortress = 0; // combat_2 int end = 0; // combat_3 @@ -109,6 +110,9 @@ public class SkyblockPlayersCommand extends CommandBase { if (skyblockPlayers.has("mining_3")) { dwarvenMines = skyblockPlayers.get("mining_3").getAsInt(); } + if (skyblockPlayers.has("crystal_hollows")) { + crystalHollows = skyblockPlayers.get("crystal_hollows").getAsInt(); + } if (skyblockPlayers.has("combat_1")) { spidersDen = skyblockPlayers.get("combat_1").getAsInt(); } @@ -144,6 +148,7 @@ public class SkyblockPlayersCommand extends CommandBase { DankersSkyblockMod.TYPE_COLOUR + " Gold Mine: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(goldMine) + " / " + Utils.getPercentage(goldMine, skyblockTotalPlayers) + "%\n" + DankersSkyblockMod.TYPE_COLOUR + " Deep Caverns: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(deepCaverns) + " / " + Utils.getPercentage(deepCaverns, skyblockTotalPlayers) + "%\n" + DankersSkyblockMod.TYPE_COLOUR + " Dwarven Mines: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(dwarvenMines) + " / " + Utils.getPercentage(dwarvenMines, skyblockTotalPlayers) + "%\n" + + DankersSkyblockMod.TYPE_COLOUR + " Crystal Hollows: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(crystalHollows) + " / " + Utils.getPercentage(crystalHollows, skyblockTotalPlayers) + "%\n" + DankersSkyblockMod.TYPE_COLOUR + " Spider's Den: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(spidersDen) + " / " + Utils.getPercentage(spidersDen, skyblockTotalPlayers) + "%\n" + DankersSkyblockMod.TYPE_COLOUR + " Blazing Fortress: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(blazingFortress) + " / " + Utils.getPercentage(blazingFortress, skyblockTotalPlayers) + "%\n" + DankersSkyblockMod.TYPE_COLOUR + " The End: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(end) + " / " + Utils.getPercentage(end, skyblockTotalPlayers) + "%\n" + -- cgit From 59ee50124930d73cd9fd6daa23727ff8a154c37d Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sun, 18 Jul 2021 17:33:31 -0400 Subject: Add enderman slayer highlight support --- src/main/java/me/Danker/features/SlayerESP.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/SlayerESP.java b/src/main/java/me/Danker/features/SlayerESP.java index 522e696..3629474 100644 --- a/src/main/java/me/Danker/features/SlayerESP.java +++ b/src/main/java/me/Danker/features/SlayerESP.java @@ -26,6 +26,7 @@ public class SlayerESP { static Entity zombie = null; static Entity spider = null; static Entity wolf = null; + static Entity enderman = null; static boolean slayerActive = false; static boolean slayerStarted = false; public static int SLAYER_COLOUR; @@ -35,6 +36,7 @@ public class SlayerESP { zombie = null; spider = null; wolf = null; + enderman = null; } @SubscribeEvent @@ -45,7 +47,7 @@ public class SlayerESP { World world = Minecraft.getMinecraft().theWorld; if (world == null) return; if (!slayerStarted) return; - if (zombie != null || spider != null || wolf != null) { + if (zombie != null || spider != null || wolf != null || enderman != null) { return; } slayerActive = true; @@ -66,8 +68,10 @@ public class SlayerESP { } else if (e.getName().contains("Sven Packmaster")) { wolf = e; return; + } else if (e.getName().contains("Voidgloom Seraph")) { + enderman = e; + return; } - } break; } @@ -88,6 +92,7 @@ public class SlayerESP { zombie = null; spider = null; wolf = null; + enderman = null; } } @@ -113,6 +118,11 @@ public class SlayerESP { Utils.draw3DBox(aabb, SLAYER_COLOUR, event.partialTicks); return; } + if (enderman != null) { + AxisAlignedBB aabb = new AxisAlignedBB(enderman.posX - 0.5, enderman.posY - 3, enderman.posZ - 0.5, enderman.posX + 0.5, enderman.posY, enderman.posZ + 0.5); + Utils.draw3DBox(aabb, SLAYER_COLOUR, event.partialTicks); + return; + } } } -- cgit From bc3f389c52aef41f6fb4351e8d0a5a8fed8336ef Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 24 Jul 2021 01:54:57 -0400 Subject: Add crystal hollows waypoints With support for SBE crystal hollows waypoints --- README.md | 3 +- src/main/java/me/Danker/DankersSkyblockMod.java | 6 + .../commands/CrystalHollowWaypointCommand.java | 50 ++++++ .../java/me/Danker/commands/DankerGuiCommand.java | 2 + .../java/me/Danker/commands/ToggleCommand.java | 22 ++- .../me/Danker/features/CrystalHollowWaypoints.java | 193 +++++++++++++++++++++ .../Danker/gui/CrystalHollowWaypointActionGui.java | 87 ++++++++++ .../me/Danker/gui/CrystalHollowWaypointsGui.java | 139 +++++++++++++++ src/main/java/me/Danker/gui/DankerGui.java | 5 + .../java/me/Danker/handlers/ConfigHandler.java | 2 + src/main/java/me/Danker/utils/Utils.java | 147 ++++++++++++++++ 11 files changed, 651 insertions(+), 5 deletions(-) create mode 100644 src/main/java/me/Danker/commands/CrystalHollowWaypointCommand.java create mode 100644 src/main/java/me/Danker/features/CrystalHollowWaypoints.java create mode 100644 src/main/java/me/Danker/gui/CrystalHollowWaypointActionGui.java create mode 100644 src/main/java/me/Danker/gui/CrystalHollowWaypointsGui.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 8dbda56..55bcd1a 100644 --- a/README.md +++ b/README.md @@ -57,11 +57,12 @@ Discord Server: https://discord.gg/QsEkNQS - Show teammates in 30 block radius - Hide pet candy in pet tooltip - Custom name colors +- Crystal Hollows waypoints (with SkyblockExtras support) ## Commands - /dhelp - Returns this message in-game. - /dsm - Opens the GUI for Danker's Skyblock Mod. -- /toggle - Toggles features. /toggle list returns values of every toggle. +- /toggle - Toggles features. /toggle list returns values of every toggle. - /setkey - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. - /loot [winter/festival/spooky/f(1-7)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index b85c608..e02f12a 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -111,6 +111,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new ClickInOrderSolver()); MinecraftForge.EVENT_BUS.register(new ColouredNames()); MinecraftForge.EVENT_BUS.register(new CreeperSolver()); + MinecraftForge.EVENT_BUS.register(new CrystalHollowWaypoints()); MinecraftForge.EVENT_BUS.register(new CustomMusic()); MinecraftForge.EVENT_BUS.register(new DungeonTimer()); MinecraftForge.EVENT_BUS.register(new EndOfFarmAlert()); @@ -175,6 +176,7 @@ public class DankersSkyblockMod { ClientCommandHandler.instance.registerCommand(new ArmourCommand()); ClientCommandHandler.instance.registerCommand(new BankCommand()); ClientCommandHandler.instance.registerCommand(new CustomMusicCommand()); + ClientCommandHandler.instance.registerCommand(new CrystalHollowWaypointCommand()); ClientCommandHandler.instance.registerCommand(new DHelpCommand()); ClientCommandHandler.instance.registerCommand(new DankerGuiCommand()); ClientCommandHandler.instance.registerCommand(new DisplayCommand()); @@ -357,6 +359,7 @@ public class DankersSkyblockMod { if (player != null) { Utils.checkForSkyblock(); Utils.checkForDungeons(); + Utils.checkForCrystalHollows(); } tickAmount = 0; @@ -425,6 +428,9 @@ public class DankersSkyblockMod { case "custommusic": mc.displayGuiScreen(new CustomMusicGui()); break; + case "crystalwaypoints": + mc.displayGuiScreen(new CrystalHollowWaypointsGui(1)); + break; } } guiToOpen = null; diff --git a/src/main/java/me/Danker/commands/CrystalHollowWaypointCommand.java b/src/main/java/me/Danker/commands/CrystalHollowWaypointCommand.java new file mode 100644 index 0000000..c545447 --- /dev/null +++ b/src/main/java/me/Danker/commands/CrystalHollowWaypointCommand.java @@ -0,0 +1,50 @@ +package me.Danker.commands; + +import me.Danker.DankersSkyblockMod; +import me.Danker.features.CrystalHollowWaypoints; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; + +public class CrystalHollowWaypointCommand extends CommandBase { + + @Override + public String getCommandName() { + return "dsmaddcrystalhollowwaypoints"; + } + + @Override + public String getCommandUsage(ICommandSender arg0) { + return "/" + getCommandName() + " "; + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { + EntityPlayer player = (EntityPlayer) arg0; + + if (arg1.length == 0) return; + + String[] waypoints = String.join(" ", arg1).split("\\\\n"); + + for (String waypoint : waypoints) { + String[] parts = waypoint.split("@"); + String[] coords = parts[1].split(","); + + String location = parts[0]; + BlockPos pos = new BlockPos(Integer.parseInt(coords[0]), Integer.parseInt(coords[1]), Integer.parseInt(coords[2])); + CrystalHollowWaypoints.Waypoint newWaypoint = new CrystalHollowWaypoints.Waypoint(location, pos); + + CrystalHollowWaypoints.waypoints.add(newWaypoint); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Added " + newWaypoint.location + " @ " + newWaypoint.getPos())); + } + } + +} diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index 9561074..dc6845d 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -100,6 +100,8 @@ public class DankerGuiCommand extends CommandBase { debug.append("[customcolourednames][").append(ToggleCommand.customColouredNames).append("]\n"); debug.append("[endoffarmalert][").append(ToggleCommand.endOfFarmAlert).append("]\n"); debug.append("[gemstonelore][").append(ToggleCommand.gemstoneLore).append("]\n"); + debug.append("[crystalhollowwaypoints][").append(ToggleCommand.crystalHollowWaypoints).append("]\n"); + debug.append("[crystalautowaypoints][").append(ToggleCommand.crystalAutoWaypoints).append("]\n"); debug.append("[dungeonbossmusic][").append(ToggleCommand.dungeonBossMusic).append("]\n"); debug.append("[bloodroommusic][").append(ToggleCommand.bloodRoomMusic).append("]\n"); debug.append("[dungeonmusic][").append(ToggleCommand.dungeonMusic).append("]\n"); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index d52ee76..061a277 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -41,6 +41,8 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean customColouredNames; public static boolean endOfFarmAlert; public static boolean gemstoneLore; + public static boolean crystalHollowWaypoints; + public static boolean crystalAutoWaypoints; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; @@ -92,7 +94,6 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " "; + "gianthp/hidepetcandy/customcolorednames/endoffarmalert/gemstonelore/crystalhollowwaypoints/crystalautowaypoints/" + + "dungeonbossmusic/bloodroommusic/dungeonmusic/list>"; } public static String usage(ICommandSender arg0) { - return new ToggleCommand().getCommandUsage(arg0); + return "/toggle "; } @Override @@ -132,7 +134,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "hidetooltipsinaddons", "pickblock", "melodytooltips", "highlightslayers", "highlightskeletonmasters", "dungeonbossmusic", "bloodroommusic", "dungeonmusic", "teammatesinradius", "gianthp", "hidepetcandy", "customcolorednames", "endoffarmalert", - "gemstonelore", "list"); + "gemstonelore", "crystalhollowwaypoints", "crystalautowaypoints", "list"); } return null; } @@ -449,6 +451,16 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "GemstoneLore", gemstoneLore); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Gemstone in lore has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + gemstoneLore + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "crystalhollowwaypoints": + crystalHollowWaypoints = !crystalHollowWaypoints; + ConfigHandler.writeBooleanConfig("toggles", "CrystalHollowWaypoints", crystalHollowWaypoints); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Crystal Hollows waypoints has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + crystalHollowWaypoints + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "crystalautowaypoints": + crystalAutoWaypoints = !crystalAutoWaypoints; + ConfigHandler.writeBooleanConfig("toggles", "CrystalAutoWaypoints", crystalAutoWaypoints); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Auto Crystal Hollows waypoints has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + crystalAutoWaypoints + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "dungeonbossmusic": dungeonBossMusic = !dungeonBossMusic; CustomMusic.dungeonboss.stop(); @@ -520,6 +532,8 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Custom name colors: " + DankersSkyblockMod.VALUE_COLOUR + customColouredNames + "\n" + DankersSkyblockMod.TYPE_COLOUR + " End of farm alert: " + DankersSkyblockMod.VALUE_COLOUR + endOfFarmAlert + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Gemstone in lore: " + DankersSkyblockMod.VALUE_COLOUR + gemstoneLore + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Crystal Hollows waypoints: " + DankersSkyblockMod.VALUE_COLOUR + crystalHollowWaypoints + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Auto Crystal Hollows waypoints: " + DankersSkyblockMod.VALUE_COLOUR + crystalAutoWaypoints + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon boss music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonBossMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom blood room music: " + DankersSkyblockMod.VALUE_COLOUR + bloodRoomMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonMusic diff --git a/src/main/java/me/Danker/features/CrystalHollowWaypoints.java b/src/main/java/me/Danker/features/CrystalHollowWaypoints.java new file mode 100644 index 0000000..17578fe --- /dev/null +++ b/src/main/java/me/Danker/features/CrystalHollowWaypoints.java @@ -0,0 +1,193 @@ +package me.Danker.features; + +import me.Danker.DankersSkyblockMod; +import me.Danker.commands.ToggleCommand; +import me.Danker.handlers.ScoreboardHandler; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.event.ClickEvent; +import net.minecraft.util.*; +import net.minecraft.world.World; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + +import java.util.ArrayList; +import java.util.List; + +public class CrystalHollowWaypoints { + + public static List waypoints = new ArrayList<>(); + + static boolean khazad = false; + static boolean fairy = false; + static boolean temple = false; + static boolean guardian = false; + static boolean divan = false; + static boolean corleone = false; + static boolean king = false; + static boolean queen = false; + static boolean city = false; + static boolean nucleus = false; + static boolean shop = false; + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + if (event.phase != TickEvent.Phase.START) return; + + Minecraft mc = Minecraft.getMinecraft(); + EntityPlayer player = mc.thePlayer; + World world = mc.theWorld; + + if (DankersSkyblockMod.tickAmount % 20 == 0) { + if (ToggleCommand.crystalAutoWaypoints && Utils.inCrystalHollows && world != null) { + boolean found = false; + List scoreboard = ScoreboardHandler.getSidebarLines(); + + if (!nucleus) { + nucleus = true; + waypoints.add(new Waypoint("Crystal Nucleus", new BlockPos(512, 110, 512))); + } + + for (String s : scoreboard) { + String sCleaned = ScoreboardHandler.cleanSB(s); + if (!khazad && sCleaned.contains("Khazad-d")) { + khazad = found = true; + waypoints.add(new Waypoint("Khazad-dûm", player.getPosition())); + } else if (!fairy && sCleaned.contains("Fairy Grotto")) { + fairy = found = true; + waypoints.add(new Waypoint("Fairy Grotto", player.getPosition())); + } else if (!temple && sCleaned.contains("Jungle Temple")) { + temple = found = true; + waypoints.add(new Waypoint("Jungle Temple", player.getPosition())); + } else if (!divan && sCleaned.contains("Mines of Divan")) { + divan = found = true; + waypoints.add(new Waypoint("Mines of Divan", player.getPosition())); + } else if (!queen && sCleaned.contains("Goblin Queen's Den")) { + queen = found = true; + waypoints.add(new Waypoint("Goblin Queen's Den", player.getPosition())); + } else if (!city && sCleaned.contains("Lost Precursor City")) { + city = found = true; + waypoints.add(new Waypoint("Lost Precursor City", player.getPosition())); + } + + if (found) break; + } + + if (!found) { + AxisAlignedBB scan = new AxisAlignedBB(player.getPosition().add(-15, -15, -15), player.getPosition().add(15, 15, 15)); + List entities = world.getEntitiesWithinAABB(EntityArmorStand.class, scan); + + for (EntityArmorStand entity : entities) { + if (entity.hasCustomName()) { + if (!king && entity.getCustomNameTag().endsWith("King Yolkar")) { + king = found = true; + waypoints.add(new Waypoint("King Yolkar", entity.getPosition())); + } else if (!corleone && entity.getCustomNameTag().endsWith("Boss Corleone")) { + corleone = found = true; + waypoints.add(new Waypoint("Boss Corleone", entity.getPosition())); + } else if (!guardian && entity.getCustomNameTag().contains("Key Guardian")) { + guardian = found = true; + waypoints.add(new Waypoint("Key Guardian", entity.getPosition())); + } else if (!shop && entity.getCustomNameTag().contains("Odawa")) { + shop = found = true; + waypoints.add(new Waypoint("Odawa", entity.getPosition())); + } + } + } + } + + if (found && ToggleCommand.crystalHollowWaypoints) { + Waypoint latest = waypoints.get(waypoints.size() - 1); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Added " + latest.location + " @ " + latest.getPos())); + } + } + } + } + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent event) { + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + + /* examples + $SBECHWP:Mines of Divan@-673,117,426 + $SBECHWP:Khazad-dûm@-292,63,281\nFairy Grotto@-216,110,400\njungle temple@-525,110,395\nJungle Temple@-493,101,425\nMines of Divan@-673,117,426 + */ + if (ToggleCommand.crystalHollowWaypoints && Utils.inCrystalHollows) { + if (!message.contains(player.getName()) && (message.contains(": $DSMCHWP:") || message.contains(": $SBECHWP:"))) { + ChatComponentText add = new ChatComponentText(EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + " [ADD]\n"); + add.setChatStyle(add.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/dsmaddcrystalhollowwaypoints " + message.substring(message.lastIndexOf(":") + 1)))); + + new Thread(() -> { + try { + Thread.sleep(10); + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + player.addChatMessage(new ChatComponentText("\n" + DankersSkyblockMod.MAIN_COLOUR + "DSM/SBE Crystal Hollows waypoints found. Click to add.\n").appendSibling(add)); + }).start(); + } + } + } + + @SubscribeEvent + public void onWorldRender(RenderWorldLastEvent event) { + if (ToggleCommand.crystalHollowWaypoints && Utils.inCrystalHollows) { + for (Waypoint waypoint : waypoints) { + if (waypoint.toggled) Utils.draw3DWaypointString(waypoint, event.partialTicks); + } + } + } + + @SubscribeEvent + public void onWorldChange(WorldEvent.Load event) { + waypoints.clear(); + khazad = false; + fairy = false; + temple = false; + guardian = false; + divan = false; + corleone = false; + king = false; + queen = false; + city = false; + nucleus = false; + shop = false; + } + + public static class Waypoint { + + public String location; + public BlockPos pos; + public boolean toggled; + + public Waypoint(String location, BlockPos pos) { + this.location = location; + this.pos = pos; + this.toggled = true; + } + + public String getFormattedWaypoint() { + return location + "@" + pos.getX() + "," + pos.getY() + "," + pos.getZ(); + } + + public String getDistance(EntityPlayer player) { + return Math.round(player.getDistance(pos.getX(), pos.getY(), pos.getZ())) + "m"; + } + + public String getPos() { + return pos.getX() + ", " + pos.getY() + ", " + pos.getZ(); + } + + public void toggle() { + toggled = !toggled; + } + + } + +} diff --git a/src/main/java/me/Danker/gui/CrystalHollowWaypointActionGui.java b/src/main/java/me/Danker/gui/CrystalHollowWaypointActionGui.java new file mode 100644 index 0000000..d7f598d --- /dev/null +++ b/src/main/java/me/Danker/gui/CrystalHollowWaypointActionGui.java @@ -0,0 +1,87 @@ +package me.Danker.gui; + +import me.Danker.DankersSkyblockMod; +import me.Danker.features.CrystalHollowWaypoints; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.util.EnumChatFormatting; + +public class CrystalHollowWaypointActionGui extends GuiScreen { + + private int id; + + private GuiButton goBack; + private GuiButton toggle; + private GuiButton sendNormal; + private GuiButton sendDSM; + private GuiButton sendSBE; + private GuiButton delete; + + public CrystalHollowWaypointActionGui(int id) { + this.id = id; + } + + @Override + public boolean doesGuiPauseGame() { + return false; + } + + @Override + public void initGui() { + super.initGui(); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int height = sr.getScaledHeight(); + int width = sr.getScaledWidth(); + + CrystalHollowWaypoints.Waypoint waypoint = CrystalHollowWaypoints.waypoints.get(id); + + goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); + toggle = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Set Visibility: " + Utils.getColouredBoolean(waypoint.toggled)); + sendNormal = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Send Location And Coordinates"); + sendDSM = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Send DSM Formatted Waypoint"); + sendSBE = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Send SBE Formatted Waypoint"); + delete = new GuiButton(0, width / 2 - 100, (int) (height * 0.8), EnumChatFormatting.RED + "Delete Waypoint"); + + this.buttonList.add(toggle); + this.buttonList.add(sendNormal); + this.buttonList.add(sendDSM); + this.buttonList.add(sendSBE); + this.buttonList.add(delete); + this.buttonList.add(goBack); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + @Override + public void actionPerformed(GuiButton button) { + CrystalHollowWaypoints.Waypoint waypoint = CrystalHollowWaypoints.waypoints.get(id); + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + if (button == goBack) { + DankersSkyblockMod.guiToOpen = "crystalwaypoints"; + } else if (button == toggle) { + waypoint.toggle(); + toggle.displayString = "Set Visibility: " + Utils.getColouredBoolean(waypoint.toggled); + } else if (button == sendNormal) { + player.sendChatMessage(waypoint.location + " @ " + waypoint.getPos()); + } else if (button == sendDSM) { + player.sendChatMessage("$DSMCHWP:" + waypoint.getFormattedWaypoint()); + } else if (button == sendSBE) { + player.sendChatMessage("$SBECHWP:" + waypoint.getFormattedWaypoint()); + } else if (button == delete) { + CrystalHollowWaypoints.waypoints.remove(id); + mc.displayGuiScreen(new CrystalHollowWaypointsGui(1)); + return; + } + CrystalHollowWaypoints.waypoints.set(id, waypoint); + } + +} diff --git a/src/main/java/me/Danker/gui/CrystalHollowWaypointsGui.java b/src/main/java/me/Danker/gui/CrystalHollowWaypointsGui.java new file mode 100644 index 0000000..392f16b --- /dev/null +++ b/src/main/java/me/Danker/gui/CrystalHollowWaypointsGui.java @@ -0,0 +1,139 @@ +package me.Danker.gui; + +import me.Danker.DankersSkyblockMod; +import me.Danker.commands.ToggleCommand; +import me.Danker.features.CrystalHollowWaypoints; +import me.Danker.gui.buttons.FeatureButton; +import me.Danker.handlers.ConfigHandler; +import me.Danker.handlers.TextRenderer; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; + +import java.util.ArrayList; +import java.util.List; + +public class CrystalHollowWaypointsGui extends GuiScreen { + + private int page; + private List allButtons = new ArrayList<>(); + + private GuiButton goBack; + private GuiButton backPage; + private GuiButton nextPage; + private GuiButton sendDSM; + private GuiButton sendSBE; + private FeatureButton crystalHollowWaypoints; + private FeatureButton crystalAutoWaypoints; + + public CrystalHollowWaypointsGui(int page) { + this.page = page; + } + + @Override + public boolean doesGuiPauseGame() { + return false; + } + + @Override + public void initGui() { + super.initGui(); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int height = sr.getScaledHeight(); + int width = sr.getScaledWidth(); + + goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); + backPage = new GuiButton(0, width / 2 - 100, (int) (height * 0.8), 80, 20, "< Back"); + nextPage = new GuiButton(0, width / 2 + 20, (int) (height * 0.8), 80, 20, "Next >"); + sendDSM = new GuiButton(0, 2, 10, 175, 20, "Send DSM Formatted Waypoints"); + sendSBE = new GuiButton(0, 2, 40, 175, 20, "Send SBE Formatted Waypoints"); + crystalHollowWaypoints = new FeatureButton("Crystal Hollows Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalHollowWaypoints), "Shows waypoints to various places in the Crystal Hollows."); + crystalAutoWaypoints = new FeatureButton("Auto Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalAutoWaypoints), "Automatically creates waypoints when you visit a special place in the Crystal Hollows."); + + allButtons.clear(); + allButtons.add(crystalHollowWaypoints); + allButtons.add(crystalAutoWaypoints); + for (int i = 0; i < CrystalHollowWaypoints.waypoints.size(); i++) { + CrystalHollowWaypoints.Waypoint waypoint = CrystalHollowWaypoints.waypoints.get(i); + GuiButton button = new GuiButton(i, 0, 0, waypoint.location + " >"); + allButtons.add(button); + } + + reInit(); + } + + public void reInit() { + this.buttonList.clear(); + + for (int i = (page - 1) * 7, iteration = 0; iteration < 7 && i < allButtons.size(); i++, iteration++) { + GuiButton button = allButtons.get(i); + button.xPosition = width / 2 - 100; + button.yPosition = (int) (height * (0.1 * (iteration + 1))); + this.buttonList.add(button); + } + + if (page > 1) this.buttonList.add(backPage); + if (page < Math.ceil(allButtons.size() / 7D)) this.buttonList.add(nextPage); + + this.buttonList.add(goBack); + this.buttonList.add(sendDSM); + this.buttonList.add(sendSBE); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + + String pageText = "Page: " + page + "/" + (int) Math.ceil(allButtons.size() / 7D); + int pageWidth = mc.fontRendererObj.getStringWidth(pageText); + new TextRenderer(mc, pageText, width / 2 - pageWidth / 2, 10, 1D); + } + + @Override + public void actionPerformed(GuiButton button) { + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + if (button == goBack) { + DankersSkyblockMod.guiToOpen = "dankergui1"; + } else if (button == nextPage) { + mc.displayGuiScreen(new CrystalHollowWaypointsGui(page + 1)); + } else if (button == backPage) { + mc.displayGuiScreen(new CrystalHollowWaypointsGui(page - 1)); + } else if (button == sendDSM) { + if (CrystalHollowWaypoints.waypoints.size() > 0) { + StringBuilder message = new StringBuilder(); + for (CrystalHollowWaypoints.Waypoint waypoint : CrystalHollowWaypoints.waypoints) { + if (message.length() > 0) message.append("\\n"); + message.append(waypoint.getFormattedWaypoint()); + } + message.insert(0, "$DSMCHWP:"); + player.sendChatMessage(message.toString()); + } + } else if (button == sendSBE) { + if (CrystalHollowWaypoints.waypoints.size() > 0) { + StringBuilder message = new StringBuilder(); + for (CrystalHollowWaypoints.Waypoint waypoint : CrystalHollowWaypoints.waypoints) { + if (message.length() > 0) message.append("\\n"); + message.append(waypoint.getFormattedWaypoint()); + } + message.insert(0, "$SBECHWP:"); + player.sendChatMessage(message.toString()); + } + } else if (button == crystalHollowWaypoints) { + ToggleCommand.crystalHollowWaypoints = !ToggleCommand.crystalHollowWaypoints; + ConfigHandler.writeBooleanConfig("toggles", "CrystalHollowWaypoints", ToggleCommand.crystalHollowWaypoints); + crystalHollowWaypoints.displayString = "Crystal Hollows Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalHollowWaypoints); + } else if (button == crystalAutoWaypoints) { + ToggleCommand.crystalAutoWaypoints = !ToggleCommand.crystalAutoWaypoints; + ConfigHandler.writeBooleanConfig("toggles", "CrystalAutoWaypoints", ToggleCommand.crystalAutoWaypoints); + crystalAutoWaypoints.displayString = "Auto Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalAutoWaypoints); + } else { + mc.displayGuiScreen(new CrystalHollowWaypointActionGui(button.id)); + } + } + +} diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index d7e2c16..bed219a 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -41,6 +41,7 @@ public class DankerGui extends GuiScreen { private GuiButton experimentationTableSolvers; private GuiButton skillTracker; private GuiButton customMusic; + private GuiButton crystalHollowWaypoints; // Toggles private GuiButton gparty; private GuiButton coords; @@ -118,6 +119,7 @@ public class DankerGui extends GuiScreen { experimentationTableSolvers = new GuiButton(0, 0, 0, "Toggle Experimentation Table Solvers"); skillTracker = new GuiButton(0, 0, 0, "Toggle Skill XP/Hour Tracking"); customMusic = new GuiButton(0, 0, 0, "Custom Music"); + crystalHollowWaypoints = new GuiButton(0, 0, 0, "Crystal Hollows Waypoints"); outlineText = new FeatureButton("Outline Displayed Text: " + Utils.getColouredBoolean(ToggleCommand.outlineTextToggled), "Adds bold outline to on-screen text."); pickBlock = new FeatureButton("Auto-Swap to Pick Block: " + Utils.getColouredBoolean(ToggleCommand.swapToPickBlockToggled), "Automatically changes left clicks to middle clicks.\nHelpful when lagging."); coords = new FeatureButton("Coordinate/Angle Display: " + Utils.getColouredBoolean(ToggleCommand.coordsToggled), "Displays coordinates and angle."); @@ -166,6 +168,7 @@ public class DankerGui extends GuiScreen { allButtons.add(experimentationTableSolvers); allButtons.add(skillTracker); allButtons.add(customMusic); + allButtons.add(crystalHollowWaypoints); allButtons.add(outlineText); allButtons.add(pickBlock); allButtons.add(coords); @@ -297,6 +300,8 @@ public class DankerGui extends GuiScreen { DankersSkyblockMod.guiToOpen = "skilltracker"; } else if (button == customMusic) { DankersSkyblockMod.guiToOpen = "custommusic"; + } else if (button == crystalHollowWaypoints) { + DankersSkyblockMod.guiToOpen = "crystalwaypoints"; } else if (button == outlineText) { ToggleCommand.outlineTextToggled = !ToggleCommand.outlineTextToggled; ConfigHandler.writeBooleanConfig("toggles", "OutlineText", ToggleCommand.outlineTextToggled); diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 1d6311e..d5ff5bd 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -217,6 +217,8 @@ public class ConfigHandler { ToggleCommand.customColouredNames = initBoolean("toggles", "CustomColouredNames", true); ToggleCommand.endOfFarmAlert = initBoolean("toggles", "EndOfFarmAlert", false); ToggleCommand.gemstoneLore = initBoolean("toggles", "GemstoneLore", false); + ToggleCommand.crystalHollowWaypoints = initBoolean("toggles", "CrystalHollowWaypoints", false); + ToggleCommand.crystalAutoWaypoints = initBoolean("toggles", "CrystalAutoWaypoints", true); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index e1a99ea..dd6eed5 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -2,6 +2,7 @@ package me.Danker.utils; import me.Danker.DankersSkyblockMod; import me.Danker.features.ColouredNames; +import me.Danker.features.CrystalHollowWaypoints; import me.Danker.features.GoldenEnchants; import me.Danker.handlers.APIHandler; import me.Danker.handlers.ConfigHandler; @@ -9,6 +10,7 @@ import me.Danker.handlers.ScoreboardHandler; import me.Danker.handlers.TextRenderer; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.network.NetworkPlayerInfo; @@ -38,6 +40,7 @@ public class Utils { public static boolean inSkyblock = false; public static boolean inDungeons = false; + public static boolean inCrystalHollows = false; public static int[] skillXPPerLevel = {0, 50, 125, 200, 300, 500, 750, 1000, 1500, 2000, 3500, 5000, 7500, 10000, 15000, 20000, 30000, 50000, 75000, 100000, 200000, 300000, 400000, 500000, 600000, 700000, 800000, 900000, 1000000, 1100000, 1200000, 1300000, 1400000, 1500000, 1600000, 1700000, 1800000, 1900000, 2000000, 2100000, 2200000, @@ -167,6 +170,20 @@ public class Utils { inDungeons = false; } + public static void checkForCrystalHollows() { + if (inSkyblock) { + Collection players = Minecraft.getMinecraft().getNetHandler().getPlayerInfoMap(); + for (NetworkPlayerInfo player : players) { + if (player == null || player.getDisplayName() == null) continue; + if (player.getDisplayName().getUnformattedText().contains("Crystal Hollows")) { + inCrystalHollows = true; + return; + } + } + } + inCrystalHollows = false; + } + public static boolean isInScoreboard(String text) { List scoreboard = ScoreboardHandler.getSidebarLines(); for (String s : scoreboard) { @@ -397,6 +414,136 @@ public class Utils { GlStateManager.popMatrix(); } + // I couldnt get waypoint strings to work so in the end I just copied from NEU + // If anyone sees this please help + /*public static void draw3DWaypointString(CrystalHollowWaypoints.Waypoint waypoint, float partialTicks) { + Minecraft mc = Minecraft.getMinecraft(); + EntityPlayer player = mc.thePlayer; + BlockPos pos = waypoint.pos; + double x = (pos.getX() - player.lastTickPosX) + ((pos.getX() - player.posX) - (pos.getX() - player.lastTickPosX)) * partialTicks; + double y = (pos.getY() - player.lastTickPosY) + ((pos.getY() - player.posY) - (pos.getY() - player.lastTickPosY)) * partialTicks; + double z = (pos.getZ() - player.lastTickPosZ) + ((pos.getZ() - player.posZ) - (pos.getZ() - player.lastTickPosZ)) * partialTicks; + + double distance = player.getDistance(x, y, z); + if (distance > 12) { + x *= 12 / distance; + y *= 12 / distance; + z *= 12 / distance; + } + + RenderManager renderManager = mc.getRenderManager(); + Entity viewer = Minecraft.getMinecraft().getRenderViewEntity(); + + float f = 1.6F; + float f1 = 0.016666668F * f; + int width = mc.fontRendererObj.getStringWidth(waypoint.location) / 2; + int width2 = mc.fontRendererObj.getStringWidth(waypoint.getDistance(player)) / 2; + GlStateManager.pushMatrix(); + GlStateManager.translate(x, y, z); + GL11.glNormal3f(0f, 1f, 0f); + GlStateManager.rotate(-renderManager.playerViewY, 0f, 1f, 0f); + GlStateManager.rotate(renderManager.playerViewX, 1f, 0f, 0f); + GlStateManager.scale(-f1, -f1, -f1); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GlStateManager.depthMask(false); + + mc.fontRendererObj.drawString(waypoint.location, -width, 0, 0x55FFFF); + + GlStateManager.rotate(-renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + GlStateManager.translate(0, -1, 0); + GlStateManager.rotate(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + + mc.fontRendererObj.drawString(waypoint.getDistance(player), -width2, 0, 0xFFFF55); + + GL11.glEnable(GL11.GL_DEPTH_TEST); + GlStateManager.depthMask(true); + GlStateManager.disableBlend(); + GlStateManager.popMatrix(); + }*/ + + // https://github.com/Moulberry/NotEnoughUpdates/blob/master/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesWaypoints.java#L261 + public static void draw3DWaypointString(CrystalHollowWaypoints.Waypoint waypoint, float partialTicks) { + GlStateManager.alphaFunc(516, 0.1F); + + GlStateManager.pushMatrix(); + + Entity viewer = Minecraft.getMinecraft().getRenderViewEntity(); + double viewerX = viewer.lastTickPosX + (viewer.posX - viewer.lastTickPosX) * partialTicks; + double viewerY = viewer.lastTickPosY + (viewer.posY - viewer.lastTickPosY) * partialTicks; + double viewerZ = viewer.lastTickPosZ + (viewer.posZ - viewer.lastTickPosZ) * partialTicks; + + double x = waypoint.pos.getX()-viewerX+0.5f; + double y = waypoint.pos.getY()-viewerY-viewer.getEyeHeight(); + double z = waypoint.pos.getZ()-viewerZ+0.5f; + + double distSq = x*x + y*y + z*z; + double dist = Math.sqrt(distSq); + if(distSq > 144) { + x *= 12/dist; + y *= 12/dist; + z *= 12/dist; + } + GlStateManager.translate(x, y, z); + GlStateManager.translate(0, viewer.getEyeHeight(), 0); + + renderNametag(EnumChatFormatting.AQUA + waypoint.location); + + GlStateManager.rotate(-Minecraft.getMinecraft().getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(Minecraft.getMinecraft().getRenderManager().playerViewX, 1.0F, 0.0F, 0.0F); + GlStateManager.translate(0, -0.25f, 0); + GlStateManager.rotate(-Minecraft.getMinecraft().getRenderManager().playerViewX, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(Minecraft.getMinecraft().getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F); + + renderNametag(EnumChatFormatting.YELLOW + waypoint.getDistance(Minecraft.getMinecraft().thePlayer)); + + GlStateManager.popMatrix(); + + GlStateManager.disableLighting(); + } + + // https://github.com/Moulberry/NotEnoughUpdates/blob/master/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesWaypoints.java#L300 + public static void renderNametag(String str) { + FontRenderer fontrenderer = Minecraft.getMinecraft().fontRendererObj; + float f = 1.6F; + float f1 = 0.016666668F * f; + GlStateManager.pushMatrix(); + GL11.glNormal3f(0.0F, 1.0F, 0.0F); + GlStateManager.rotate(-Minecraft.getMinecraft().getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(Minecraft.getMinecraft().getRenderManager().playerViewX, 1.0F, 0.0F, 0.0F); + GlStateManager.scale(-f1, -f1, f1); + GlStateManager.disableLighting(); + GlStateManager.depthMask(false); + GlStateManager.disableDepth(); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + int i = 0; + + int j = fontrenderer.getStringWidth(str) / 2; + GlStateManager.disableTexture2D(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.pos(-j - 1, -1 + i, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos(-j - 1, 8 + i, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos(j + 1, 8 + i, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos(j + 1, -1 + i, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + tessellator.draw(); + GlStateManager.enableTexture2D(); + fontrenderer.drawString(str, -fontrenderer.getStringWidth(str) / 2, i, 553648127); + GlStateManager.depthMask(true); + + fontrenderer.drawString(str, -fontrenderer.getStringWidth(str) / 2, i, -1); + + GlStateManager.enableDepth(); + GlStateManager.enableBlend(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.popMatrix(); + } + public static void draw3DBox(AxisAlignedBB aabb, int colourInt, float partialTicks) { Entity render = Minecraft.getMinecraft().getRenderViewEntity(); Color colour = new Color(colourInt); -- cgit From 0aa907f911d77a9ead77c97034f55bc4c82ecf12 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 24 Jul 2021 01:55:58 -0400 Subject: Add /dankersskyblockmod alias to /dsm --- src/main/java/me/Danker/commands/DankerGuiCommand.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index dc6845d..7c0bbd6 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -14,6 +14,8 @@ import net.minecraft.util.StringUtils; import java.awt.*; import java.awt.datatransfer.StringSelection; +import java.util.Collections; +import java.util.List; public class DankerGuiCommand extends CommandBase { @@ -22,6 +24,11 @@ public class DankerGuiCommand extends CommandBase { return "dsm"; } + @Override + public List getCommandAliases() { + return Collections.singletonList("dankersskyblockmod"); + } + @Override public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName(); -- cgit From 362ecd929a3b506535e31ad4329be8cec52e0bc6 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 24 Jul 2021 21:21:35 -0400 Subject: Fix Giant HP display not in correct location Accidentally left test values --- src/main/java/me/Danker/features/GiantHPDisplay.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/GiantHPDisplay.java b/src/main/java/me/Danker/features/GiantHPDisplay.java index 07378dd..456ba0a 100644 --- a/src/main/java/me/Danker/features/GiantHPDisplay.java +++ b/src/main/java/me/Danker/features/GiantHPDisplay.java @@ -1,6 +1,8 @@ package me.Danker.features; import me.Danker.DankersSkyblockMod; +import me.Danker.commands.MoveCommand; +import me.Danker.commands.ScaleCommand; import me.Danker.commands.ToggleCommand; import me.Danker.events.RenderOverlay; import me.Danker.handlers.ScoreboardHandler; @@ -64,7 +66,7 @@ public class GiantHPDisplay { if (!giant.isDead) sb.append(Utils.removeBold(giant.getDisplayName().getFormattedText())).append("\n"); } - new TextRenderer(Minecraft.getMinecraft(), sb.toString(), 100, 100, 1); + new TextRenderer(Minecraft.getMinecraft(), sb.toString(), MoveCommand.giantHPXY[0], MoveCommand.giantHPXY[1], ScaleCommand.giantHPScale); } } -- cgit From d534e7e9da3c3d20825cda831f2814249e212d5a Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 30 Jul 2021 02:14:10 -0400 Subject: Auto accept reparty --- README.md | 3 +- src/main/java/me/Danker/DankersSkyblockMod.java | 1 + .../java/me/Danker/commands/DankerGuiCommand.java | 1 + .../java/me/Danker/commands/ToggleCommand.java | 11 ++++++-- .../java/me/Danker/features/AutoAcceptReparty.java | 33 ++++++++++++++++++++++ src/main/java/me/Danker/gui/DankerGui.java | 7 +++++ .../java/me/Danker/handlers/ConfigHandler.java | 1 + 7 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 src/main/java/me/Danker/features/AutoAcceptReparty.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 55bcd1a..7aaef81 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ Discord Server: https://discord.gg/QsEkNQS - API commands - Update checker - Reparty command +- Auto accept reparty - Highlight Slayer Bosses - Highlight Arachne - Highlight Skeleton Masters @@ -62,7 +63,7 @@ Discord Server: https://discord.gg/QsEkNQS ## Commands - /dhelp - Returns this message in-game. - /dsm - Opens the GUI for Danker's Skyblock Mod. -- /toggle - Toggles features. /toggle list returns values of every toggle. +- /toggle - Toggles features. /toggle list returns values of every toggle. - /setkey - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. - /loot [winter/festival/spooky/f(1-7)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index e02f12a..9258892 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -101,6 +101,7 @@ public class DankersSkyblockMod { public void init(FMLInitializationEvent event) throws UnsupportedAudioFileException, IOException, LineUnavailableException { MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(new ArachneESP()); + MinecraftForge.EVENT_BUS.register(new AutoAcceptReparty()); MinecraftForge.EVENT_BUS.register(new AutoDisplay()); MinecraftForge.EVENT_BUS.register(new AutoSwapToPickBlock()); MinecraftForge.EVENT_BUS.register(new BlazeSolver()); diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index 7c0bbd6..d6b92eb 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -109,6 +109,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[gemstonelore][").append(ToggleCommand.gemstoneLore).append("]\n"); debug.append("[crystalhollowwaypoints][").append(ToggleCommand.crystalHollowWaypoints).append("]\n"); debug.append("[crystalautowaypoints][").append(ToggleCommand.crystalAutoWaypoints).append("]\n"); + debug.append("[autoacceptreparty][").append(ToggleCommand.autoAcceptReparty).append("]\n"); debug.append("[dungeonbossmusic][").append(ToggleCommand.dungeonBossMusic).append("]\n"); debug.append("[bloodroommusic][").append(ToggleCommand.bloodRoomMusic).append("]\n"); debug.append("[dungeonmusic][").append(ToggleCommand.dungeonMusic).append("]\n"); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 061a277..c810eff 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -43,6 +43,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean gemstoneLore; public static boolean crystalHollowWaypoints; public static boolean crystalAutoWaypoints; + public static boolean autoAcceptReparty; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; @@ -104,7 +105,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/" + "melodytooltips/highlightslayers/highlightarachne/highlightskeletonmasters/teammatesinradius/" + "gianthp/hidepetcandy/customcolorednames/endoffarmalert/gemstonelore/crystalhollowwaypoints/crystalautowaypoints/" + - "dungeonbossmusic/bloodroommusic/dungeonmusic/list>"; + "autoacceptreparty/dungeonbossmusic/bloodroommusic/dungeonmusic/list>"; } public static String usage(ICommandSender arg0) { @@ -134,7 +135,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "hidetooltipsinaddons", "pickblock", "melodytooltips", "highlightslayers", "highlightskeletonmasters", "dungeonbossmusic", "bloodroommusic", "dungeonmusic", "teammatesinradius", "gianthp", "hidepetcandy", "customcolorednames", "endoffarmalert", - "gemstonelore", "crystalhollowwaypoints", "crystalautowaypoints", "list"); + "gemstonelore", "crystalhollowwaypoints", "crystalautowaypoints", "autoacceptreparty", "list"); } return null; } @@ -461,6 +462,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "CrystalAutoWaypoints", crystalAutoWaypoints); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Auto Crystal Hollows waypoints has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + crystalAutoWaypoints + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "autoacceptreparty": + autoAcceptReparty = !autoAcceptReparty; + ConfigHandler.writeBooleanConfig("toggles", "AutoAcceptReparty", autoAcceptReparty); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Auto accept reparty has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + autoAcceptReparty + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "dungeonbossmusic": dungeonBossMusic = !dungeonBossMusic; CustomMusic.dungeonboss.stop(); @@ -534,6 +540,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Gemstone in lore: " + DankersSkyblockMod.VALUE_COLOUR + gemstoneLore + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Crystal Hollows waypoints: " + DankersSkyblockMod.VALUE_COLOUR + crystalHollowWaypoints + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Auto Crystal Hollows waypoints: " + DankersSkyblockMod.VALUE_COLOUR + crystalAutoWaypoints + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Auto accept reparty: " + DankersSkyblockMod.VALUE_COLOUR + autoAcceptReparty + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon boss music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonBossMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom blood room music: " + DankersSkyblockMod.VALUE_COLOUR + bloodRoomMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonMusic diff --git a/src/main/java/me/Danker/features/AutoAcceptReparty.java b/src/main/java/me/Danker/features/AutoAcceptReparty.java new file mode 100644 index 0000000..a89b30b --- /dev/null +++ b/src/main/java/me/Danker/features/AutoAcceptReparty.java @@ -0,0 +1,33 @@ +package me.Danker.features; + +import me.Danker.commands.ToggleCommand; +import net.minecraft.client.Minecraft; +import net.minecraft.util.StringUtils; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class AutoAcceptReparty { + + String partyLeader = null; + long lastDisband = 0; + + @SubscribeEvent(receiveCanceled = true) + public void onChat(ClientChatReceivedEvent event) { + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + + if (ToggleCommand.autoAcceptReparty) { + String[] split = message.split("\\s"); + + if (message.contains("has disbanded the party!")) { + lastDisband = System.currentTimeMillis() / 1000; + partyLeader = split[0].contains("[") ? split[1] : split[0]; + } else if (message.contains("has invited you to join their party!")) { + String inviter = split[1].contains("[") ? split[2] : split[1]; + if (inviter.equals(partyLeader) && System.currentTimeMillis() / 1000 - lastDisband <= 120) { + Minecraft.getMinecraft().thePlayer.sendChatMessage("/party accept " + partyLeader); + } + } + } + } + +} diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index bed219a..f2d3bf3 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -70,6 +70,7 @@ public class DankerGui extends GuiScreen { private GuiButton customColouredNames; private GuiButton endOfFarmAlert; private GuiButton gemstoneLore; + private GuiButton autoAcceptReparty; // Chat Messages private GuiButton sceptreMessages; private GuiButton midasStaffMessages; @@ -161,6 +162,7 @@ public class DankerGui extends GuiScreen { customColouredNames = new FeatureButton("Custom Name Colors: " + Utils.getColouredBoolean(ToggleCommand.customColouredNames), "Replaces some player's usernames with a custom color."); endOfFarmAlert = new FeatureButton("Alert When Reaching End of Farm: " + Utils.getColouredBoolean(ToggleCommand.endOfFarmAlert), "Alerts when you go past coords set with /dsmfarmlength."); gemstoneLore = new FeatureButton("Applied Gemstones in Lore: " + Utils.getColouredBoolean(ToggleCommand.gemstoneLore), "Adds applied gemstones to item tooltip."); + autoAcceptReparty = new FeatureButton("Auto Accept Reparty: " + Utils.getColouredBoolean(ToggleCommand.autoAcceptReparty), "Automatically rejoins parties when disbanded and invited."); allButtons.clear(); allButtons.add(changeDisplay); @@ -210,6 +212,7 @@ public class DankerGui extends GuiScreen { allButtons.add(customColouredNames); allButtons.add(endOfFarmAlert); allButtons.add(gemstoneLore); + allButtons.add(autoAcceptReparty); search.setText(initSearchText); search.setVisible(true); @@ -466,6 +469,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.gemstoneLore = !ToggleCommand.gemstoneLore; ConfigHandler.writeBooleanConfig("toggles", "GemstoneLore", ToggleCommand.gemstoneLore); gemstoneLore.displayString = "Applied Gemstones in Lore: " + Utils.getColouredBoolean(ToggleCommand.gemstoneLore); + } else if (button == autoAcceptReparty) { + ToggleCommand.autoAcceptReparty = !ToggleCommand.autoAcceptReparty; + ConfigHandler.writeBooleanConfig("toggles", "AutoAcceptReparty", ToggleCommand.autoAcceptReparty); + autoAcceptReparty.displayString = "Auto Accept Reparty: " + Utils.getColouredBoolean(ToggleCommand.autoAcceptReparty); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index d5ff5bd..115f01b 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -219,6 +219,7 @@ public class ConfigHandler { ToggleCommand.gemstoneLore = initBoolean("toggles", "GemstoneLore", false); ToggleCommand.crystalHollowWaypoints = initBoolean("toggles", "CrystalHollowWaypoints", false); ToggleCommand.crystalAutoWaypoints = initBoolean("toggles", "CrystalAutoWaypoints", true); + ToggleCommand.autoAcceptReparty = initBoolean("toggles", "AutoAcceptReparty", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); -- cgit From 342c6c8c6096db1e3e0e2ea4363ba34764f1121b Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 30 Jul 2021 17:49:30 -0400 Subject: Add rainbow colour names --- src/main/java/me/Danker/features/ColouredNames.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/ColouredNames.java b/src/main/java/me/Danker/features/ColouredNames.java index 2156f3a..cba327a 100644 --- a/src/main/java/me/Danker/features/ColouredNames.java +++ b/src/main/java/me/Danker/features/ColouredNames.java @@ -22,6 +22,7 @@ import java.util.regex.Pattern; public class ColouredNames { public static List users = new ArrayList<>(); + public static final EnumChatFormatting[] RAINBOW_COLOURS = new EnumChatFormatting[]{EnumChatFormatting.RED, EnumChatFormatting.GOLD, EnumChatFormatting.YELLOW, EnumChatFormatting.GREEN, EnumChatFormatting.AQUA, EnumChatFormatting.BLUE, EnumChatFormatting.DARK_PURPLE}; @SubscribeEvent public void onChat(ClientChatReceivedEvent event) { @@ -76,8 +77,23 @@ public class ColouredNames { Matcher prevColourMat = Pattern.compile("(?:.*(?:(?\\u00a7[0-9a-fbr])" + name + ")\\b.*)").matcher(text); if (prevColourMat.matches()) { + if (colour.equals("§z")) { + StringBuilder rainbowName = new StringBuilder(); + for (int i = 0; i < name.length(); i++) { + rainbowName.append(RAINBOW_COLOURS[i % 7]).append(name.charAt(i)); + } + return text.replaceAll(namePattern, rainbowName + prevColourMat.group("colour")); + } return text.replaceAll(namePattern, colour + name + prevColourMat.group("colour")); } + + if (colour.equals("§z")) { + StringBuilder rainbowName = new StringBuilder(); + for (int i = 0; i < name.length(); i++) { + rainbowName.append(RAINBOW_COLOURS[i % 7]).append(name.charAt(i)); + } + return text.replaceAll(namePattern, rainbowName.toString() + EnumChatFormatting.WHITE); + } return text.replaceAll(namePattern, colour + name + EnumChatFormatting.WHITE); } -- cgit From a49b673bd9badcb7c4c02539f53c39c5b52c1b32 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 31 Jul 2021 19:58:02 -0400 Subject: Add custom music to every area Hub, island, farming islands, gold mine, deep caverns, dwarven mines, crystal hollows, blazing fortress, end, park --- README.md | 21 +++- src/main/java/me/Danker/DankersSkyblockMod.java | 4 +- .../me/Danker/commands/CustomMusicCommand.java | 88 +++++++++++--- .../java/me/Danker/commands/ToggleCommand.java | 100 +++++++++++++++- .../me/Danker/features/CrystalHollowWaypoints.java | 6 +- src/main/java/me/Danker/features/CustomMusic.java | 133 +++++++++++++++++---- src/main/java/me/Danker/gui/CustomMusicGui.java | 118 +++++++++++++++++- .../java/me/Danker/handlers/ConfigHandler.java | 22 ++++ src/main/java/me/Danker/utils/Utils.java | 13 +- 9 files changed, 442 insertions(+), 63 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 7aaef81..db33492 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ Discord Server: https://discord.gg/QsEkNQS ## Commands - /dhelp - Returns this message in-game. - /dsm - Opens the GUI for Danker's Skyblock Mod. -- /toggle - Toggles features. /toggle list returns values of every toggle. +- /toggle - Toggles features. /toggle list returns values of every toggle. - /setkey - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. - /loot [winter/festival/spooky/f(1-7)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. @@ -85,7 +85,7 @@ Discord Server: https://discord.gg/QsEkNQS - /reparty - Disbands and reparties all members in the party - /fairysouls - Check the fairysouls of a player - /lobbybank - Uses API to find the average bank total of the lobby, as well the three players with the highest total money in the bank (and purse). -- /dsmmusic [dungeonboss/bloodroom/dungeon] [1-100] - Stops, reloads or changes the volume of custom music. +- /dsmmusic [dungeonboss/bloodroom/dungeon/hub/island/dungeonhub/farmingislands/goldmine/deepcaverns/dwarvenmines/crystalhollows/blazingfortress/end/park] [1-100] - Stops, reloads or changes the volume of custom music. - /player [player] - Uses API to find skills, slayers, coins and weight of a player. - /reloadconfig - Reloads Danker's Skyblock Mod config. - /reloaddsmrepo - Reloads Danker's Skyblock Mod repository. @@ -98,9 +98,20 @@ Discord Server: https://discord.gg/QsEkNQS ## Custom Music 1. Place a music file with the given name in the `.minecraft/config/dsmmusic` folder: - - Dungeon music: `dungeon.wav` - - Blood room music: `bloodroom.wav` - - Dungeon boss music: `dungeonboss.wav` + - Dungeon: `dungeon.wav` + - Blood room: `bloodroom.wav` + - Dungeon boss: `dungeonboss.wav` + - Dungeon hub: `dungeonhub.wav` + - Hub: `hub.wav` + - Private Island: `island.wav` + - Farming Islands: `farmingislands.wav` + - Gold Mine: `goldmine.wav` + - Deep Caverns: `deepcaverns.wav` + - Dwarven Mines: `dwarvenmines.wav` + - Crystal Hollows: `crystalhollows.wav` + - Blazing Fortress: `blazingfortress.wav` + - The End: `end.wav` + - The Park: `park.wav` 2. Either run `/dsmmusic reload` or restart your game. 3. Enable the custom music in `/dsm`. 4. (Optional) Change the volume of the music with `/dsmmusic volume`. diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 9258892..100db96 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -360,7 +360,7 @@ public class DankersSkyblockMod { if (player != null) { Utils.checkForSkyblock(); Utils.checkForDungeons(); - Utils.checkForCrystalHollows(); + Utils.checkTabLocation(); } tickAmount = 0; @@ -427,7 +427,7 @@ public class DankersSkyblockMod { mc.displayGuiScreen(new SkillTrackerGui()); break; case "custommusic": - mc.displayGuiScreen(new CustomMusicGui()); + mc.displayGuiScreen(new CustomMusicGui(1)); break; case "crystalwaypoints": mc.displayGuiScreen(new CrystalHollowWaypointsGui(1)); diff --git a/src/main/java/me/Danker/commands/CustomMusicCommand.java b/src/main/java/me/Danker/commands/CustomMusicCommand.java index 0e80dd3..45e3770 100644 --- a/src/main/java/me/Danker/commands/CustomMusicCommand.java +++ b/src/main/java/me/Danker/commands/CustomMusicCommand.java @@ -24,7 +24,8 @@ public class CustomMusicCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " [dungeonboss/bloodroom/dungeon] [1-100]"; + return "/" + getCommandName() + " [dungeonboss/bloodroom/dungeon/hub/island/dungeonhub/farmingislands/" + + "goldmine/deepcaverns/dwarvenmines/crystalhollows/blazingfortress/end/park] [1-100]"; } public static String usage(ICommandSender arg0) { @@ -41,7 +42,8 @@ public class CustomMusicCommand extends CommandBase { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "stop", "reload", "volume"); } else if (args.length == 2) { - return getListOfStringsMatchingLastWord(args, "dungeonboss", "bloodroom", "dungeon"); + return getListOfStringsMatchingLastWord(args, "dungeonboss", "bloodroom", "dungeon", "hub", "island", "dungeonhub", "farmingislands", "goldmine", + "deepcaverns", "dwarvenmines", "crystalhollows", "blazingfortress", "end", "park"); } return null; } @@ -76,36 +78,92 @@ public class CustomMusicCommand extends CommandBase { } int volume = Integer.parseInt(arg1[2]); - boolean success; switch (arg1[1].toLowerCase()) { case "dungeonboss": - success = CustomMusic.dungeonboss.setVolume(volume); - if (!success) { - return; - } + if (!CustomMusic.dungeonboss.setVolume(volume)) return; CustomMusic.dungeonbossVolume = volume; ConfigHandler.writeIntConfig("music", "DungeonBossVolume", volume); break; case "bloodroom": - success = CustomMusic.bloodroom.setVolume(volume); - if (!success) { - return; - } + if (!CustomMusic.bloodroom.setVolume(volume)) return; CustomMusic.bloodroomVolume = volume; ConfigHandler.writeIntConfig("music", "BloodRoomVolume", volume); break; case "dungeon": - success = CustomMusic.dungeon.setVolume(volume); - if (!success) { - return; - } + if (!CustomMusic.dungeon.setVolume(volume)) return; CustomMusic.dungeonVolume = volume; ConfigHandler.writeIntConfig("music", "DungeonVolume", volume); break; + case "hub": + if (!CustomMusic.hub.setVolume(volume)) return; + + CustomMusic.hubVolume = volume; + ConfigHandler.writeIntConfig("music", "HubVolume", volume); + break; + case "island": + if (!CustomMusic.island.setVolume(volume)) return; + + CustomMusic.islandVolume = volume; + ConfigHandler.writeIntConfig("music", "IslandVolume", volume); + break; + case "dungeonhub": + if (!CustomMusic.dungeonHub.setVolume(volume)) return; + + CustomMusic.dungeonHubVolume = volume; + ConfigHandler.writeIntConfig("music", "DungeonHubVolume", volume); + break; + case "farmingislands": + if (!CustomMusic.farmingIslands.setVolume(volume)) return; + + CustomMusic.farmingIslandsVolume = volume; + ConfigHandler.writeIntConfig("music", "FarmingIslandsVolume", volume); + break; + case "goldmine": + if (!CustomMusic.goldMine.setVolume(volume)) return; + + CustomMusic.goldMineVolume = volume; + ConfigHandler.writeIntConfig("music", "GoldMineVolume", volume); + break; + case "deepcaverns": + if (!CustomMusic.deepCaverns.setVolume(volume)) return; + + CustomMusic.deepCavernsVolume = volume; + ConfigHandler.writeIntConfig("music", "DeepCavernsVolume", volume); + break; + case "dwarvenmines": + if (!CustomMusic.dwarvenMines.setVolume(volume)) return; + + CustomMusic.dwarvenMinesVolume = volume; + ConfigHandler.writeIntConfig("music", "DwarvenMinesVolume", volume); + break; + case "crystalhollows": + if (!CustomMusic.crystalHollows.setVolume(volume)) return; + + CustomMusic.crystalHollowsVolume = volume; + ConfigHandler.writeIntConfig("music", "CrystalHollowsVolume", volume); + break; + case "blazingfortress": + if (!CustomMusic.blazingFortress.setVolume(volume)) return; + + CustomMusic.blazingFortressVolume = volume; + ConfigHandler.writeIntConfig("music", "BlazingFortressVolume", volume); + break; + case "end": + if (!CustomMusic.end.setVolume(volume)) return; + + CustomMusic.endVolume = volume; + ConfigHandler.writeIntConfig("music", "EndVolume", volume); + break; + case "park": + if (!CustomMusic.park.setVolume(volume)) return; + + CustomMusic.parkVolume = volume; + ConfigHandler.writeIntConfig("music", "ParkVolume", volume); + break; default: player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); return; diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index c810eff..65900fd 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -14,6 +14,7 @@ import net.minecraft.util.ChatComponentText; import java.util.List; public class ToggleCommand extends CommandBase implements ICommand { + // i hate this file so much // Some of these end with toggled and some don't, I don't want to go back and fix them all for consistency public static boolean gpartyToggled; public static boolean coordsToggled; @@ -87,6 +88,17 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean dungeonBossMusic; public static boolean bloodRoomMusic; public static boolean dungeonMusic; + public static boolean hubMusic; + public static boolean islandMusic; + public static boolean dungeonHubMusic; + public static boolean farmingIslandsMusic; + public static boolean goldMineMusic; + public static boolean deepCavernsMusic; + public static boolean dwarvenMinesMusic; + public static boolean crystalHollowsMusic; + public static boolean blazingFortressMusic; + public static boolean endMusic; + public static boolean parkMusic; @Override public String getCommandName() { @@ -105,7 +117,9 @@ public class ToggleCommand extends CommandBase implements ICommand { "ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/" + "melodytooltips/highlightslayers/highlightarachne/highlightskeletonmasters/teammatesinradius/" + "gianthp/hidepetcandy/customcolorednames/endoffarmalert/gemstonelore/crystalhollowwaypoints/crystalautowaypoints/" + - "autoacceptreparty/dungeonbossmusic/bloodroommusic/dungeonmusic/list>"; + "autoacceptreparty/dungeonbossmusic/bloodroommusic/dungeonmusic/hubmusic/islandmusic/dungeonhubmusic/" + + "farmingislandsmusic/goldminemusic/deepcavernsmusic/crystalhollowsmusic/blazingfortressmusic/endmusic/" + + "parkmusic/list>"; } public static String usage(ICommandSender arg0) { @@ -135,7 +149,10 @@ public class ToggleCommand extends CommandBase implements ICommand { "hidetooltipsinaddons", "pickblock", "melodytooltips", "highlightslayers", "highlightskeletonmasters", "dungeonbossmusic", "bloodroommusic", "dungeonmusic", "teammatesinradius", "gianthp", "hidepetcandy", "customcolorednames", "endoffarmalert", - "gemstonelore", "crystalhollowwaypoints", "crystalautowaypoints", "autoacceptreparty", "list"); + "gemstonelore", "crystalhollowwaypoints", "crystalautowaypoints", "autoacceptreparty", + "hubmusic", "islandmusic", "dungeonhubmusic", "farmingislandsmusic", "goldminemusic", + "deepcavernsmusic", "dwarvenminesmusic", "crystalhollowsmusic", "blazingfortressmusic", + "endmusic", "parkmusic", "list"); } return null; } @@ -485,6 +502,72 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "DungeonMusic", dungeonMusic); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom dungeon music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + dungeonMusic + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "hubmusic": + hubMusic = !hubMusic; + CustomMusic.hub.stop(); + ConfigHandler.writeBooleanConfig("toggles", "HubMusic", hubMusic); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom hub music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + hubMusic + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "islandmusic": + islandMusic = !islandMusic; + CustomMusic.island.stop(); + ConfigHandler.writeBooleanConfig("toggles", "IslandMusic", islandMusic); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom island music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + islandMusic + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "dungeonhubmusic": + dungeonHubMusic = !dungeonHubMusic; + CustomMusic.dungeonHub.stop(); + ConfigHandler.writeBooleanConfig("toggles", "DungeonHubMusic", dungeonHubMusic); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom dungeon hub music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + dungeonHubMusic + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "farmingislandsmusic": + farmingIslandsMusic = !farmingIslandsMusic; + CustomMusic.farmingIslands.stop(); + ConfigHandler.writeBooleanConfig("toggles", "FarmingIslandsMusic", farmingIslandsMusic); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom farming islands music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + farmingIslandsMusic + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "goldminemusic": + goldMineMusic = !goldMineMusic; + CustomMusic.goldMine.stop(); + ConfigHandler.writeBooleanConfig("toggles", "GoldMineMusic", goldMineMusic); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom gold mine music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + goldMineMusic + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "deepcavernsmusic": + deepCavernsMusic = !deepCavernsMusic; + CustomMusic.deepCaverns.stop(); + ConfigHandler.writeBooleanConfig("toggles", "DeepCavernsMusic", deepCavernsMusic); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom deep caverns music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + deepCavernsMusic + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "dwarvenminesmusic": + dwarvenMinesMusic = !dwarvenMinesMusic; + CustomMusic.dwarvenMines.stop(); + ConfigHandler.writeBooleanConfig("toggles", "DwarvenMinesMusic", dwarvenMinesMusic); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom dwarven mines music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + dwarvenMinesMusic + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "crystalhollowsmusic": + crystalHollowsMusic = !crystalHollowsMusic; + CustomMusic.crystalHollows.stop(); + ConfigHandler.writeBooleanConfig("toggles", "CrystalHollowsMusic", crystalHollowsMusic); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom crystal hollows music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + crystalHollowsMusic + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "blazingfortressmusic": + blazingFortressMusic = !blazingFortressMusic; + CustomMusic.blazingFortress.stop(); + ConfigHandler.writeBooleanConfig("toggles", "BlazingFortressMusic", blazingFortressMusic); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom blazing fortress music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + blazingFortressMusic + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "endmusic": + endMusic = !endMusic; + CustomMusic.end.stop(); + ConfigHandler.writeBooleanConfig("toggles", "EndMusic", endMusic); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom end music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + endMusic + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "parkmusic": + parkMusic = !parkMusic; + CustomMusic.park.stop(); + ConfigHandler.writeBooleanConfig("toggles", "DungeonMusic", parkMusic); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom park music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + parkMusic + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "list": player.addChatMessage(new ChatComponentText(DankersSkyblockMod.TYPE_COLOUR + "Guild party notifications: " + DankersSkyblockMod.VALUE_COLOUR + gpartyToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Coord/Angle display: " + DankersSkyblockMod.VALUE_COLOUR + coordsToggled + "\n" + @@ -543,7 +626,18 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Auto accept reparty: " + DankersSkyblockMod.VALUE_COLOUR + autoAcceptReparty + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon boss music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonBossMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom blood room music: " + DankersSkyblockMod.VALUE_COLOUR + bloodRoomMusic + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonMusic + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonMusic + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Custom hub music: " + DankersSkyblockMod.VALUE_COLOUR + hubMusic + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Custom island music: " + DankersSkyblockMod.VALUE_COLOUR + islandMusic + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon hub music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonHubMusic + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Custom farming islands music: " + DankersSkyblockMod.VALUE_COLOUR + farmingIslandsMusic + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Custom gold mine music: " + DankersSkyblockMod.VALUE_COLOUR + goldMineMusic + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Custom deep caverns music: " + DankersSkyblockMod.VALUE_COLOUR + deepCavernsMusic + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Custom dwarven mines music: " + DankersSkyblockMod.VALUE_COLOUR + dwarvenMinesMusic + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Custom crystal hollows music: " + DankersSkyblockMod.VALUE_COLOUR + crystalHollowsMusic + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Custom blazing fortress music: " + DankersSkyblockMod.VALUE_COLOUR + blazingFortressMusic + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Custom end music: " + DankersSkyblockMod.VALUE_COLOUR + endMusic + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Custom park music: " + DankersSkyblockMod.VALUE_COLOUR + parkMusic )); break; default: diff --git a/src/main/java/me/Danker/features/CrystalHollowWaypoints.java b/src/main/java/me/Danker/features/CrystalHollowWaypoints.java index 17578fe..37f709a 100644 --- a/src/main/java/me/Danker/features/CrystalHollowWaypoints.java +++ b/src/main/java/me/Danker/features/CrystalHollowWaypoints.java @@ -44,7 +44,7 @@ public class CrystalHollowWaypoints { World world = mc.theWorld; if (DankersSkyblockMod.tickAmount % 20 == 0) { - if (ToggleCommand.crystalAutoWaypoints && Utils.inCrystalHollows && world != null) { + if (ToggleCommand.crystalAutoWaypoints && Utils.tabLocation.equals("Crystal Hollows") && world != null) { boolean found = false; List scoreboard = ScoreboardHandler.getSidebarLines(); @@ -118,7 +118,7 @@ public class CrystalHollowWaypoints { $SBECHWP:Mines of Divan@-673,117,426 $SBECHWP:Khazad-dûm@-292,63,281\nFairy Grotto@-216,110,400\njungle temple@-525,110,395\nJungle Temple@-493,101,425\nMines of Divan@-673,117,426 */ - if (ToggleCommand.crystalHollowWaypoints && Utils.inCrystalHollows) { + if (ToggleCommand.crystalHollowWaypoints && Utils.tabLocation.equals("Crystal Hollows")) { if (!message.contains(player.getName()) && (message.contains(": $DSMCHWP:") || message.contains(": $SBECHWP:"))) { ChatComponentText add = new ChatComponentText(EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + " [ADD]\n"); add.setChatStyle(add.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/dsmaddcrystalhollowwaypoints " + message.substring(message.lastIndexOf(":") + 1)))); @@ -137,7 +137,7 @@ public class CrystalHollowWaypoints { @SubscribeEvent public void onWorldRender(RenderWorldLastEvent event) { - if (ToggleCommand.crystalHollowWaypoints && Utils.inCrystalHollows) { + if (ToggleCommand.crystalHollowWaypoints && Utils.tabLocation.equals("Crystal Hollows")) { for (Waypoint waypoint : waypoints) { if (waypoint.toggled) Utils.draw3DWaypointString(waypoint, event.partialTicks); } diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java index 5080821..d61b640 100644 --- a/src/main/java/me/Danker/features/CustomMusic.java +++ b/src/main/java/me/Danker/features/CustomMusic.java @@ -35,6 +35,29 @@ public class CustomMusic { public static int bloodroomVolume; public static Song dungeon; public static int dungeonVolume; + public static Song hub; + public static int hubVolume; + public static Song island; + public static int islandVolume; + public static Song dungeonHub; + public static int dungeonHubVolume; + public static Song farmingIslands; + public static int farmingIslandsVolume; + public static Song goldMine; + public static int goldMineVolume; + public static Song deepCaverns; + public static int deepCavernsVolume; + public static Song dwarvenMines; + public static int dwarvenMinesVolume; + public static Song crystalHollows; + public static int crystalHollowsVolume; + public static Song blazingFortress; + public static int blazingFortressVolume; + public static Song end; + public static int endVolume; + public static Song park; + public static int parkVolume; + @SubscribeEvent public void onWorldChange(WorldEvent.Load event) { @@ -49,28 +72,66 @@ public class CustomMusic { EntityPlayerSP player = mc.thePlayer; World world = mc.theWorld; if (DankersSkyblockMod.tickAmount % 10 == 0) { - if (Utils.inDungeons && world != null && player != null) { - prevInDungeonBossRoom = inDungeonBossRoom; - List scoreboard = ScoreboardHandler.getSidebarLines(); - if (scoreboard.size() > 2) { - String firstLine = ScoreboardHandler.cleanSB(scoreboard.get(scoreboard.size() - 1)); - String secondLine = ScoreboardHandler.cleanSB(scoreboard.get(scoreboard.size() - 2)); - if (firstLine.contains("30,30") || // F1 - firstLine.contains("30,125") || // F2 - firstLine.contains("30,225") || // F3 - secondLine.contains("- Healthy") || // F3 - firstLine.contains("30,344") || // F4 - firstLine.contains("livid") || // F5 - firstLine.contains("sadan") || // F6 - firstLine.contains("necron")) { // F7 - - inDungeonBossRoom = true; - if (!prevInDungeonBossRoom) { - bloodroom.stop(); - if (ToggleCommand.dungeonBossMusic) dungeonboss.start(); + if (world != null && player != null) { + if (Utils.inDungeons) { + prevInDungeonBossRoom = inDungeonBossRoom; + List scoreboard = ScoreboardHandler.getSidebarLines(); + if (scoreboard.size() > 2) { + String firstLine = ScoreboardHandler.cleanSB(scoreboard.get(scoreboard.size() - 1)); + String secondLine = ScoreboardHandler.cleanSB(scoreboard.get(scoreboard.size() - 2)); + if (firstLine.contains("30,30") || // F1 + firstLine.contains("30,125") || // F2 + firstLine.contains("30,225") || // F3 + secondLine.contains("- Healthy") || // F3 + firstLine.contains("30,344") || // F4 + firstLine.contains("livid") || // F5 + firstLine.contains("sadan") || // F6 + firstLine.contains("necron")) { // F7 + + inDungeonBossRoom = true; + if (!prevInDungeonBossRoom) { + bloodroom.stop(); + if (ToggleCommand.dungeonBossMusic) dungeonboss.start(); + } + } else { + inDungeonBossRoom = false; } - } else { - inDungeonBossRoom = false; + } + } else { + switch (Utils.tabLocation) { + case "Hub": + if (ToggleCommand.hubMusic) hub.start(); + break; + case "Private World": + if (ToggleCommand.islandMusic) island.start(); + break; + case "Dungeon Hub": + if (ToggleCommand.dungeonHubMusic) dungeonHub.start(); + break; + case "The Farming Islands": + if (ToggleCommand.farmingIslandsMusic) farmingIslands.start(); + break; + case "Gold Mine": + if (ToggleCommand.goldMineMusic) goldMine.start(); + break; + case "Deep Caverns": + if (ToggleCommand.deepCavernsMusic) deepCaverns.start(); + break; + case "Dwarven Mines": + if (ToggleCommand.dwarvenMinesMusic) dwarvenMines.start(); + break; + case "Crystal Hollows": + if (ToggleCommand.crystalHollowsMusic) crystalHollows.start(); + break; + case "Blazing Fortress": + if (ToggleCommand.blazingFortressMusic) blazingFortress.start(); + break; + case "The End": + if (ToggleCommand.endMusic) end.start(); + break; + case "The Park": + if (ToggleCommand.parkMusic) park.start(); + break; } } } @@ -118,12 +179,34 @@ public class CustomMusic { dungeonboss = new Song(directory, "dungeonboss", dungeonbossVolume); bloodroom = new Song(directory, "bloodroom", bloodroomVolume); dungeon = new Song(directory, "dungeon", dungeonVolume); + hub = new Song(directory, "hub", hubVolume); + island = new Song(directory, "island", hubVolume); + dungeonHub = new Song(directory, "dungeonhub", dungeonHubVolume); + farmingIslands = new Song(directory, "farmingislands", farmingIslandsVolume); + goldMine = new Song(directory, "goldmine", goldMineVolume); + deepCaverns = new Song(directory, "deepcaverns", deepCavernsVolume); + dwarvenMines = new Song(directory, "dwarvenmines", dwarvenMinesVolume); + crystalHollows = new Song(directory, "crystalhollows", crystalHollowsVolume); + blazingFortress = new Song(directory, "blazingfortress", blazingFortressVolume); + end = new Song(directory, "end", endVolume); + park = new Song(directory, "park", parkVolume); } public static void reset() { if (dungeonboss != null) dungeonboss.stop(); if (bloodroom != null) bloodroom.stop(); if (dungeon != null) dungeon.stop(); + if (hub != null) hub.stop(); + if (island != null) island.stop(); + if (dungeonHub != null) dungeonHub.stop(); + if (farmingIslands != null) farmingIslands.stop(); + if (goldMine != null) goldMine.stop(); + if (deepCaverns != null) deepCaverns.stop(); + if (dwarvenMines != null) dwarvenMines.stop(); + if (crystalHollows != null) crystalHollows.stop(); + if (blazingFortress != null) blazingFortress.stop(); + if (end != null) end.stop(); + if (park != null) park.stop(); } public static class Song { @@ -153,8 +236,8 @@ public class CustomMusic { } public void start() { - reset(); - if (music != null) { + if (music != null && !music.isRunning()) { + reset(); shuffle(); cancelNotes = true; music.setMicrosecondPosition(0); @@ -183,9 +266,7 @@ public class CustomMusic { float decibels = (float) (20 * Math.log(volume / 100.0)); for (Clip music : playlist) { FloatControl control = (FloatControl) music.getControl(FloatControl.Type.MASTER_GAIN); - if (decibels <= control.getMinimum() || decibels >= control.getMaximum()) { - return false; - } + if (decibels <= control.getMinimum() || decibels >= control.getMaximum()) return false; control.setValue(decibels); } diff --git a/src/main/java/me/Danker/gui/CustomMusicGui.java b/src/main/java/me/Danker/gui/CustomMusicGui.java index 505bf34..3e634bf 100644 --- a/src/main/java/me/Danker/gui/CustomMusicGui.java +++ b/src/main/java/me/Danker/gui/CustomMusicGui.java @@ -12,11 +12,30 @@ import net.minecraft.client.gui.ScaledResolution; public class CustomMusicGui extends GuiScreen { + private int page; + private GuiButton goBack; + private GuiButton backPage; + private GuiButton nextPage; private GuiButton dungeonBossMusic; private GuiButton bloodRoomMusic; private GuiButton dungeonMusic; + private GuiButton hubMusic; + private GuiButton islandMusic; + private GuiButton dungeonHubMusic; + private GuiButton farmingIslandsMusic; + private GuiButton goldMineMusic; + private GuiButton deepCavernsMusic; + private GuiButton dwarvenMinesMusic; + private GuiButton crystalHollowsMusic; + private GuiButton blazingFortressMusic; + private GuiButton endMusic; + private GuiButton parkMusic; + + public CustomMusicGui(int page) { + this.page = page; + } @Override public boolean doesGuiPauseGame() { @@ -32,13 +51,47 @@ public class CustomMusicGui extends GuiScreen { int width = sr.getScaledWidth(); goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); + backPage = new GuiButton(0, width / 2 - 100, (int) (height * 0.8), 80, 20, "< Back"); + nextPage = new GuiButton(0, width / 2 + 20, (int) (height * 0.8), 80, 20, "Next >"); + dungeonMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Custom Dungeon Music: " + Utils.getColouredBoolean(ToggleCommand.dungeonMusic)); bloodRoomMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Custom Blood Room Music: " + Utils.getColouredBoolean(ToggleCommand.bloodRoomMusic)); dungeonBossMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Custom Dungeon Boss Music: " + Utils.getColouredBoolean(ToggleCommand.dungeonBossMusic)); + hubMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Custom Hub Music: " + Utils.getColouredBoolean(ToggleCommand.hubMusic)); + islandMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Custom Island Music: " + Utils.getColouredBoolean(ToggleCommand.islandMusic)); + dungeonHubMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Custom Dungeon Hub Music: " + Utils.getColouredBoolean(ToggleCommand.dungeonHubMusic)); + farmingIslandsMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Custom Farming Islands Music: " + Utils.getColouredBoolean(ToggleCommand.farmingIslandsMusic)); + goldMineMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Custom Gold Mine Music: " + Utils.getColouredBoolean(ToggleCommand.goldMineMusic)); + deepCavernsMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Custom Deep Caverns Music: " + Utils.getColouredBoolean(ToggleCommand.deepCavernsMusic)); + dwarvenMinesMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Custom Dwarven Mines Music: " + Utils.getColouredBoolean(ToggleCommand.dwarvenMinesMusic)); + crystalHollowsMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Custom Crystal Hollows Music: " + Utils.getColouredBoolean(ToggleCommand.crystalHollowsMusic)); + blazingFortressMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Custom Blazing Fortress Music: " + Utils.getColouredBoolean(ToggleCommand.blazingFortressMusic)); + endMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Custom End Music: " + Utils.getColouredBoolean(ToggleCommand.endMusic)); + parkMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Custom Park Music: " + Utils.getColouredBoolean(ToggleCommand.parkMusic)); + + switch (page) { + case 1: + this.buttonList.add(dungeonMusic); + this.buttonList.add(bloodRoomMusic); + this.buttonList.add(dungeonBossMusic); + this.buttonList.add(hubMusic); + this.buttonList.add(islandMusic); + this.buttonList.add(dungeonHubMusic); + this.buttonList.add(farmingIslandsMusic); + this.buttonList.add(nextPage); + break; + case 2: + this.buttonList.add(goldMineMusic); + this.buttonList.add(deepCavernsMusic); + this.buttonList.add(dwarvenMinesMusic); + this.buttonList.add(crystalHollowsMusic); + this.buttonList.add(blazingFortressMusic); + this.buttonList.add(endMusic); + this.buttonList.add(parkMusic); + this.buttonList.add(backPage); + break; + } - this.buttonList.add(dungeonMusic); - this.buttonList.add(bloodRoomMusic); - this.buttonList.add(dungeonBossMusic); this.buttonList.add(goBack); } @@ -52,6 +105,10 @@ public class CustomMusicGui extends GuiScreen { public void actionPerformed(GuiButton button) { if (button == goBack) { DankersSkyblockMod.guiToOpen = "dankergui1"; + } else if (button == backPage) { + Minecraft.getMinecraft().displayGuiScreen(new CustomMusicGui(page - 1)); + } else if (button == nextPage) { + Minecraft.getMinecraft().displayGuiScreen(new CustomMusicGui(page + 1)); } else if (button == dungeonBossMusic) { ToggleCommand.dungeonBossMusic = !ToggleCommand.dungeonBossMusic; CustomMusic.dungeonboss.stop(); @@ -67,6 +124,61 @@ public class CustomMusicGui extends GuiScreen { CustomMusic.dungeon.stop(); ConfigHandler.writeBooleanConfig("toggles", "DungeonMusic", ToggleCommand.dungeonMusic); dungeonMusic.displayString = "Custom Dungeon Music: " + Utils.getColouredBoolean(ToggleCommand.dungeonMusic); + } else if (button == hubMusic) { + ToggleCommand.hubMusic = !ToggleCommand.hubMusic; + CustomMusic.hub.stop(); + ConfigHandler.writeBooleanConfig("toggles", "HubMusic", ToggleCommand.hubMusic); + hubMusic.displayString = "Custom Hub Music: " + Utils.getColouredBoolean(ToggleCommand.hubMusic); + } else if (button == islandMusic) { + ToggleCommand.islandMusic = !ToggleCommand.islandMusic; + CustomMusic.island.stop(); + ConfigHandler.writeBooleanConfig("toggles", "IslandMusic", ToggleCommand.islandMusic); + islandMusic.displayString = "Custom Island Music: " + Utils.getColouredBoolean(ToggleCommand.islandMusic); + } else if (button == dungeonHubMusic) { + ToggleCommand.dungeonHubMusic = !ToggleCommand.dungeonHubMusic; + CustomMusic.dungeonHub.stop(); + ConfigHandler.writeBooleanConfig("toggles", "DungeonHubMusic", ToggleCommand.dungeonHubMusic); + dungeonHubMusic.displayString = "Custom Dungeon Hub Music: " + Utils.getColouredBoolean(ToggleCommand.dungeonHubMusic); + } else if (button == farmingIslandsMusic) { + ToggleCommand.farmingIslandsMusic = !ToggleCommand.farmingIslandsMusic; + CustomMusic.farmingIslands.stop(); + ConfigHandler.writeBooleanConfig("toggles", "FarmingIslandsMusic", ToggleCommand.farmingIslandsMusic); + farmingIslandsMusic.displayString = "Custom Farming Islands Music: " + Utils.getColouredBoolean(ToggleCommand.farmingIslandsMusic); + } else if (button == goldMineMusic) { + ToggleCommand.goldMineMusic = !ToggleCommand.goldMineMusic; + CustomMusic.goldMine.stop(); + ConfigHandler.writeBooleanConfig("toggles", "GoldMineMusic", ToggleCommand.goldMineMusic); + goldMineMusic.displayString = "Custom Gold Mine Music: " + Utils.getColouredBoolean(ToggleCommand.goldMineMusic); + } else if (button == deepCavernsMusic) { + ToggleCommand.deepCavernsMusic = !ToggleCommand.deepCavernsMusic; + CustomMusic.deepCaverns.stop(); + ConfigHandler.writeBooleanConfig("toggles", "DeepCavernsMusic", ToggleCommand.deepCavernsMusic); + deepCavernsMusic.displayString = "Custom Deep Caverns Music: " + Utils.getColouredBoolean(ToggleCommand.deepCavernsMusic); + } else if (button == dwarvenMinesMusic) { + ToggleCommand.dwarvenMinesMusic = !ToggleCommand.dwarvenMinesMusic; + CustomMusic.dwarvenMines.stop(); + ConfigHandler.writeBooleanConfig("toggles", "DwarvenMinesMusic", ToggleCommand.dwarvenMinesMusic); + dwarvenMinesMusic.displayString = "Custom Dwarven Mines Music: " + Utils.getColouredBoolean(ToggleCommand.dwarvenMinesMusic); + } else if (button == crystalHollowsMusic) { + ToggleCommand.crystalHollowsMusic = !ToggleCommand.crystalHollowsMusic; + CustomMusic.crystalHollows.stop(); + ConfigHandler.writeBooleanConfig("toggles", "CrystalHollowsMusic", ToggleCommand.crystalHollowsMusic); + crystalHollowsMusic.displayString = "Custom Crystal Hollows Music: " + Utils.getColouredBoolean(ToggleCommand.crystalHollowsMusic); + } else if (button == blazingFortressMusic) { + ToggleCommand.blazingFortressMusic = !ToggleCommand.blazingFortressMusic; + CustomMusic.blazingFortress.stop(); + ConfigHandler.writeBooleanConfig("toggles", "BlazingFortressMusic", ToggleCommand.blazingFortressMusic); + blazingFortressMusic.displayString = "Custom Blazing Fortress Music: " + Utils.getColouredBoolean(ToggleCommand.blazingFortressMusic); + } else if (button == endMusic) { + ToggleCommand.endMusic = !ToggleCommand.endMusic; + CustomMusic.end.stop(); + ConfigHandler.writeBooleanConfig("toggles", "EndMusic", ToggleCommand.endMusic); + endMusic.displayString = "Custom End Music: " + Utils.getColouredBoolean(ToggleCommand.endMusic); + } else if (button == parkMusic) { + ToggleCommand.parkMusic = !ToggleCommand.parkMusic; + CustomMusic.park.stop(); + ConfigHandler.writeBooleanConfig("toggles", "ParkMusic", ToggleCommand.parkMusic); + parkMusic.displayString = "Custom Park Music: " + Utils.getColouredBoolean(ToggleCommand.parkMusic); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 115f01b..cfee6b2 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -262,10 +262,32 @@ public class ConfigHandler { ToggleCommand.dungeonBossMusic = initBoolean("toggles", "DungeonBossMusic", false); ToggleCommand.bloodRoomMusic = initBoolean("toggles", "BloodRoomMusic", false); ToggleCommand.dungeonMusic = initBoolean("toggles", "DungeonMusic", false); + ToggleCommand.hubMusic = initBoolean("toggles", "HubMusic", false); + ToggleCommand.islandMusic = initBoolean("toggles", "IslandMusic", false); + ToggleCommand.dungeonHubMusic = initBoolean("toggles", "DungeonHubMusic", false); + ToggleCommand.farmingIslandsMusic = initBoolean("toggles", "FarmingIslandsMusic", false); + ToggleCommand.goldMineMusic = initBoolean("toggles", "GoldMineMusic", false); + ToggleCommand.deepCavernsMusic = initBoolean("toggles", "DeepCavernsMusic", false); + ToggleCommand.dwarvenMinesMusic = initBoolean("toggles", "DwarvenMinesMusic", false); + ToggleCommand.crystalHollowsMusic = initBoolean("toggles", "CrystalHollowsMusic", false); + ToggleCommand.blazingFortressMusic = initBoolean("toggles", "BlazingFortressMusic", false); + ToggleCommand.endMusic = initBoolean("toggles", "Music", false); + ToggleCommand.parkMusic = initBoolean("toggles", "Music", false); // Music Volume CustomMusic.dungeonbossVolume = initInt("music", "DungeonBossVolume", 50); CustomMusic.bloodroomVolume = initInt("music", "BloodRoomVolume", 50); CustomMusic.dungeonVolume = initInt("music", "DungeonVolume", 50); + CustomMusic.hubVolume = initInt("music", "HubVolume", 50); + CustomMusic.islandVolume = initInt("music", "IslandVolume", 50); + CustomMusic.dungeonHubVolume = initInt("music", "DungeonHubVolume", 50); + CustomMusic.farmingIslandsVolume = initInt("music", "FarmingIslandsVolume", 50); + CustomMusic.goldMineVolume = initInt("music", "GoldMineVolume", 50); + CustomMusic.deepCavernsVolume = initInt("music", "DeepCavernsVolume", 50); + CustomMusic.dwarvenMinesVolume = initInt("music", "DwarvenMinesVolume", 50); + CustomMusic.crystalHollowsVolume = initInt("music", "CrystalHollowsVolume", 50); + CustomMusic.blazingFortressVolume = initInt("music", "BlazingFortressVolume", 50); + CustomMusic.endVolume = initInt("music", "EndVolume", 50); + CustomMusic.parkVolume = initInt("music", "ParkVolume", 50); // API if (!hasKey("api", "APIKey")) writeStringConfig("api", "APIKey", ""); diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index dd6eed5..c1e76d7 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -40,7 +40,7 @@ public class Utils { public static boolean inSkyblock = false; public static boolean inDungeons = false; - public static boolean inCrystalHollows = false; + public static String tabLocation = ""; public static int[] skillXPPerLevel = {0, 50, 125, 200, 300, 500, 750, 1000, 1500, 2000, 3500, 5000, 7500, 10000, 15000, 20000, 30000, 50000, 75000, 100000, 200000, 300000, 400000, 500000, 600000, 700000, 800000, 900000, 1000000, 1100000, 1200000, 1300000, 1400000, 1500000, 1600000, 1700000, 1800000, 1900000, 2000000, 2100000, 2200000, @@ -170,18 +170,19 @@ public class Utils { inDungeons = false; } - public static void checkForCrystalHollows() { - if (inSkyblock) { + public static void checkTabLocation() { + if (inSkyblock) { Collection players = Minecraft.getMinecraft().getNetHandler().getPlayerInfoMap(); for (NetworkPlayerInfo player : players) { if (player == null || player.getDisplayName() == null) continue; - if (player.getDisplayName().getUnformattedText().contains("Crystal Hollows")) { - inCrystalHollows = true; + String text = player.getDisplayName().getUnformattedText(); + if (text.startsWith("Area: ")) { + tabLocation = text.substring(text.indexOf(":") + 2); return; } } } - inCrystalHollows = false; + tabLocation = ""; } public static boolean isInScoreboard(String text) { -- cgit From d807469333b343e7726536b12d13ff29e3b136c5 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 31 Jul 2021 20:05:00 -0400 Subject: Shuffle custom music at end of song --- src/main/java/me/Danker/features/CustomMusic.java | 82 ++++++++++------------- 1 file changed, 36 insertions(+), 46 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java index d61b640..16fef34 100644 --- a/src/main/java/me/Danker/features/CustomMusic.java +++ b/src/main/java/me/Danker/features/CustomMusic.java @@ -27,8 +27,6 @@ import java.util.Random; public class CustomMusic { static boolean cancelNotes; - static boolean prevInDungeonBossRoom = false; - public static boolean inDungeonBossRoom = false; public static Song dungeonboss; public static int dungeonbossVolume; public static Song bloodroom; @@ -74,7 +72,6 @@ public class CustomMusic { if (DankersSkyblockMod.tickAmount % 10 == 0) { if (world != null && player != null) { if (Utils.inDungeons) { - prevInDungeonBossRoom = inDungeonBossRoom; List scoreboard = ScoreboardHandler.getSidebarLines(); if (scoreboard.size() > 2) { String firstLine = ScoreboardHandler.cleanSB(scoreboard.get(scoreboard.size() - 1)); @@ -88,51 +85,45 @@ public class CustomMusic { firstLine.contains("sadan") || // F6 firstLine.contains("necron")) { // F7 - inDungeonBossRoom = true; - if (!prevInDungeonBossRoom) { - bloodroom.stop(); if (ToggleCommand.dungeonBossMusic) dungeonboss.start(); } - } else { - inDungeonBossRoom = false; } - } - } else { - switch (Utils.tabLocation) { - case "Hub": - if (ToggleCommand.hubMusic) hub.start(); - break; - case "Private World": - if (ToggleCommand.islandMusic) island.start(); - break; - case "Dungeon Hub": - if (ToggleCommand.dungeonHubMusic) dungeonHub.start(); - break; - case "The Farming Islands": - if (ToggleCommand.farmingIslandsMusic) farmingIslands.start(); - break; - case "Gold Mine": - if (ToggleCommand.goldMineMusic) goldMine.start(); - break; - case "Deep Caverns": - if (ToggleCommand.deepCavernsMusic) deepCaverns.start(); - break; - case "Dwarven Mines": - if (ToggleCommand.dwarvenMinesMusic) dwarvenMines.start(); - break; - case "Crystal Hollows": - if (ToggleCommand.crystalHollowsMusic) crystalHollows.start(); - break; - case "Blazing Fortress": - if (ToggleCommand.blazingFortressMusic) blazingFortress.start(); - break; - case "The End": - if (ToggleCommand.endMusic) end.start(); - break; - case "The Park": - if (ToggleCommand.parkMusic) park.start(); - break; - } + } else { + switch (Utils.tabLocation) { + case "Hub": + if (ToggleCommand.hubMusic) hub.start(); + break; + case "Private World": + if (ToggleCommand.islandMusic) island.start(); + break; + case "Dungeon Hub": + if (ToggleCommand.dungeonHubMusic) dungeonHub.start(); + break; + case "The Farming Islands": + if (ToggleCommand.farmingIslandsMusic) farmingIslands.start(); + break; + case "Gold Mine": + if (ToggleCommand.goldMineMusic) goldMine.start(); + break; + case "Deep Caverns": + if (ToggleCommand.deepCavernsMusic) deepCaverns.start(); + break; + case "Dwarven Mines": + if (ToggleCommand.dwarvenMinesMusic) dwarvenMines.start(); + break; + case "Crystal Hollows": + if (ToggleCommand.crystalHollowsMusic) crystalHollows.start(); + break; + case "Blazing Fortress": + if (ToggleCommand.blazingFortressMusic) blazingFortress.start(); + break; + case "The End": + if (ToggleCommand.endMusic) end.start(); + break; + case "The Park": + if (ToggleCommand.parkMusic) park.start(); + break; + } } } } @@ -242,7 +233,6 @@ public class CustomMusic { cancelNotes = true; music.setMicrosecondPosition(0); music.start(); - music.loop(Clip.LOOP_CONTINUOUSLY); } } -- cgit From 5f2206d383afd3b6424ccda1a2d36522cfbe9b1f Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 31 Jul 2021 21:16:48 -0400 Subject: Add spiders den to custom music I forgot it existed --- README.md | 3 ++- .../java/me/Danker/commands/CustomMusicCommand.java | 10 ++++++++-- src/main/java/me/Danker/commands/ToggleCommand.java | 12 ++++++++++-- src/main/java/me/Danker/features/ArachneESP.java | 11 +---------- src/main/java/me/Danker/features/CustomMusic.java | 7 +++++++ src/main/java/me/Danker/gui/CustomMusicGui.java | 18 +++++++++++++++--- src/main/java/me/Danker/handlers/ConfigHandler.java | 2 ++ 7 files changed, 45 insertions(+), 18 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index db33492..ea7b8b3 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ Discord Server: https://discord.gg/QsEkNQS - /reparty - Disbands and reparties all members in the party - /fairysouls - Check the fairysouls of a player - /lobbybank - Uses API to find the average bank total of the lobby, as well the three players with the highest total money in the bank (and purse). -- /dsmmusic [dungeonboss/bloodroom/dungeon/hub/island/dungeonhub/farmingislands/goldmine/deepcaverns/dwarvenmines/crystalhollows/blazingfortress/end/park] [1-100] - Stops, reloads or changes the volume of custom music. +- /dsmmusic [dungeonboss/bloodroom/dungeon/hub/island/dungeonhub/farmingislands/goldmine/deepcaverns/dwarvenmines/crystalhollows/spidersden/blazingfortress/end/park] [1-100] - Stops, reloads or changes the volume of custom music. - /player [player] - Uses API to find skills, slayers, coins and weight of a player. - /reloadconfig - Reloads Danker's Skyblock Mod config. - /reloaddsmrepo - Reloads Danker's Skyblock Mod repository. @@ -109,6 +109,7 @@ Discord Server: https://discord.gg/QsEkNQS - Deep Caverns: `deepcaverns.wav` - Dwarven Mines: `dwarvenmines.wav` - Crystal Hollows: `crystalhollows.wav` + - Spider's Den: `spidersden.wav` - Blazing Fortress: `blazingfortress.wav` - The End: `end.wav` - The Park: `park.wav` diff --git a/src/main/java/me/Danker/commands/CustomMusicCommand.java b/src/main/java/me/Danker/commands/CustomMusicCommand.java index 45e3770..c07ab45 100644 --- a/src/main/java/me/Danker/commands/CustomMusicCommand.java +++ b/src/main/java/me/Danker/commands/CustomMusicCommand.java @@ -25,7 +25,7 @@ public class CustomMusicCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName() + " [dungeonboss/bloodroom/dungeon/hub/island/dungeonhub/farmingislands/" + - "goldmine/deepcaverns/dwarvenmines/crystalhollows/blazingfortress/end/park] [1-100]"; + "goldmine/deepcaverns/dwarvenmines/crystalhollows/spidersden/blazingfortress/end/park] [1-100]"; } public static String usage(ICommandSender arg0) { @@ -43,7 +43,7 @@ public class CustomMusicCommand extends CommandBase { return getListOfStringsMatchingLastWord(args, "stop", "reload", "volume"); } else if (args.length == 2) { return getListOfStringsMatchingLastWord(args, "dungeonboss", "bloodroom", "dungeon", "hub", "island", "dungeonhub", "farmingislands", "goldmine", - "deepcaverns", "dwarvenmines", "crystalhollows", "blazingfortress", "end", "park"); + "deepcaverns", "dwarvenmines", "crystalhollows", "spidersden", "blazingfortress", "end", "park"); } return null; } @@ -146,6 +146,12 @@ public class CustomMusicCommand extends CommandBase { CustomMusic.crystalHollowsVolume = volume; ConfigHandler.writeIntConfig("music", "CrystalHollowsVolume", volume); break; + case "spidersden": + if (!CustomMusic.spidersDen.setVolume(volume)) return; + + CustomMusic.spidersDenVolume = volume; + ConfigHandler.writeIntConfig("music", "SpidersDenVolume", volume); + break; case "blazingfortress": if (!CustomMusic.blazingFortress.setVolume(volume)) return; diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 65900fd..7d1020a 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -96,6 +96,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean deepCavernsMusic; public static boolean dwarvenMinesMusic; public static boolean crystalHollowsMusic; + public static boolean spidersDenMusic; public static boolean blazingFortressMusic; public static boolean endMusic; public static boolean parkMusic; @@ -118,7 +119,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "melodytooltips/highlightslayers/highlightarachne/highlightskeletonmasters/teammatesinradius/" + "gianthp/hidepetcandy/customcolorednames/endoffarmalert/gemstonelore/crystalhollowwaypoints/crystalautowaypoints/" + "autoacceptreparty/dungeonbossmusic/bloodroommusic/dungeonmusic/hubmusic/islandmusic/dungeonhubmusic/" + - "farmingislandsmusic/goldminemusic/deepcavernsmusic/crystalhollowsmusic/blazingfortressmusic/endmusic/" + + "farmingislandsmusic/goldminemusic/deepcavernsmusic/crystalhollowsmusic/spidersdenmusic/blazingfortressmusic/endmusic/" + "parkmusic/list>"; } @@ -151,7 +152,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "teammatesinradius", "gianthp", "hidepetcandy", "customcolorednames", "endoffarmalert", "gemstonelore", "crystalhollowwaypoints", "crystalautowaypoints", "autoacceptreparty", "hubmusic", "islandmusic", "dungeonhubmusic", "farmingislandsmusic", "goldminemusic", - "deepcavernsmusic", "dwarvenminesmusic", "crystalhollowsmusic", "blazingfortressmusic", + "deepcavernsmusic", "dwarvenminesmusic", "crystalhollowsmusic", "spidersdenmusic", "blazingfortressmusic", "endmusic", "parkmusic", "list"); } return null; @@ -550,6 +551,12 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "CrystalHollowsMusic", crystalHollowsMusic); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom crystal hollows music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + crystalHollowsMusic + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "spidersdenmusic": + spidersDenMusic = !spidersDenMusic; + CustomMusic.spidersDen.stop(); + ConfigHandler.writeBooleanConfig("toggles", "SpidersDenMusic", spidersDenMusic); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom spider's den music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + spidersDenMusic + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "blazingfortressmusic": blazingFortressMusic = !blazingFortressMusic; CustomMusic.blazingFortress.stop(); @@ -635,6 +642,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Custom deep caverns music: " + DankersSkyblockMod.VALUE_COLOUR + deepCavernsMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dwarven mines music: " + DankersSkyblockMod.VALUE_COLOUR + dwarvenMinesMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom crystal hollows music: " + DankersSkyblockMod.VALUE_COLOUR + crystalHollowsMusic + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Custom spider's den music: " + DankersSkyblockMod.VALUE_COLOUR + spidersDenMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom blazing fortress music: " + DankersSkyblockMod.VALUE_COLOUR + blazingFortressMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom end music: " + DankersSkyblockMod.VALUE_COLOUR + endMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom park music: " + DankersSkyblockMod.VALUE_COLOUR + parkMusic diff --git a/src/main/java/me/Danker/features/ArachneESP.java b/src/main/java/me/Danker/features/ArachneESP.java index 7e39a8f..1848a9b 100644 --- a/src/main/java/me/Danker/features/ArachneESP.java +++ b/src/main/java/me/Danker/features/ArachneESP.java @@ -30,19 +30,10 @@ public class ArachneESP { arachne = null; } - public boolean inSpidersDen(List scoreboard) { - for (String s : scoreboard) { - if (ScoreboardHandler.cleanSB(s).contains("Spider's Den")) { - return true; - } - } - return false; - } - @SubscribeEvent public void onChat(ClientChatReceivedEvent event) { if (!Utils.inSkyblock) return; - if (!inSpidersDen(ScoreboardHandler.getSidebarLines())) return; + if (!Utils.tabLocation.equals("Spider's Den")) return; String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); if (message.contains("Something is awakening")){ arachneActive = true; diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java index 16fef34..4891fe3 100644 --- a/src/main/java/me/Danker/features/CustomMusic.java +++ b/src/main/java/me/Danker/features/CustomMusic.java @@ -49,6 +49,8 @@ public class CustomMusic { public static int dwarvenMinesVolume; public static Song crystalHollows; public static int crystalHollowsVolume; + public static Song spidersDen; + public static int spidersDenVolume; public static Song blazingFortress; public static int blazingFortressVolume; public static Song end; @@ -114,6 +116,9 @@ public class CustomMusic { case "Crystal Hollows": if (ToggleCommand.crystalHollowsMusic) crystalHollows.start(); break; + case "Spider's Den": + if (ToggleCommand.spidersDenMusic) spidersDen.start(); + break; case "Blazing Fortress": if (ToggleCommand.blazingFortressMusic) blazingFortress.start(); break; @@ -178,6 +183,7 @@ public class CustomMusic { deepCaverns = new Song(directory, "deepcaverns", deepCavernsVolume); dwarvenMines = new Song(directory, "dwarvenmines", dwarvenMinesVolume); crystalHollows = new Song(directory, "crystalhollows", crystalHollowsVolume); + spidersDen = new Song(directory, "spidersden", spidersDenVolume); blazingFortress = new Song(directory, "blazingfortress", blazingFortressVolume); end = new Song(directory, "end", endVolume); park = new Song(directory, "park", parkVolume); @@ -195,6 +201,7 @@ public class CustomMusic { if (deepCaverns != null) deepCaverns.stop(); if (dwarvenMines != null) dwarvenMines.stop(); if (crystalHollows != null) crystalHollows.stop(); + if (spidersDen != null) spidersDen.stop(); if (blazingFortress != null) blazingFortress.stop(); if (end != null) end.stop(); if (park != null) park.stop(); diff --git a/src/main/java/me/Danker/gui/CustomMusicGui.java b/src/main/java/me/Danker/gui/CustomMusicGui.java index 3e634bf..83bed09 100644 --- a/src/main/java/me/Danker/gui/CustomMusicGui.java +++ b/src/main/java/me/Danker/gui/CustomMusicGui.java @@ -29,6 +29,7 @@ public class CustomMusicGui extends GuiScreen { private GuiButton deepCavernsMusic; private GuiButton dwarvenMinesMusic; private GuiButton crystalHollowsMusic; + private GuiButton spidersDenMusic; private GuiButton blazingFortressMusic; private GuiButton endMusic; private GuiButton parkMusic; @@ -65,9 +66,10 @@ public class CustomMusicGui extends GuiScreen { deepCavernsMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Custom Deep Caverns Music: " + Utils.getColouredBoolean(ToggleCommand.deepCavernsMusic)); dwarvenMinesMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Custom Dwarven Mines Music: " + Utils.getColouredBoolean(ToggleCommand.dwarvenMinesMusic)); crystalHollowsMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Custom Crystal Hollows Music: " + Utils.getColouredBoolean(ToggleCommand.crystalHollowsMusic)); - blazingFortressMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Custom Blazing Fortress Music: " + Utils.getColouredBoolean(ToggleCommand.blazingFortressMusic)); - endMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Custom End Music: " + Utils.getColouredBoolean(ToggleCommand.endMusic)); - parkMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Custom Park Music: " + Utils.getColouredBoolean(ToggleCommand.parkMusic)); + spidersDenMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Custom Spider's Den Music: " + Utils.getColouredBoolean(ToggleCommand.spidersDenMusic)); + blazingFortressMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Custom Blazing Fortress Music: " + Utils.getColouredBoolean(ToggleCommand.blazingFortressMusic)); + endMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Custom End Music: " + Utils.getColouredBoolean(ToggleCommand.endMusic)); + parkMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Custom Park Music: " + Utils.getColouredBoolean(ToggleCommand.parkMusic)); switch (page) { case 1: @@ -85,8 +87,13 @@ public class CustomMusicGui extends GuiScreen { this.buttonList.add(deepCavernsMusic); this.buttonList.add(dwarvenMinesMusic); this.buttonList.add(crystalHollowsMusic); + this.buttonList.add(spidersDenMusic); this.buttonList.add(blazingFortressMusic); this.buttonList.add(endMusic); + this.buttonList.add(nextPage); + this.buttonList.add(backPage); + break; + case 3: this.buttonList.add(parkMusic); this.buttonList.add(backPage); break; @@ -164,6 +171,11 @@ public class CustomMusicGui extends GuiScreen { CustomMusic.crystalHollows.stop(); ConfigHandler.writeBooleanConfig("toggles", "CrystalHollowsMusic", ToggleCommand.crystalHollowsMusic); crystalHollowsMusic.displayString = "Custom Crystal Hollows Music: " + Utils.getColouredBoolean(ToggleCommand.crystalHollowsMusic); + } else if (button == spidersDenMusic) { + ToggleCommand.spidersDenMusic = !ToggleCommand.spidersDenMusic; + CustomMusic.spidersDen.stop(); + ConfigHandler.writeBooleanConfig("toggles", "SpidersDenMusic", ToggleCommand.spidersDenMusic); + spidersDenMusic.displayString = "Custom Spider's Den Music: " + Utils.getColouredBoolean(ToggleCommand.spidersDenMusic); } else if (button == blazingFortressMusic) { ToggleCommand.blazingFortressMusic = !ToggleCommand.blazingFortressMusic; CustomMusic.blazingFortress.stop(); diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index cfee6b2..98368e1 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -270,6 +270,7 @@ public class ConfigHandler { ToggleCommand.deepCavernsMusic = initBoolean("toggles", "DeepCavernsMusic", false); ToggleCommand.dwarvenMinesMusic = initBoolean("toggles", "DwarvenMinesMusic", false); ToggleCommand.crystalHollowsMusic = initBoolean("toggles", "CrystalHollowsMusic", false); + ToggleCommand.spidersDenMusic = initBoolean("toggles", "SpidersDenMusic", false); ToggleCommand.blazingFortressMusic = initBoolean("toggles", "BlazingFortressMusic", false); ToggleCommand.endMusic = initBoolean("toggles", "Music", false); ToggleCommand.parkMusic = initBoolean("toggles", "Music", false); @@ -285,6 +286,7 @@ public class ConfigHandler { CustomMusic.deepCavernsVolume = initInt("music", "DeepCavernsVolume", 50); CustomMusic.dwarvenMinesVolume = initInt("music", "DwarvenMinesVolume", 50); CustomMusic.crystalHollowsVolume = initInt("music", "CrystalHollowsVolume", 50); + CustomMusic.spidersDenVolume = initInt("music", "SpidersDenVolume", 50); CustomMusic.blazingFortressVolume = initInt("music", "BlazingFortressVolume", 50); CustomMusic.endVolume = initInt("music", "EndVolume", 50); CustomMusic.parkVolume = initInt("music", "ParkVolume", 50); -- cgit From a40b6338955f469f4a476b0d9b0ff61952289bcb Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 6 Aug 2021 14:33:34 -0400 Subject: Fix slayer 20% drops only counting as 1 Also add missing lines in /dsmfarmlength --- src/main/java/me/Danker/commands/FarmLengthCommand.java | 2 ++ src/main/java/me/Danker/features/loot/LootTracker.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/FarmLengthCommand.java b/src/main/java/me/Danker/commands/FarmLengthCommand.java index 6a28430..c9c8e11 100644 --- a/src/main/java/me/Danker/commands/FarmLengthCommand.java +++ b/src/main/java/me/Danker/commands/FarmLengthCommand.java @@ -36,6 +36,7 @@ public class FarmLengthCommand extends CommandBase { if (arg1.length == 0) { player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Current Range: " + DankersSkyblockMod.SECONDARY_COLOUR + EndOfFarmAlert.min + DankersSkyblockMod.MAIN_COLOUR + " to " + DankersSkyblockMod.SECONDARY_COLOUR + EndOfFarmAlert.max)); + return; } else if (arg1.length < 2) { player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); return; @@ -45,6 +46,7 @@ public class FarmLengthCommand extends CommandBase { EndOfFarmAlert.max = Double.parseDouble(arg1[1]); ConfigHandler.writeDoubleConfig("misc", "farmMin", EndOfFarmAlert.min); ConfigHandler.writeDoubleConfig("misc", "farmMax", EndOfFarmAlert.max); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Farm length set to " + DankersSkyblockMod.SECONDARY_COLOUR + EndOfFarmAlert.min + DankersSkyblockMod.MAIN_COLOUR + " to " + DankersSkyblockMod.SECONDARY_COLOUR + EndOfFarmAlert.max)); } } diff --git a/src/main/java/me/Danker/features/loot/LootTracker.java b/src/main/java/me/Danker/features/loot/LootTracker.java index 58f5a54..8a2739a 100644 --- a/src/main/java/me/Danker/features/loot/LootTracker.java +++ b/src/main/java/me/Danker/features/loot/LootTracker.java @@ -1318,7 +1318,7 @@ public class LootTracker { } public int getAmountfromMessage(String message) { - if (message.charAt(message.indexOf("(") + 1) == 'x') { + if (message.charAt(message.indexOf("(") + 2) == 'x') { return Integer.parseInt(message.substring(message.indexOf("(") + 1, message.indexOf("x"))); } else { return 1; -- cgit From 4ef36d87f423c021891075e8015b5f20760510fd Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 6 Aug 2021 20:45:44 -0400 Subject: Add option to use lily weight in /weight --- README.md | 1 + .../java/me/Danker/commands/ArmourCommand.java | 2 +- src/main/java/me/Danker/commands/BankCommand.java | 2 +- src/main/java/me/Danker/commands/DHelpCommand.java | 1 + .../java/me/Danker/commands/DungeonsCommand.java | 4 +- .../java/me/Danker/commands/FairySoulsCommand.java | 4 +- .../java/me/Danker/commands/GuildOfCommand.java | 2 +- .../me/Danker/commands/ImportFishingCommand.java | 2 +- .../java/me/Danker/commands/LobbyBankCommand.java | 2 +- .../me/Danker/commands/LobbySkillsCommand.java | 4 +- src/main/java/me/Danker/commands/PetsCommand.java | 2 +- .../java/me/Danker/commands/PlayerCommand.java | 6 +- .../java/me/Danker/commands/SkillsCommand.java | 4 +- .../me/Danker/commands/SkyblockPlayersCommand.java | 2 +- .../java/me/Danker/commands/SlayerCommand.java | 2 +- .../java/me/Danker/commands/WeightCommand.java | 87 +++++++++++++++------- .../java/me/Danker/features/UpdateChecker.java | 2 +- .../Danker/features/puzzlesolvers/BlazeSolver.java | 5 +- src/main/java/me/Danker/handlers/APIHandler.java | 8 +- src/main/java/me/Danker/utils/Utils.java | 2 +- 20 files changed, 88 insertions(+), 56 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index ea7b8b3..69c7aaf 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ Discord Server: https://discord.gg/QsEkNQS - /bank [player] - Uses API to get bank and purse coins of a person. If no name is provided, it checks yours. - /armor [player] - Uses API to get armour of a person. If no name is provided, it checks yours. - /dungeons [player] - Uses API to get dungeon levels of a person. If no name is provided, it checks yours. +- /weight [player] [lily] - Uses API to get weight of a person. If no name is provided, it checks yours. Adding lily uses lily's weight instead of Senither's. - /importfishing - Imports your fishing stats from your latest profile to your fishing tracker using the API. - /sbplayers - Uses API to find how many players are on each Skyblock island. - /skilltracker - Text display for skill xp/hour. diff --git a/src/main/java/me/Danker/commands/ArmourCommand.java b/src/main/java/me/Danker/commands/ArmourCommand.java index 4597309..9b6630c 100644 --- a/src/main/java/me/Danker/commands/ArmourCommand.java +++ b/src/main/java/me/Danker/commands/ArmourCommand.java @@ -88,7 +88,7 @@ public class ArmourCommand extends CommandBase { String profileURL = "https://api.hypixel.net/skyblock/profile?profile=" + latestProfile + "&key=" + key; System.out.println("Fetching profile..."); - JsonObject profileResponse = APIHandler.getResponse(profileURL); + JsonObject profileResponse = APIHandler.getResponse(profileURL, true); if (!profileResponse.get("success").getAsBoolean()) { String reason = profileResponse.get("cause").getAsString(); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); diff --git a/src/main/java/me/Danker/commands/BankCommand.java b/src/main/java/me/Danker/commands/BankCommand.java index ddf9502..0de6bde 100644 --- a/src/main/java/me/Danker/commands/BankCommand.java +++ b/src/main/java/me/Danker/commands/BankCommand.java @@ -83,7 +83,7 @@ public class BankCommand extends CommandBase { String profileURL = "https://api.hypixel.net/skyblock/profile?profile=" + latestProfile + "&key=" + key; System.out.println("Fetching profile..."); - JsonObject profileResponse = APIHandler.getResponse(profileURL); + JsonObject profileResponse = APIHandler.getResponse(profileURL, true); if (!profileResponse.get("success").getAsBoolean()) { String reason = profileResponse.get("cause").getAsString(); player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Failed with reason: " + reason)); diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index b88f6cc..c82eb0e 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -50,6 +50,7 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + BankCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to get bank and purse coins of a person. If no name is provided, it checks yours.\n" + EnumChatFormatting.GOLD + ArmourCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to get armour of a person. If no name is provided, it checks yours.\n" + EnumChatFormatting.GOLD + DungeonsCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to get dungeon levels of a person. If no name is provided, it checks yours.\n" + + EnumChatFormatting.GOLD + WeightCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to get weight of a person. If no name is provided, it checks yours. Adding lily uses lily's weight instead of Senither's.\n" + EnumChatFormatting.GOLD + ImportFishingCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Imports your fishing stats from your latest profile to your fishing tracker using the API.\n" + EnumChatFormatting.GOLD + SkyblockPlayersCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find how many players are on each Skyblock island.\n" + EnumChatFormatting.GOLD + SkillTrackerCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Text display for skill xp/hour.\n" + diff --git a/src/main/java/me/Danker/commands/DungeonsCommand.java b/src/main/java/me/Danker/commands/DungeonsCommand.java index 3391a08..482bcd0 100644 --- a/src/main/java/me/Danker/commands/DungeonsCommand.java +++ b/src/main/java/me/Danker/commands/DungeonsCommand.java @@ -76,7 +76,7 @@ public class DungeonsCommand extends CommandBase { String profileURL = "https://api.hypixel.net/skyblock/profile?profile=" + latestProfile + "&key=" + key; System.out.println("Fetching profile..."); - JsonObject profileResponse = APIHandler.getResponse(profileURL); + JsonObject profileResponse = APIHandler.getResponse(profileURL, true); if (!profileResponse.get("success").getAsBoolean()) { String reason = profileResponse.get("cause").getAsString(); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); @@ -85,7 +85,7 @@ public class DungeonsCommand extends CommandBase { String playerURL = "https://api.hypixel.net/player?uuid=" + uuid + "&key=" + key; System.out.println("Fetching player data..."); - JsonObject playerResponse = APIHandler.getResponse(playerURL); + JsonObject playerResponse = APIHandler.getResponse(playerURL, true); if (!playerResponse.get("success").getAsBoolean()) { String reason = playerResponse.get("cause").getAsString(); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); diff --git a/src/main/java/me/Danker/commands/FairySoulsCommand.java b/src/main/java/me/Danker/commands/FairySoulsCommand.java index b93d596..00ac7bb 100644 --- a/src/main/java/me/Danker/commands/FairySoulsCommand.java +++ b/src/main/java/me/Danker/commands/FairySoulsCommand.java @@ -74,7 +74,7 @@ public class FairySoulsCommand extends CommandBase { String profileURL = "https://api.hypixel.net/skyblock/profile?profile=" + latestProfile + "&key=" + key; System.out.println("Fetching profile..."); - JsonObject profileResponse = APIHandler.getResponse(profileURL); + JsonObject profileResponse = APIHandler.getResponse(profileURL, true); if (!profileResponse.get("success").getAsBoolean()) { String reason = profileResponse.get("cause").getAsString(); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); @@ -88,7 +88,7 @@ public class FairySoulsCommand extends CommandBase { int fairy_souls = userObject.get("fairy_souls_collected").getAsInt(); System.out.println(fairy_souls); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "The player " + username + " has " + DankersSkyblockMod.VALUE_COLOUR + fairy_souls + DankersSkyblockMod.MAIN_COLOUR + "/222" + " collected")); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "The player " + username + " has " + DankersSkyblockMod.VALUE_COLOUR + fairy_souls + DankersSkyblockMod.MAIN_COLOUR + "/227" + " collected")); }).start(); diff --git a/src/main/java/me/Danker/commands/GuildOfCommand.java b/src/main/java/me/Danker/commands/GuildOfCommand.java index 1c9f1c4..e9ac8ba 100644 --- a/src/main/java/me/Danker/commands/GuildOfCommand.java +++ b/src/main/java/me/Danker/commands/GuildOfCommand.java @@ -74,7 +74,7 @@ public class GuildOfCommand extends CommandBase { // Find guild ID System.out.println("Fetching guild..."); String guildURL = "https://api.hypixel.net/guild?player=" + uuid + "&key=" + key; - JsonObject guildResponse = APIHandler.getResponse(guildURL); + JsonObject guildResponse = APIHandler.getResponse(guildURL, true); if (!guildResponse.get("success").getAsBoolean()) { String reason = guildResponse.get("cause").getAsString(); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); diff --git a/src/main/java/me/Danker/commands/ImportFishingCommand.java b/src/main/java/me/Danker/commands/ImportFishingCommand.java index 4aeff2c..8d40c0c 100644 --- a/src/main/java/me/Danker/commands/ImportFishingCommand.java +++ b/src/main/java/me/Danker/commands/ImportFishingCommand.java @@ -54,7 +54,7 @@ public class ImportFishingCommand extends CommandBase { String profileURL = "https://api.hypixel.net/skyblock/profile?profile=" + latestProfile + "&key=" + key; System.out.println("Fetching profile..."); - JsonObject profileResponse = APIHandler.getResponse(profileURL); + JsonObject profileResponse = APIHandler.getResponse(profileURL, true); if (!profileResponse.get("success").getAsBoolean()) { String reason = profileResponse.get("cause").getAsString(); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); diff --git a/src/main/java/me/Danker/commands/LobbyBankCommand.java b/src/main/java/me/Danker/commands/LobbyBankCommand.java index 886077c..165750b 100644 --- a/src/main/java/me/Danker/commands/LobbyBankCommand.java +++ b/src/main/java/me/Danker/commands/LobbyBankCommand.java @@ -65,7 +65,7 @@ public class LobbyBankCommand extends CommandBase { long biggestLastSave = 0; int profileIndex = -1; Thread.sleep(600); - JsonObject profileResponse = APIHandler.getResponse("https://api.hypixel.net/skyblock/profiles?uuid=" + UUID + "&key=" + key); + JsonObject profileResponse = APIHandler.getResponse("https://api.hypixel.net/skyblock/profiles?uuid=" + UUID + "&key=" + key, true); if (!profileResponse.get("success").getAsBoolean()) { String reason = profileResponse.get("cause").getAsString(); System.out.println("User " + player.getGameProfile().getName() + " failed with reason: " + reason); diff --git a/src/main/java/me/Danker/commands/LobbySkillsCommand.java b/src/main/java/me/Danker/commands/LobbySkillsCommand.java index b6cd87d..dd5c249 100644 --- a/src/main/java/me/Danker/commands/LobbySkillsCommand.java +++ b/src/main/java/me/Danker/commands/LobbySkillsCommand.java @@ -68,7 +68,7 @@ public class LobbySkillsCommand extends CommandBase { long biggestLastSave = 0; int profileIndex = -1; Thread.sleep(600); - JsonObject profileResponse = APIHandler.getResponse("https://api.hypixel.net/skyblock/profiles?uuid=" + UUID + "&key=" + key); + JsonObject profileResponse = APIHandler.getResponse("https://api.hypixel.net/skyblock/profiles?uuid=" + UUID + "&key=" + key, true); if (!profileResponse.get("success").getAsBoolean()) { String reason = profileResponse.get("cause").getAsString(); System.out.println("User " + player.getGameProfile().getName() + " failed with reason: " + reason); @@ -134,7 +134,7 @@ public class LobbySkillsCommand extends CommandBase { } else { Thread.sleep(600); // Sleep for another request System.out.println("Fetching skills from achievement API"); - JsonObject playerObject = APIHandler.getResponse("https://api.hypixel.net/player?uuid=" + UUID + "&key=" + key); + JsonObject playerObject = APIHandler.getResponse("https://api.hypixel.net/player?uuid=" + UUID + "&key=" + key, true); if (!playerObject.get("success").getAsBoolean()) { String reason = profileResponse.get("cause").getAsString(); diff --git a/src/main/java/me/Danker/commands/PetsCommand.java b/src/main/java/me/Danker/commands/PetsCommand.java index fc2f691..f35fee4 100644 --- a/src/main/java/me/Danker/commands/PetsCommand.java +++ b/src/main/java/me/Danker/commands/PetsCommand.java @@ -176,7 +176,7 @@ public class PetsCommand extends CommandBase { String profileURL = "https://api.hypixel.net/skyblock/profile?profile=" + latestProfile + "&key=" + key; System.out.println("Fetching profile..."); - JsonObject profileResponse = APIHandler.getResponse(profileURL); + JsonObject profileResponse = APIHandler.getResponse(profileURL, true); if (!profileResponse.get("success").getAsBoolean()) { String reason = profileResponse.get("cause").getAsString(); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); diff --git a/src/main/java/me/Danker/commands/PlayerCommand.java b/src/main/java/me/Danker/commands/PlayerCommand.java index 6236168..f097501 100644 --- a/src/main/java/me/Danker/commands/PlayerCommand.java +++ b/src/main/java/me/Danker/commands/PlayerCommand.java @@ -78,7 +78,7 @@ public class PlayerCommand extends CommandBase { String profileURL = "https://api.hypixel.net/skyblock/profile?profile=" + latestProfile + "&key=" + key; System.out.println("Fetching profile..."); - JsonObject profileResponse = APIHandler.getResponse(profileURL); + JsonObject profileResponse = APIHandler.getResponse(profileURL, true); if (!profileResponse.get("success").getAsBoolean()) { String reason = profileResponse.get("cause").getAsString(); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); @@ -136,7 +136,7 @@ public class PlayerCommand extends CommandBase { String playerURL = "https://api.hypixel.net/player?uuid=" + uuid + "&key=" + key; System.out.println("Fetching skills from achievement API"); - JsonObject playerObject = APIHandler.getResponse(playerURL); + JsonObject playerObject = APIHandler.getResponse(playerURL, true); if (!playerObject.get("success").getAsBoolean()) { String reason = profileResponse.get("cause").getAsString(); @@ -214,7 +214,7 @@ public class PlayerCommand extends CommandBase { // Weight System.out.println("Fetching weight from Senither API..."); String weightURL = "https://hypixel-api.senither.com/v1/profiles/" + uuid + "/weight?key=" + key; - JsonObject weightResponse = APIHandler.getResponse(weightURL); + JsonObject weightResponse = APIHandler.getResponse(weightURL, true); if (weightResponse.get("status").getAsInt() != 200) { String reason = weightResponse.get("reason").getAsString(); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); diff --git a/src/main/java/me/Danker/commands/SkillsCommand.java b/src/main/java/me/Danker/commands/SkillsCommand.java index 6195e81..533c804 100644 --- a/src/main/java/me/Danker/commands/SkillsCommand.java +++ b/src/main/java/me/Danker/commands/SkillsCommand.java @@ -75,7 +75,7 @@ public class SkillsCommand extends CommandBase { String profileURL = "https://api.hypixel.net/skyblock/profile?profile=" + latestProfile + "&key=" + key; System.out.println("Fetching profile..."); - JsonObject profileResponse = APIHandler.getResponse(profileURL); + JsonObject profileResponse = APIHandler.getResponse(profileURL, true); if (!profileResponse.get("success").getAsBoolean()) { String reason = profileResponse.get("cause").getAsString(); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); @@ -132,7 +132,7 @@ public class SkillsCommand extends CommandBase { String playerURL = "https://api.hypixel.net/player?uuid=" + uuid + "&key=" + key; System.out.println("Fetching skills from achievement API"); - JsonObject playerObject = APIHandler.getResponse(playerURL); + JsonObject playerObject = APIHandler.getResponse(playerURL, true); if (!playerObject.get("success").getAsBoolean()) { String reason = profileResponse.get("cause").getAsString(); diff --git a/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java b/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java index 2d05815..ced8906 100644 --- a/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java +++ b/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java @@ -57,7 +57,7 @@ public class SkyblockPlayersCommand extends CommandBase { String playersURL = "https://api.hypixel.net/gameCounts?key=" + key; System.out.println("Fetching player count..."); - JsonObject playersResponse = APIHandler.getResponse(playersURL); + JsonObject playersResponse = APIHandler.getResponse(playersURL, true); if (!playersResponse.get("success").getAsBoolean()) { String reason = playersResponse.get("cause").getAsString(); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); diff --git a/src/main/java/me/Danker/commands/SlayerCommand.java b/src/main/java/me/Danker/commands/SlayerCommand.java index 0efac3f..4d17534 100644 --- a/src/main/java/me/Danker/commands/SlayerCommand.java +++ b/src/main/java/me/Danker/commands/SlayerCommand.java @@ -83,7 +83,7 @@ public class SlayerCommand extends CommandBase { String profileURL = "https://api.hypixel.net/skyblock/profile?profile=" + latestProfile + "&key=" + key; System.out.println("Fetching profile..."); - JsonObject profileResponse = APIHandler.getResponse(profileURL); + JsonObject profileResponse = APIHandler.getResponse(profileURL, true); if (!profileResponse.get("success").getAsBoolean()) { String reason = profileResponse.get("cause").getAsString(); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); diff --git a/src/main/java/me/Danker/commands/WeightCommand.java b/src/main/java/me/Danker/commands/WeightCommand.java index 41c59d8..7593f65 100644 --- a/src/main/java/me/Danker/commands/WeightCommand.java +++ b/src/main/java/me/Danker/commands/WeightCommand.java @@ -26,7 +26,7 @@ public class WeightCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " [name]"; + return "/" + getCommandName() + " [name] [lily]"; } public static String usage(ICommandSender arg0) { @@ -72,33 +72,66 @@ public class WeightCommand extends CommandBase { uuid = APIHandler.getUUID(username); } - System.out.println("Fetching weight from Senither API..."); - String weightURL = "https://hypixel-api.senither.com/v1/profiles/" + uuid + "/weight?key=" + key; - JsonObject weightResponse = APIHandler.getResponse(weightURL); - if (weightResponse.get("status").getAsInt() != 200) { - String reason = weightResponse.get("reason").getAsString(); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); - return; - } + if (arg1.length < 2) { + System.out.println("Fetching weight from Senither API..."); + String weightURL = "https://hypixel-api.senither.com/v1/profiles/" + uuid + "/weight?key=" + key; + JsonObject weightResponse = APIHandler.getResponse(weightURL, true); + if (weightResponse.get("status").getAsInt() != 200) { + String reason = weightResponse.get("reason").getAsString(); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); + return; + } + + JsonObject data = weightResponse.get("data").getAsJsonObject(); + double weight = data.get("weight").getAsDouble(); + double overflow = data.get("weight_overflow").getAsDouble(); + double skillWeight = data.get("skills").getAsJsonObject().get("weight").getAsDouble(); + double skillOverflow = data.get("skills").getAsJsonObject().get("weight_overflow").getAsDouble(); + double slayerWeight = data.get("slayers").getAsJsonObject().get("weight").getAsDouble(); + double slayerOverflow = data.get("slayers").getAsJsonObject().get("weight_overflow").getAsDouble(); + double dungeonWeight = data.get("dungeons").getAsJsonObject().get("weight").getAsDouble(); + double dungeonOverflow = data.get("dungeons").getAsJsonObject().get("weight_overflow").getAsDouble(); + + NumberFormat nf = NumberFormat.getNumberInstance(Locale.US); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.AQUA + " " + username + "'s Weight:\n" + + DankersSkyblockMod.TYPE_COLOUR + " Total Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(weight + overflow) + " (" + nf.format(weight) + " + " + nf.format(overflow) + ")\n" + + DankersSkyblockMod.TYPE_COLOUR + " Skill Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(skillWeight + skillOverflow) + " (" + nf.format(skillWeight) + " + " + nf.format(skillOverflow) + ")\n" + + DankersSkyblockMod.TYPE_COLOUR + " Slayers Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(slayerWeight + slayerOverflow) + " (" + nf.format(slayerWeight) + " + " + nf.format(slayerOverflow) + ")\n" + + DankersSkyblockMod.TYPE_COLOUR + " Dungeons Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(dungeonWeight + dungeonOverflow) + " (" + nf.format(dungeonWeight) + " + " + nf.format(dungeonOverflow) + ")\n" + + DankersSkyblockMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------")); + } else if (arg1[1].equalsIgnoreCase("lily")) { + System.out.println("Fetching weight from Lily API..."); + String weightURL = "https://lily.antonio32a.com/" + uuid + "?key=" + key; + JsonObject weightResponse = APIHandler.getResponse(weightURL, true); + if (!weightResponse.get("success").getAsBoolean()) { + String reason = weightResponse.get("error").getAsString(); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); + return; + } - JsonObject data = weightResponse.get("data").getAsJsonObject(); - double weight = data.get("weight").getAsDouble(); - double overflow = data.get("weight_overflow").getAsDouble(); - double skillWeight = data.get("skills").getAsJsonObject().get("weight").getAsDouble(); - double skillOverflow = data.get("skills").getAsJsonObject().get("weight_overflow").getAsDouble(); - double slayerWeight = data.get("slayers").getAsJsonObject().get("weight").getAsDouble(); - double slayerOverflow = data.get("slayers").getAsJsonObject().get("weight_overflow").getAsDouble(); - double dungeonWeight = data.get("dungeons").getAsJsonObject().get("weight").getAsDouble(); - double dungeonOverflow = data.get("dungeons").getAsJsonObject().get("weight_overflow").getAsDouble(); - - NumberFormat nf = NumberFormat.getNumberInstance(Locale.US); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" + - EnumChatFormatting.AQUA + " " + username + "'s Weight:\n" + - DankersSkyblockMod.TYPE_COLOUR + " Total Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(weight + overflow) + " (" + nf.format(weight) + " + " + nf.format(overflow) + ")\n" + - DankersSkyblockMod.TYPE_COLOUR + " Skill Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(skillWeight + skillOverflow) + " (" + nf.format(skillWeight) + " + " + nf.format(skillOverflow) + ")\n" + - DankersSkyblockMod.TYPE_COLOUR + " Slayers Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(slayerWeight + slayerOverflow) + " (" + nf.format(slayerWeight) + " + " + nf.format(slayerOverflow) + ")\n" + - DankersSkyblockMod.TYPE_COLOUR + " Dungeons Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(dungeonWeight + dungeonOverflow) + " (" + nf.format(dungeonWeight) + " + " + nf.format(dungeonOverflow) + ")\n" + - DankersSkyblockMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------")); + JsonObject data = weightResponse.get("data").getAsJsonObject(); + double weight = data.get("total").getAsDouble(); + double skillWeight = data.get("skill").getAsJsonObject().get("base").getAsDouble(); + double skillOverflow = data.get("skill").getAsJsonObject().get("overflow").getAsDouble(); + double slayerWeight = data.get("slayer").getAsDouble(); + double catacombsXPWeight = data.get("catacombs").getAsJsonObject().get("experience").getAsDouble(); + double catacombsBaseWeight = data.get("catacombs").getAsJsonObject().get("completion").getAsJsonObject().get("base").getAsDouble(); + double catacombsMasterWeight = data.get("catacombs").getAsJsonObject().get("completion").getAsJsonObject().get("master").getAsDouble(); + + NumberFormat nf = NumberFormat.getNumberInstance(Locale.US); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.AQUA + " " + username + "'s Weight (Lily):\n" + + DankersSkyblockMod.TYPE_COLOUR + " Total Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(weight) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Skill Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(skillWeight + skillOverflow) + " (" + nf.format(skillWeight) + " + " + nf.format(skillOverflow) + ")\n" + + DankersSkyblockMod.TYPE_COLOUR + " Slayers Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(slayerWeight) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Catacombs XP Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(catacombsXPWeight) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Catacombs Completion Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(catacombsBaseWeight) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Catacombs Master Completion Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(catacombsMasterWeight) + "\n" + + DankersSkyblockMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------")); + } else { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); + } }).start(); } diff --git a/src/main/java/me/Danker/features/UpdateChecker.java b/src/main/java/me/Danker/features/UpdateChecker.java index 747fe91..7fe75b0 100644 --- a/src/main/java/me/Danker/features/UpdateChecker.java +++ b/src/main/java/me/Danker/features/UpdateChecker.java @@ -26,7 +26,7 @@ public class UpdateChecker { EntityPlayer player = Minecraft.getMinecraft().thePlayer; System.out.println("Checking for updates..."); - JsonObject latestRelease = APIHandler.getResponse("https://api.github.com/repos/bowser0000/SkyblockMod/releases/latest"); + JsonObject latestRelease = APIHandler.getResponse("https://api.github.com/repos/bowser0000/SkyblockMod/releases/latest", false); String latestTag = latestRelease.get("tag_name").getAsString(); DefaultArtifactVersion currentVersion = new DefaultArtifactVersion(DankersSkyblockMod.VERSION); diff --git a/src/main/java/me/Danker/features/puzzlesolvers/BlazeSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/BlazeSolver.java index e9d6f3f..affe416 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/BlazeSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/BlazeSolver.java @@ -8,10 +8,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StringUtils; +import net.minecraft.util.*; import net.minecraft.world.World; import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.event.world.WorldEvent; diff --git a/src/main/java/me/Danker/handlers/APIHandler.java b/src/main/java/me/Danker/handlers/APIHandler.java index 66001a3..4417973 100644 --- a/src/main/java/me/Danker/handlers/APIHandler.java +++ b/src/main/java/me/Danker/handlers/APIHandler.java @@ -18,7 +18,7 @@ import java.net.URL; import java.util.Scanner; public class APIHandler { - public static JsonObject getResponse(String urlString) { + public static JsonObject getResponse(String urlString, boolean hasError) { EntityPlayer player = Minecraft.getMinecraft().thePlayer; try { @@ -41,7 +41,7 @@ public class APIHandler { return gson.fromJson(response.toString(), JsonObject.class); } else { - if (urlString.startsWith("https://api.hypixel.net/") || urlString.startsWith("https://hypixel-api.senither.com")) { + if (hasError) { InputStream errorStream = conn.getErrorStream(); try (Scanner scanner = new Scanner(errorStream)) { scanner.useDelimiter("\\Z"); @@ -98,7 +98,7 @@ public class APIHandler { } public static String getUUID(String username) { - JsonObject uuidResponse = getResponse("https://api.mojang.com/users/profiles/minecraft/" + username); + JsonObject uuidResponse = getResponse("https://api.mojang.com/users/profiles/minecraft/" + username, false); return uuidResponse.get("id").getAsString(); } @@ -108,7 +108,7 @@ public class APIHandler { // Get profiles System.out.println("Fetching profiles..."); - JsonObject profilesResponse = getResponse("https://api.hypixel.net/skyblock/profiles?uuid=" + UUID + "&key=" + key); + JsonObject profilesResponse = getResponse("https://api.hypixel.net/skyblock/profiles?uuid=" + UUID + "&key=" + key, true); if (!profilesResponse.get("success").getAsBoolean()) { String reason = profilesResponse.get("cause").getAsString(); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index c1e76d7..31c791a 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -766,7 +766,7 @@ public class Utils { } public static void refreshRepo() { - DankersSkyblockMod.data = APIHandler.getResponse("https://raw.githubusercontent.com/bowser0000/SkyblockMod-REPO/main/data.json"); + DankersSkyblockMod.data = APIHandler.getResponse("https://raw.githubusercontent.com/bowser0000/SkyblockMod-REPO/main/data.json", false); System.out.println("Loaded data from GitHub?: " + (DankersSkyblockMod.data != null && DankersSkyblockMod.data.has("trivia"))); ColouredNames.users = DankersSkyblockMod.data.get("colourednames").getAsJsonObject().entrySet().stream() .map(Map.Entry::getKey) -- cgit From 5a045d7805b0708e2baa9db648130137be986e9a Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 7 Aug 2021 15:57:44 -0400 Subject: Add more info to open skill menu warning --- src/main/java/me/Danker/features/ColouredNames.java | 3 ++- src/main/java/me/Danker/features/Skill50Display.java | 2 +- src/main/java/me/Danker/features/SkillTracker.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/ColouredNames.java b/src/main/java/me/Danker/features/ColouredNames.java index cba327a..d0daf2a 100644 --- a/src/main/java/me/Danker/features/ColouredNames.java +++ b/src/main/java/me/Danker/features/ColouredNames.java @@ -5,6 +5,7 @@ import me.Danker.commands.ToggleCommand; import me.Danker.utils.Utils; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; @@ -62,7 +63,7 @@ public class ColouredNames { if (!ToggleCommand.customColouredNames || !Utils.inSkyblock) return; Entity entity = event.entity; - if (entity.hasCustomName()) { + if (entity instanceof EntityArmorStand && entity.hasCustomName()) { for (String user : users) { if (entity.getCustomNameTag().contains(user)) { entity.setCustomNameTag(replaceName(entity.getCustomNameTag(), user, getColourFromName(user))); diff --git a/src/main/java/me/Danker/features/Skill50Display.java b/src/main/java/me/Danker/features/Skill50Display.java index 54afb3a..5a58b0c 100644 --- a/src/main/java/me/Danker/features/Skill50Display.java +++ b/src/main/java/me/Danker/features/Skill50Display.java @@ -115,7 +115,7 @@ public class Skill50Display { @SubscribeEvent public void renderPlayerInfo(RenderOverlay event) { if (!Utils.skillsInitialized() && Utils.inSkyblock) { - new TextRenderer(Minecraft.getMinecraft(), EnumChatFormatting.RED + "Please open the skill menu to use skill features.", MoveCommand.skill50XY[0], MoveCommand.skill50XY[0], ScaleCommand.skill50Scale); + new TextRenderer(Minecraft.getMinecraft(), EnumChatFormatting.RED + "Please open the skill menu to use skill features. (/skills)", MoveCommand.skill50XY[0], MoveCommand.skill50XY[0], ScaleCommand.skill50Scale); return; } diff --git a/src/main/java/me/Danker/features/SkillTracker.java b/src/main/java/me/Danker/features/SkillTracker.java index 9438b3d..3d932d0 100644 --- a/src/main/java/me/Danker/features/SkillTracker.java +++ b/src/main/java/me/Danker/features/SkillTracker.java @@ -169,7 +169,7 @@ public class SkillTracker { public void renderPlayerInfo(RenderOverlay event) { if (showSkillTracker && Utils.inSkyblock) { if (!Utils.skillsInitialized()) { - new TextRenderer(Minecraft.getMinecraft(), EnumChatFormatting.RED + "Please open the skill menu to use skill features.", MoveCommand.skillTrackerXY[0], MoveCommand.skillTrackerXY[0], ScaleCommand.skillTrackerScale); + new TextRenderer(Minecraft.getMinecraft(), EnumChatFormatting.RED + "Please open the skill menu to use skill features. (/skills)", MoveCommand.skillTrackerXY[0], MoveCommand.skillTrackerXY[0], ScaleCommand.skillTrackerScale); return; } -- cgit From e1cd7b73d0e96b1be4892d75f46cc92ad7bf979e Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 26 Aug 2021 22:41:16 -0400 Subject: Reduce lag with custom colours --- .../java/me/Danker/features/ColouredNames.java | 33 ++++++++++++++++++---- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/ColouredNames.java b/src/main/java/me/Danker/features/ColouredNames.java index d0daf2a..dfd6d84 100644 --- a/src/main/java/me/Danker/features/ColouredNames.java +++ b/src/main/java/me/Danker/features/ColouredNames.java @@ -13,16 +13,21 @@ import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.RenderLivingEvent; import net.minecraftforge.event.entity.player.ItemTooltipEvent; import net.minecraftforge.event.entity.player.PlayerEvent; +import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; public class ColouredNames { public static List users = new ArrayList<>(); + public static Map nametags = new HashMap<>(); public static final EnumChatFormatting[] RAINBOW_COLOURS = new EnumChatFormatting[]{EnumChatFormatting.RED, EnumChatFormatting.GOLD, EnumChatFormatting.YELLOW, EnumChatFormatting.GREEN, EnumChatFormatting.AQUA, EnumChatFormatting.BLUE, EnumChatFormatting.DARK_PURPLE}; @SubscribeEvent @@ -58,20 +63,38 @@ public class ColouredNames { } } - @SubscribeEvent + @SubscribeEvent(priority = EventPriority.LOW) public void onRenderLiving(RenderLivingEvent.Specials.Pre event) { if (!ToggleCommand.customColouredNames || !Utils.inSkyblock) return; Entity entity = event.entity; - if (entity instanceof EntityArmorStand && entity.hasCustomName()) { - for (String user : users) { - if (entity.getCustomNameTag().contains(user)) { - entity.setCustomNameTag(replaceName(entity.getCustomNameTag(), user, getColourFromName(user))); + if (entity instanceof EntityArmorStand && !entity.isDead && entity.hasCustomName()) { + String name = entity.getCustomNameTag(); + if (name.charAt(name.length() - 1) == '❤') return; + + String id = entity.getUniqueID().toString(); + String nametag = nametags.get(id); + + if (name.equals(nametag)) { + entity.setCustomNameTag(nametag); + } else { + for (String user : users) { + if (name.contains(user)) { + name = replaceName(name, user, getColourFromName(user)); + } } + + nametags.put(id, name); + entity.setCustomNameTag(name); } } } + @SubscribeEvent + public void onWorldChange(WorldEvent.Load event) { + nametags.clear(); + } + // https://github.com/SteveKunG/SkyBlockcatia/blob/1.8.9/src/main/java/com/stevekung/skyblockcatia/utils/SupporterUtils.java#L53 public static String replaceName(String text, String name, String colour) { String namePattern = "(?:(?:\\u00a7[0-9a-fbr])\\B(?:" + name + ")\\b)|(?:\\u00a7[rb]" + name + "\\u00a7r)|\\b" + name + "\\b"; -- cgit From 4ea49e306ca14e2f4045045f7895e2c1c5d51d6d Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 27 Aug 2021 03:04:42 -0400 Subject: Update private island custom music detection --- src/main/java/me/Danker/features/CustomMusic.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java index 4891fe3..7309462 100644 --- a/src/main/java/me/Danker/features/CustomMusic.java +++ b/src/main/java/me/Danker/features/CustomMusic.java @@ -95,7 +95,7 @@ public class CustomMusic { case "Hub": if (ToggleCommand.hubMusic) hub.start(); break; - case "Private World": + case "Private Island": if (ToggleCommand.islandMusic) island.start(); break; case "Dungeon Hub": -- cgit From ea8413504f2a6663608367ad6ab5fbcad7e6c029 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 28 Aug 2021 02:56:06 -0400 Subject: A lot of internal changes Rename RenderOverlay -> RenderOverlayEvent Split loot trackers into own classes Add packet read and write events Move render functions form Utils to RenderUtils Fix warnings in installer frame Move spirit boots fix to own class --- build.gradle | 2 +- .../java/DefenitlyNotAJoikedInstallerFrame.java | 25 +- src/main/java/me/Danker/DankersSkyblockMod.java | 30 +- .../me/Danker/commands/ImportFishingCommand.java | 250 ++-- src/main/java/me/Danker/commands/LootCommand.java | 750 ++++++------ .../java/me/Danker/commands/ResetLootCommand.java | 320 ++--- .../java/me/Danker/events/PacketReadEvent.java | 16 + .../java/me/Danker/events/PacketWriteEvent.java | 16 + src/main/java/me/Danker/events/RenderOverlay.java | 6 - .../java/me/Danker/events/RenderOverlayEvent.java | 6 + src/main/java/me/Danker/features/ArachneESP.java | 4 +- .../java/me/Danker/features/BonzoMaskTimer.java | 4 +- src/main/java/me/Danker/features/CakeTimer.java | 4 +- .../me/Danker/features/CrystalHollowWaypoints.java | 3 +- src/main/java/me/Danker/features/DungeonTimer.java | 4 +- .../java/me/Danker/features/GiantHPDisplay.java | 4 +- .../me/Danker/features/GolemSpawningAlert.java | 4 +- .../Danker/features/HighlightSkeletonMasters.java | 3 +- src/main/java/me/Danker/features/NoF3Coords.java | 4 +- src/main/java/me/Danker/features/PetColours.java | 3 +- .../java/me/Danker/features/Skill50Display.java | 4 +- src/main/java/me/Danker/features/SkillTracker.java | 4 +- src/main/java/me/Danker/features/SlayerESP.java | 9 +- .../java/me/Danker/features/SpiritBootsFix.java | 28 + .../java/me/Danker/features/TetherDisplay.java | 4 +- .../me/Danker/features/loot/CatacombsTracker.java | 431 +++++++ .../me/Danker/features/loot/EndermanTracker.java | 178 +++ .../me/Danker/features/loot/FishingTracker.java | 285 +++++ .../java/me/Danker/features/loot/GhostTracker.java | 60 + .../java/me/Danker/features/loot/LootDisplay.java | 828 ++++++------- .../java/me/Danker/features/loot/LootTracker.java | 1295 +------------------- .../Danker/features/loot/MythologicalTracker.java | 87 ++ .../me/Danker/features/loot/SpiderTracker.java | 114 ++ .../java/me/Danker/features/loot/WolfTracker.java | 116 ++ .../me/Danker/features/loot/ZombieTracker.java | 143 +++ .../Danker/features/puzzlesolvers/BlazeSolver.java | 17 +- .../features/puzzlesolvers/BoulderSolver.java | 3 +- .../features/puzzlesolvers/ChronomatronSolver.java | 5 +- .../features/puzzlesolvers/ClickInOrderSolver.java | 5 +- .../features/puzzlesolvers/CreeperSolver.java | 7 +- .../features/puzzlesolvers/IceWalkSolver.java | 7 +- .../Danker/features/puzzlesolvers/LividSolver.java | 4 +- .../puzzlesolvers/SelectAllColourSolver.java | 3 +- .../features/puzzlesolvers/SilverfishSolver.java | 3 +- .../features/puzzlesolvers/StartsWithSolver.java | 3 +- .../features/puzzlesolvers/SuperpairsSolver.java | 5 +- .../features/puzzlesolvers/ThreeManSolver.java | 3 +- .../features/puzzlesolvers/TicTacToeSolver.java | 3 +- .../puzzlesolvers/UltrasequencerSolver.java | 5 +- .../Danker/features/puzzlesolvers/WaterSolver.java | 4 +- .../java/me/Danker/handlers/ConfigHandler.java | 341 +++--- .../java/me/Danker/handlers/PacketHandler.java | 33 +- src/main/java/me/Danker/utils/BoulderUtils.java | 20 +- src/main/java/me/Danker/utils/RenderUtils.java | 366 ++++++ src/main/java/me/Danker/utils/Utils.java | 353 ------ 55 files changed, 3231 insertions(+), 3003 deletions(-) create mode 100644 src/main/java/me/Danker/events/PacketReadEvent.java create mode 100644 src/main/java/me/Danker/events/PacketWriteEvent.java delete mode 100644 src/main/java/me/Danker/events/RenderOverlay.java create mode 100644 src/main/java/me/Danker/events/RenderOverlayEvent.java create mode 100644 src/main/java/me/Danker/features/SpiritBootsFix.java create mode 100644 src/main/java/me/Danker/features/loot/CatacombsTracker.java create mode 100644 src/main/java/me/Danker/features/loot/EndermanTracker.java create mode 100644 src/main/java/me/Danker/features/loot/FishingTracker.java create mode 100644 src/main/java/me/Danker/features/loot/GhostTracker.java create mode 100644 src/main/java/me/Danker/features/loot/MythologicalTracker.java create mode 100644 src/main/java/me/Danker/features/loot/SpiderTracker.java create mode 100644 src/main/java/me/Danker/features/loot/WolfTracker.java create mode 100644 src/main/java/me/Danker/features/loot/ZombieTracker.java create mode 100644 src/main/java/me/Danker/utils/RenderUtils.java (limited to 'src/main/java/me/Danker') diff --git a/build.gradle b/build.gradle index 05a7231..3ccc643 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ plugins { id "net.minecraftforge.gradle.forge" version "2.0.2" } */ -version = "1.8.7-beta4" +version = "1.8.7-beta5" group= "me.Danker.DankersSkyblockMod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Danker's Skyblock Mod" diff --git a/src/main/java/DefenitlyNotAJoikedInstallerFrame.java b/src/main/java/DefenitlyNotAJoikedInstallerFrame.java index bd5e218..9d19f5f 100644 --- a/src/main/java/DefenitlyNotAJoikedInstallerFrame.java +++ b/src/main/java/DefenitlyNotAJoikedInstallerFrame.java @@ -80,7 +80,7 @@ public class DefenitlyNotAJoikedInstallerFrame extends JFrame implements ActionL UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); DefenitlyNotAJoikedInstallerFrame frame = new DefenitlyNotAJoikedInstallerFrame(); frame.centerFrame(frame); - frame.show(); + frame.setVisible(true); } catch (Exception ex) { showErrorPopup(ex); @@ -421,10 +421,7 @@ public class DefenitlyNotAJoikedInstallerFrame extends JFrame implements ActionL File thisFile = getThisFile(); if (thisFile != null) { - boolean inSubFolder = false; - if (IN_MODS_SUBFOLDER.matcher(modsFolder.getPath()).find()) { - inSubFolder = true; - } + boolean inSubFolder = IN_MODS_SUBFOLDER.matcher(modsFolder.getPath()).find(); File newFile = new File(modsFolder, "Danker's Skyblock Mod - " + DankersSkyblockMod.VERSION + ".jar"); @@ -627,24 +624,6 @@ public class DefenitlyNotAJoikedInstallerFrame extends JFrame implements ActionL JOptionPane.showMessageDialog(null, errorScrollPane, "Error", JOptionPane.ERROR_MESSAGE); } - private String getVersionFromMcmodInfo() { - String version = ""; - try { - BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(Objects.requireNonNull(getClass(). - getClassLoader().getResourceAsStream("mcmod.info"), "mcmod.info not found."))); - while ((version = bufferedReader.readLine()) != null) { - if (version.contains("\"version\": \"")) { - version = version.split(Pattern.quote("\"version\": \""))[1]; - version = version.substring(0, version.length() - 2); - break; - } - } - } catch (Exception ex) { - // It's okay, I guess just don't use the version lol. - } - return version; - } - private String getModIDFromInputStream(InputStream inputStream) { String version = ""; try { diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 100db96..d9da871 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -4,14 +4,14 @@ import com.google.gson.JsonObject; import me.Danker.commands.*; import me.Danker.events.ChestSlotClickedEvent; import me.Danker.events.GuiChestBackgroundDrawnEvent; -import me.Danker.events.RenderOverlay; +import me.Danker.events.RenderOverlayEvent; import me.Danker.features.*; -import me.Danker.features.loot.LootDisplay; -import me.Danker.features.loot.LootTracker; +import me.Danker.features.loot.*; import me.Danker.features.puzzlesolvers.*; import me.Danker.gui.*; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.PacketHandler; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; @@ -64,7 +64,7 @@ import java.util.Map; @Mod(modid = DankersSkyblockMod.MODID, version = DankersSkyblockMod.VERSION, clientSideOnly = true) public class DankersSkyblockMod { public static final String MODID = "Danker's Skyblock Mod"; - public static final String VERSION = "1.8.7-beta4"; + public static final String VERSION = "1.8.7-beta5"; public static int titleTimer = -1; public static boolean showTitle = false; public static String titleText = ""; @@ -128,8 +128,6 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new HighlightSkeletonMasters()); MinecraftForge.EVENT_BUS.register(new IceWalkSolver()); MinecraftForge.EVENT_BUS.register(new LividSolver()); - MinecraftForge.EVENT_BUS.register(new LootDisplay()); - MinecraftForge.EVENT_BUS.register(new LootTracker()); MinecraftForge.EVENT_BUS.register(new LowHealthNotifications()); MinecraftForge.EVENT_BUS.register(new NecronNotifications()); MinecraftForge.EVENT_BUS.register(new NoF3Coords()); @@ -143,6 +141,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new SlayerESP()); MinecraftForge.EVENT_BUS.register(new SpamHider()); MinecraftForge.EVENT_BUS.register(new SpiritBearAlert()); + MinecraftForge.EVENT_BUS.register(new SpiritBootsFix()); MinecraftForge.EVENT_BUS.register(new StartsWithSolver()); MinecraftForge.EVENT_BUS.register(new StopSalvagingStarredItems()); MinecraftForge.EVENT_BUS.register(new SuperpairsSolver()); @@ -155,6 +154,17 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new WatcherReadyAlert()); MinecraftForge.EVENT_BUS.register(new WaterSolver()); + MinecraftForge.EVENT_BUS.register(new LootDisplay()); + MinecraftForge.EVENT_BUS.register(new LootTracker()); + MinecraftForge.EVENT_BUS.register(new CatacombsTracker()); + MinecraftForge.EVENT_BUS.register(new EndermanTracker()); + MinecraftForge.EVENT_BUS.register(new FishingTracker()); + MinecraftForge.EVENT_BUS.register(new GhostTracker()); + MinecraftForge.EVENT_BUS.register(new MythologicalTracker()); + MinecraftForge.EVENT_BUS.register(new SpiderTracker()); + MinecraftForge.EVENT_BUS.register(new WolfTracker()); + MinecraftForge.EVENT_BUS.register(new ZombieTracker()); + ConfigHandler.reloadConfig(); GoldenEnchants.init(); TriviaSolver.init(); @@ -328,7 +338,7 @@ public class DankersSkyblockMod { if (event.type != RenderGameOverlayEvent.ElementType.EXPERIENCE && event.type != RenderGameOverlayEvent.ElementType.JUMPBAR) return; if (Minecraft.getMinecraft().currentScreen instanceof EditLocationsGui) return; - MinecraftForge.EVENT_BUS.post(new RenderOverlay()); + MinecraftForge.EVENT_BUS.post(new RenderOverlayEvent()); } // LabyMod Support @@ -337,13 +347,13 @@ public class DankersSkyblockMod { if (!usingLabymod) return; if (event.type != null) return; if (Minecraft.getMinecraft().currentScreen instanceof EditLocationsGui) return; - MinecraftForge.EVENT_BUS.post(new RenderOverlay()); + MinecraftForge.EVENT_BUS.post(new RenderOverlayEvent()); } @SubscribeEvent - public void renderPlayerInfo(RenderOverlay event) { + public void renderPlayerInfo(RenderOverlayEvent event) { if (showTitle) { - Utils.drawTitle(titleText); + RenderUtils.drawTitle(titleText); } } diff --git a/src/main/java/me/Danker/commands/ImportFishingCommand.java b/src/main/java/me/Danker/commands/ImportFishingCommand.java index 8d40c0c..f27aa8a 100644 --- a/src/main/java/me/Danker/commands/ImportFishingCommand.java +++ b/src/main/java/me/Danker/commands/ImportFishingCommand.java @@ -2,7 +2,7 @@ package me.Danker.commands; import com.google.gson.JsonObject; import me.Danker.DankersSkyblockMod; -import me.Danker.features.loot.LootTracker; +import me.Danker.features.loot.FishingTracker; import me.Danker.handlers.APIHandler; import me.Danker.handlers.ConfigHandler; import net.minecraft.command.CommandBase; @@ -64,230 +64,230 @@ public class ImportFishingCommand extends CommandBase { System.out.println("Fetching fishing stats..."); JsonObject statsObject = profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject().get("stats").getAsJsonObject(); - LootTracker.greatCatches = 0; - LootTracker.goodCatches = 0; + FishingTracker.greatCatches = 0; + FishingTracker.goodCatches = 0; if (statsObject.has("items_fished_treasure")) { if (statsObject.has("items_fished_large_treasure")) { - LootTracker.greatCatches = statsObject.get("items_fished_large_treasure").getAsInt(); - LootTracker.goodCatches = statsObject.get("items_fished_treasure").getAsInt() - LootTracker.greatCatches; + FishingTracker.greatCatches = statsObject.get("items_fished_large_treasure").getAsInt(); + FishingTracker.goodCatches = statsObject.get("items_fished_treasure").getAsInt() - FishingTracker.greatCatches; } else { - LootTracker.goodCatches = statsObject.get("items_fished_treasure").getAsInt(); + FishingTracker.goodCatches = statsObject.get("items_fished_treasure").getAsInt(); } } - LootTracker.seaCreatures = 0; - LootTracker.squids = 0; + FishingTracker.seaCreatures = 0; + FishingTracker.squids = 0; if (statsObject.has("kills_pond_squid")) { - LootTracker.squids = statsObject.get("kills_pond_squid").getAsInt(); + FishingTracker.squids = statsObject.get("kills_pond_squid").getAsInt(); } - LootTracker.seaCreatures += LootTracker.squids; + FishingTracker.seaCreatures += FishingTracker.squids; - LootTracker.seaWalkers = 0; + FishingTracker.seaWalkers = 0; if (statsObject.has("kills_sea_walker")) { - LootTracker.seaWalkers = statsObject.get("kills_sea_walker").getAsInt(); + FishingTracker.seaWalkers = statsObject.get("kills_sea_walker").getAsInt(); } - LootTracker.seaCreatures += LootTracker.seaWalkers; + FishingTracker.seaCreatures += FishingTracker.seaWalkers; - LootTracker.nightSquids = 0; + FishingTracker.nightSquids = 0; if (statsObject.has("kills_night_squid")) { - LootTracker.nightSquids = statsObject.get("kills_night_squid").getAsInt(); + FishingTracker.nightSquids = statsObject.get("kills_night_squid").getAsInt(); } - LootTracker.seaCreatures += LootTracker.nightSquids; + FishingTracker.seaCreatures += FishingTracker.nightSquids; - LootTracker.seaGuardians = 0; + FishingTracker.seaGuardians = 0; if (statsObject.has("kills_sea_guardian")) { - LootTracker.seaGuardians = statsObject.get("kills_sea_guardian").getAsInt(); + FishingTracker.seaGuardians = statsObject.get("kills_sea_guardian").getAsInt(); } - LootTracker.seaCreatures += LootTracker.seaGuardians; + FishingTracker.seaCreatures += FishingTracker.seaGuardians; - LootTracker.seaWitches = 0; + FishingTracker.seaWitches = 0; if (statsObject.has("kills_sea_witch")) { - LootTracker.seaWitches = statsObject.get("kills_sea_witch").getAsInt(); + FishingTracker.seaWitches = statsObject.get("kills_sea_witch").getAsInt(); } - LootTracker.seaCreatures += LootTracker.seaWitches; + FishingTracker.seaCreatures += FishingTracker.seaWitches; - LootTracker.seaArchers = 0; + FishingTracker.seaArchers = 0; if (statsObject.has("kills_sea_archer")) { - LootTracker.seaArchers = statsObject.get("kills_sea_archer").getAsInt(); + FishingTracker.seaArchers = statsObject.get("kills_sea_archer").getAsInt(); } - LootTracker.seaCreatures += LootTracker.seaArchers; + FishingTracker.seaCreatures += FishingTracker.seaArchers; - LootTracker.monsterOfTheDeeps = 0; + FishingTracker.monsterOfTheDeeps = 0; if (statsObject.has("kills_zombie_deep")) { if (statsObject.has("kills_chicken_deep")) { - LootTracker.monsterOfTheDeeps = statsObject.get("kills_zombie_deep").getAsInt() + statsObject.get("kills_chicken_deep").getAsInt(); + FishingTracker.monsterOfTheDeeps = statsObject.get("kills_zombie_deep").getAsInt() + statsObject.get("kills_chicken_deep").getAsInt(); } else { - LootTracker.monsterOfTheDeeps = statsObject.get("kills_zombie_deep").getAsInt(); + FishingTracker.monsterOfTheDeeps = statsObject.get("kills_zombie_deep").getAsInt(); } } else if (statsObject.has("kills_chicken_deep")) { - LootTracker.monsterOfTheDeeps = statsObject.get("kills_chicken_deep").getAsInt(); + FishingTracker.monsterOfTheDeeps = statsObject.get("kills_chicken_deep").getAsInt(); } - LootTracker.seaCreatures += LootTracker.monsterOfTheDeeps; + FishingTracker.seaCreatures += FishingTracker.monsterOfTheDeeps; - LootTracker.catfishes = 0; + FishingTracker.catfishes = 0; if (statsObject.has("kills_catfish")) { - LootTracker.catfishes = statsObject.get("kills_catfish").getAsInt(); + FishingTracker.catfishes = statsObject.get("kills_catfish").getAsInt(); } - LootTracker.seaCreatures += LootTracker.catfishes; + FishingTracker.seaCreatures += FishingTracker.catfishes; - LootTracker.carrotKings = 0; + FishingTracker.carrotKings = 0; if (statsObject.has("kills_carrot_king")) { - LootTracker.carrotKings = statsObject.get("kills_carrot_king").getAsInt(); + FishingTracker.carrotKings = statsObject.get("kills_carrot_king").getAsInt(); } - LootTracker.seaCreatures += LootTracker.carrotKings; + FishingTracker.seaCreatures += FishingTracker.carrotKings; - LootTracker.seaLeeches = 0; + FishingTracker.seaLeeches = 0; if (statsObject.has("kills_sea_leech")) { - LootTracker.seaLeeches = statsObject.get("kills_sea_leech").getAsInt(); + FishingTracker.seaLeeches = statsObject.get("kills_sea_leech").getAsInt(); } - LootTracker.seaCreatures += LootTracker.seaLeeches; + FishingTracker.seaCreatures += FishingTracker.seaLeeches; - LootTracker.guardianDefenders = 0; + FishingTracker.guardianDefenders = 0; if (statsObject.has("kills_guardian_defender")) { - LootTracker.guardianDefenders = statsObject.get("kills_guardian_defender").getAsInt(); + FishingTracker.guardianDefenders = statsObject.get("kills_guardian_defender").getAsInt(); } - LootTracker.seaCreatures += LootTracker.guardianDefenders; + FishingTracker.seaCreatures += FishingTracker.guardianDefenders; - LootTracker.deepSeaProtectors = 0; + FishingTracker.deepSeaProtectors = 0; if (statsObject.has("kills_deep_sea_protector")) { - LootTracker.deepSeaProtectors = statsObject.get("kills_deep_sea_protector").getAsInt(); + FishingTracker.deepSeaProtectors = statsObject.get("kills_deep_sea_protector").getAsInt(); } - LootTracker.seaCreatures += LootTracker.deepSeaProtectors; + FishingTracker.seaCreatures += FishingTracker.deepSeaProtectors; - LootTracker.hydras = 0; + FishingTracker.hydras = 0; if (statsObject.has("kills_water_hydra")) { // Hydra splits - LootTracker.hydras = statsObject.get("kills_water_hydra").getAsInt() / 2; + FishingTracker.hydras = statsObject.get("kills_water_hydra").getAsInt() / 2; } - LootTracker.seaCreatures += LootTracker.hydras; + FishingTracker.seaCreatures += FishingTracker.hydras; - LootTracker.seaEmperors = 0; + FishingTracker.seaEmperors = 0; if (statsObject.has("kills_skeleton_emperor")) { if (statsObject.has("kills_guardian_emperor")) { - LootTracker.seaEmperors = statsObject.get("kills_skeleton_emperor").getAsInt() + statsObject.get("kills_guardian_emperor").getAsInt(); + FishingTracker.seaEmperors = statsObject.get("kills_skeleton_emperor").getAsInt() + statsObject.get("kills_guardian_emperor").getAsInt(); } else { - LootTracker.seaEmperors = statsObject.get("kills_skeleton_emperor").getAsInt(); + FishingTracker.seaEmperors = statsObject.get("kills_skeleton_emperor").getAsInt(); } } else if (statsObject.has("kills_guardian_emperor")) { - LootTracker.seaEmperors = statsObject.get("kills_guardian_emperor").getAsInt(); + FishingTracker.seaEmperors = statsObject.get("kills_guardian_emperor").getAsInt(); } - LootTracker.seaCreatures += LootTracker.seaEmperors; + FishingTracker.seaCreatures += FishingTracker.seaEmperors; - LootTracker.fishingMilestone = 0; + FishingTracker.fishingMilestone = 0; if (statsObject.has("pet_milestone_sea_creatures_killed")) { - LootTracker.fishingMilestone = statsObject.get("pet_milestone_sea_creatures_killed").getAsInt(); + FishingTracker.fishingMilestone = statsObject.get("pet_milestone_sea_creatures_killed").getAsInt(); } - LootTracker.frozenSteves = 0; + FishingTracker.frozenSteves = 0; if (statsObject.has("kills_frozen_steve")) { - LootTracker.frozenSteves = statsObject.get("kills_frozen_steve").getAsInt(); + FishingTracker.frozenSteves = statsObject.get("kills_frozen_steve").getAsInt(); } - LootTracker.seaCreatures += LootTracker.frozenSteves; + FishingTracker.seaCreatures += FishingTracker.frozenSteves; - LootTracker.frostyTheSnowmans = 0; + FishingTracker.frostyTheSnowmans = 0; if (statsObject.has("kills_frosty_the_snowman")) { - LootTracker.frostyTheSnowmans = statsObject.get("kills_frosty_the_snowman").getAsInt(); + FishingTracker.frostyTheSnowmans = statsObject.get("kills_frosty_the_snowman").getAsInt(); } - LootTracker.seaCreatures += LootTracker.frostyTheSnowmans; + FishingTracker.seaCreatures += FishingTracker.frostyTheSnowmans; - LootTracker.grinches = 0; + FishingTracker.grinches = 0; if (statsObject.has("kills_grinch")) { - LootTracker.grinches = statsObject.get("kills_grinch").getAsInt(); + FishingTracker.grinches = statsObject.get("kills_grinch").getAsInt(); } - LootTracker.seaCreatures += LootTracker.grinches; + FishingTracker.seaCreatures += FishingTracker.grinches; - LootTracker.yetis = 0; + FishingTracker.yetis = 0; if (statsObject.has("kills_yeti")) { - LootTracker.yetis = statsObject.get("kills_yeti").getAsInt(); + FishingTracker.yetis = statsObject.get("kills_yeti").getAsInt(); } - LootTracker.seaCreatures += LootTracker.yetis; + FishingTracker.seaCreatures += FishingTracker.yetis; - LootTracker.nurseSharks = 0; + FishingTracker.nurseSharks = 0; if (statsObject.has("kills_nurse_shark")) { - LootTracker.nurseSharks = statsObject.get("kills_nurse_shark").getAsInt(); + FishingTracker.nurseSharks = statsObject.get("kills_nurse_shark").getAsInt(); } - LootTracker.seaCreatures += LootTracker.nurseSharks; + FishingTracker.seaCreatures += FishingTracker.nurseSharks; - LootTracker.blueSharks = 0; + FishingTracker.blueSharks = 0; if (statsObject.has("kills_nurse_shark")) { - LootTracker.blueSharks = statsObject.get("kills_blue_shark").getAsInt(); + FishingTracker.blueSharks = statsObject.get("kills_blue_shark").getAsInt(); } - LootTracker.seaCreatures += LootTracker.blueSharks; + FishingTracker.seaCreatures += FishingTracker.blueSharks; - LootTracker.tigerSharks = 0; + FishingTracker.tigerSharks = 0; if (statsObject.has("kills_nurse_shark")) { - LootTracker.tigerSharks = statsObject.get("kills_tiger_shark").getAsInt(); + FishingTracker.tigerSharks = statsObject.get("kills_tiger_shark").getAsInt(); } - LootTracker.seaCreatures += LootTracker.tigerSharks; + FishingTracker.seaCreatures += FishingTracker.tigerSharks; - LootTracker.greatWhiteSharks = 0; + FishingTracker.greatWhiteSharks = 0; if (statsObject.has("kills_nurse_shark")) { - LootTracker.greatWhiteSharks = statsObject.get("kills_great_white_shark").getAsInt(); + FishingTracker.greatWhiteSharks = statsObject.get("kills_great_white_shark").getAsInt(); } - LootTracker.seaCreatures += LootTracker.greatWhiteSharks; + FishingTracker.seaCreatures += FishingTracker.greatWhiteSharks; - LootTracker.scarecrows = 0; + FishingTracker.scarecrows = 0; if (statsObject.has("kills_scarecrow")) { - LootTracker.scarecrows = statsObject.get("kills_scarecrow").getAsInt(); + FishingTracker.scarecrows = statsObject.get("kills_scarecrow").getAsInt(); } - LootTracker.seaCreatures += LootTracker.scarecrows; + FishingTracker.seaCreatures += FishingTracker.scarecrows; - LootTracker.nightmares = 0; + FishingTracker.nightmares = 0; if (statsObject.has("kills_nightmare")) { - LootTracker.nightmares = statsObject.get("kills_nightmare").getAsInt(); + FishingTracker.nightmares = statsObject.get("kills_nightmare").getAsInt(); } - LootTracker.seaCreatures += LootTracker.nightmares; + FishingTracker.seaCreatures += FishingTracker.nightmares; - LootTracker.werewolfs = 0; + FishingTracker.werewolfs = 0; if (statsObject.has("kills_werewolf")) { - LootTracker.werewolfs = statsObject.get("kills_werewolf").getAsInt(); + FishingTracker.werewolfs = statsObject.get("kills_werewolf").getAsInt(); } - LootTracker.seaCreatures += LootTracker.werewolfs; + FishingTracker.seaCreatures += FishingTracker.werewolfs; - LootTracker.phantomFishers = 0; + FishingTracker.phantomFishers = 0; if (statsObject.has("kills_phantom_fisherman")) { - LootTracker.phantomFishers = statsObject.get("kills_phantom_fisherman").getAsInt(); + FishingTracker.phantomFishers = statsObject.get("kills_phantom_fisherman").getAsInt(); } - LootTracker.seaCreatures += LootTracker.phantomFishers; + FishingTracker.seaCreatures += FishingTracker.phantomFishers; - LootTracker.grimReapers = 0; + FishingTracker.grimReapers = 0; if (statsObject.has("kills_grim_reaper")) { - LootTracker.grimReapers = statsObject.get("kills_grim_reaper").getAsInt(); + FishingTracker.grimReapers = statsObject.get("kills_grim_reaper").getAsInt(); } - LootTracker.seaCreatures += LootTracker.grimReapers; + FishingTracker.seaCreatures += FishingTracker.grimReapers; System.out.println("Writing to config..."); - ConfigHandler.writeIntConfig("fishing", "goodCatch", LootTracker.goodCatches); - ConfigHandler.writeIntConfig("fishing", "greatCatch", LootTracker.greatCatches); - ConfigHandler.writeIntConfig("fishing", "seaCreature", LootTracker.seaCreatures); - ConfigHandler.writeIntConfig("fishing", "squid", LootTracker.squids); - ConfigHandler.writeIntConfig("fishing", "seaWalker", LootTracker.seaWalkers); - ConfigHandler.writeIntConfig("fishing", "nightSquid", LootTracker.nightSquids); - ConfigHandler.writeIntConfig("fishing", "seaGuardian", LootTracker.seaGuardians); - ConfigHandler.writeIntConfig("fishing", "seaWitch", LootTracker.seaWitches); - ConfigHandler.writeIntConfig("fishing", "seaArcher", LootTracker.seaArchers); - ConfigHandler.writeIntConfig("fishing", "monsterOfDeep", LootTracker.monsterOfTheDeeps); - ConfigHandler.writeIntConfig("fishing", "catfish", LootTracker.catfishes); - ConfigHandler.writeIntConfig("fishing", "carrotKing", LootTracker.carrotKings); - ConfigHandler.writeIntConfig("fishing", "seaLeech", LootTracker.seaLeeches); - ConfigHandler.writeIntConfig("fishing", "guardianDefender", LootTracker.guardianDefenders); - ConfigHandler.writeIntConfig("fishing", "deepSeaProtector", LootTracker.deepSeaProtectors); - ConfigHandler.writeIntConfig("fishing", "hydra", LootTracker.hydras); - ConfigHandler.writeIntConfig("fishing", "seaEmperor", LootTracker.seaEmperors); - ConfigHandler.writeIntConfig("fishing", "milestone", LootTracker.fishingMilestone); - ConfigHandler.writeIntConfig("fishing", "frozenSteve", LootTracker.frozenSteves); - ConfigHandler.writeIntConfig("fishing", "snowman", LootTracker.frostyTheSnowmans); - ConfigHandler.writeIntConfig("fishing", "grinch", LootTracker.grinches); - ConfigHandler.writeIntConfig("fishing", "yeti", LootTracker.yetis); - ConfigHandler.writeIntConfig("fishing", "nurseShark", LootTracker.nurseSharks); - ConfigHandler.writeIntConfig("fishing", "blueShark", LootTracker.blueSharks); - ConfigHandler.writeIntConfig("fishing", "tigerShark", LootTracker.tigerSharks); - ConfigHandler.writeIntConfig("fishing", "greatWhiteShark", LootTracker.greatWhiteSharks); - ConfigHandler.writeIntConfig("fishing", "scarecrow", LootTracker.scarecrows); - ConfigHandler.writeIntConfig("fishing", "nightmare", LootTracker.nightmares); - ConfigHandler.writeIntConfig("fishing", "werewolf", LootTracker.werewolfs); - ConfigHandler.writeIntConfig("fishing", "phantomFisher", LootTracker.phantomFishers); - ConfigHandler.writeIntConfig("fishing", "grimReaper", LootTracker.grimReapers); + ConfigHandler.writeIntConfig("fishing", "goodCatch", FishingTracker.goodCatches); + ConfigHandler.writeIntConfig("fishing", "greatCatch", FishingTracker.greatCatches); + ConfigHandler.writeIntConfig("fishing", "seaCreature", FishingTracker.seaCreatures); + ConfigHandler.writeIntConfig("fishing", "squid", FishingTracker.squids); + ConfigHandler.writeIntConfig("fishing", "seaWalker", FishingTracker.seaWalkers); + ConfigHandler.writeIntConfig("fishing", "nightSquid", FishingTracker.nightSquids); + ConfigHandler.writeIntConfig("fishing", "seaGuardian", FishingTracker.seaGuardians); + ConfigHandler.writeIntConfig("fishing", "seaWitch", FishingTracker.seaWitches); + ConfigHandler.writeIntConfig("fishing", "seaArcher", FishingTracker.seaArchers); + ConfigHandler.writeIntConfig("fishing", "monsterOfDeep", FishingTracker.monsterOfTheDeeps); + ConfigHandler.writeIntConfig("fishing", "catfish", FishingTracker.catfishes); + ConfigHandler.writeIntConfig("fishing", "carrotKing", FishingTracker.carrotKings); + ConfigHandler.writeIntConfig("fishing", "seaLeech", FishingTracker.seaLeeches); + ConfigHandler.writeIntConfig("fishing", "guardianDefender", FishingTracker.guardianDefenders); + ConfigHandler.writeIntConfig("fishing", "deepSeaProtector", FishingTracker.deepSeaProtectors); + ConfigHandler.writeIntConfig("fishing", "hydra", FishingTracker.hydras); + ConfigHandler.writeIntConfig("fishing", "seaEmperor", FishingTracker.seaEmperors); + ConfigHandler.writeIntConfig("fishing", "milestone", FishingTracker.fishingMilestone); + ConfigHandler.writeIntConfig("fishing", "frozenSteve", FishingTracker.frozenSteves); + ConfigHandler.writeIntConfig("fishing", "snowman", FishingTracker.frostyTheSnowmans); + ConfigHandler.writeIntConfig("fishing", "grinch", FishingTracker.grinches); + ConfigHandler.writeIntConfig("fishing", "yeti", FishingTracker.yetis); + ConfigHandler.writeIntConfig("fishing", "nurseShark", FishingTracker.nurseSharks); + ConfigHandler.writeIntConfig("fishing", "blueShark", FishingTracker.blueSharks); + ConfigHandler.writeIntConfig("fishing", "tigerShark", FishingTracker.tigerSharks); + ConfigHandler.writeIntConfig("fishing", "greatWhiteShark", FishingTracker.greatWhiteSharks); + ConfigHandler.writeIntConfig("fishing", "scarecrow", FishingTracker.scarecrows); + ConfigHandler.writeIntConfig("fishing", "nightmare", FishingTracker.nightmares); + ConfigHandler.writeIntConfig("fishing", "werewolf", FishingTracker.werewolfs); + ConfigHandler.writeIntConfig("fishing", "phantomFisher", FishingTracker.phantomFishers); + ConfigHandler.writeIntConfig("fishing", "grimReaper", FishingTracker.grimReapers); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Fishing stats imported.")); }).start(); diff --git a/src/main/java/me/Danker/commands/LootCommand.java b/src/main/java/me/Danker/commands/LootCommand.java index d0b4272..40b215d 100644 --- a/src/main/java/me/Danker/commands/LootCommand.java +++ b/src/main/java/me/Danker/commands/LootCommand.java @@ -1,7 +1,7 @@ package me.Danker.commands; import me.Danker.DankersSkyblockMod; -import me.Danker.features.loot.LootTracker; +import me.Danker.features.loot.*; import me.Danker.utils.Utils; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; @@ -71,292 +71,292 @@ public class LootCommand extends CommandBase { switch (arg1[0].toLowerCase()) { case "wolf": if (showSession) { - if (LootTracker.wolfTimeSession == -1) { + if (WolfTracker.wolfTimeSession == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.wolfTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(WolfTracker.wolfTimeSession, timeNow); } - if (LootTracker.wolfBossesSession == -1) { + if (WolfTracker.wolfBossesSession == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.wolfBossesSession); + bossesBetween = nf.format(WolfTracker.wolfBossesSession); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(LootTracker.wolfWheelsSession); + drop20 = nf.format(WolfTracker.wolfWheelsSession); } else { - drop20 = nf.format(LootTracker.wolfWheelsDropsSession) + " times"; + drop20 = nf.format(WolfTracker.wolfWheelsDropsSession) + " times"; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.DARK_AQUA + EnumChatFormatting.BOLD + " Sven Loot Summary (Current Session):\n" + - EnumChatFormatting.GOLD + " Svens Killed: " + nf.format(LootTracker.wolfSvensSession) + "\n" + - EnumChatFormatting.GREEN + " Wolf Teeth: " + nf.format(LootTracker.wolfTeethSession) + "\n" + + EnumChatFormatting.GOLD + " Svens Killed: " + nf.format(WolfTracker.wolfSvensSession) + "\n" + + EnumChatFormatting.GREEN + " Wolf Teeth: " + nf.format(WolfTracker.wolfTeethSession) + "\n" + EnumChatFormatting.BLUE + " Hamster Wheels: " + drop20 + "\n" + - EnumChatFormatting.AQUA + " Spirit Runes: " + LootTracker.wolfSpiritsSession + "\n" + - EnumChatFormatting.WHITE + " Critical VI Books: " + LootTracker.wolfBooksSession + "\n" + - EnumChatFormatting.DARK_RED + " Red Claw Eggs: " + LootTracker.wolfEggsSession + "\n" + - EnumChatFormatting.GOLD + " Couture Runes: " + LootTracker.wolfCouturesSession + "\n" + - EnumChatFormatting.AQUA + " Grizzly Baits: " + LootTracker.wolfBaitsSession + "\n" + - EnumChatFormatting.DARK_PURPLE + " Overfluxes: " + LootTracker.wolfFluxesSession + "\n" + + EnumChatFormatting.AQUA + " Spirit Runes: " + WolfTracker.wolfSpiritsSession + "\n" + + EnumChatFormatting.WHITE + " Critical VI Books: " + WolfTracker.wolfBooksSession + "\n" + + EnumChatFormatting.DARK_RED + " Red Claw Eggs: " + WolfTracker.wolfEggsSession + "\n" + + EnumChatFormatting.GOLD + " Couture Runes: " + WolfTracker.wolfCouturesSession + "\n" + + EnumChatFormatting.AQUA + " Grizzly Baits: " + WolfTracker.wolfBaitsSession + "\n" + + EnumChatFormatting.DARK_PURPLE + " Overfluxes: " + WolfTracker.wolfFluxesSession + "\n" + EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " -------------------")); return; } - if (LootTracker.wolfTime == -1) { + if (WolfTracker.wolfTime == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.wolfTime, timeNow); + timeBetween = Utils.getTimeBetween(WolfTracker.wolfTime, timeNow); } - if (LootTracker.wolfBosses == -1) { + if (WolfTracker.wolfBosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.wolfBosses); + bossesBetween = nf.format(WolfTracker.wolfBosses); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(LootTracker.wolfWheels); + drop20 = nf.format(WolfTracker.wolfWheels); } else { - drop20 = nf.format(LootTracker.wolfWheelsDrops) + " times"; + drop20 = nf.format(WolfTracker.wolfWheelsDrops) + " times"; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.DARK_AQUA + EnumChatFormatting.BOLD + " Sven Loot Summary:\n" + - EnumChatFormatting.GOLD + " Svens Killed: " + nf.format(LootTracker.wolfSvens) + "\n" + - EnumChatFormatting.GREEN + " Wolf Teeth: " + nf.format(LootTracker.wolfTeeth) + "\n" + + EnumChatFormatting.GOLD + " Svens Killed: " + nf.format(WolfTracker.wolfSvens) + "\n" + + EnumChatFormatting.GREEN + " Wolf Teeth: " + nf.format(WolfTracker.wolfTeeth) + "\n" + EnumChatFormatting.BLUE + " Hamster Wheels: " + drop20 + "\n" + - EnumChatFormatting.AQUA + " Spirit Runes: " + LootTracker.wolfSpirits + "\n" + - EnumChatFormatting.WHITE + " Critical VI Books: " + LootTracker.wolfBooks + "\n" + - EnumChatFormatting.DARK_RED + " Red Claw Eggs: " + LootTracker.wolfEggs + "\n" + - EnumChatFormatting.GOLD + " Couture Runes: " + LootTracker.wolfCoutures + "\n" + - EnumChatFormatting.AQUA + " Grizzly Baits: " + LootTracker.wolfBaits + "\n" + - EnumChatFormatting.DARK_PURPLE + " Overfluxes: " + LootTracker.wolfFluxes + "\n" + + EnumChatFormatting.AQUA + " Spirit Runes: " + WolfTracker.wolfSpirits + "\n" + + EnumChatFormatting.WHITE + " Critical VI Books: " + WolfTracker.wolfBooks + "\n" + + EnumChatFormatting.DARK_RED + " Red Claw Eggs: " + WolfTracker.wolfEggs + "\n" + + EnumChatFormatting.GOLD + " Couture Runes: " + WolfTracker.wolfCoutures + "\n" + + EnumChatFormatting.AQUA + " Grizzly Baits: " + WolfTracker.wolfBaits + "\n" + + EnumChatFormatting.DARK_PURPLE + " Overfluxes: " + WolfTracker.wolfFluxes + "\n" + EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " -------------------")); break; case "spider": if (showSession) { - if (LootTracker.spiderTimeSession == -1) { + if (SpiderTracker.spiderTimeSession == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.spiderTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(SpiderTracker.spiderTimeSession, timeNow); } - if (LootTracker.spiderBossesSession == -1) { + if (SpiderTracker.spiderBossesSession == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.spiderBossesSession); + bossesBetween = nf.format(SpiderTracker.spiderBossesSession); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(LootTracker.spiderTAPSession); + drop20 = nf.format(SpiderTracker.spiderTAPSession); } else { - drop20 = nf.format(LootTracker.spiderTAPDropsSession) + " times"; + drop20 = nf.format(SpiderTracker.spiderTAPDropsSession) + " times"; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " Spider Loot Summary (Current Session):\n" + - EnumChatFormatting.GOLD + " Tarantulas Killed: " + nf.format(LootTracker.spiderTarantulasSession) + "\n" + - EnumChatFormatting.GREEN + " Tarantula Webs: " + nf.format(LootTracker.spiderWebsSession) + "\n" + + EnumChatFormatting.GOLD + " Tarantulas Killed: " + nf.format(SpiderTracker.spiderTarantulasSession) + "\n" + + EnumChatFormatting.GREEN + " Tarantula Webs: " + nf.format(SpiderTracker.spiderWebsSession) + "\n" + EnumChatFormatting.DARK_GREEN + " Arrow Poison: " + drop20 + "\n" + - EnumChatFormatting.DARK_GRAY + " Bite Runes: " + LootTracker.spiderBitesSession + "\n" + - EnumChatFormatting.WHITE + " Bane VI Books: " + LootTracker.spiderBooksSession + "\n" + - EnumChatFormatting.AQUA + " Spider Catalysts: " + LootTracker.spiderCatalystsSession + "\n" + - EnumChatFormatting.DARK_PURPLE + " Tarantula Talismans: " + LootTracker.spiderTalismansSession + "\n" + - EnumChatFormatting.LIGHT_PURPLE + " Fly Swatters: " + LootTracker.spiderSwattersSession + "\n" + - EnumChatFormatting.GOLD + " Digested Mosquitos: " + LootTracker.spiderMosquitosSession + "\n" + + EnumChatFormatting.DARK_GRAY + " Bite Runes: " + SpiderTracker.spiderBitesSession + "\n" + + EnumChatFormatting.WHITE + " Bane VI Books: " + SpiderTracker.spiderBooksSession + "\n" + + EnumChatFormatting.AQUA + " Spider Catalysts: " + SpiderTracker.spiderCatalystsSession + "\n" + + EnumChatFormatting.DARK_PURPLE + " Tarantula Talismans: " + SpiderTracker.spiderTalismansSession + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Fly Swatters: " + SpiderTracker.spiderSwattersSession + "\n" + + EnumChatFormatting.GOLD + " Digested Mosquitos: " + SpiderTracker.spiderMosquitosSession + "\n" + EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " -------------------")); return; } - if (LootTracker.spiderTime == -1) { + if (SpiderTracker.spiderTime == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.spiderTime, timeNow); + timeBetween = Utils.getTimeBetween(SpiderTracker.spiderTime, timeNow); } - if (LootTracker.spiderBosses == -1) { + if (SpiderTracker.spiderBosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.spiderBosses); + bossesBetween = nf.format(SpiderTracker.spiderBosses); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(LootTracker.spiderTAP); + drop20 = nf.format(SpiderTracker.spiderTAP); } else { - drop20 = nf.format(LootTracker.spiderTAPDrops) + " times"; + drop20 = nf.format(SpiderTracker.spiderTAPDrops) + " times"; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " Spider Loot Summary:\n" + - EnumChatFormatting.GOLD + " Tarantulas Killed: " + nf.format(LootTracker.spiderTarantulas) + "\n" + - EnumChatFormatting.GREEN + " Tarantula Webs: " + nf.format(LootTracker.spiderWebs) + "\n" + + EnumChatFormatting.GOLD + " Tarantulas Killed: " + nf.format(SpiderTracker.spiderTarantulas) + "\n" + + EnumChatFormatting.GREEN + " Tarantula Webs: " + nf.format(SpiderTracker.spiderWebs) + "\n" + EnumChatFormatting.DARK_GREEN + " Arrow Poison: " + drop20 + "\n" + - EnumChatFormatting.DARK_GRAY + " Bite Runes: " + LootTracker.spiderBites + "\n" + - EnumChatFormatting.WHITE + " Bane VI Books: " + LootTracker.spiderBooks + "\n" + - EnumChatFormatting.AQUA + " Spider Catalysts: " + LootTracker.spiderCatalysts + "\n" + - EnumChatFormatting.DARK_PURPLE + " Tarantula Talismans: " + LootTracker.spiderTalismans + "\n" + - EnumChatFormatting.LIGHT_PURPLE + " Fly Swatters: " + LootTracker.spiderSwatters + "\n" + - EnumChatFormatting.GOLD + " Digested Mosquitos: " + LootTracker.spiderMosquitos + "\n" + + EnumChatFormatting.DARK_GRAY + " Bite Runes: " + SpiderTracker.spiderBites + "\n" + + EnumChatFormatting.WHITE + " Bane VI Books: " + SpiderTracker.spiderBooks + "\n" + + EnumChatFormatting.AQUA + " Spider Catalysts: " + SpiderTracker.spiderCatalysts + "\n" + + EnumChatFormatting.DARK_PURPLE + " Tarantula Talismans: " + SpiderTracker.spiderTalismans + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Fly Swatters: " + SpiderTracker.spiderSwatters + "\n" + + EnumChatFormatting.GOLD + " Digested Mosquitos: " + SpiderTracker.spiderMosquitos + "\n" + EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " -------------------")); break; case "zombie": if (showSession) { - if (LootTracker.zombieTimeSession == -1) { + if (ZombieTracker.zombieTimeSession == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.zombieTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(ZombieTracker.zombieTimeSession, timeNow); } - if (LootTracker.zombieBossesSession == -1) { + if (ZombieTracker.zombieBossesSession == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.zombieBossesSession); + bossesBetween = nf.format(ZombieTracker.zombieBossesSession); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(LootTracker.zombieFoulFleshSession); + drop20 = nf.format(ZombieTracker.zombieFoulFleshSession); } else { - drop20 = nf.format(LootTracker.zombieFoulFleshDropsSession) + " times"; + drop20 = nf.format(ZombieTracker.zombieFoulFleshDropsSession) + " times"; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD + " Zombie Loot Summary (Current Session):\n" + - EnumChatFormatting.GOLD + " Revs Killed: " + nf.format(LootTracker.zombieRevsSession) + "\n" + - EnumChatFormatting.GREEN + " Revenant Flesh: " + nf.format(LootTracker.zombieRevFleshSession) + "\n" + - EnumChatFormatting.GREEN + " Revenant Viscera: " + nf.format(LootTracker.zombieRevVisceraSession) + "\n" + + EnumChatFormatting.GOLD + " Revs Killed: " + nf.format(ZombieTracker.zombieRevsSession) + "\n" + + EnumChatFormatting.GREEN + " Revenant Flesh: " + nf.format(ZombieTracker.zombieRevFleshSession) + "\n" + + EnumChatFormatting.GREEN + " Revenant Viscera: " + nf.format(ZombieTracker.zombieRevVisceraSession) + "\n" + EnumChatFormatting.BLUE + " Foul Flesh: " + drop20 + "\n" + - EnumChatFormatting.DARK_GREEN + " Pestilence Runes: " +LootTracker.zombiePestilencesSession + "\n" + - EnumChatFormatting.WHITE + " Smite VI Books: " + LootTracker.zombieBooksSession + "\n" + - EnumChatFormatting.AQUA + " Undead Catalysts: " + LootTracker.zombieUndeadCatasSession + "\n" + - EnumChatFormatting.DARK_PURPLE + " Beheaded Horrors: " + LootTracker.zombieBeheadedsSession + "\n" + - EnumChatFormatting.RED + " Revenant Catalysts: " + LootTracker.zombieRevCatasSession + "\n" + - EnumChatFormatting.DARK_GREEN + " Snake Runes: " + LootTracker.zombieSnakesSession + "\n" + - EnumChatFormatting.GOLD + " Scythe Blades: " + LootTracker.zombieScythesSession + "\n" + - EnumChatFormatting.RED + " Shard of the Shreddeds: " + LootTracker.zombieShardsSession + "\n" + - EnumChatFormatting.RED + " Warden Hearts: " + LootTracker.zombieWardenHeartsSession + "\n" + + EnumChatFormatting.DARK_GREEN + " Pestilence Runes: " +ZombieTracker.zombiePestilencesSession + "\n" + + EnumChatFormatting.WHITE + " Smite VI Books: " + ZombieTracker.zombieBooksSession + "\n" + + EnumChatFormatting.AQUA + " Undead Catalysts: " + ZombieTracker.zombieUndeadCatasSession + "\n" + + EnumChatFormatting.DARK_PURPLE + " Beheaded Horrors: " + ZombieTracker.zombieBeheadedsSession + "\n" + + EnumChatFormatting.RED + " Revenant Catalysts: " + ZombieTracker.zombieRevCatasSession + "\n" + + EnumChatFormatting.DARK_GREEN + " Snake Runes: " + ZombieTracker.zombieSnakesSession + "\n" + + EnumChatFormatting.GOLD + " Scythe Blades: " + ZombieTracker.zombieScythesSession + "\n" + + EnumChatFormatting.RED + " Shard of the Shreddeds: " + ZombieTracker.zombieShardsSession + "\n" + + EnumChatFormatting.RED + " Warden Hearts: " + ZombieTracker.zombieWardenHeartsSession + "\n" + EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + EnumChatFormatting.GREEN + EnumChatFormatting.BOLD + " -------------------")); return; } - if (LootTracker.zombieTime == -1) { + if (ZombieTracker.zombieTime == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.zombieTime, timeNow); + timeBetween = Utils.getTimeBetween(ZombieTracker.zombieTime, timeNow); } - if (LootTracker.zombieBosses == -1) { + if (ZombieTracker.zombieBosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.zombieBosses); + bossesBetween = nf.format(ZombieTracker.zombieBosses); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(LootTracker.zombieFoulFlesh); + drop20 = nf.format(ZombieTracker.zombieFoulFlesh); } else { - drop20 = nf.format(LootTracker.zombieFoulFleshDrops) + " times"; + drop20 = nf.format(ZombieTracker.zombieFoulFleshDrops) + " times"; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD + " Zombie Loot Summary:\n" + - EnumChatFormatting.GOLD + " Revs Killed: " + nf.format(LootTracker.zombieRevs) + "\n" + - EnumChatFormatting.GREEN + " Revenant Flesh: " + nf.format(LootTracker.zombieRevFlesh) + "\n" + - EnumChatFormatting.GREEN + " Revenant Viscera: " + nf.format(LootTracker.zombieRevViscera) + "\n" + + EnumChatFormatting.GOLD + " Revs Killed: " + nf.format(ZombieTracker.zombieRevs) + "\n" + + EnumChatFormatting.GREEN + " Revenant Flesh: " + nf.format(ZombieTracker.zombieRevFlesh) + "\n" + + EnumChatFormatting.GREEN + " Revenant Viscera: " + nf.format(ZombieTracker.zombieRevViscera) + "\n" + EnumChatFormatting.BLUE + " Foul Flesh: " + drop20 + "\n" + - EnumChatFormatting.DARK_GREEN + " Pestilence Runes: " + LootTracker.zombiePestilences + "\n" + - EnumChatFormatting.WHITE + " Smite VI Books: " + LootTracker.zombieBooks + "\n" + - EnumChatFormatting.AQUA + " Undead Catalysts: " + LootTracker.zombieUndeadCatas + "\n" + - EnumChatFormatting.DARK_PURPLE + " Beheaded Horrors: " + LootTracker.zombieBeheadeds + "\n" + - EnumChatFormatting.RED + " Revenant Catalysts: " + LootTracker.zombieRevCatas + "\n" + - EnumChatFormatting.DARK_GREEN + " Snake Runes: " + LootTracker.zombieSnakes + "\n" + - EnumChatFormatting.GOLD + " Scythe Blades: " + LootTracker.zombieScythes + "\n" + - EnumChatFormatting.RED + " Shard of the Shreddeds: " + LootTracker.zombieShards + "\n" + - EnumChatFormatting.RED + " Warden Hearts: " + LootTracker.zombieWardenHearts + "\n" + + EnumChatFormatting.DARK_GREEN + " Pestilence Runes: " + ZombieTracker.zombiePestilences + "\n" + + EnumChatFormatting.WHITE + " Smite VI Books: " + ZombieTracker.zombieBooks + "\n" + + EnumChatFormatting.AQUA + " Undead Catalysts: " + ZombieTracker.zombieUndeadCatas + "\n" + + EnumChatFormatting.DARK_PURPLE + " Beheaded Horrors: " + ZombieTracker.zombieBeheadeds + "\n" + + EnumChatFormatting.RED + " Revenant Catalysts: " + ZombieTracker.zombieRevCatas + "\n" + + EnumChatFormatting.DARK_GREEN + " Snake Runes: " + ZombieTracker.zombieSnakes + "\n" + + EnumChatFormatting.GOLD + " Scythe Blades: " + ZombieTracker.zombieScythes + "\n" + + EnumChatFormatting.RED + " Shard of the Shreddeds: " + ZombieTracker.zombieShards + "\n" + + EnumChatFormatting.RED + " Warden Hearts: " + ZombieTracker.zombieWardenHearts + "\n" + EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + EnumChatFormatting.GREEN + EnumChatFormatting.BOLD + " -------------------")); break; case "enderman": if (showSession) { - if (LootTracker.endermanTimeSession == -1) { + if (EndermanTracker.endermanTimeSession == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.endermanTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(EndermanTracker.endermanTimeSession, timeNow); } - if (LootTracker.endermanBossesSession == -1) { + if (EndermanTracker.endermanBossesSession == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.endermanBossesSession); + bossesBetween = nf.format(EndermanTracker.endermanBossesSession); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(LootTracker.endermanTAPSession); + drop20 = nf.format(EndermanTracker.endermanTAPSession); } else { - drop20 = nf.format(LootTracker.endermanTAPDropsSession) + " times"; + drop20 = nf.format(EndermanTracker.endermanTAPDropsSession) + " times"; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD + " Enderman Loot Summary (Current Session):\n" + - EnumChatFormatting.GOLD + " Voidglooms Killed: " + nf.format(LootTracker.endermanVoidgloomsSession) + "\n" + - EnumChatFormatting.DARK_GRAY + " Null Spheres: " + nf.format(LootTracker.endermanNullSpheresSession) + "\n" + + EnumChatFormatting.GOLD + " Voidglooms Killed: " + nf.format(EndermanTracker.endermanVoidgloomsSession) + "\n" + + EnumChatFormatting.DARK_GRAY + " Null Spheres: " + nf.format(EndermanTracker.endermanNullSpheresSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " Arrow Poison: " + drop20 + "\n" + - EnumChatFormatting.LIGHT_PURPLE + " Endersnake Runes: " + LootTracker.endermanEndersnakesSession + "\n" + - EnumChatFormatting.DARK_GREEN + " Summoning Eyes: " + LootTracker.endermanSummoningEyesSession + "\n" + - EnumChatFormatting.AQUA + " Mana Steal Books: " + LootTracker.endermanManaBooksSession + "\n" + - EnumChatFormatting.BLUE + " Transmission Tuners: " + LootTracker.endermanTunersSession + "\n" + - EnumChatFormatting.YELLOW + " Null Atoms: " + LootTracker.endermanAtomsSession + "\n" + - EnumChatFormatting.AQUA + " Espresso Machines: " + LootTracker.endermanEspressoMachinesSession + "\n" + - EnumChatFormatting.WHITE + " Smarty Pants Books: " + LootTracker.endermanSmartyBooksSession + "\n" + - EnumChatFormatting.LIGHT_PURPLE + " End Runes: " + LootTracker.endermanEndRunesSession + "\n" + - EnumChatFormatting.RED + " Blood Chalices: " + LootTracker.endermanChalicesSession + "\n" + - EnumChatFormatting.RED + " Sinful Dice: " + LootTracker.endermanDiceSession + "\n" + - EnumChatFormatting.DARK_PURPLE + " Artifact Upgrader: " + LootTracker.endermanArtifactsSession + "\n" + - EnumChatFormatting.DARK_PURPLE + " Enderman Skins: " + LootTracker.endermanSkinsSession + "\n" + - EnumChatFormatting.GRAY + " Enchant Runes: " + LootTracker.endermanEnchantRunesSession + "\n" + - EnumChatFormatting.GOLD + " Etherwarp Mergers: " + LootTracker.endermanMergersSession + "\n" + - EnumChatFormatting.GOLD + " Judgement Cores: " + LootTracker.endermanCoresSession + "\n" + - EnumChatFormatting.RED + " Ender Slayer VII Books: " + LootTracker.endermanEnderBooksSession + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Endersnake Runes: " + EndermanTracker.endermanEndersnakesSession + "\n" + + EnumChatFormatting.DARK_GREEN + " Summoning Eyes: " + EndermanTracker.endermanSummoningEyesSession + "\n" + + EnumChatFormatting.AQUA + " Mana Steal Books: " + EndermanTracker.endermanManaBooksSession + "\n" + + EnumChatFormatting.BLUE + " Transmission Tuners: " + EndermanTracker.endermanTunersSession + "\n" + + EnumChatFormatting.YELLOW + " Null Atoms: " + EndermanTracker.endermanAtomsSession + "\n" + + EnumChatFormatting.AQUA + " Espresso Machines: " + EndermanTracker.endermanEspressoMachinesSession + "\n" + + EnumChatFormatting.WHITE + " Smarty Pants Books: " + EndermanTracker.endermanSmartyBooksSession + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " End Runes: " + EndermanTracker.endermanEndRunesSession + "\n" + + EnumChatFormatting.RED + " Blood Chalices: " + EndermanTracker.endermanChalicesSession + "\n" + + EnumChatFormatting.RED + " Sinful Dice: " + EndermanTracker.endermanDiceSession + "\n" + + EnumChatFormatting.DARK_PURPLE + " Artifact Upgrader: " + EndermanTracker.endermanArtifactsSession + "\n" + + EnumChatFormatting.DARK_PURPLE + " Enderman Skins: " + EndermanTracker.endermanSkinsSession + "\n" + + EnumChatFormatting.GRAY + " Enchant Runes: " + EndermanTracker.endermanEnchantRunesSession + "\n" + + EnumChatFormatting.GOLD + " Etherwarp Mergers: " + EndermanTracker.endermanMergersSession + "\n" + + EnumChatFormatting.GOLD + " Judgement Cores: " + EndermanTracker.endermanCoresSession + "\n" + + EnumChatFormatting.RED + " Ender Slayer VII Books: " + EndermanTracker.endermanEnderBooksSession + "\n" + EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + EnumChatFormatting.DARK_PURPLE + EnumChatFormatting.BOLD + " -------------------")); return; } - if (LootTracker.endermanTime == -1) { + if (EndermanTracker.endermanTime == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.endermanTime, timeNow); + timeBetween = Utils.getTimeBetween(EndermanTracker.endermanTime, timeNow); } - if (LootTracker.endermanBosses == -1) { + if (EndermanTracker.endermanBosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.endermanBosses); + bossesBetween = nf.format(EndermanTracker.endermanBosses); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(LootTracker.endermanTAP); + drop20 = nf.format(EndermanTracker.endermanTAP); } else { - drop20 = nf.format(LootTracker.endermanTAPDrops) + " times"; + drop20 = nf.format(EndermanTracker.endermanTAPDrops) + " times"; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD + " Enderman Loot Summary:\n" + - EnumChatFormatting.GOLD + " Voidglooms Killed: " + nf.format(LootTracker.endermanVoidglooms) + "\n" + - EnumChatFormatting.DARK_GRAY + " Null Spheres: " + nf.format(LootTracker.endermanNullSpheres) + "\n" + + EnumChatFormatting.GOLD + " Voidglooms Killed: " + nf.format(EndermanTracker.endermanVoidglooms) + "\n" + + EnumChatFormatting.DARK_GRAY + " Null Spheres: " + nf.format(EndermanTracker.endermanNullSpheres) + "\n" + EnumChatFormatting.DARK_PURPLE + " Arrow Poison: " + drop20 + "\n" + - EnumChatFormatting.LIGHT_PURPLE + " Endersnake Runes: " + LootTracker.endermanEndersnakes + "\n" + - EnumChatFormatting.DARK_GREEN + " Summoning Eyes: " + LootTracker.endermanSummoningEyes + "\n" + - EnumChatFormatting.AQUA + " Mana Steal Books: " + LootTracker.endermanManaBooks + "\n" + - EnumChatFormatting.BLUE + " Transmission Tuners: " + LootTracker.endermanTuners + "\n" + - EnumChatFormatting.YELLOW + " Null Atoms: " + LootTracker.endermanAtoms + "\n" + - EnumChatFormatting.AQUA + " Espresso Machines: " + LootTracker.endermanEspressoMachines + "\n" + - EnumChatFormatting.WHITE + " Smarty Pants Books: " + LootTracker.endermanSmartyBooks + "\n" + - EnumChatFormatting.LIGHT_PURPLE + " End Runes: " + LootTracker.endermanEndRunes + "\n" + - EnumChatFormatting.RED + " Blood Chalices: " + LootTracker.endermanChalices + "\n" + - EnumChatFormatting.RED + " Sinful Dice: " + LootTracker.endermanDice + "\n" + - EnumChatFormatting.DARK_PURPLE + " Artifact Upgrader: " + LootTracker.endermanArtifacts + "\n" + - EnumChatFormatting.DARK_PURPLE + " Enderman Skins: " + LootTracker.endermanSkins + "\n" + - EnumChatFormatting.GRAY + " Enchant Runes: " + LootTracker.endermanEnchantRunes + "\n" + - EnumChatFormatting.GOLD + " Etherwarp Mergers: " + LootTracker.endermanMergers + "\n" + - EnumChatFormatting.GOLD + " Judgement Cores: " + LootTracker.endermanCores + "\n" + - EnumChatFormatting.RED + " Ender Slayer VII Books: " + LootTracker.endermanEnderBooks + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Endersnake Runes: " + EndermanTracker.endermanEndersnakes + "\n" + + EnumChatFormatting.DARK_GREEN + " Summoning Eyes: " + EndermanTracker.endermanSummoningEyes + "\n" + + EnumChatFormatting.AQUA + " Mana Steal Books: " + EndermanTracker.endermanManaBooks + "\n" + + EnumChatFormatting.BLUE + " Transmission Tuners: " + EndermanTracker.endermanTuners + "\n" + + EnumChatFormatting.YELLOW + " Null Atoms: " + EndermanTracker.endermanAtoms + "\n" + + EnumChatFormatting.AQUA + " Espresso Machines: " + EndermanTracker.endermanEspressoMachines + "\n" + + EnumChatFormatting.WHITE + " Smarty Pants Books: " + EndermanTracker.endermanSmartyBooks + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " End Runes: " + EndermanTracker.endermanEndRunes + "\n" + + EnumChatFormatting.RED + " Blood Chalices: " + EndermanTracker.endermanChalices + "\n" + + EnumChatFormatting.RED + " Sinful Dice: " + EndermanTracker.endermanDice + "\n" + + EnumChatFormatting.DARK_PURPLE + " Artifact Upgrader: " + EndermanTracker.endermanArtifacts + "\n" + + EnumChatFormatting.DARK_PURPLE + " Enderman Skins: " + EndermanTracker.endermanSkins + "\n" + + EnumChatFormatting.GRAY + " Enchant Runes: " + EndermanTracker.endermanEnchantRunes + "\n" + + EnumChatFormatting.GOLD + " Etherwarp Mergers: " + EndermanTracker.endermanMergers + "\n" + + EnumChatFormatting.GOLD + " Judgement Cores: " + EndermanTracker.endermanCores + "\n" + + EnumChatFormatting.RED + " Ender Slayer VII Books: " + EndermanTracker.endermanEnderBooks + "\n" + EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + EnumChatFormatting.DARK_PURPLE + EnumChatFormatting.BOLD + " -------------------")); @@ -365,46 +365,46 @@ public class LootCommand extends CommandBase { if (arg1.length > 1) { if (arg1[1].equalsIgnoreCase("winter")) { if (showSession) { - if (LootTracker.yetiTimeSession == -1) { + if (FishingTracker.yetiTimeSession == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.yetiTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(FishingTracker.yetiTimeSession, timeNow); } - if (LootTracker.yetiSCsSession == -1) { + if (FishingTracker.yetiSCsSession == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.yetiSCsSession); + bossesBetween = nf.format(FishingTracker.yetiSCsSession); } player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.WHITE + EnumChatFormatting.BOLD + " Winter Fishing Summary (Current Session):\n" + - EnumChatFormatting.AQUA + " Frozen Steves: " + nf.format(LootTracker.frozenStevesSession) + "\n" + - EnumChatFormatting.WHITE + " Snowmans: " + nf.format(LootTracker.frostyTheSnowmansSession) + "\n" + - EnumChatFormatting.DARK_GREEN + " Grinches: " + nf.format(LootTracker.grinchesSession) + "\n" + - EnumChatFormatting.GOLD + " Yetis: " + nf.format(LootTracker.yetisSession) + "\n" + + EnumChatFormatting.AQUA + " Frozen Steves: " + nf.format(FishingTracker.frozenStevesSession) + "\n" + + EnumChatFormatting.WHITE + " Snowmans: " + nf.format(FishingTracker.frostyTheSnowmansSession) + "\n" + + EnumChatFormatting.DARK_GREEN + " Grinches: " + nf.format(FishingTracker.grinchesSession) + "\n" + + EnumChatFormatting.GOLD + " Yetis: " + nf.format(FishingTracker.yetisSession) + "\n" + EnumChatFormatting.AQUA + " Time Since Yeti: " + timeBetween + "\n" + EnumChatFormatting.AQUA + " Creatures Since Yeti: " + bossesBetween + "\n" + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " -------------------")); return; } - if (LootTracker.yetiTime == -1) { + if (FishingTracker.yetiTime == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.yetiTime, timeNow); + timeBetween = Utils.getTimeBetween(FishingTracker.yetiTime, timeNow); } - if (LootTracker.yetiSCs == -1) { + if (FishingTracker.yetiSCs == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.yetiSCs); + bossesBetween = nf.format(FishingTracker.yetiSCs); } player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.WHITE + EnumChatFormatting.BOLD + " Winter Fishing Summary:\n" + - EnumChatFormatting.AQUA + " Frozen Steves: " + nf.format(LootTracker.frozenSteves) + "\n" + - EnumChatFormatting.WHITE + " Snowmans: " + nf.format(LootTracker.frostyTheSnowmans) + "\n" + - EnumChatFormatting.DARK_GREEN + " Grinches: " + nf.format(LootTracker.grinches) + "\n" + - EnumChatFormatting.GOLD + " Yetis: " + nf.format(LootTracker.yetis) + "\n" + + EnumChatFormatting.AQUA + " Frozen Steves: " + nf.format(FishingTracker.frozenSteves) + "\n" + + EnumChatFormatting.WHITE + " Snowmans: " + nf.format(FishingTracker.frostyTheSnowmans) + "\n" + + EnumChatFormatting.DARK_GREEN + " Grinches: " + nf.format(FishingTracker.grinches) + "\n" + + EnumChatFormatting.GOLD + " Yetis: " + nf.format(FishingTracker.yetis) + "\n" + EnumChatFormatting.AQUA + " Time Since Yeti: " + timeBetween + "\n" + EnumChatFormatting.AQUA + " Creatures Since Yeti: " + bossesBetween + "\n" + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " -------------------")); @@ -413,112 +413,112 @@ public class LootCommand extends CommandBase { if (showSession) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.DARK_BLUE + EnumChatFormatting.BOLD + " Fishing Festival Summary (Current Session):\n" + - EnumChatFormatting.LIGHT_PURPLE + " Nurse Sharks: " + nf.format(LootTracker.nurseSharksSession) + "\n" + - EnumChatFormatting.BLUE + " Blue Sharks: " + nf.format(LootTracker.blueSharksSession) + "\n" + - EnumChatFormatting.GOLD + " Tiger Sharks: " + nf.format(LootTracker.tigerSharksSession) + "\n" + - EnumChatFormatting.WHITE + " Great White Sharks: " + nf.format(LootTracker.greatWhiteSharksSession) + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Nurse Sharks: " + nf.format(FishingTracker.nurseSharksSession) + "\n" + + EnumChatFormatting.BLUE + " Blue Sharks: " + nf.format(FishingTracker.blueSharksSession) + "\n" + + EnumChatFormatting.GOLD + " Tiger Sharks: " + nf.format(FishingTracker.tigerSharksSession) + "\n" + + EnumChatFormatting.WHITE + " Great White Sharks: " + nf.format(FishingTracker.greatWhiteSharksSession) + "\n" + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " -------------------")); return; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.DARK_BLUE + EnumChatFormatting.BOLD + " Fishing Festival Summary:\n" + - EnumChatFormatting.LIGHT_PURPLE + " Nurse Sharks: " + nf.format(LootTracker.nurseSharks) + "\n" + - EnumChatFormatting.BLUE + " Blue Sharks: " + nf.format(LootTracker.blueSharks) + "\n" + - EnumChatFormatting.GOLD + " Tiger Sharks: " + nf.format(LootTracker.tigerSharks) + "\n" + - EnumChatFormatting.WHITE + " Great White Sharks: " + nf.format(LootTracker.greatWhiteSharks) + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Nurse Sharks: " + nf.format(FishingTracker.nurseSharks) + "\n" + + EnumChatFormatting.BLUE + " Blue Sharks: " + nf.format(FishingTracker.blueSharks) + "\n" + + EnumChatFormatting.GOLD + " Tiger Sharks: " + nf.format(FishingTracker.tigerSharks) + "\n" + + EnumChatFormatting.WHITE + " Great White Sharks: " + nf.format(FishingTracker.greatWhiteSharks) + "\n" + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " -------------------")); } else if (arg1[1].equalsIgnoreCase("spooky")) { if (showSession) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.GOLD + EnumChatFormatting.BOLD + " Spooky Fishing Summary (Current Session):\n" + - EnumChatFormatting.BLUE + " Scarecrows: " + nf.format(LootTracker.scarecrowsSession) + "\n" + - EnumChatFormatting.GRAY + " Nightmares: " + nf.format(LootTracker.nightmaresSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Werewolves: " + nf.format(LootTracker.werewolfsSession) + "\n" + - EnumChatFormatting.GOLD + " Phantom Fishers: " + nf.format(LootTracker.phantomFishersSession) + "\n" + - EnumChatFormatting.GOLD + " Grim Reapers: " + nf.format(LootTracker.grimReapersSession) + "\n" + + EnumChatFormatting.BLUE + " Scarecrows: " + nf.format(FishingTracker.scarecrowsSession) + "\n" + + EnumChatFormatting.GRAY + " Nightmares: " + nf.format(FishingTracker.nightmaresSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Werewolves: " + nf.format(FishingTracker.werewolfsSession) + "\n" + + EnumChatFormatting.GOLD + " Phantom Fishers: " + nf.format(FishingTracker.phantomFishersSession) + "\n" + + EnumChatFormatting.GOLD + " Grim Reapers: " + nf.format(FishingTracker.grimReapersSession) + "\n" + EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------")); return; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.GOLD + EnumChatFormatting.BOLD + " Spooky Fishing Summary:\n" + - EnumChatFormatting.BLUE + " Scarecrows: " + nf.format(LootTracker.scarecrows) + "\n" + - EnumChatFormatting.GRAY + " Nightmares: " + nf.format(LootTracker.nightmares) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Werewolves: " + nf.format(LootTracker.werewolfs) + "\n" + - EnumChatFormatting.GOLD + " Phantom Fishers: " + nf.format(LootTracker.phantomFishers) + "\n" + - EnumChatFormatting.GOLD + " Grim Reapers: " + nf.format(LootTracker.grimReapers) + "\n" + + EnumChatFormatting.BLUE + " Scarecrows: " + nf.format(FishingTracker.scarecrows) + "\n" + + EnumChatFormatting.GRAY + " Nightmares: " + nf.format(FishingTracker.nightmares) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Werewolves: " + nf.format(FishingTracker.werewolfs) + "\n" + + EnumChatFormatting.GOLD + " Phantom Fishers: " + nf.format(FishingTracker.phantomFishers) + "\n" + + EnumChatFormatting.GOLD + " Grim Reapers: " + nf.format(FishingTracker.grimReapers) + "\n" + EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------")); } } if (showSession) { - if (LootTracker.empTimeSession == -1) { + if (FishingTracker.empTimeSession == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.empTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(FishingTracker.empTimeSession, timeNow); } - if (LootTracker.empSCsSession == -1) { + if (FishingTracker.empSCsSession == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.empSCsSession); + bossesBetween = nf.format(FishingTracker.empSCsSession); } player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " Fishing Summary (Current Session):\n" + - EnumChatFormatting.AQUA + " Sea Creatures Caught: " + nf.format(LootTracker.seaCreaturesSession) + "\n" + - EnumChatFormatting.GOLD + " Good Catches: " + nf.format(LootTracker.goodCatchesSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Great Catches: " + nf.format(LootTracker.greatCatchesSession) + "\n\n" + - EnumChatFormatting.GRAY + " Squids: " + nf.format(LootTracker.squidsSession) + "\n" + - EnumChatFormatting.GREEN + " Sea Walkers: " + nf.format(LootTracker.seaWalkersSession) + "\n" + - EnumChatFormatting.DARK_GRAY + " Night Squids: " + nf.format(LootTracker.nightSquidsSession) + "\n" + - EnumChatFormatting.DARK_AQUA + " Sea Guardians: " + nf.format(LootTracker.seaGuardiansSession) + "\n" + - EnumChatFormatting.BLUE + " Sea Witches: " + nf.format(LootTracker.seaWitchesSession) + "\n" + - EnumChatFormatting.GREEN + " Sea Archers: " + nf.format(LootTracker.seaArchersSession) + "\n" + - EnumChatFormatting.GREEN + " Monster of the Deeps: " + nf.format(LootTracker.monsterOfTheDeepsSession) + "\n" + - EnumChatFormatting.YELLOW + " Catfishes: " + nf.format(LootTracker.catfishesSession) + "\n" + - EnumChatFormatting.GOLD + " Carrot Kings: " + nf.format(LootTracker.carrotKingsSession) + "\n" + - EnumChatFormatting.GRAY + " Sea Leeches: " + nf.format(LootTracker.seaLeechesSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Guardian Defenders: " + nf.format(LootTracker.guardianDefendersSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Deep Sea Protectors: " + nf.format(LootTracker.deepSeaProtectorsSession) + "\n" + - EnumChatFormatting.GOLD + " Hydras: " + nf.format(LootTracker.hydrasSession) + "\n" + - EnumChatFormatting.GOLD + " Sea Emperors: " + nf.format(LootTracker.seaEmperorsSession) + "\n" + + EnumChatFormatting.AQUA + " Sea Creatures Caught: " + nf.format(FishingTracker.seaCreaturesSession) + "\n" + + EnumChatFormatting.GOLD + " Good Catches: " + nf.format(FishingTracker.goodCatchesSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Great Catches: " + nf.format(FishingTracker.greatCatchesSession) + "\n\n" + + EnumChatFormatting.GRAY + " Squids: " + nf.format(FishingTracker.squidsSession) + "\n" + + EnumChatFormatting.GREEN + " Sea Walkers: " + nf.format(FishingTracker.seaWalkersSession) + "\n" + + EnumChatFormatting.DARK_GRAY + " Night Squids: " + nf.format(FishingTracker.nightSquidsSession) + "\n" + + EnumChatFormatting.DARK_AQUA + " Sea Guardians: " + nf.format(FishingTracker.seaGuardiansSession) + "\n" + + EnumChatFormatting.BLUE + " Sea Witches: " + nf.format(FishingTracker.seaWitchesSession) + "\n" + + EnumChatFormatting.GREEN + " Sea Archers: " + nf.format(FishingTracker.seaArchersSession) + "\n" + + EnumChatFormatting.GREEN + " Monster of the Deeps: " + nf.format(FishingTracker.monsterOfTheDeepsSession) + "\n" + + EnumChatFormatting.YELLOW + " Catfishes: " + nf.format(FishingTracker.catfishesSession) + "\n" + + EnumChatFormatting.GOLD + " Carrot Kings: " + nf.format(FishingTracker.carrotKingsSession) + "\n" + + EnumChatFormatting.GRAY + " Sea Leeches: " + nf.format(FishingTracker.seaLeechesSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Guardian Defenders: " + nf.format(FishingTracker.guardianDefendersSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Deep Sea Protectors: " + nf.format(FishingTracker.deepSeaProtectorsSession) + "\n" + + EnumChatFormatting.GOLD + " Hydras: " + nf.format(FishingTracker.hydrasSession) + "\n" + + EnumChatFormatting.GOLD + " Sea Emperors: " + nf.format(FishingTracker.seaEmperorsSession) + "\n" + EnumChatFormatting.AQUA + " Time Since Sea Emperor: " + timeBetween + "\n" + EnumChatFormatting.AQUA + " Sea Creatures Since Sea Emperor: " + bossesBetween + "\n" + EnumChatFormatting.DARK_AQUA + EnumChatFormatting.BOLD + " -------------------")); return; } - if (LootTracker.empTime == -1) { + if (FishingTracker.empTime == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.empTime, timeNow); + timeBetween = Utils.getTimeBetween(FishingTracker.empTime, timeNow); } - if (LootTracker.empSCs == -1) { + if (FishingTracker.empSCs == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.empSCs); + bossesBetween = nf.format(FishingTracker.empSCs); } player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " Fishing Summary:\n" + - EnumChatFormatting.AQUA + " Sea Creatures Caught: " + nf.format(LootTracker.seaCreatures) + "\n" + - EnumChatFormatting.GOLD + " Good Catches: " + nf.format(LootTracker.goodCatches) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Great Catches: " + nf.format(LootTracker.greatCatches) + "\n\n" + - EnumChatFormatting.GRAY + " Squids: " + nf.format(LootTracker.squids) + "\n" + - EnumChatFormatting.GREEN + " Sea Walkers: " + nf.format(LootTracker.seaWalkers) + "\n" + - EnumChatFormatting.DARK_GRAY + " Night Squids: " + nf.format(LootTracker.nightSquids) + "\n" + - EnumChatFormatting.DARK_AQUA + " Sea Guardians: " + nf.format(LootTracker.seaGuardians) + "\n" + - EnumChatFormatting.BLUE + " Sea Witches: " + nf.format(LootTracker.seaWitches) + "\n" + - EnumChatFormatting.GREEN + " Sea Archers: " + nf.format(LootTracker.seaArchers) + "\n" + - EnumChatFormatting.GREEN + " Monster of the Deeps: " + nf.format(LootTracker.monsterOfTheDeeps) + "\n" + - EnumChatFormatting.YELLOW + " Catfishes: " + nf.format(LootTracker.catfishes) + "\n" + - EnumChatFormatting.GOLD + " Carrot Kings: " + nf.format(LootTracker.carrotKings) + "\n" + - EnumChatFormatting.GRAY + " Sea Leeches: " + nf.format(LootTracker.seaLeeches) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Guardian Defenders: " + nf.format(LootTracker.guardianDefenders) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Deep Sea Protectors: " + nf.format(LootTracker.deepSeaProtectors) + "\n" + - EnumChatFormatting.GOLD + " Hydras: " + nf.format(LootTracker.hydras) + "\n" + - EnumChatFormatting.GOLD + " Sea Emperors: " + nf.format(LootTracker.seaEmperors) + "\n" + + EnumChatFormatting.AQUA + " Sea Creatures Caught: " + nf.format(FishingTracker.seaCreatures) + "\n" + + EnumChatFormatting.GOLD + " Good Catches: " + nf.format(FishingTracker.goodCatches) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Great Catches: " + nf.format(FishingTracker.greatCatches) + "\n\n" + + EnumChatFormatting.GRAY + " Squids: " + nf.format(FishingTracker.squids) + "\n" + + EnumChatFormatting.GREEN + " Sea Walkers: " + nf.format(FishingTracker.seaWalkers) + "\n" + + EnumChatFormatting.DARK_GRAY + " Night Squids: " + nf.format(FishingTracker.nightSquids) + "\n" + + EnumChatFormatting.DARK_AQUA + " Sea Guardians: " + nf.format(FishingTracker.seaGuardians) + "\n" + + EnumChatFormatting.BLUE + " Sea Witches: " + nf.format(FishingTracker.seaWitches) + "\n" + + EnumChatFormatting.GREEN + " Sea Archers: " + nf.format(FishingTracker.seaArchers) + "\n" + + EnumChatFormatting.GREEN + " Monster of the Deeps: " + nf.format(FishingTracker.monsterOfTheDeeps) + "\n" + + EnumChatFormatting.YELLOW + " Catfishes: " + nf.format(FishingTracker.catfishes) + "\n" + + EnumChatFormatting.GOLD + " Carrot Kings: " + nf.format(FishingTracker.carrotKings) + "\n" + + EnumChatFormatting.GRAY + " Sea Leeches: " + nf.format(FishingTracker.seaLeeches) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Guardian Defenders: " + nf.format(FishingTracker.guardianDefenders) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Deep Sea Protectors: " + nf.format(FishingTracker.deepSeaProtectors) + "\n" + + EnumChatFormatting.GOLD + " Hydras: " + nf.format(FishingTracker.hydras) + "\n" + + EnumChatFormatting.GOLD + " Sea Emperors: " + nf.format(FishingTracker.seaEmperors) + "\n" + EnumChatFormatting.AQUA + " Time Since Sea Emperor: " + timeBetween + "\n" + EnumChatFormatting.AQUA + " Sea Creatures Since Sea Emperor: " + bossesBetween + "\n" + EnumChatFormatting.DARK_AQUA + EnumChatFormatting.BOLD + " -------------------")); @@ -528,31 +528,31 @@ public class LootCommand extends CommandBase { if (showSession) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.GOLD + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.YELLOW + EnumChatFormatting.BOLD + " Mythological Event Summary (Current Session):\n" + - EnumChatFormatting.YELLOW + " Coins: " + Utils.getMoneySpent(LootTracker.mythCoinsSession) + "\n" + - EnumChatFormatting.WHITE + " Griffin Feathers: " + nf.format(LootTracker.griffinFeathersSession) + "\n" + - EnumChatFormatting.GOLD + " Crown of Greeds: " + nf.format(LootTracker.crownOfGreedsSession) + "\n" + - EnumChatFormatting.AQUA + " Washed-up Souvenirs: " + nf.format(LootTracker.washedUpSouvenirsSession) + "\n" + - EnumChatFormatting.RED + " Minos Hunters: " + nf.format(LootTracker.minosHuntersSession) + "\n" + - EnumChatFormatting.GRAY + " Siamese Lynxes: " + nf.format(LootTracker.siameseLynxesSession) + "\n" + - EnumChatFormatting.RED + " Minotaurs: " + nf.format(LootTracker.minotaursSession) + "\n" + - EnumChatFormatting.WHITE + " Gaia Constructs: " + nf.format(LootTracker.gaiaConstructsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Minos Champions: " + nf.format(LootTracker.minosChampionsSession) + "\n" + - EnumChatFormatting.GOLD + " Minos Inquisitors: " + nf.format(LootTracker.minosInquisitorsSession) + "\n" + + EnumChatFormatting.YELLOW + " Coins: " + Utils.getMoneySpent(MythologicalTracker.mythCoinsSession) + "\n" + + EnumChatFormatting.WHITE + " Griffin Feathers: " + nf.format(MythologicalTracker.griffinFeathersSession) + "\n" + + EnumChatFormatting.GOLD + " Crown of Greeds: " + nf.format(MythologicalTracker.crownOfGreedsSession) + "\n" + + EnumChatFormatting.AQUA + " Washed-up Souvenirs: " + nf.format(MythologicalTracker.washedUpSouvenirsSession) + "\n" + + EnumChatFormatting.RED + " Minos Hunters: " + nf.format(MythologicalTracker.minosHuntersSession) + "\n" + + EnumChatFormatting.GRAY + " Siamese Lynxes: " + nf.format(MythologicalTracker.siameseLynxesSession) + "\n" + + EnumChatFormatting.RED + " Minotaurs: " + nf.format(MythologicalTracker.minotaursSession) + "\n" + + EnumChatFormatting.WHITE + " Gaia Constructs: " + nf.format(MythologicalTracker.gaiaConstructsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Minos Champions: " + nf.format(MythologicalTracker.minosChampionsSession) + "\n" + + EnumChatFormatting.GOLD + " Minos Inquisitors: " + nf.format(MythologicalTracker.minosInquisitorsSession) + "\n" + EnumChatFormatting.GOLD + EnumChatFormatting.BOLD + "-------------------")); return; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.GOLD + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.YELLOW + EnumChatFormatting.BOLD + " Mythological Event Summary:\n" + - EnumChatFormatting.YELLOW + " Coins: " + Utils.getMoneySpent(LootTracker.mythCoins) + "\n" + - EnumChatFormatting.WHITE + " Griffin Feathers: " + nf.format(LootTracker.griffinFeathers) + "\n" + - EnumChatFormatting.GOLD + " Crown of Greeds: " + nf.format(LootTracker.crownOfGreeds) + "\n" + - EnumChatFormatting.AQUA + " Washed-up Souvenirs: " + nf.format(LootTracker.washedUpSouvenirs) + "\n" + - EnumChatFormatting.RED + " Minos Hunters: " + nf.format(LootTracker.minosHunters) + "\n" + - EnumChatFormatting.GRAY + " Siamese Lynxes: " + nf.format(LootTracker.siameseLynxes) + "\n" + - EnumChatFormatting.RED + " Minotaurs: " + nf.format(LootTracker.minotaurs) + "\n" + - EnumChatFormatting.WHITE + " Gaia Constructs: " + nf.format(LootTracker.gaiaConstructs) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Minos Champions: " + nf.format(LootTracker.minosChampions) + "\n" + - EnumChatFormatting.GOLD + " Minos Inquisitors: " + nf.format(LootTracker.minosInquisitors) + "\n" + + EnumChatFormatting.YELLOW + " Coins: " + Utils.getMoneySpent(MythologicalTracker.mythCoins) + "\n" + + EnumChatFormatting.WHITE + " Griffin Feathers: " + nf.format(MythologicalTracker.griffinFeathers) + "\n" + + EnumChatFormatting.GOLD + " Crown of Greeds: " + nf.format(MythologicalTracker.crownOfGreeds) + "\n" + + EnumChatFormatting.AQUA + " Washed-up Souvenirs: " + nf.format(MythologicalTracker.washedUpSouvenirs) + "\n" + + EnumChatFormatting.RED + " Minos Hunters: " + nf.format(MythologicalTracker.minosHunters) + "\n" + + EnumChatFormatting.GRAY + " Siamese Lynxes: " + nf.format(MythologicalTracker.siameseLynxes) + "\n" + + EnumChatFormatting.RED + " Minotaurs: " + nf.format(MythologicalTracker.minotaurs) + "\n" + + EnumChatFormatting.WHITE + " Gaia Constructs: " + nf.format(MythologicalTracker.gaiaConstructs) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Minos Champions: " + nf.format(MythologicalTracker.minosChampions) + "\n" + + EnumChatFormatting.GOLD + " Minos Inquisitors: " + nf.format(MythologicalTracker.minosInquisitors) + "\n" + EnumChatFormatting.GOLD + EnumChatFormatting.BOLD + "-------------------")); break; case "catacombs": @@ -566,21 +566,21 @@ public class LootCommand extends CommandBase { if (showSession) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F1 Summary (Current Session):\n" + - EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(LootTracker.recombobulatorsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(LootTracker.fumingPotatoBooksSession) + "\n" + - EnumChatFormatting.BLUE + " Bonzo's Staffs: " + nf.format(LootTracker.bonzoStaffsSession) + "\n" + - EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(LootTracker.f1CoinsSpentSession) + "\n" + - EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, LootTracker.f1TimeSpentSession) + "\n" + + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.BLUE + " Bonzo's Staffs: " + nf.format(CatacombsTracker.bonzoStaffsSession) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(CatacombsTracker.f1CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, CatacombsTracker.f1TimeSpentSession) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); return; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F1 Summary:\n" + - EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(LootTracker.recombobulators) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(LootTracker.fumingPotatoBooks) + "\n" + - EnumChatFormatting.BLUE + " Bonzo's Staffs: " + nf.format(LootTracker.bonzoStaffs) + "\n" + - EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(LootTracker.f1CoinsSpent) + "\n" + - EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, LootTracker.f1TimeSpent) + "\n" + + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + + EnumChatFormatting.BLUE + " Bonzo's Staffs: " + nf.format(CatacombsTracker.bonzoStaffs) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(CatacombsTracker.f1CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, CatacombsTracker.f1TimeSpent) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); break; case "f2": @@ -588,23 +588,23 @@ public class LootCommand extends CommandBase { if (showSession) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F2 Summary (Current Session):\n" + - EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(LootTracker.recombobulatorsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(LootTracker.fumingPotatoBooksSession) + "\n" + - EnumChatFormatting.BLUE + " Scarf's Studies: " + nf.format(LootTracker.scarfStudiesSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Adaptive Blades: " + nf.format(LootTracker.adaptiveSwordsSession) + "\n" + - EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(LootTracker.f2CoinsSpentSession) + "\n" + - EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, LootTracker.f2TimeSpentSession) + "\n" + + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.BLUE + " Scarf's Studies: " + nf.format(CatacombsTracker.scarfStudiesSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Adaptive Blades: " + nf.format(CatacombsTracker.adaptiveSwordsSession) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(CatacombsTracker.f2CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, CatacombsTracker.f2TimeSpentSession) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); return; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F2 Summary:\n" + - EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(LootTracker.recombobulators) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(LootTracker.fumingPotatoBooks) + "\n" + - EnumChatFormatting.BLUE + " Scarf's Studies: " + nf.format(LootTracker.scarfStudies) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Adaptive Blades: " + nf.format(LootTracker.adaptiveSwords) + "\n" + - EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(LootTracker.f2CoinsSpent) + "\n" + - EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, LootTracker.f2TimeSpent) + "\n" + + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + + EnumChatFormatting.BLUE + " Scarf's Studies: " + nf.format(CatacombsTracker.scarfStudies) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Adaptive Blades: " + nf.format(CatacombsTracker.adaptiveSwords) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(CatacombsTracker.f2CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, CatacombsTracker.f2TimeSpent) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); break; case "f3": @@ -612,27 +612,27 @@ public class LootCommand extends CommandBase { if (showSession) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F3 Summary (Current Session):\n" + - EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(LootTracker.recombobulatorsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(LootTracker.fumingPotatoBooksSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Adaptive Helmets: " + nf.format(LootTracker.adaptiveHelmsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Adaptive Chestplates: " + nf.format(LootTracker.adaptiveChestsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Adaptive Leggings: " + nf.format(LootTracker.adaptiveLegsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Adaptive Boots: " + nf.format(LootTracker.adaptiveBootsSession) + "\n" + - EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(LootTracker.f3CoinsSpentSession) + "\n" + - EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, LootTracker.f3TimeSpentSession) + "\n" + + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Adaptive Helmets: " + nf.format(CatacombsTracker.adaptiveHelmsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Adaptive Chestplates: " + nf.format(CatacombsTracker.adaptiveChestsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Adaptive Leggings: " + nf.format(CatacombsTracker.adaptiveLegsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Adaptive Boots: " + nf.format(CatacombsTracker.adaptiveBootsSession) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(CatacombsTracker.f3CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, CatacombsTracker.f3TimeSpentSession) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); return; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F3 Summary:\n" + - EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(LootTracker.recombobulators) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(LootTracker.fumingPotatoBooks) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Adaptive Helmets: " + nf.format(LootTracker.adaptiveHelms) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Adaptive Chestplates: " + nf.format(LootTracker.adaptiveChests) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Adaptive Leggings: " + nf.format(LootTracker.adaptiveLegs) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Adaptive Boots: " + nf.format(LootTracker.adaptiveBoots) + "\n" + - EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(LootTracker.f3CoinsSpent) + "\n" + - EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, LootTracker.f3TimeSpent) + "\n" + + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Adaptive Helmets: " + nf.format(CatacombsTracker.adaptiveHelms) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Adaptive Chestplates: " + nf.format(CatacombsTracker.adaptiveChests) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Adaptive Leggings: " + nf.format(CatacombsTracker.adaptiveLegs) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Adaptive Boots: " + nf.format(CatacombsTracker.adaptiveBoots) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(CatacombsTracker.f3CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, CatacombsTracker.f3TimeSpent) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); break; case "f4": @@ -640,33 +640,33 @@ public class LootCommand extends CommandBase { if (showSession) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F4 Summary (Current Session):\n" + - EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(LootTracker.recombobulatorsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(LootTracker.fumingPotatoBooksSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Spirit Wings: " + nf.format(LootTracker.spiritWingsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Spirit Bones: " + nf.format(LootTracker.spiritBonesSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Spirit Boots: " + nf.format(LootTracker.spiritBootsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Spirit Swords: " + nf.format(LootTracker.spiritSwordsSession) + "\n" + - EnumChatFormatting.GOLD + " Spirit Bows: " + nf.format(LootTracker.spiritBowsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Epic Spirit Pets: " + nf.format(LootTracker.epicSpiritPetsSession) + "\n" + - EnumChatFormatting.GOLD + " Leg Spirit Pets: " + nf.format(LootTracker.legSpiritPetsSession) + "\n" + - EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(LootTracker.f4CoinsSpentSession) + "\n" + - EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, LootTracker.f4TimeSpentSession) + "\n" + + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Spirit Wings: " + nf.format(CatacombsTracker.spiritWingsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Spirit Bones: " + nf.format(CatacombsTracker.spiritBonesSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Spirit Boots: " + nf.format(CatacombsTracker.spiritBootsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Spirit Swords: " + nf.format(CatacombsTracker.spiritSwordsSession) + "\n" + + EnumChatFormatting.GOLD + " Spirit Bows: " + nf.format(CatacombsTracker.spiritBowsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Epic Spirit Pets: " + nf.format(CatacombsTracker.epicSpiritPetsSession) + "\n" + + EnumChatFormatting.GOLD + " Leg Spirit Pets: " + nf.format(CatacombsTracker.legSpiritPetsSession) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(CatacombsTracker.f4CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, CatacombsTracker.f4TimeSpentSession) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); return; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F4 Summary:\n" + - EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(LootTracker.recombobulators) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(LootTracker.fumingPotatoBooks) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Spirit Wings: " + nf.format(LootTracker.spiritWings) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Spirit Bones: " + nf.format(LootTracker.spiritBones) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Spirit Boots: " + nf.format(LootTracker.spiritBoots) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Spirit Swords: " + nf.format(LootTracker.spiritSwords) + "\n" + - EnumChatFormatting.GOLD + " Spirit Bows: " + nf.format(LootTracker.spiritBows) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Epic Spirit Pets: " + nf.format(LootTracker.epicSpiritPets) + "\n" + - EnumChatFormatting.GOLD + " Leg Spirit Pets: " + nf.format(LootTracker.legSpiritPets) + "\n" + - EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(LootTracker.f4CoinsSpent) + "\n" + - EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, LootTracker.f4TimeSpent) + "\n" + + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Spirit Wings: " + nf.format(CatacombsTracker.spiritWings) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Spirit Bones: " + nf.format(CatacombsTracker.spiritBones) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Spirit Boots: " + nf.format(CatacombsTracker.spiritBoots) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Spirit Swords: " + nf.format(CatacombsTracker.spiritSwords) + "\n" + + EnumChatFormatting.GOLD + " Spirit Bows: " + nf.format(CatacombsTracker.spiritBows) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Epic Spirit Pets: " + nf.format(CatacombsTracker.epicSpiritPets) + "\n" + + EnumChatFormatting.GOLD + " Leg Spirit Pets: " + nf.format(CatacombsTracker.legSpiritPets) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(CatacombsTracker.f4CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, CatacombsTracker.f4TimeSpent) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); break; case "f5": @@ -674,35 +674,35 @@ public class LootCommand extends CommandBase { if (showSession) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F5 Summary (Current Session):\n" + - EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(LootTracker.recombobulatorsSession) + "\n" + - EnumChatFormatting.BLUE + " Warped Stones: " + nf.format(LootTracker.warpedStonesSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(LootTracker.fumingPotatoBooksSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Shadow Assassin Helmets: " + nf.format(LootTracker.shadowAssHelmsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Shadow Assassin Chests: " + nf.format(LootTracker.shadowAssChestsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Shadow Assassin Legs: " + nf.format(LootTracker.shadowAssLegsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Shadow Assassin Boots: " + nf.format(LootTracker.shadowAssBootsSession) + "\n" + - EnumChatFormatting.GOLD + " Last Breaths: " + nf.format(LootTracker.lastBreathsSession) + "\n" + - EnumChatFormatting.GOLD + " Livid Daggers: " + nf.format(LootTracker.lividDaggersSession) + "\n" + - EnumChatFormatting.GOLD + " Shadow Furys: " + nf.format(LootTracker.shadowFurysSession) + "\n" + - EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(LootTracker.f5CoinsSpentSession) + "\n" + - EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, LootTracker.f5TimeSpentSession) + "\n" + + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + + EnumChatFormatting.BLUE + " Warped Stones: " + nf.format(CatacombsTracker.warpedStonesSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Shadow Assassin Helmets: " + nf.format(CatacombsTracker.shadowAssHelmsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Shadow Assassin Chests: " + nf.format(CatacombsTracker.shadowAssChestsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Shadow Assassin Legs: " + nf.format(CatacombsTracker.shadowAssLegsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Shadow Assassin Boots: " + nf.format(CatacombsTracker.shadowAssBootsSession) + "\n" + + EnumChatFormatting.GOLD + " Last Breaths: " + nf.format(CatacombsTracker.lastBreathsSession) + "\n" + + EnumChatFormatting.GOLD + " Livid Daggers: " + nf.format(CatacombsTracker.lividDaggersSession) + "\n" + + EnumChatFormatting.GOLD + " Shadow Furys: " + nf.format(CatacombsTracker.shadowFurysSession) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(CatacombsTracker.f5CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, CatacombsTracker.f5TimeSpentSession) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); return; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F5 Summary:\n" + - EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(LootTracker.recombobulators) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(LootTracker.fumingPotatoBooks) + "\n" + - EnumChatFormatting.BLUE + " Warped Stones: " + nf.format(LootTracker.warpedStones) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Shadow Assassin Helmets: " + nf.format(LootTracker.shadowAssHelms) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Shadow Assassin Chests: " + nf.format(LootTracker.shadowAssChests) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Shadow Assassin Legs: " + nf.format(LootTracker.shadowAssLegs) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Shadow Assassin Boots: " + nf.format(LootTracker.shadowAssBoots) + "\n" + - EnumChatFormatting.GOLD + " Last Breaths: " + nf.format(LootTracker.lastBreaths) + "\n" + - EnumChatFormatting.GOLD + " Livid Daggers: " + nf.format(LootTracker.lividDaggers) + "\n" + - EnumChatFormatting.GOLD + " Shadow Furys: " + nf.format(LootTracker.shadowFurys) + "\n" + - EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(LootTracker.f5CoinsSpent) + "\n" + - EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, LootTracker.f5TimeSpent) + "\n" + + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + + EnumChatFormatting.BLUE + " Warped Stones: " + nf.format(CatacombsTracker.warpedStones) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Shadow Assassin Helmets: " + nf.format(CatacombsTracker.shadowAssHelms) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Shadow Assassin Chests: " + nf.format(CatacombsTracker.shadowAssChests) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Shadow Assassin Legs: " + nf.format(CatacombsTracker.shadowAssLegs) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Shadow Assassin Boots: " + nf.format(CatacombsTracker.shadowAssBoots) + "\n" + + EnumChatFormatting.GOLD + " Last Breaths: " + nf.format(CatacombsTracker.lastBreaths) + "\n" + + EnumChatFormatting.GOLD + " Livid Daggers: " + nf.format(CatacombsTracker.lividDaggers) + "\n" + + EnumChatFormatting.GOLD + " Shadow Furys: " + nf.format(CatacombsTracker.shadowFurys) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(CatacombsTracker.f5CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, CatacombsTracker.f5TimeSpent) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); break; case "f6": @@ -710,35 +710,35 @@ public class LootCommand extends CommandBase { if (showSession) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F6 Summary (Current Session):\n" + - EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(LootTracker.recombobulatorsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(LootTracker.fumingPotatoBooksSession) + "\n" + - EnumChatFormatting.BLUE + " Ancient Roses: " + nf.format(LootTracker.ancientRosesSession) + "\n" + - EnumChatFormatting.GOLD + " Precursor Eyes: " + nf.format(LootTracker.precursorEyesSession) + "\n" + - EnumChatFormatting.GOLD + " Giant's Swords: " + nf.format(LootTracker.giantsSwordsSession) + "\n" + - EnumChatFormatting.GOLD + " Necro Lord Helmets: " + nf.format(LootTracker.necroLordHelmsSession) + "\n" + - EnumChatFormatting.GOLD + " Necro Lord Chestplates: " + nf.format(LootTracker.necroLordChestsSession) + "\n" + - EnumChatFormatting.GOLD + " Necro Lord Leggings: " + nf.format(LootTracker.necroLordLegsSession) + "\n" + - EnumChatFormatting.GOLD + " Necro Lord Boots: " + nf.format(LootTracker.necroLordBootsSession) + "\n" + - EnumChatFormatting.GOLD + " Necro Swords: " + nf.format(LootTracker.necroSwordsSession) + "\n" + - EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(LootTracker.f6CoinsSpentSession) + "\n" + - EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, LootTracker.f6TimeSpentSession) + "\n" + + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.BLUE + " Ancient Roses: " + nf.format(CatacombsTracker.ancientRosesSession) + "\n" + + EnumChatFormatting.GOLD + " Precursor Eyes: " + nf.format(CatacombsTracker.precursorEyesSession) + "\n" + + EnumChatFormatting.GOLD + " Giant's Swords: " + nf.format(CatacombsTracker.giantsSwordsSession) + "\n" + + EnumChatFormatting.GOLD + " Necro Lord Helmets: " + nf.format(CatacombsTracker.necroLordHelmsSession) + "\n" + + EnumChatFormatting.GOLD + " Necro Lord Chestplates: " + nf.format(CatacombsTracker.necroLordChestsSession) + "\n" + + EnumChatFormatting.GOLD + " Necro Lord Leggings: " + nf.format(CatacombsTracker.necroLordLegsSession) + "\n" + + EnumChatFormatting.GOLD + " Necro Lord Boots: " + nf.format(CatacombsTracker.necroLordBootsSession) + "\n" + + EnumChatFormatting.GOLD + " Necro Swords: " + nf.format(CatacombsTracker.necroSwordsSession) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(CatacombsTracker.f6CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, CatacombsTracker.f6TimeSpentSession) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); return; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F6 Summary:\n" + - EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(LootTracker.recombobulators) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(LootTracker.fumingPotatoBooks) + "\n" + - EnumChatFormatting.BLUE + " Ancient Roses: " + nf.format(LootTracker.ancientRoses) + "\n" + - EnumChatFormatting.GOLD + " Precursor Eyes: " + nf.format(LootTracker.precursorEyes) + "\n" + - EnumChatFormatting.GOLD + " Giant's Swords: " + nf.format(LootTracker.giantsSwords) + "\n" + - EnumChatFormatting.GOLD + " Necro Lord Helmets: " + nf.format(LootTracker.necroLordHelms) + "\n" + - EnumChatFormatting.GOLD + " Necro Lord Chestplates: " + nf.format(LootTracker.necroLordChests) + "\n" + - EnumChatFormatting.GOLD + " Necro Lord Leggings: " + nf.format(LootTracker.necroLordLegs) + "\n" + - EnumChatFormatting.GOLD + " Necro Lord Boots: " + nf.format(LootTracker.necroLordBoots) + "\n" + - EnumChatFormatting.GOLD + " Necro Swords: " + nf.format(LootTracker.necroSwords) + "\n" + - EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(LootTracker.f6CoinsSpent) + "\n" + - EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, LootTracker.f6TimeSpent) + "\n" + + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + + EnumChatFormatting.BLUE + " Ancient Roses: " + nf.format(CatacombsTracker.ancientRoses) + "\n" + + EnumChatFormatting.GOLD + " Precursor Eyes: " + nf.format(CatacombsTracker.precursorEyes) + "\n" + + EnumChatFormatting.GOLD + " Giant's Swords: " + nf.format(CatacombsTracker.giantsSwords) + "\n" + + EnumChatFormatting.GOLD + " Necro Lord Helmets: " + nf.format(CatacombsTracker.necroLordHelms) + "\n" + + EnumChatFormatting.GOLD + " Necro Lord Chestplates: " + nf.format(CatacombsTracker.necroLordChests) + "\n" + + EnumChatFormatting.GOLD + " Necro Lord Leggings: " + nf.format(CatacombsTracker.necroLordLegs) + "\n" + + EnumChatFormatting.GOLD + " Necro Lord Boots: " + nf.format(CatacombsTracker.necroLordBoots) + "\n" + + EnumChatFormatting.GOLD + " Necro Swords: " + nf.format(CatacombsTracker.necroSwords) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(CatacombsTracker.f6CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, CatacombsTracker.f6TimeSpent) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); break; case "f7": @@ -746,41 +746,41 @@ public class LootCommand extends CommandBase { if (showSession) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F7 Summary (Current Session):\n" + - EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(LootTracker.recombobulatorsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(LootTracker.fumingPotatoBooksSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Wither Bloods: " + nf.format(LootTracker.witherBloodsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Wither Cloaks: " + nf.format(LootTracker.witherCloaksSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Implosions: " + nf.format(LootTracker.implosionsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Wither Shields: " + nf.format(LootTracker.witherShieldsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Shadow Warps: " + nf.format(LootTracker.shadowWarpsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Necron's Handles: " + nf.format(LootTracker.necronsHandlesSession) + "\n" + - EnumChatFormatting.GOLD + " Auto Recombobulator: " + nf.format(LootTracker.autoRecombsSession) + "\n" + - EnumChatFormatting.GOLD + " Wither Helmets: " + nf.format(LootTracker.witherHelmsSession) + "\n" + - EnumChatFormatting.GOLD + " Wither Chesplates: " + nf.format(LootTracker.witherChestsSession) + "\n" + - EnumChatFormatting.GOLD + " Wither Leggings: " + nf.format(LootTracker.witherLegsSession) + "\n" + - EnumChatFormatting.GOLD + " Wither Boots: " + nf.format(LootTracker.witherBootsSession) + "\n" + - EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(LootTracker.f7CoinsSpentSession) + "\n" + - EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, LootTracker.f7TimeSpentSession) + "\n" + + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Wither Bloods: " + nf.format(CatacombsTracker.witherBloodsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Wither Cloaks: " + nf.format(CatacombsTracker.witherCloaksSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Implosions: " + nf.format(CatacombsTracker.implosionsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Wither Shields: " + nf.format(CatacombsTracker.witherShieldsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Shadow Warps: " + nf.format(CatacombsTracker.shadowWarpsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Necron's Handles: " + nf.format(CatacombsTracker.necronsHandlesSession) + "\n" + + EnumChatFormatting.GOLD + " Auto Recombobulator: " + nf.format(CatacombsTracker.autoRecombsSession) + "\n" + + EnumChatFormatting.GOLD + " Wither Helmets: " + nf.format(CatacombsTracker.witherHelmsSession) + "\n" + + EnumChatFormatting.GOLD + " Wither Chesplates: " + nf.format(CatacombsTracker.witherChestsSession) + "\n" + + EnumChatFormatting.GOLD + " Wither Leggings: " + nf.format(CatacombsTracker.witherLegsSession) + "\n" + + EnumChatFormatting.GOLD + " Wither Boots: " + nf.format(CatacombsTracker.witherBootsSession) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(CatacombsTracker.f7CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, CatacombsTracker.f7TimeSpentSession) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); return; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F7 Summary:\n" + - EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(LootTracker.recombobulators) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(LootTracker.fumingPotatoBooks) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Wither Bloods: " + nf.format(LootTracker.witherBloods) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Wither Cloaks: " + nf.format(LootTracker.witherCloaks) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Implosions: " + nf.format(LootTracker.implosions) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Wither Shields: " + nf.format(LootTracker.witherShields) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Shadow Warps: " + nf.format(LootTracker.shadowWarps) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Necron's Handles: " + nf.format(LootTracker.necronsHandles) + "\n" + - EnumChatFormatting.GOLD + " Auto Recombobulator: " + nf.format(LootTracker.autoRecombs) + "\n" + - EnumChatFormatting.GOLD + " Wither Helmets: " + nf.format(LootTracker.witherHelms) + "\n" + - EnumChatFormatting.GOLD + " Wither Chesplates: " + nf.format(LootTracker.witherChests) + "\n" + - EnumChatFormatting.GOLD + " Wither Leggings: " + nf.format(LootTracker.witherLegs) + "\n" + - EnumChatFormatting.GOLD + " Wither Boots: " + nf.format(LootTracker.witherBoots) + "\n" + - EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(LootTracker.f7CoinsSpent) + "\n" + - EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, LootTracker.f7TimeSpent) + "\n" + + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Wither Bloods: " + nf.format(CatacombsTracker.witherBloods) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Wither Cloaks: " + nf.format(CatacombsTracker.witherCloaks) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Implosions: " + nf.format(CatacombsTracker.implosions) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Wither Shields: " + nf.format(CatacombsTracker.witherShields) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Shadow Warps: " + nf.format(CatacombsTracker.shadowWarps) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Necron's Handles: " + nf.format(CatacombsTracker.necronsHandles) + "\n" + + EnumChatFormatting.GOLD + " Auto Recombobulator: " + nf.format(CatacombsTracker.autoRecombs) + "\n" + + EnumChatFormatting.GOLD + " Wither Helmets: " + nf.format(CatacombsTracker.witherHelms) + "\n" + + EnumChatFormatting.GOLD + " Wither Chesplates: " + nf.format(CatacombsTracker.witherChests) + "\n" + + EnumChatFormatting.GOLD + " Wither Leggings: " + nf.format(CatacombsTracker.witherLegs) + "\n" + + EnumChatFormatting.GOLD + " Wither Boots: " + nf.format(CatacombsTracker.witherBoots) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(CatacombsTracker.f7CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, CatacombsTracker.f7TimeSpent) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); break; default: diff --git a/src/main/java/me/Danker/commands/ResetLootCommand.java b/src/main/java/me/Danker/commands/ResetLootCommand.java index e13b1a5..974d50c 100644 --- a/src/main/java/me/Danker/commands/ResetLootCommand.java +++ b/src/main/java/me/Danker/commands/ResetLootCommand.java @@ -1,7 +1,7 @@ package me.Danker.commands; import me.Danker.DankersSkyblockMod; -import me.Danker.features.loot.LootTracker; +import me.Danker.features.loot.*; import me.Danker.handlers.ConfigHandler; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; @@ -122,195 +122,195 @@ public class ResetLootCommand extends CommandBase { } static void resetZombie() { - LootTracker.zombieRevsSession = 0; - LootTracker.zombieRevFleshSession = 0; - LootTracker.zombieRevVisceraSession = 0; - LootTracker.zombieFoulFleshSession = 0; - LootTracker.zombieFoulFleshDropsSession = 0; - LootTracker.zombiePestilencesSession = 0; - LootTracker.zombieUndeadCatasSession = 0; - LootTracker.zombieBooksSession = 0; - LootTracker.zombieBeheadedsSession = 0; - LootTracker.zombieRevCatasSession = 0; - LootTracker.zombieSnakesSession = 0; - LootTracker.zombieScythesSession = 0; - LootTracker.zombieTimeSession = -1; - LootTracker.zombieBossesSession = -1; + ZombieTracker.zombieRevsSession = 0; + ZombieTracker.zombieRevFleshSession = 0; + ZombieTracker.zombieRevVisceraSession = 0; + ZombieTracker.zombieFoulFleshSession = 0; + ZombieTracker.zombieFoulFleshDropsSession = 0; + ZombieTracker.zombiePestilencesSession = 0; + ZombieTracker.zombieUndeadCatasSession = 0; + ZombieTracker.zombieBooksSession = 0; + ZombieTracker.zombieBeheadedsSession = 0; + ZombieTracker.zombieRevCatasSession = 0; + ZombieTracker.zombieSnakesSession = 0; + ZombieTracker.zombieScythesSession = 0; + ZombieTracker.zombieTimeSession = -1; + ZombieTracker.zombieBossesSession = -1; ConfigHandler.deleteCategory("zombie"); ConfigHandler.reloadConfig(); } static void resetSpider() { - LootTracker.spiderTarantulasSession = 0; - LootTracker.spiderWebsSession = 0; - LootTracker.spiderTAPSession = 0; - LootTracker.spiderTAPDropsSession = 0; - LootTracker.spiderBitesSession = 0; - LootTracker.spiderCatalystsSession = 0; - LootTracker.spiderBooksSession = 0; - LootTracker.spiderSwattersSession = 0; - LootTracker.spiderTalismansSession = 0; - LootTracker.spiderMosquitosSession = 0; - LootTracker.spiderTimeSession = -1; - LootTracker.spiderBossesSession = -1; + SpiderTracker.spiderTarantulasSession = 0; + SpiderTracker.spiderWebsSession = 0; + SpiderTracker.spiderTAPSession = 0; + SpiderTracker.spiderTAPDropsSession = 0; + SpiderTracker.spiderBitesSession = 0; + SpiderTracker.spiderCatalystsSession = 0; + SpiderTracker.spiderBooksSession = 0; + SpiderTracker.spiderSwattersSession = 0; + SpiderTracker.spiderTalismansSession = 0; + SpiderTracker.spiderMosquitosSession = 0; + SpiderTracker.spiderTimeSession = -1; + SpiderTracker.spiderBossesSession = -1; ConfigHandler.deleteCategory("spider"); ConfigHandler.reloadConfig(); } static void resetWolf() { - LootTracker.wolfSvensSession = 0; - LootTracker.wolfTeethSession = 0; - LootTracker.wolfWheelsSession = 0; - LootTracker.wolfWheelsDropsSession = 0; - LootTracker.wolfSpiritsSession = 0; - LootTracker.wolfBooksSession = 0; - LootTracker.wolfEggsSession = 0; - LootTracker.wolfCouturesSession = 0; - LootTracker.wolfBaitsSession = 0; - LootTracker.wolfFluxesSession = 0; - LootTracker.wolfTimeSession = -1; - LootTracker.wolfBossesSession = -1; + WolfTracker.wolfSvensSession = 0; + WolfTracker.wolfTeethSession = 0; + WolfTracker.wolfWheelsSession = 0; + WolfTracker.wolfWheelsDropsSession = 0; + WolfTracker.wolfSpiritsSession = 0; + WolfTracker.wolfBooksSession = 0; + WolfTracker.wolfEggsSession = 0; + WolfTracker.wolfCouturesSession = 0; + WolfTracker.wolfBaitsSession = 0; + WolfTracker.wolfFluxesSession = 0; + WolfTracker.wolfTimeSession = -1; + WolfTracker.wolfBossesSession = -1; ConfigHandler.deleteCategory("wolf"); ConfigHandler.reloadConfig(); } static void resetEnderman() { - LootTracker.endermanVoidgloomsSession = 0; - LootTracker.endermanNullSpheresSession = 0; - LootTracker.endermanTAPSession = 0; - LootTracker.endermanTAPDropsSession = 0; - LootTracker.endermanEndersnakesSession = 0; - LootTracker.endermanSummoningEyesSession = 0; - LootTracker.endermanManaBooksSession = 0; - LootTracker.endermanTunersSession = 0; - LootTracker.endermanAtomsSession = 0; - LootTracker.endermanEspressoMachinesSession = 0; - LootTracker.endermanSmartyBooksSession = 0; - LootTracker.endermanEndRunesSession = 0; - LootTracker.endermanChalicesSession = 0; - LootTracker.endermanDiceSession = 0; - LootTracker.endermanArtifactsSession = 0; - LootTracker.endermanSkinsSession = 0; - LootTracker.endermanMergersSession = 0; - LootTracker.endermanCoresSession = 0; - LootTracker.endermanEnchantRunesSession = 0; - LootTracker.endermanEnderBooksSession = 0; - LootTracker.endermanTimeSession = -1; - LootTracker.endermanBossesSession = -1; + EndermanTracker.endermanVoidgloomsSession = 0; + EndermanTracker.endermanNullSpheresSession = 0; + EndermanTracker.endermanTAPSession = 0; + EndermanTracker.endermanTAPDropsSession = 0; + EndermanTracker.endermanEndersnakesSession = 0; + EndermanTracker.endermanSummoningEyesSession = 0; + EndermanTracker.endermanManaBooksSession = 0; + EndermanTracker.endermanTunersSession = 0; + EndermanTracker.endermanAtomsSession = 0; + EndermanTracker.endermanEspressoMachinesSession = 0; + EndermanTracker.endermanSmartyBooksSession = 0; + EndermanTracker.endermanEndRunesSession = 0; + EndermanTracker.endermanChalicesSession = 0; + EndermanTracker.endermanDiceSession = 0; + EndermanTracker.endermanArtifactsSession = 0; + EndermanTracker.endermanSkinsSession = 0; + EndermanTracker.endermanMergersSession = 0; + EndermanTracker.endermanCoresSession = 0; + EndermanTracker.endermanEnchantRunesSession = 0; + EndermanTracker.endermanEnderBooksSession = 0; + EndermanTracker.endermanTimeSession = -1; + EndermanTracker.endermanBossesSession = -1; ConfigHandler.deleteCategory("enderman"); ConfigHandler.reloadConfig(); } static void resetFishing() { - LootTracker.seaCreaturesSession = 0; - LootTracker.goodCatchesSession = 0; - LootTracker.greatCatchesSession = 0; - LootTracker.squidsSession = 0; - LootTracker.seaWalkersSession = 0; - LootTracker.nightSquidsSession = 0; - LootTracker.seaGuardiansSession = 0; - LootTracker.seaWitchesSession = 0; - LootTracker.seaArchersSession = 0; - LootTracker.monsterOfTheDeepsSession = 0; - LootTracker.catfishesSession = 0; - LootTracker.carrotKingsSession = 0; - LootTracker.seaLeechesSession = 0; - LootTracker.guardianDefendersSession = 0; - LootTracker.deepSeaProtectorsSession = 0; - LootTracker.hydrasSession = 0; - LootTracker.seaEmperorsSession = 0; - LootTracker.empTimeSession = -1; - LootTracker.empSCsSession = -1; - LootTracker.fishingMilestoneSession = 0; - LootTracker.frozenStevesSession = 0; - LootTracker.frostyTheSnowmansSession = 0; - LootTracker.grinchesSession = 0; - LootTracker.yetisSession = 0; - LootTracker.yetiTimeSession = -1; - LootTracker.yetiSCsSession = -1; - LootTracker.nurseSharksSession = 0; - LootTracker.blueSharksSession = 0; - LootTracker.tigerSharksSession = 0; - LootTracker.greatWhiteSharksSession = 0; - LootTracker.scarecrowsSession = 0; - LootTracker.nightmaresSession = 0; - LootTracker.werewolfsSession = 0; - LootTracker.phantomFishersSession = 0; - LootTracker.grimReapersSession = 0; + FishingTracker.seaCreaturesSession = 0; + FishingTracker.goodCatchesSession = 0; + FishingTracker.greatCatchesSession = 0; + FishingTracker.squidsSession = 0; + FishingTracker.seaWalkersSession = 0; + FishingTracker.nightSquidsSession = 0; + FishingTracker.seaGuardiansSession = 0; + FishingTracker.seaWitchesSession = 0; + FishingTracker.seaArchersSession = 0; + FishingTracker.monsterOfTheDeepsSession = 0; + FishingTracker.catfishesSession = 0; + FishingTracker.carrotKingsSession = 0; + FishingTracker.seaLeechesSession = 0; + FishingTracker.guardianDefendersSession = 0; + FishingTracker.deepSeaProtectorsSession = 0; + FishingTracker.hydrasSession = 0; + FishingTracker.seaEmperorsSession = 0; + FishingTracker.empTimeSession = -1; + FishingTracker.empSCsSession = -1; + FishingTracker.fishingMilestoneSession = 0; + FishingTracker.frozenStevesSession = 0; + FishingTracker.frostyTheSnowmansSession = 0; + FishingTracker.grinchesSession = 0; + FishingTracker.yetisSession = 0; + FishingTracker.yetiTimeSession = -1; + FishingTracker.yetiSCsSession = -1; + FishingTracker.nurseSharksSession = 0; + FishingTracker.blueSharksSession = 0; + FishingTracker.tigerSharksSession = 0; + FishingTracker.greatWhiteSharksSession = 0; + FishingTracker.scarecrowsSession = 0; + FishingTracker.nightmaresSession = 0; + FishingTracker.werewolfsSession = 0; + FishingTracker.phantomFishersSession = 0; + FishingTracker.grimReapersSession = 0; ConfigHandler.deleteCategory("fishing"); ConfigHandler.reloadConfig(); } static void resetMythological() { - LootTracker.mythCoinsSession = 0; - LootTracker.griffinFeathersSession = 0; - LootTracker.crownOfGreedsSession = 0; - LootTracker.washedUpSouvenirsSession = 0; - LootTracker.minosHuntersSession = 0; - LootTracker.siameseLynxesSession = 0; - LootTracker.minotaursSession = 0; - LootTracker.gaiaConstructsSession = 0; - LootTracker.minosChampionsSession = 0; - LootTracker.minosInquisitorsSession = 0; + MythologicalTracker.mythCoinsSession = 0; + MythologicalTracker.griffinFeathersSession = 0; + MythologicalTracker.crownOfGreedsSession = 0; + MythologicalTracker.washedUpSouvenirsSession = 0; + MythologicalTracker.minosHuntersSession = 0; + MythologicalTracker.siameseLynxesSession = 0; + MythologicalTracker.minotaursSession = 0; + MythologicalTracker.gaiaConstructsSession = 0; + MythologicalTracker.minosChampionsSession = 0; + MythologicalTracker.minosInquisitorsSession = 0; ConfigHandler.deleteCategory("mythological"); ConfigHandler.reloadConfig(); } static void resetCatacombs() { - LootTracker.recombobulatorsSession = 0; - LootTracker.fumingPotatoBooksSession = 0; - LootTracker.bonzoStaffsSession = 0; - LootTracker.f1CoinsSpentSession = 0; - LootTracker.f1TimeSpentSession = 0; - LootTracker.scarfStudiesSession = 0; - LootTracker.f2CoinsSpentSession = 0; - LootTracker.f2TimeSpentSession = 0; - LootTracker.adaptiveHelmsSession = 0; - LootTracker.adaptiveChestsSession = 0; - LootTracker.adaptiveLegsSession = 0; - LootTracker.adaptiveBootsSession = 0; - LootTracker.adaptiveSwordsSession = 0; - LootTracker.f3CoinsSpentSession = 0; - LootTracker.f3TimeSpentSession = 0; - LootTracker.spiritWingsSession = 0; - LootTracker.spiritBonesSession = 0; - LootTracker.spiritBootsSession = 0; - LootTracker.spiritSwordsSession = 0; - LootTracker.epicSpiritPetsSession = 0; - LootTracker.f4CoinsSpentSession = 0; - LootTracker.f4TimeSpentSession = 0; - LootTracker.warpedStonesSession = 0; - LootTracker.shadowAssHelmsSession = 0; - LootTracker.shadowAssChestsSession = 0; - LootTracker.shadowAssLegsSession = 0; - LootTracker.shadowAssBootsSession = 0; - LootTracker.lividDaggersSession = 0; - LootTracker.shadowFurysSession = 0; - LootTracker.f5CoinsSpentSession = 0; - LootTracker.f5TimeSpentSession = 0; - LootTracker.ancientRosesSession = 0; - LootTracker.precursorEyesSession = 0; - LootTracker.giantsSwordsSession = 0; - LootTracker.necroLordHelmsSession = 0; - LootTracker.necroLordChestsSession = 0; - LootTracker.necroLordLegsSession = 0; - LootTracker.necroLordBootsSession = 0; - LootTracker.necroSwordsSession = 0; - LootTracker.f6CoinsSpentSession = 0; - LootTracker.f6TimeSpentSession = 0; - LootTracker.witherBloodsSession = 0; - LootTracker.witherCloaksSession = 0; - LootTracker.implosionsSession = 0; - LootTracker.witherShieldsSession = 0; - LootTracker.shadowWarpsSession = 0; - LootTracker.necronsHandlesSession = 0; - LootTracker.autoRecombsSession = 0; - LootTracker.witherHelmsSession = 0; - LootTracker.witherChestsSession = 0; - LootTracker.witherLegsSession = 0; - LootTracker.witherBootsSession = 0; - LootTracker.f7CoinsSpentSession = 0; - LootTracker.f7TimeSpentSession = 0; + CatacombsTracker.recombobulatorsSession = 0; + CatacombsTracker.fumingPotatoBooksSession = 0; + CatacombsTracker.bonzoStaffsSession = 0; + CatacombsTracker.f1CoinsSpentSession = 0; + CatacombsTracker.f1TimeSpentSession = 0; + CatacombsTracker.scarfStudiesSession = 0; + CatacombsTracker.f2CoinsSpentSession = 0; + CatacombsTracker.f2TimeSpentSession = 0; + CatacombsTracker.adaptiveHelmsSession = 0; + CatacombsTracker.adaptiveChestsSession = 0; + CatacombsTracker.adaptiveLegsSession = 0; + CatacombsTracker.adaptiveBootsSession = 0; + CatacombsTracker.adaptiveSwordsSession = 0; + CatacombsTracker.f3CoinsSpentSession = 0; + CatacombsTracker.f3TimeSpentSession = 0; + CatacombsTracker.spiritWingsSession = 0; + CatacombsTracker.spiritBonesSession = 0; + CatacombsTracker.spiritBootsSession = 0; + CatacombsTracker.spiritSwordsSession = 0; + CatacombsTracker.epicSpiritPetsSession = 0; + CatacombsTracker.f4CoinsSpentSession = 0; + CatacombsTracker.f4TimeSpentSession = 0; + CatacombsTracker.warpedStonesSession = 0; + CatacombsTracker.shadowAssHelmsSession = 0; + CatacombsTracker.shadowAssChestsSession = 0; + CatacombsTracker.shadowAssLegsSession = 0; + CatacombsTracker.shadowAssBootsSession = 0; + CatacombsTracker.lividDaggersSession = 0; + CatacombsTracker.shadowFurysSession = 0; + CatacombsTracker.f5CoinsSpentSession = 0; + CatacombsTracker.f5TimeSpentSession = 0; + CatacombsTracker.ancientRosesSession = 0; + CatacombsTracker.precursorEyesSession = 0; + CatacombsTracker.giantsSwordsSession = 0; + CatacombsTracker.necroLordHelmsSession = 0; + CatacombsTracker.necroLordChestsSession = 0; + CatacombsTracker.necroLordLegsSession = 0; + CatacombsTracker.necroLordBootsSession = 0; + CatacombsTracker.necroSwordsSession = 0; + CatacombsTracker.f6CoinsSpentSession = 0; + CatacombsTracker.f6TimeSpentSession = 0; + CatacombsTracker.witherBloodsSession = 0; + CatacombsTracker.witherCloaksSession = 0; + CatacombsTracker.implosionsSession = 0; + CatacombsTracker.witherShieldsSession = 0; + CatacombsTracker.shadowWarpsSession = 0; + CatacombsTracker.necronsHandlesSession = 0; + CatacombsTracker.autoRecombsSession = 0; + CatacombsTracker.witherHelmsSession = 0; + CatacombsTracker.witherChestsSession = 0; + CatacombsTracker.witherLegsSession = 0; + CatacombsTracker.witherBootsSession = 0; + CatacombsTracker.f7CoinsSpentSession = 0; + CatacombsTracker.f7TimeSpentSession = 0; ConfigHandler.deleteCategory("catacombs"); ConfigHandler.reloadConfig(); } diff --git a/src/main/java/me/Danker/events/PacketReadEvent.java b/src/main/java/me/Danker/events/PacketReadEvent.java new file mode 100644 index 0000000..0f3ed7e --- /dev/null +++ b/src/main/java/me/Danker/events/PacketReadEvent.java @@ -0,0 +1,16 @@ +package me.Danker.events; + +import net.minecraft.network.Packet; +import net.minecraftforge.fml.common.eventhandler.Cancelable; +import net.minecraftforge.fml.common.eventhandler.Event; + +@Cancelable +public class PacketReadEvent extends Event { + + public Packet packet; + + public PacketReadEvent(Packet packet) { + this.packet = packet; + } + +} diff --git a/src/main/java/me/Danker/events/PacketWriteEvent.java b/src/main/java/me/Danker/events/PacketWriteEvent.java new file mode 100644 index 0000000..8af5a60 --- /dev/null +++ b/src/main/java/me/Danker/events/PacketWriteEvent.java @@ -0,0 +1,16 @@ +package me.Danker.events; + +import net.minecraft.network.Packet; +import net.minecraftforge.fml.common.eventhandler.Cancelable; +import net.minecraftforge.fml.common.eventhandler.Event; + +@Cancelable +public class PacketWriteEvent extends Event { + + public Packet packet; + + public PacketWriteEvent(Packet packet) { + this.packet = packet; + } + +} diff --git a/src/main/java/me/Danker/events/RenderOverlay.java b/src/main/java/me/Danker/events/RenderOverlay.java deleted file mode 100644 index 06c181f..0000000 --- a/src/main/java/me/Danker/events/RenderOverlay.java +++ /dev/null @@ -1,6 +0,0 @@ -package me.Danker.events; - -import net.minecraftforge.fml.common.eventhandler.Event; - -public class RenderOverlay extends Event { -} diff --git a/src/main/java/me/Danker/events/RenderOverlayEvent.java b/src/main/java/me/Danker/events/RenderOverlayEvent.java new file mode 100644 index 0000000..64264bd --- /dev/null +++ b/src/main/java/me/Danker/events/RenderOverlayEvent.java @@ -0,0 +1,6 @@ +package me.Danker.events; + +import net.minecraftforge.fml.common.eventhandler.Event; + +public class RenderOverlayEvent extends Event { +} diff --git a/src/main/java/me/Danker/features/ArachneESP.java b/src/main/java/me/Danker/features/ArachneESP.java index 1848a9b..807cfb1 100644 --- a/src/main/java/me/Danker/features/ArachneESP.java +++ b/src/main/java/me/Danker/features/ArachneESP.java @@ -1,7 +1,7 @@ package me.Danker.features; import me.Danker.commands.ToggleCommand; -import me.Danker.handlers.ScoreboardHandler; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; @@ -57,7 +57,7 @@ public class ArachneESP { if (arachne != null) { if (arachneActive && ToggleCommand.highlightArachne) { AxisAlignedBB aabb = new AxisAlignedBB(arachne.posX - 0.75, arachne.posY - 1, arachne.posZ - 0.75, arachne.posX + 0.75, arachne.posY, arachne.posZ + 0.75); - Utils.draw3DBox(aabb, ARACHANE_COLOUR, event.partialTicks); + RenderUtils.draw3DBox(aabb, ARACHANE_COLOUR, event.partialTicks); } } } diff --git a/src/main/java/me/Danker/features/BonzoMaskTimer.java b/src/main/java/me/Danker/features/BonzoMaskTimer.java index e038786..e27d0bf 100644 --- a/src/main/java/me/Danker/features/BonzoMaskTimer.java +++ b/src/main/java/me/Danker/features/BonzoMaskTimer.java @@ -3,7 +3,7 @@ package me.Danker.features; import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; import me.Danker.commands.ToggleCommand; -import me.Danker.events.RenderOverlay; +import me.Danker.events.RenderOverlayEvent; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; @@ -56,7 +56,7 @@ public class BonzoMaskTimer { } @SubscribeEvent - public void renderPlayerInfo(RenderOverlay event) { + public void renderPlayerInfo(RenderOverlayEvent event) { if (ToggleCommand.bonzoTimerToggled && Utils.inDungeons) { Minecraft mc = Minecraft.getMinecraft(); ItemStack helmetSlot = mc.thePlayer.getCurrentArmor(3); diff --git a/src/main/java/me/Danker/features/CakeTimer.java b/src/main/java/me/Danker/features/CakeTimer.java index ba6eb3d..480ff07 100644 --- a/src/main/java/me/Danker/features/CakeTimer.java +++ b/src/main/java/me/Danker/features/CakeTimer.java @@ -3,7 +3,7 @@ package me.Danker.features; import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; import me.Danker.commands.ToggleCommand; -import me.Danker.events.RenderOverlay; +import me.Danker.events.RenderOverlayEvent; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; @@ -36,7 +36,7 @@ public class CakeTimer { } @SubscribeEvent - public void renderPlayerInfo(RenderOverlay event) { + public void renderPlayerInfo(RenderOverlayEvent event) { if (ToggleCommand.cakeTimerToggled && Utils.inSkyblock) { Minecraft mc = Minecraft.getMinecraft(); double scale = ScaleCommand.cakeTimerScale; diff --git a/src/main/java/me/Danker/features/CrystalHollowWaypoints.java b/src/main/java/me/Danker/features/CrystalHollowWaypoints.java index 37f709a..fdd49f2 100644 --- a/src/main/java/me/Danker/features/CrystalHollowWaypoints.java +++ b/src/main/java/me/Danker/features/CrystalHollowWaypoints.java @@ -3,6 +3,7 @@ package me.Danker.features; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; import me.Danker.handlers.ScoreboardHandler; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.entity.item.EntityArmorStand; @@ -139,7 +140,7 @@ public class CrystalHollowWaypoints { public void onWorldRender(RenderWorldLastEvent event) { if (ToggleCommand.crystalHollowWaypoints && Utils.tabLocation.equals("Crystal Hollows")) { for (Waypoint waypoint : waypoints) { - if (waypoint.toggled) Utils.draw3DWaypointString(waypoint, event.partialTicks); + if (waypoint.toggled) RenderUtils.draw3DWaypointString(waypoint, event.partialTicks); } } } diff --git a/src/main/java/me/Danker/features/DungeonTimer.java b/src/main/java/me/Danker/features/DungeonTimer.java index 394f2de..9d363db 100644 --- a/src/main/java/me/Danker/features/DungeonTimer.java +++ b/src/main/java/me/Danker/features/DungeonTimer.java @@ -3,7 +3,7 @@ package me.Danker.features; import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; import me.Danker.commands.ToggleCommand; -import me.Danker.events.RenderOverlay; +import me.Danker.events.RenderOverlayEvent; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; @@ -56,7 +56,7 @@ public class DungeonTimer { } @SubscribeEvent - public void renderPlayerInfo(RenderOverlay event) { + public void renderPlayerInfo(RenderOverlayEvent event) { if (ToggleCommand.dungeonTimerToggled && Utils.inDungeons) { Minecraft mc = Minecraft.getMinecraft(); String dungeonTimerText = EnumChatFormatting.GRAY + "Wither Doors:\n" + diff --git a/src/main/java/me/Danker/features/GiantHPDisplay.java b/src/main/java/me/Danker/features/GiantHPDisplay.java index 456ba0a..4af31ae 100644 --- a/src/main/java/me/Danker/features/GiantHPDisplay.java +++ b/src/main/java/me/Danker/features/GiantHPDisplay.java @@ -4,7 +4,7 @@ import me.Danker.DankersSkyblockMod; import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; import me.Danker.commands.ToggleCommand; -import me.Danker.events.RenderOverlay; +import me.Danker.events.RenderOverlayEvent; import me.Danker.handlers.ScoreboardHandler; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; @@ -58,7 +58,7 @@ public class GiantHPDisplay { } @SubscribeEvent - public void renderPlayerInfo(RenderOverlay event) { + public void renderPlayerInfo(RenderOverlayEvent event) { if (ToggleCommand.giantHP && Utils.inDungeons && giants.size() > 0) { StringBuilder sb = new StringBuilder(); diff --git a/src/main/java/me/Danker/features/GolemSpawningAlert.java b/src/main/java/me/Danker/features/GolemSpawningAlert.java index de5cb89..87af663 100644 --- a/src/main/java/me/Danker/features/GolemSpawningAlert.java +++ b/src/main/java/me/Danker/features/GolemSpawningAlert.java @@ -3,7 +3,7 @@ package me.Danker.features; import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; import me.Danker.commands.ToggleCommand; -import me.Danker.events.RenderOverlay; +import me.Danker.events.RenderOverlayEvent; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; @@ -37,7 +37,7 @@ public class GolemSpawningAlert { } @SubscribeEvent - public void renderPlayerInfo(RenderOverlay event) { + public void renderPlayerInfo(RenderOverlayEvent event) { if (ToggleCommand.golemAlertToggled && Utils.inSkyblock && golemTime > System.currentTimeMillis() / 1000) { Minecraft mc = Minecraft.getMinecraft(); double scale = ScaleCommand.golemTimerScale; diff --git a/src/main/java/me/Danker/features/HighlightSkeletonMasters.java b/src/main/java/me/Danker/features/HighlightSkeletonMasters.java index f97699c..72259db 100644 --- a/src/main/java/me/Danker/features/HighlightSkeletonMasters.java +++ b/src/main/java/me/Danker/features/HighlightSkeletonMasters.java @@ -1,6 +1,7 @@ package me.Danker.features; import me.Danker.commands.ToggleCommand; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -33,7 +34,7 @@ public class HighlightSkeletonMasters { if (ToggleCommand.highlightSkeletonMasters) { for (Entity skeletonMaster : skeletonMasters) { if (!skeletonMaster.isDead) - Utils.draw3DBox(skeletonMaster.getEntityBoundingBox(), SKELETON_MASTER_COLOUR, event.partialTicks); + RenderUtils.draw3DBox(skeletonMaster.getEntityBoundingBox(), SKELETON_MASTER_COLOUR, event.partialTicks); } skeletonMasters.clear(); } diff --git a/src/main/java/me/Danker/features/NoF3Coords.java b/src/main/java/me/Danker/features/NoF3Coords.java index 4f362e6..7dc304c 100644 --- a/src/main/java/me/Danker/features/NoF3Coords.java +++ b/src/main/java/me/Danker/features/NoF3Coords.java @@ -3,7 +3,7 @@ package me.Danker.features; import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; import me.Danker.commands.ToggleCommand; -import me.Danker.events.RenderOverlay; +import me.Danker.events.RenderOverlayEvent; import me.Danker.handlers.TextRenderer; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; @@ -14,7 +14,7 @@ public class NoF3Coords { public static String COORDS_COLOUR; @SubscribeEvent - public void renderPlayerInfo(RenderOverlay event) { + public void renderPlayerInfo(RenderOverlayEvent event) { Minecraft mc = Minecraft.getMinecraft(); if (ToggleCommand.coordsToggled) { diff --git a/src/main/java/me/Danker/features/PetColours.java b/src/main/java/me/Danker/features/PetColours.java index 5889b12..940bb08 100644 --- a/src/main/java/me/Danker/features/PetColours.java +++ b/src/main/java/me/Danker/features/PetColours.java @@ -2,6 +2,7 @@ package me.Danker.features; import me.Danker.commands.ToggleCommand; import me.Danker.events.GuiChestBackgroundDrawnEvent; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -60,7 +61,7 @@ public class PetColours { } else { colour = PET_1_TO_9; } - Utils.drawOnSlot(event.chestSize, slot.xDisplayPosition, slot.yDisplayPosition, colour + 0xBF000000); + RenderUtils.drawOnSlot(event.chestSize, slot.xDisplayPosition, slot.yDisplayPosition, colour + 0xBF000000); } } } diff --git a/src/main/java/me/Danker/features/Skill50Display.java b/src/main/java/me/Danker/features/Skill50Display.java index 5a58b0c..7025ac5 100644 --- a/src/main/java/me/Danker/features/Skill50Display.java +++ b/src/main/java/me/Danker/features/Skill50Display.java @@ -4,7 +4,7 @@ import me.Danker.DankersSkyblockMod; import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; import me.Danker.commands.ToggleCommand; -import me.Danker.events.RenderOverlay; +import me.Danker.events.RenderOverlayEvent; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; @@ -113,7 +113,7 @@ public class Skill50Display { } @SubscribeEvent - public void renderPlayerInfo(RenderOverlay event) { + public void renderPlayerInfo(RenderOverlayEvent event) { if (!Utils.skillsInitialized() && Utils.inSkyblock) { new TextRenderer(Minecraft.getMinecraft(), EnumChatFormatting.RED + "Please open the skill menu to use skill features. (/skills)", MoveCommand.skill50XY[0], MoveCommand.skill50XY[0], ScaleCommand.skill50Scale); return; diff --git a/src/main/java/me/Danker/features/SkillTracker.java b/src/main/java/me/Danker/features/SkillTracker.java index 3d932d0..1c1005f 100644 --- a/src/main/java/me/Danker/features/SkillTracker.java +++ b/src/main/java/me/Danker/features/SkillTracker.java @@ -4,7 +4,7 @@ import me.Danker.DankersSkyblockMod; import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; import me.Danker.commands.ToggleCommand; -import me.Danker.events.RenderOverlay; +import me.Danker.events.RenderOverlayEvent; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; @@ -166,7 +166,7 @@ public class SkillTracker { } @SubscribeEvent - public void renderPlayerInfo(RenderOverlay event) { + public void renderPlayerInfo(RenderOverlayEvent event) { if (showSkillTracker && Utils.inSkyblock) { if (!Utils.skillsInitialized()) { new TextRenderer(Minecraft.getMinecraft(), EnumChatFormatting.RED + "Please open the skill menu to use skill features. (/skills)", MoveCommand.skillTrackerXY[0], MoveCommand.skillTrackerXY[0], ScaleCommand.skillTrackerScale); diff --git a/src/main/java/me/Danker/features/SlayerESP.java b/src/main/java/me/Danker/features/SlayerESP.java index 3629474..b179979 100644 --- a/src/main/java/me/Danker/features/SlayerESP.java +++ b/src/main/java/me/Danker/features/SlayerESP.java @@ -3,6 +3,7 @@ package me.Danker.features; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; import me.Danker.handlers.ScoreboardHandler; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; @@ -105,22 +106,22 @@ public class SlayerESP { if (slayerActive && ToggleCommand.highlightSlayers) { if (zombie != null) { AxisAlignedBB aabb = new AxisAlignedBB(zombie.posX - 0.5, zombie.posY - 2, zombie.posZ - 0.5, zombie.posX + 0.5, zombie.posY, zombie.posZ + 0.5); - Utils.draw3DBox(aabb, SLAYER_COLOUR, event.partialTicks); + RenderUtils.draw3DBox(aabb, SLAYER_COLOUR, event.partialTicks); return; } if (spider != null) { AxisAlignedBB aabb = new AxisAlignedBB(spider.posX - 0.75, spider.posY - 1, spider.posZ - 0.75, spider.posX + 0.75, spider.posY, spider.posZ + 0.75); - Utils.draw3DBox(aabb, SLAYER_COLOUR, event.partialTicks); + RenderUtils.draw3DBox(aabb, SLAYER_COLOUR, event.partialTicks); return; } if (wolf != null) { AxisAlignedBB aabb = new AxisAlignedBB(wolf.posX - 0.5, wolf.posY - 1, wolf.posZ - 0.5, wolf.posX + 0.5, wolf.posY, wolf.posZ + 0.5); - Utils.draw3DBox(aabb, SLAYER_COLOUR, event.partialTicks); + RenderUtils.draw3DBox(aabb, SLAYER_COLOUR, event.partialTicks); return; } if (enderman != null) { AxisAlignedBB aabb = new AxisAlignedBB(enderman.posX - 0.5, enderman.posY - 3, enderman.posZ - 0.5, enderman.posX + 0.5, enderman.posY, enderman.posZ + 0.5); - Utils.draw3DBox(aabb, SLAYER_COLOUR, event.partialTicks); + RenderUtils.draw3DBox(aabb, SLAYER_COLOUR, event.partialTicks); return; } } diff --git a/src/main/java/me/Danker/features/SpiritBootsFix.java b/src/main/java/me/Danker/features/SpiritBootsFix.java new file mode 100644 index 0000000..c50b538 --- /dev/null +++ b/src/main/java/me/Danker/features/SpiritBootsFix.java @@ -0,0 +1,28 @@ +package me.Danker.features; + +import me.Danker.events.PacketReadEvent; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.network.play.server.S04PacketEntityEquipment; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.ReflectionHelper; + +import java.lang.reflect.Field; + +public class SpiritBootsFix { + + static Field slot = ReflectionHelper.findField(S04PacketEntityEquipment.class, "equipmentSlot", "field_149392_b"); + + @SubscribeEvent + public void onPacketRead(PacketReadEvent event) throws IllegalAccessException { + if (Utils.inSkyblock && event.packet instanceof S04PacketEntityEquipment) { + S04PacketEntityEquipment packet = (S04PacketEntityEquipment) event.packet; + if (packet.getEntityID() == Minecraft.getMinecraft().thePlayer.getEntityId()) { + slot.setAccessible(true); + slot.setInt(packet, slot.getInt(packet) + 1); + event.packet = packet; + } + } + } + +} diff --git a/src/main/java/me/Danker/features/TetherDisplay.java b/src/main/java/me/Danker/features/TetherDisplay.java index 363b90f..1af3a0f 100644 --- a/src/main/java/me/Danker/features/TetherDisplay.java +++ b/src/main/java/me/Danker/features/TetherDisplay.java @@ -4,7 +4,7 @@ import me.Danker.DankersSkyblockMod; import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; import me.Danker.commands.ToggleCommand; -import me.Danker.events.RenderOverlay; +import me.Danker.events.RenderOverlayEvent; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; @@ -45,7 +45,7 @@ public class TetherDisplay { } @SubscribeEvent - public void renderPlayerInfo(RenderOverlay event) { + public void renderPlayerInfo(RenderOverlayEvent event) { if (ToggleCommand.teammatesInRadius && Utils.inDungeons) { String teammates; if (playersInRadius.size() > 0) { diff --git a/src/main/java/me/Danker/features/loot/CatacombsTracker.java b/src/main/java/me/Danker/features/loot/CatacombsTracker.java new file mode 100644 index 0000000..9de197c --- /dev/null +++ b/src/main/java/me/Danker/features/loot/CatacombsTracker.java @@ -0,0 +1,431 @@ +package me.Danker.features.loot; + +import me.Danker.events.ChestSlotClickedEvent; +import me.Danker.handlers.ConfigHandler; +import me.Danker.handlers.ScoreboardHandler; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StringUtils; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.util.List; + +public class CatacombsTracker { + + // Catacombs Dungeons + public static int recombobulators; + public static int fumingPotatoBooks; + // F1 + public static int bonzoStaffs; + public static double f1CoinsSpent; + public static double f1TimeSpent; + // F2 + public static int scarfStudies; + public static int adaptiveSwords; + public static double f2CoinsSpent; + public static double f2TimeSpent; + // F3 + public static int adaptiveHelms; + public static int adaptiveChests; + public static int adaptiveLegs; + public static int adaptiveBoots; + public static double f3CoinsSpent; + public static double f3TimeSpent; + // F4 + public static int spiritWings; + public static int spiritBones; + public static int spiritBoots; + public static int spiritSwords; + public static int spiritBows; + public static int epicSpiritPets; + public static int legSpiritPets; + public static double f4CoinsSpent; + public static double f4TimeSpent; + // F5 + public static int warpedStones; + public static int shadowAssHelms; + public static int shadowAssChests; + public static int shadowAssLegs; + public static int shadowAssBoots; + public static int lastBreaths; + public static int lividDaggers; + public static int shadowFurys; + public static double f5CoinsSpent; + public static double f5TimeSpent; + // F6 + public static int ancientRoses; + public static int precursorEyes; + public static int giantsSwords; + public static int necroLordHelms; + public static int necroLordChests; + public static int necroLordLegs; + public static int necroLordBoots; + public static int necroSwords; + public static double f6CoinsSpent; + public static double f6TimeSpent; + // F7 + public static int witherBloods; + public static int witherCloaks; + public static int implosions; + public static int witherShields; + public static int shadowWarps; + public static int necronsHandles; + public static int autoRecombs; + public static int witherHelms; + public static int witherChests; + public static int witherLegs; + public static int witherBoots; + public static double f7CoinsSpent; + public static double f7TimeSpent; + + // Catacombs Dungeons + public static int recombobulatorsSession = 0; + public static int fumingPotatoBooksSession = 0; + // F1 + public static int bonzoStaffsSession = 0; + public static double f1CoinsSpentSession = 0; + public static double f1TimeSpentSession = 0; + // F2 + public static int scarfStudiesSession = 0; + public static int adaptiveSwordsSession = 0; + public static double f2CoinsSpentSession = 0; + public static double f2TimeSpentSession = 0; + // F3 + public static int adaptiveHelmsSession = 0; + public static int adaptiveChestsSession = 0; + public static int adaptiveLegsSession = 0; + public static int adaptiveBootsSession = 0; + public static double f3CoinsSpentSession = 0; + public static double f3TimeSpentSession = 0; + // F4 + public static int spiritWingsSession = 0; + public static int spiritBonesSession = 0; + public static int spiritBootsSession = 0; + public static int spiritSwordsSession = 0; + public static int spiritBowsSession = 0; + public static int epicSpiritPetsSession = 0; + public static int legSpiritPetsSession = 0; + public static double f4CoinsSpentSession = 0; + public static double f4TimeSpentSession = 0; + // F5 + public static int warpedStonesSession = 0; + public static int shadowAssHelmsSession = 0; + public static int shadowAssChestsSession = 0; + public static int shadowAssLegsSession = 0; + public static int shadowAssBootsSession = 0; + public static int lastBreathsSession = 0; + public static int lividDaggersSession = 0; + public static int shadowFurysSession = 0; + public static double f5CoinsSpentSession = 0; + public static double f5TimeSpentSession = 0; + // F6 + public static int ancientRosesSession = 0; + public static int precursorEyesSession = 0; + public static int giantsSwordsSession = 0; + public static int necroLordHelmsSession = 0; + public static int necroLordChestsSession = 0; + public static int necroLordLegsSession = 0; + public static int necroLordBootsSession = 0; + public static int necroSwordsSession = 0; + public static double f6CoinsSpentSession = 0; + public static double f6TimeSpentSession = 0; + // F7 + public static int witherBloodsSession = 0; + public static int witherCloaksSession = 0; + public static int implosionsSession = 0; + public static int witherShieldsSession = 0; + public static int shadowWarpsSession = 0; + public static int necronsHandlesSession = 0; + public static int autoRecombsSession = 0; + public static int witherHelmsSession = 0; + public static int witherChestsSession = 0; + public static int witherLegsSession = 0; + public static int witherBootsSession = 0; + public static double f7CoinsSpentSession = 0; + public static double f7TimeSpentSession = 0; + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent event) { + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + + if (!Utils.inSkyblock) return; + if (event.type == 2) return; + if (message.contains(":")) return; + + if (message.contains(" ")) { + if (message.contains("Recombobulator 3000")) { + recombobulators++; + recombobulatorsSession++; + ConfigHandler.writeIntConfig("catacombs", "recombobulator", recombobulators); + } else if (message.contains("Fuming Potato Book")) { + fumingPotatoBooks++; + fumingPotatoBooksSession++; + ConfigHandler.writeIntConfig("catacombs", "fumingBooks", fumingPotatoBooks); + } else if (message.contains("Bonzo's Staff")) { // F1 + bonzoStaffs++; + bonzoStaffsSession++; + ConfigHandler.writeIntConfig("catacombs", "bonzoStaff", bonzoStaffs); + } else if (message.contains("Scarf's Studies")) { // F2 + scarfStudies++; + scarfStudiesSession++; + ConfigHandler.writeIntConfig("catacombs", "scarfStudies", scarfStudies); + } else if (message.contains("Adaptive Helmet")) { // F3 + adaptiveHelms++; + adaptiveHelmsSession++; + ConfigHandler.writeIntConfig("catacombs", "adaptiveHelm", adaptiveHelms); + } else if (message.contains("Adaptive Chestplate")) { + adaptiveChests++; + adaptiveChestsSession++; + ConfigHandler.writeIntConfig("catacombs", "adaptiveChest", adaptiveChests); + } else if (message.contains("Adaptive Leggings")) { + adaptiveLegs++; + adaptiveLegsSession++; + ConfigHandler.writeIntConfig("catacombs", "adaptiveLegging", adaptiveLegs); + } else if (message.contains("Adaptive Boots")) { + adaptiveBoots++; + adaptiveBootsSession++; + ConfigHandler.writeIntConfig("catacombs", "adaptiveBoot", adaptiveBoots); + } else if (message.contains("Adaptive Blade")) { + adaptiveSwords++; + adaptiveSwordsSession++; + ConfigHandler.writeIntConfig("catacombs", "adaptiveSword", adaptiveSwords); + } else if (message.contains("Spirit Wing")) { // F4 + spiritWings++; + spiritWingsSession++; + ConfigHandler.writeIntConfig("catacombs", "spiritWing", spiritWings); + } else if (message.contains("Spirit Bone")) { + spiritBones++; + spiritBonesSession++; + ConfigHandler.writeIntConfig("catacombs", "spiritBone", spiritBones); + } else if (message.contains("Spirit Boots")) { + spiritBoots++; + spiritBootsSession++; + ConfigHandler.writeIntConfig("catacombs", "spiritBoot", spiritBoots); + } else if (message.contains("[Lvl 1] Spirit")) { + String formattedMessage = event.message.getFormattedText(); + // Unicode colour code messes up here, just gonna remove the symbols + if (formattedMessage.contains("5Spirit")) { + epicSpiritPets++; + epicSpiritPetsSession++; + ConfigHandler.writeIntConfig("catacombs", "spiritPetEpic", epicSpiritPets); + } else if (formattedMessage.contains("6Spirit")) { + legSpiritPets++; + legSpiritPetsSession++; + ConfigHandler.writeIntConfig("catacombs", "spiritPetLeg", legSpiritPets); + } + } else if (message.contains("Spirit Sword")) { + spiritSwords++; + spiritSwordsSession++; + ConfigHandler.writeIntConfig("catacombs", "spiritSword", spiritSwords); + } else if (message.contains("Spirit Bow")) { + spiritBows++; + spiritBowsSession++; + ConfigHandler.writeIntConfig("catacombs", "spiritBow", spiritBows); + } else if (message.contains("Warped Stone")) { // F5 + warpedStones++; + warpedStonesSession++; + ConfigHandler.writeIntConfig("catacombs", "warpedStone", warpedStones); + } else if (message.contains("Shadow Assassin Helmet")) { + shadowAssHelms++; + shadowAssHelmsSession++; + ConfigHandler.writeIntConfig("catacombs", "shadowAssassinHelm", shadowAssHelms); + } else if (message.contains("Shadow Assassin Chestplate")) { + shadowAssChests++; + shadowAssChestsSession++; + ConfigHandler.writeIntConfig("catacombs", "shadowAssassinChest", shadowAssChests); + } else if (message.contains("Shadow Assassin Leggings")) { + shadowAssLegs++; + shadowAssLegsSession++; + ConfigHandler.writeIntConfig("catacombs", "shadowAssassinLegging", shadowAssLegs); + } else if (message.contains("Shadow Assassin Boots")) { + shadowAssBoots++; + shadowAssBootsSession++; + ConfigHandler.writeIntConfig("catacombs", "shadowAssassinBoot", shadowAssBoots); + } else if (message.contains("Livid Dagger")) { + lividDaggers++; + lividDaggersSession++; + ConfigHandler.writeIntConfig("catacombs", "lividDagger", lividDaggers); + } else if (message.contains("Shadow Fury")) { + shadowFurys++; + shadowFurysSession++; + ConfigHandler.writeIntConfig("catacombs", "shadowFury", shadowFurys); + } else if (message.contains("Ancient Rose")) { // F6 + ancientRoses++; + ancientRosesSession++; + ConfigHandler.writeIntConfig("catacombs", "ancientRose", ancientRoses); + } else if (message.contains("Precursor Eye")) { + precursorEyes++; + precursorEyesSession++; + ConfigHandler.writeIntConfig("catacombs", "precursorEye", precursorEyes); + } else if (message.contains("Giant's Sword")) { + giantsSwords++; + giantsSwordsSession++; + ConfigHandler.writeIntConfig("catacombs", "giantsSword", giantsSwords); + } else if (message.contains("Necromancer Lord Helmet")) { + necroLordHelms++; + necroLordHelmsSession++; + ConfigHandler.writeIntConfig("catacombs", "necroLordHelm", necroLordHelms); + } else if (message.contains("Necromancer Lord Chestplate")) { + necroLordChests++; + necroLordChestsSession++; + ConfigHandler.writeIntConfig("catacombs", "necroLordChest", necroLordChests); + } else if (message.contains("Necromancer Lord Leggings")) { + necroLordLegs++; + necroLordLegsSession++; + ConfigHandler.writeIntConfig("catacombs", "necroLordLegging", necroLordLegs); + } else if (message.contains("Necromancer Lord Boots")) { + necroLordBoots++; + necroLordBootsSession++; + ConfigHandler.writeIntConfig("catacombs", "necroLordBoot", necroLordBoots); + } else if (message.contains("Necromancer Sword")) { + necroSwords++; + necroSwordsSession++; + ConfigHandler.writeIntConfig("catacombs", "necroSword", necroSwords); + } else if (message.contains("Wither Blood")) { // F7 + witherBloods++; + witherBloodsSession++; + ConfigHandler.writeIntConfig("catacombs", "witherBlood", witherBloods); + } else if (message.contains("Wither Cloak")) { + witherCloaks++; + witherCloaksSession++; + ConfigHandler.writeIntConfig("catacombs", "witherCloak", witherCloaks); + } else if (message.contains("Implosion")) { + implosions++; + implosionsSession++; + ConfigHandler.writeIntConfig("catacombs", "implosion", implosions); + } else if (message.contains("Wither Shield")) { + witherShields++; + witherShieldsSession++; + ConfigHandler.writeIntConfig("catacombs", "witherShield", witherShields); + } else if (message.contains("Shadow Warp")) { + shadowWarps++; + shadowWarpsSession++; + ConfigHandler.writeIntConfig("catacombs", "shadowWarp", shadowWarps); + } else if (message.contains("Necron's Handle")) { + necronsHandles++; + necronsHandlesSession++; + ConfigHandler.writeIntConfig("catacombs", "necronsHandle", necronsHandles); + } else if (message.contains("Auto Recombobulator")) { + autoRecombs++; + autoRecombsSession++; + ConfigHandler.writeIntConfig("catacombs", "autoRecomb", autoRecombs); + } else if (message.contains("Wither Helmet")) { + witherHelms++; + witherHelmsSession++; + ConfigHandler.writeIntConfig("catacombs", "witherHelm", witherHelms); + } else if (message.contains("Wither Chestplate")) { + witherChests++; + witherChestsSession++; + ConfigHandler.writeIntConfig("catacombs", "witherChest", witherChests); + } else if (message.contains("Wither Leggings")) { + witherLegs++; + witherLegsSession++; + ConfigHandler.writeIntConfig("catacombs", "witherLegging", witherLegs); + } else if (message.contains("Wither Boots")) { + witherBoots++; + witherBootsSession++; + ConfigHandler.writeIntConfig("catacombs", "witherBoot", witherBoots); + } + } + + if (message.contains("EXTRA STATS ")) { + List scoreboard = ScoreboardHandler.getSidebarLines(); + int timeToAdd = 0; + for (String s : scoreboard) { + String sCleaned = ScoreboardHandler.cleanSB(s); + if (sCleaned.contains("The Catacombs (")) { + // Add time to floor + if (sCleaned.contains("F1")) { + f1TimeSpent = Math.floor(f1TimeSpent + timeToAdd); + f1TimeSpentSession = Math.floor(f1TimeSpentSession + timeToAdd); + ConfigHandler.writeDoubleConfig("catacombs", "floorOneTime", f1TimeSpent); + } else if (sCleaned.contains("F2")) { + f2TimeSpent = Math.floor(f2TimeSpent + timeToAdd); + f2TimeSpentSession = Math.floor(f2TimeSpentSession + timeToAdd); + ConfigHandler.writeDoubleConfig("catacombs", "floorTwoTime", f2TimeSpent); + } else if (sCleaned.contains("F3")) { + f3TimeSpent = Math.floor(f3TimeSpent + timeToAdd); + f3TimeSpentSession = Math.floor(f3TimeSpentSession + timeToAdd); + ConfigHandler.writeDoubleConfig("catacombs", "floorThreeTime", f3TimeSpent); + } else if (sCleaned.contains("F4")) { + f4TimeSpent = Math.floor(f4TimeSpent + timeToAdd); + f4TimeSpentSession = Math.floor(f4TimeSpentSession + timeToAdd); + ConfigHandler.writeDoubleConfig("catacombs", "floorFourTime", f4TimeSpent); + } else if (sCleaned.contains("F5")) { + f5TimeSpent = Math.floor(f5TimeSpent + timeToAdd); + f5TimeSpentSession = Math.floor(f5TimeSpentSession + timeToAdd); + ConfigHandler.writeDoubleConfig("catacombs", "floorFiveTime", f5TimeSpent); + } else if (sCleaned.contains("F6")) { + f6TimeSpent = Math.floor(f6TimeSpent + timeToAdd); + f6TimeSpentSession = Math.floor(f6TimeSpentSession + timeToAdd); + ConfigHandler.writeDoubleConfig("catacombs", "floorSixTime", f6TimeSpent); + } else if (sCleaned.contains("F7")) { + f7TimeSpent = Math.floor(f7TimeSpent + timeToAdd); + f7TimeSpentSession = Math.floor(f7TimeSpentSession + timeToAdd); + ConfigHandler.writeDoubleConfig("catacombs", "floorSevenTime", f7TimeSpent); + } + } else if (sCleaned.contains("Time Elapsed:")) { + // Get floor time + String time = sCleaned.substring(sCleaned.indexOf(":") + 2); + time = time.replaceAll("\\s", ""); + int minutes = Integer.parseInt(time.substring(0, time.indexOf("m"))); + int seconds = Integer.parseInt(time.substring(time.indexOf("m") + 1, time.indexOf("s"))); + timeToAdd = (minutes * 60) + seconds; + } + } + } + } + + @SubscribeEvent + public void onSlotClick(ChestSlotClickedEvent event) { + ItemStack item = event.item; + + if (event.inventoryName.endsWith(" Chest") && item != null && item.getDisplayName().contains("Open Reward Chest")) { + List tooltip = item.getTooltip(Minecraft.getMinecraft().thePlayer, Minecraft.getMinecraft().gameSettings.advancedItemTooltips); + for (String lineUnclean : tooltip) { + String line = StringUtils.stripControlCodes(lineUnclean); + if (line.contains("FREE")) { + break; + } else if (line.contains(" Coins")) { + int coinsSpent = Integer.parseInt(line.substring(0, line.indexOf(" ")).replaceAll(",", "")); + + if (Utils.isInScoreboard("The Catacombs (")) { + if (Utils.isInScoreboard("F1")) { + f1CoinsSpent += coinsSpent; + f1CoinsSpentSession += coinsSpent; + ConfigHandler.writeDoubleConfig("catacombs", "floorOneCoins", f1CoinsSpent); + } else if (Utils.isInScoreboard("F2")) { + f2CoinsSpent += coinsSpent; + f2CoinsSpentSession += coinsSpent; + ConfigHandler.writeDoubleConfig("catacombs", "floorTwoCoins", f2CoinsSpent); + } else if (Utils.isInScoreboard("F3")) { + f3CoinsSpent += coinsSpent; + f3CoinsSpentSession += coinsSpent; + ConfigHandler.writeDoubleConfig("catacombs", "floorThreeCoins", f3CoinsSpent); + } else if (Utils.isInScoreboard("F4")) { + f4CoinsSpent += coinsSpent; + f4CoinsSpentSession += coinsSpent; + ConfigHandler.writeDoubleConfig("catacombs", "floorFourCoins", f4CoinsSpent); + } else if (Utils.isInScoreboard("F5")) { + f5CoinsSpent += coinsSpent; + f5CoinsSpentSession += coinsSpent; + ConfigHandler.writeDoubleConfig("catacombs", "floorFiveCoins", f5CoinsSpent); + } else if (Utils.isInScoreboard("F6")) { + f6CoinsSpent += coinsSpent; + f6CoinsSpentSession += coinsSpent; + ConfigHandler.writeDoubleConfig("catacombs", "floorSixCoins", f6CoinsSpent); + } else if (Utils.isInScoreboard("F7")) { + f7CoinsSpent += coinsSpent; + f7CoinsSpentSession += coinsSpent; + ConfigHandler.writeDoubleConfig("catacombs", "floorSevenCoins", f7CoinsSpent); + } + } + break; + } + } + } + } + +} diff --git a/src/main/java/me/Danker/features/loot/EndermanTracker.java b/src/main/java/me/Danker/features/loot/EndermanTracker.java new file mode 100644 index 0000000..38b22f9 --- /dev/null +++ b/src/main/java/me/Danker/features/loot/EndermanTracker.java @@ -0,0 +1,178 @@ +package me.Danker.features.loot; + +import me.Danker.commands.ToggleCommand; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.Utils; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StringUtils; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class EndermanTracker { + + public static int endermanVoidglooms; + public static int endermanNullSpheres; + public static int endermanTAP; + public static int endermanTAPDrops; + public static int endermanEndersnakes; + public static int endermanSummoningEyes; + public static int endermanManaBooks; + public static int endermanTuners; + public static int endermanAtoms; + public static int endermanEspressoMachines; + public static int endermanSmartyBooks; + public static int endermanEndRunes; + public static int endermanChalices; + public static int endermanDice; + public static int endermanArtifacts; + public static int endermanSkins; + public static int endermanMergers; + public static int endermanCores; + public static int endermanEnchantRunes; + public static int endermanEnderBooks; + public static double endermanTime; + public static int endermanBosses; + + public static int endermanVoidgloomsSession = 0; + public static int endermanNullSpheresSession = 0; + public static int endermanTAPSession = 0; + public static int endermanTAPDropsSession = 0; + public static int endermanEndersnakesSession = 0; + public static int endermanSummoningEyesSession = 0; + public static int endermanManaBooksSession = 0; + public static int endermanTunersSession = 0; + public static int endermanAtomsSession = 0; + public static int endermanEspressoMachinesSession = 0; + public static int endermanSmartyBooksSession = 0; + public static int endermanEndRunesSession = 0; + public static int endermanChalicesSession = 0; + public static int endermanDiceSession = 0; + public static int endermanArtifactsSession = 0; + public static int endermanSkinsSession = 0; + public static int endermanMergersSession = 0; + public static int endermanCoresSession = 0; + public static int endermanEnchantRunesSession = 0; + public static int endermanEnderBooksSession = 0; + public static double endermanTimeSession = -1; + public static int endermanBossesSession = -1; + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent event) { + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + + if (!Utils.inSkyblock) return; + if (event.type == 2) return; + if (message.contains(":")) return; + + boolean rng = false; + + if (message.contains(" Enderman Slayer LVL ")) { + endermanVoidglooms++; + endermanVoidgloomsSession++; + if (endermanBosses != -1) { + endermanBosses++; + } + if (endermanBossesSession != -1) { + endermanBossesSession++; + } + ConfigHandler.writeIntConfig("enderman", "voidglooms", endermanVoidglooms); + ConfigHandler.writeIntConfig("enderman", "bossRNG", endermanBosses); + } else if (message.contains("RARE DROP! (") && message.contains("Twilight Arrow Poison)")) { + int amount = LootTracker.getAmountfromMessage(message); + endermanTAP += amount; + endermanTAPSession += amount; + endermanTAPDrops++; + endermanTAPDropsSession++; + ConfigHandler.writeIntConfig("enderman", "tap", endermanTAP); + ConfigHandler.writeIntConfig("enderman", "tapDrops", endermanTAPDrops); + } else if (message.contains("VERY RARE DROP! (") && message.contains(" Endersnake Rune I)")) { + endermanEndersnakes++; + endermanEndersnakesSession++; + ConfigHandler.writeIntConfig("enderman", "endersnakes", endermanEndersnakes); + } else if (message.contains("VERY RARE DROP! (Summoning Eye)")) { + endermanSummoningEyes++; + endermanSummoningEyesSession++; + ConfigHandler.writeIntConfig("enderman", "summoningEyes", endermanSummoningEyes); + } else if (message.contains("VERY RARE DROP! (Mana Steal I)")) { + endermanManaBooks++; + endermanManaBooksSession++; + ConfigHandler.writeIntConfig("enderman", "manaBooks", endermanManaBooks); + } else if (message.contains("VERY RARE DROP! (Transmission Tuner)")) { + endermanTuners++; + endermanTunersSession++; + ConfigHandler.writeIntConfig("enderman", "tuners", endermanTuners); + } else if (message.contains("VERY RARE DROP! (Null Atom)")) { + endermanAtoms++; + endermanAtomsSession++; + ConfigHandler.writeIntConfig("enderman", "atoms", endermanAtoms); + } else if (message.contains("CRAZY RARE DROP! (Pocket Espresso Machine)")) { + rng = true; + endermanEspressoMachines++; + endermanEspressoMachinesSession++; + ConfigHandler.writeIntConfig("enderman", "espressoMachines", endermanEspressoMachines); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.AQUA + "POCKET ESPRESSO MACHINE!", 3); + } else if (message.contains("VERY RARE DROP! (Smarty Pants I)")) { + endermanSmartyBooks++; + endermanSmartyBooksSession++; + ConfigHandler.writeIntConfig("enderman", "smartyBooks", endermanSmartyBooks); + } else if (message.contains("VERY RARE DROP! (") && message.contains(" End Rune I)")) { + endermanEndRunes++; + endermanEndRunesSession++; + ConfigHandler.writeIntConfig("enderman", "endRunes", endermanEndRunes); + } else if (message.contains("CRAZY RARE DROP! (Handy Blood Chalice)")) { + rng = true; + endermanChalices++; + endermanChalicesSession++; + ConfigHandler.writeIntConfig("enderman", "chalices", endermanChalices); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.RED + "HANDY BLOOD CHALICE!", 3); + } else if (message.contains("VERY RARE DROP! (Sinful Dice)")) { + endermanDice++; + endermanDiceSession++; + ConfigHandler.writeIntConfig("enderman", "dice", endermanDice); + } else if (message.contains("CRAZY RARE DROP! (Exceedingly Rare Ender Artifact Upgrader)")) { + rng = true; + endermanArtifacts++; + endermanArtifactsSession++; + ConfigHandler.writeIntConfig("enderman", "artifacts", endermanArtifacts); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "ENDER ARTIFACT UPGRADER!", 3); + } else if (message.contains("CRAZY RARE DROP! (Void Conqueror Enderman Skin)")) { + rng = true; + endermanSkins++; + endermanSkinsSession++; + ConfigHandler.writeIntConfig("enderman", "skins", endermanSkins); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "ENDERMAN SKIN!", 3); + } else if (message.contains("VERY RARE DROP! (Etherwarp Merger)")) { + endermanMergers++; + endermanMergersSession++; + ConfigHandler.writeIntConfig("enderman", "mergers", endermanMergers); + } else if (message.contains("CRAZY RARE DROP! (Judgement Core)")) { + rng = true; + endermanCores++; + endermanCoresSession++; + ConfigHandler.writeIntConfig("enderman", "cores", endermanCores); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GOLD + "JUDGEMENT CORE!", 5); + } else if (message.contains("CRAZY RARE DROP! (") && message.contains(" Enchant Rune I)")) { + rng = true; + endermanEnchantRunes++; + endermanEnchantRunesSession++; + ConfigHandler.writeIntConfig("enderman", "enchantRunes", endermanEnchantRunes); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GRAY + "ENCHANT RUNE!", 3); + } else if (message.contains("INSANE DROP! (Ender Slayer VII)") || message.contains("CRAZY RARE DROP! (Ender Slayer VII)")) { + rng = true; + endermanEnderBooks++; + endermanEnderBooksSession++; + ConfigHandler.writeIntConfig("enderman", "enderBooks", endermanEnderBooks); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.RED + "ENDER SLAYER VII!", 3); + } + + if (rng) { + endermanTime = System.currentTimeMillis() / 1000; + endermanBosses = 0; + endermanTimeSession = System.currentTimeMillis() / 1000; + endermanBossesSession = 0; + ConfigHandler.writeDoubleConfig("enderman", "timeRNG", endermanTime); + ConfigHandler.writeIntConfig("enderman", "bossRNG", 0); + } + } + +} diff --git a/src/main/java/me/Danker/features/loot/FishingTracker.java b/src/main/java/me/Danker/features/loot/FishingTracker.java new file mode 100644 index 0000000..c54f943 --- /dev/null +++ b/src/main/java/me/Danker/features/loot/FishingTracker.java @@ -0,0 +1,285 @@ +package me.Danker.features.loot; + +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.Utils; +import net.minecraft.util.StringUtils; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class FishingTracker { + + // Fishing + public static int seaCreatures; + public static int goodCatches; + public static int greatCatches; + public static int squids; + public static int seaWalkers; + public static int nightSquids; + public static int seaGuardians; + public static int seaWitches; + public static int seaArchers; + public static int monsterOfTheDeeps; + public static int catfishes; + public static int carrotKings; + public static int seaLeeches; + public static int guardianDefenders; + public static int deepSeaProtectors; + public static int hydras; + public static int seaEmperors; + public static double empTime; + public static int empSCs; + public static int fishingMilestone; + // Fishing Winter + public static int frozenSteves; + public static int frostyTheSnowmans; + public static int grinches; + public static int yetis; + public static double yetiTime; + public static int yetiSCs; + // Fishing Festival + public static int nurseSharks; + public static int blueSharks; + public static int tigerSharks; + public static int greatWhiteSharks; + // Spooky Fishing + public static int scarecrows; + public static int nightmares; + public static int werewolfs; + public static int phantomFishers; + public static int grimReapers; + + // Fishing + public static int seaCreaturesSession = 0; + public static int goodCatchesSession = 0; + public static int greatCatchesSession = 0; + public static int squidsSession = 0; + public static int seaWalkersSession = 0; + public static int nightSquidsSession = 0; + public static int seaGuardiansSession = 0; + public static int seaWitchesSession = 0; + public static int seaArchersSession = 0; + public static int monsterOfTheDeepsSession = 0; + public static int catfishesSession = 0; + public static int carrotKingsSession = 0; + public static int seaLeechesSession = 0; + public static int guardianDefendersSession = 0; + public static int deepSeaProtectorsSession = 0; + public static int hydrasSession = 0; + public static int seaEmperorsSession = 0; + public static double empTimeSession = -1; + public static int empSCsSession = -1; + public static int fishingMilestoneSession = 0; + // Fishing Winter + public static int frozenStevesSession = 0; + public static int frostyTheSnowmansSession = 0; + public static int grinchesSession = 0; + public static int yetisSession = 0; + public static double yetiTimeSession = -1; + public static int yetiSCsSession = -1; + // Fishing Festival + public static int nurseSharksSession = 0; + public static int blueSharksSession = 0; + public static int tigerSharksSession = 0; + public static int greatWhiteSharksSession = 0; + // Spooky Fishing + public static int scarecrowsSession = 0; + public static int nightmaresSession = 0; + public static int werewolfsSession = 0; + public static int phantomFishersSession = 0; + public static int grimReapersSession = 0; + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent event) { + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + + if (!Utils.inSkyblock) return; + if (event.type == 2) return; + if (message.contains(":")) return; + + if (message.contains("GOOD CATCH!")) { + goodCatches++; + goodCatchesSession++; + ConfigHandler.writeIntConfig("fishing", "goodCatch", goodCatches); + } else if (message.contains("GREAT CATCH!")) { + greatCatches++; + greatCatchesSession++; + ConfigHandler.writeIntConfig("fishing", "greatCatch", greatCatches); + } else if (message.contains("A Squid appeared")) { + squids++; + squidsSession++; + ConfigHandler.writeIntConfig("fishing", "squid", squids); + increaseSeaCreatures(); + } else if (message.contains("You caught a Sea Walker")) { + seaWalkers++; + seaWalkersSession++; + ConfigHandler.writeIntConfig("fishing", "seaWalker", seaWalkers); + increaseSeaCreatures(); + } else if (message.contains("Pitch darkness reveals a Night Squid")) { + nightSquids++; + nightSquidsSession++; + ConfigHandler.writeIntConfig("fishing", "nightSquid", nightSquids); + increaseSeaCreatures(); + } else if (message.contains("You stumbled upon a Sea Guardian")) { + seaGuardians++; + seaGuardiansSession++; + ConfigHandler.writeIntConfig("fishing", "seaGuardian", seaGuardians); + increaseSeaCreatures(); + } else if (message.contains("It looks like you've disrupted the Sea Witch's brewing session. Watch out, she's furious")) { + seaWitches++; + seaWitchesSession++; + ConfigHandler.writeIntConfig("fishing", "seaWitch", seaWitches); + increaseSeaCreatures(); + } else if (message.contains("You reeled in a Sea Archer")) { + seaArchers++; + seaArchersSession++; + ConfigHandler.writeIntConfig("fishing", "seaArcher", seaArchers); + increaseSeaCreatures(); + } else if (message.contains("The Monster of the Deep has emerged")) { + monsterOfTheDeeps++; + monsterOfTheDeepsSession++; + ConfigHandler.writeIntConfig("fishing", "monsterOfDeep", monsterOfTheDeeps); + increaseSeaCreatures(); + } else if (message.contains("Huh? A Catfish")) { + catfishes++; + catfishesSession++; + ConfigHandler.writeIntConfig("fishing", "catfish", catfishes); + increaseSeaCreatures(); + } else if (message.contains("Is this even a fish? It's the Carrot King")) { + carrotKings++; + carrotKingsSession++; + ConfigHandler.writeIntConfig("fishing", "carrotKing", carrotKings); + increaseSeaCreatures(); + } else if (message.contains("Gross! A Sea Leech")) { + seaLeeches++; + seaLeechesSession++; + ConfigHandler.writeIntConfig("fishing", "seaLeech", seaLeeches); + increaseSeaCreatures(); + } else if (message.contains("You've discovered a Guardian Defender of the sea")) { + guardianDefenders++; + guardianDefendersSession++; + ConfigHandler.writeIntConfig("fishing", "guardianDefender", guardianDefenders); + increaseSeaCreatures(); + } else if (message.contains("You have awoken the Deep Sea Protector, prepare for a battle")) { + deepSeaProtectors++; + deepSeaProtectorsSession++; + ConfigHandler.writeIntConfig("fishing", "deepSeaProtector", deepSeaProtectors); + increaseSeaCreatures(); + } else if (message.contains("The Water Hydra has come to test your strength")) { + hydras++; + hydrasSession++; + ConfigHandler.writeIntConfig("fishing", "hydra", hydras); + increaseSeaCreatures(); + } else if (message.contains("The Sea Emperor arises from the depths")) { + increaseSeaCreatures(); + + seaEmperors++; + empTime = System.currentTimeMillis() / 1000; + empSCs = 0; + seaEmperorsSession++; + empTimeSession = System.currentTimeMillis() / 1000; + empSCsSession = 0; + ConfigHandler.writeIntConfig("fishing", "seaEmperor", seaEmperors); + ConfigHandler.writeDoubleConfig("fishing", "empTime", empTime); + ConfigHandler.writeIntConfig("fishing", "empSC", empSCs); + } else if (message.contains("Frozen Steve fell into the pond long ago")) { // Fishing Winter + frozenSteves++; + frozenStevesSession++; + ConfigHandler.writeIntConfig("fishing", "frozenSteve", frozenSteves); + increaseSeaCreatures(); + } else if (message.contains("It's a snowman! He looks harmless")) { + frostyTheSnowmans++; + frostyTheSnowmansSession++; + ConfigHandler.writeIntConfig("fishing", "snowman", frostyTheSnowmans); + increaseSeaCreatures(); + } else if (message.contains("stole Jerry's Gifts...get them back")) { + grinches++; + grinchesSession++; + ConfigHandler.writeIntConfig("fishing", "grinch", grinches); + increaseSeaCreatures(); + } else if (message.contains("What is this creature")) { + yetis++; + yetiTime = System.currentTimeMillis() / 1000; + yetiSCs = 0; + yetisSession++; + yetiTimeSession = System.currentTimeMillis() / 1000; + yetiSCsSession = 0; + ConfigHandler.writeIntConfig("fishing", "yeti", yetis); + ConfigHandler.writeDoubleConfig("fishing", "yetiTime", yetiTime); + ConfigHandler.writeIntConfig("fishing", "yetiSC", yetiSCs); + increaseSeaCreatures(); + } else if (message.contains("A tiny fin emerges from the water, you've caught a Nurse Shark")) { // Fishing Festival + nurseSharks++; + nurseSharksSession++; + ConfigHandler.writeIntConfig("fishing", "nurseShark", nurseSharks); + increaseSeaCreatures(); + } else if (message.contains("You spot a fin as blue as the water it came from, it's a Blue Shark")) { + blueSharks++; + blueSharksSession++; + ConfigHandler.writeIntConfig("fishing", "blueShark", blueSharks); + increaseSeaCreatures(); + } else if (message.contains("A striped beast bounds from the depths, the wild Tiger Shark")) { + tigerSharks++; + tigerSharksSession++; + ConfigHandler.writeIntConfig("fishing", "tigerShark", tigerSharks); + increaseSeaCreatures(); + } else if (message.contains("Hide no longer, a Great White Shark has tracked your scent and thirsts for your blood")) { + greatWhiteSharks++; + greatWhiteSharksSession++; + ConfigHandler.writeIntConfig("fishing", "greatWhiteShark", greatWhiteSharks); + increaseSeaCreatures(); + } else if (message.contains("Phew! It's only a Scarecrow")) { + scarecrows++; + scarecrowsSession++; + ConfigHandler.writeIntConfig("fishing", "scarecrow", scarecrows); + increaseSeaCreatures(); + } else if (message.contains("You hear trotting from beneath the waves, you caught a Nightmare")) { + nightmares++; + nightmaresSession++; + ConfigHandler.writeIntConfig("fishing", "nightmare", nightmares); + increaseSeaCreatures(); + } else if (message.contains("It must be a full moon, a Werewolf appears")) { + werewolfs++; + werewolfsSession++; + ConfigHandler.writeIntConfig("fishing", "werewolf", werewolfs); + increaseSeaCreatures(); + } else if (message.contains("The spirit of a long lost Phantom Fisher has come to haunt you")) { + phantomFishers++; + phantomFishersSession++; + ConfigHandler.writeIntConfig("fishing", "phantomFisher", phantomFishers); + increaseSeaCreatures(); + } else if (message.contains("This can't be! The manifestation of death himself")) { + grimReapers++; + grimReapersSession++; + ConfigHandler.writeIntConfig("fishing", "grimReaper", grimReapers); + increaseSeaCreatures(); + } + } + + public void increaseSeaCreatures() { + if (empSCs != -1) { + empSCs++; + } + if (empSCsSession != -1) { + empSCsSession++; + } + // Only increment Yetis when in Jerry's Workshop + if (Utils.isInScoreboard("Jerry's Workshop") || Utils.isInScoreboard("Jerry Pond")) { + if (yetiSCs != -1) { + yetiSCs++; + } + if (yetiSCsSession != -1) { + yetiSCsSession++; + } + } + + seaCreatures++; + fishingMilestone++; + seaCreaturesSession++; + fishingMilestoneSession++; + ConfigHandler.writeIntConfig("fishing", "seaCreature", seaCreatures); + ConfigHandler.writeIntConfig("fishing", "milestone", fishingMilestone); + ConfigHandler.writeIntConfig("fishing", "empSC", empSCs); + ConfigHandler.writeIntConfig("fishing", "yetiSC", yetiSCs); + } + +} diff --git a/src/main/java/me/Danker/features/loot/GhostTracker.java b/src/main/java/me/Danker/features/loot/GhostTracker.java new file mode 100644 index 0000000..f402823 --- /dev/null +++ b/src/main/java/me/Danker/features/loot/GhostTracker.java @@ -0,0 +1,60 @@ +package me.Danker.features.loot; + +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.Utils; +import net.minecraft.util.StringUtils; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class GhostTracker { + + public static int sorrows = 0; + public static int bagOfCashs = 0; + public static int voltas = 0; + public static int plasmas = 0; + public static int ghostlyBoots = 0; + + public static int sorrowSession = 0; + public static int bagOfCashSession = 0; + public static int voltaSession = 0; + public static int plasmaSession = 0; + public static int ghostlyBootsSession = 0; + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent event) { + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + + if (!Utils.inSkyblock) return; + if (event.type == 2) return; + if (message.contains(":")) return; + + if (message.contains("RARE DROP!")) { + if (message.contains("Sorrow")) { + sorrows++; + sorrowSession++; + ConfigHandler.writeIntConfig("ghosts", "sorrow", sorrows); + } + if (message.contains("Volta")) { + voltas++; + voltaSession++; + ConfigHandler.writeIntConfig("ghosts", "volta", voltas); + } + if (message.contains("Plasma")) { + plasmas++; + plasmaSession++; + ConfigHandler.writeIntConfig("ghosts", "plasma", plasmas); + } + if (message.contains("Ghostly Boots")) { + ghostlyBoots++; + ghostlyBootsSession++; + ConfigHandler.writeIntConfig("ghosts", "ghostlyBoots", ghostlyBoots); + } + if (message.contains("The ghost's death materialized ")) { + bagOfCashs++; + bagOfCashSession++; + ConfigHandler.writeIntConfig("ghosts", "bagOfCash", bagOfCashs); + } + } + } + +} diff --git a/src/main/java/me/Danker/features/loot/LootDisplay.java b/src/main/java/me/Danker/features/loot/LootDisplay.java index 07a784a..9f7f0e3 100644 --- a/src/main/java/me/Danker/features/loot/LootDisplay.java +++ b/src/main/java/me/Danker/features/loot/LootDisplay.java @@ -3,7 +3,7 @@ package me.Danker.features.loot; import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; import me.Danker.commands.ToggleCommand; -import me.Danker.events.RenderOverlay; +import me.Danker.events.RenderOverlayEvent; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; @@ -20,7 +20,7 @@ public class LootDisplay { public static boolean auto; @SubscribeEvent - public void renderPlayerInfo(RenderOverlay event) { + public void renderPlayerInfo(RenderOverlayEvent event) { if (!display.equals("off")) { Minecraft mc = Minecraft.getMinecraft(); String dropsText = ""; @@ -35,20 +35,20 @@ public class LootDisplay { switch (display) { case "wolf": - if (LootTracker.wolfTime == -1) { + if (WolfTracker.wolfTime == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.wolfTime, timeNow); + timeBetween = Utils.getTimeBetween(WolfTracker.wolfTime, timeNow); } - if (LootTracker.wolfBosses == -1) { + if (WolfTracker.wolfBosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.wolfBosses); + bossesBetween = nf.format(WolfTracker.wolfBosses); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(LootTracker.wolfWheels); + drop20 = nf.format(WolfTracker.wolfWheels); } else { - drop20 = nf.format(LootTracker.wolfWheelsDrops) + " times"; + drop20 = nf.format(WolfTracker.wolfWheelsDrops) + " times"; } dropsText = EnumChatFormatting.GOLD + "Svens Killed:\n" + @@ -62,33 +62,33 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + "Overfluxes:\n" + EnumChatFormatting.AQUA + "Time Since RNG:\n" + EnumChatFormatting.AQUA + "Bosses Since RNG:"; - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.wolfSvens) + "\n" + - EnumChatFormatting.GREEN + nf.format(LootTracker.wolfTeeth) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(WolfTracker.wolfSvens) + "\n" + + EnumChatFormatting.GREEN + nf.format(WolfTracker.wolfTeeth) + "\n" + EnumChatFormatting.BLUE + drop20 + "\n" + - EnumChatFormatting.AQUA + LootTracker.wolfSpirits + "\n" + - EnumChatFormatting.WHITE + LootTracker.wolfBooks + "\n" + - EnumChatFormatting.DARK_RED + LootTracker.wolfEggs + "\n" + - EnumChatFormatting.GOLD + LootTracker.wolfCoutures + "\n" + - EnumChatFormatting.AQUA + LootTracker.wolfBaits + "\n" + - EnumChatFormatting.DARK_PURPLE + LootTracker.wolfFluxes + "\n" + + EnumChatFormatting.AQUA + WolfTracker.wolfSpirits + "\n" + + EnumChatFormatting.WHITE + WolfTracker.wolfBooks + "\n" + + EnumChatFormatting.DARK_RED + WolfTracker.wolfEggs + "\n" + + EnumChatFormatting.GOLD + WolfTracker.wolfCoutures + "\n" + + EnumChatFormatting.AQUA + WolfTracker.wolfBaits + "\n" + + EnumChatFormatting.DARK_PURPLE + WolfTracker.wolfFluxes + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; break; case "wolf_session": - if (LootTracker.wolfTimeSession == -1) { + if (WolfTracker.wolfTimeSession == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.wolfTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(WolfTracker.wolfTimeSession, timeNow); } - if (LootTracker.wolfBossesSession == -1) { + if (WolfTracker.wolfBossesSession == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.wolfBossesSession); + bossesBetween = nf.format(WolfTracker.wolfBossesSession); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(LootTracker.wolfWheelsSession); + drop20 = nf.format(WolfTracker.wolfWheelsSession); } else { - drop20 = nf.format(LootTracker.wolfWheelsDropsSession) + " times"; + drop20 = nf.format(WolfTracker.wolfWheelsDropsSession) + " times"; } dropsText = EnumChatFormatting.GOLD + "Svens Killed:\n" + @@ -102,33 +102,33 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + "Overfluxes:\n" + EnumChatFormatting.AQUA + "Time Since RNG:\n" + EnumChatFormatting.AQUA + "Bosses Since RNG:"; - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.wolfSvensSession) + "\n" + - EnumChatFormatting.GREEN + nf.format(LootTracker.wolfTeethSession) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(WolfTracker.wolfSvensSession) + "\n" + + EnumChatFormatting.GREEN + nf.format(WolfTracker.wolfTeethSession) + "\n" + EnumChatFormatting.BLUE + drop20 + "\n" + - EnumChatFormatting.AQUA + LootTracker.wolfSpiritsSession + "\n" + - EnumChatFormatting.WHITE + LootTracker.wolfBooksSession + "\n" + - EnumChatFormatting.DARK_RED + LootTracker.wolfEggsSession + "\n" + - EnumChatFormatting.GOLD + LootTracker.wolfCouturesSession + "\n" + - EnumChatFormatting.AQUA + LootTracker.wolfBaitsSession + "\n" + - EnumChatFormatting.DARK_PURPLE + LootTracker.wolfFluxesSession + "\n" + + EnumChatFormatting.AQUA + WolfTracker.wolfSpiritsSession + "\n" + + EnumChatFormatting.WHITE + WolfTracker.wolfBooksSession + "\n" + + EnumChatFormatting.DARK_RED + WolfTracker.wolfEggsSession + "\n" + + EnumChatFormatting.GOLD + WolfTracker.wolfCouturesSession + "\n" + + EnumChatFormatting.AQUA + WolfTracker.wolfBaitsSession + "\n" + + EnumChatFormatting.DARK_PURPLE + WolfTracker.wolfFluxesSession + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; break; case "spider": - if (LootTracker.spiderTime == -1) { + if (SpiderTracker.spiderTime == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.spiderTime, timeNow); + timeBetween = Utils.getTimeBetween(SpiderTracker.spiderTime, timeNow); } - if (LootTracker.spiderBosses == -1) { + if (SpiderTracker.spiderBosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.spiderBosses); + bossesBetween = nf.format(SpiderTracker.spiderBosses); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(LootTracker.spiderTAP); + drop20 = nf.format(SpiderTracker.spiderTAP); } else { - drop20 = nf.format(LootTracker.spiderTAPDrops) + " times"; + drop20 = nf.format(SpiderTracker.spiderTAPDrops) + " times"; } dropsText = EnumChatFormatting.GOLD + "Tarantulas Killed:\n" + @@ -142,33 +142,33 @@ public class LootDisplay { EnumChatFormatting.GOLD + "Digested Mosquitos:\n" + EnumChatFormatting.AQUA + "Time Since RNG:\n" + EnumChatFormatting.AQUA + "Bosses Since RNG:"; - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.spiderTarantulas) + "\n" + - EnumChatFormatting.GREEN + nf.format(LootTracker.spiderWebs) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(SpiderTracker.spiderTarantulas) + "\n" + + EnumChatFormatting.GREEN + nf.format(SpiderTracker.spiderWebs) + "\n" + EnumChatFormatting.DARK_GREEN + drop20 + "\n" + - EnumChatFormatting.DARK_GRAY + LootTracker.spiderBites + "\n" + - EnumChatFormatting.WHITE + LootTracker.spiderBooks + "\n" + - EnumChatFormatting.AQUA + LootTracker.spiderCatalysts + "\n" + - EnumChatFormatting.DARK_PURPLE + LootTracker.spiderTalismans + "\n" + - EnumChatFormatting.LIGHT_PURPLE + LootTracker.spiderSwatters + "\n" + - EnumChatFormatting.GOLD + LootTracker.spiderMosquitos + "\n" + + EnumChatFormatting.DARK_GRAY + SpiderTracker.spiderBites + "\n" + + EnumChatFormatting.WHITE + SpiderTracker.spiderBooks + "\n" + + EnumChatFormatting.AQUA + SpiderTracker.spiderCatalysts + "\n" + + EnumChatFormatting.DARK_PURPLE + SpiderTracker.spiderTalismans + "\n" + + EnumChatFormatting.LIGHT_PURPLE + SpiderTracker.spiderSwatters + "\n" + + EnumChatFormatting.GOLD + SpiderTracker.spiderMosquitos + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; break; case "spider_session": - if (LootTracker.spiderTimeSession == -1) { + if (SpiderTracker.spiderTimeSession == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.spiderTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(SpiderTracker.spiderTimeSession, timeNow); } - if (LootTracker.spiderBossesSession == -1) { + if (SpiderTracker.spiderBossesSession == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.spiderBossesSession); + bossesBetween = nf.format(SpiderTracker.spiderBossesSession); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(LootTracker.spiderTAPSession); + drop20 = nf.format(SpiderTracker.spiderTAPSession); } else { - drop20 = nf.format(LootTracker.spiderTAPDropsSession) + " times"; + drop20 = nf.format(SpiderTracker.spiderTAPDropsSession) + " times"; } dropsText = EnumChatFormatting.GOLD + "Tarantulas Killed:\n" + @@ -182,33 +182,33 @@ public class LootDisplay { EnumChatFormatting.GOLD + "Digested Mosquitos:\n" + EnumChatFormatting.AQUA + "Time Since RNG:\n" + EnumChatFormatting.AQUA + "Bosses Since RNG:"; - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.spiderTarantulasSession) + "\n" + - EnumChatFormatting.GREEN + nf.format(LootTracker.spiderWebsSession) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(SpiderTracker.spiderTarantulasSession) + "\n" + + EnumChatFormatting.GREEN + nf.format(SpiderTracker.spiderWebsSession) + "\n" + EnumChatFormatting.DARK_GREEN + drop20 + "\n" + - EnumChatFormatting.DARK_GRAY + LootTracker.spiderBitesSession + "\n" + - EnumChatFormatting.WHITE + LootTracker.spiderBooksSession + "\n" + - EnumChatFormatting.AQUA + LootTracker.spiderCatalystsSession + "\n" + - EnumChatFormatting.DARK_PURPLE + LootTracker.spiderTalismansSession + "\n" + - EnumChatFormatting.LIGHT_PURPLE + LootTracker.spiderSwattersSession + "\n" + - EnumChatFormatting.GOLD + LootTracker.spiderMosquitosSession + "\n" + + EnumChatFormatting.DARK_GRAY + SpiderTracker.spiderBitesSession + "\n" + + EnumChatFormatting.WHITE + SpiderTracker.spiderBooksSession + "\n" + + EnumChatFormatting.AQUA + SpiderTracker.spiderCatalystsSession + "\n" + + EnumChatFormatting.DARK_PURPLE + SpiderTracker.spiderTalismansSession + "\n" + + EnumChatFormatting.LIGHT_PURPLE + SpiderTracker.spiderSwattersSession + "\n" + + EnumChatFormatting.GOLD + SpiderTracker.spiderMosquitosSession + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; break; case "zombie": - if (LootTracker.zombieTime == -1) { + if (ZombieTracker.zombieTime == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.zombieTime, timeNow); + timeBetween = Utils.getTimeBetween(ZombieTracker.zombieTime, timeNow); } - if (LootTracker.zombieBosses == -1) { + if (ZombieTracker.zombieBosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.zombieBosses); + bossesBetween = nf.format(ZombieTracker.zombieBosses); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(LootTracker.zombieFoulFlesh); + drop20 = nf.format(ZombieTracker.zombieFoulFlesh); } else { - drop20 = nf.format(LootTracker.zombieFoulFleshDrops) + " times"; + drop20 = nf.format(ZombieTracker.zombieFoulFleshDrops) + " times"; } dropsText = EnumChatFormatting.GOLD + "Revs Killed:\n" + @@ -226,37 +226,37 @@ public class LootDisplay { EnumChatFormatting.RED + "Warden Hearts:\n" + EnumChatFormatting.AQUA + "Time Since RNG:\n" + EnumChatFormatting.AQUA + "Bosses Since RNG:"; - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.zombieRevs) + "\n" + - EnumChatFormatting.GREEN + nf.format(LootTracker.zombieRevFlesh) + "\n" + - EnumChatFormatting.GREEN + nf.format(LootTracker.zombieRevViscera) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(ZombieTracker.zombieRevs) + "\n" + + EnumChatFormatting.GREEN + nf.format(ZombieTracker.zombieRevFlesh) + "\n" + + EnumChatFormatting.GREEN + nf.format(ZombieTracker.zombieRevViscera) + "\n" + EnumChatFormatting.BLUE + drop20 + "\n" + - EnumChatFormatting.DARK_GREEN + LootTracker.zombiePestilences + "\n" + - EnumChatFormatting.WHITE + LootTracker.zombieBooks + "\n" + - EnumChatFormatting.AQUA + LootTracker.zombieUndeadCatas + "\n" + - EnumChatFormatting.DARK_PURPLE + LootTracker.zombieBeheadeds + "\n" + - EnumChatFormatting.RED + LootTracker.zombieRevCatas + "\n" + - EnumChatFormatting.DARK_GREEN + LootTracker.zombieSnakes + "\n" + - EnumChatFormatting.GOLD + LootTracker.zombieScythes + "\n" + - EnumChatFormatting.RED + LootTracker.zombieShards + "\n" + - EnumChatFormatting.RED + LootTracker.zombieWardenHearts + "\n" + + EnumChatFormatting.DARK_GREEN + ZombieTracker.zombiePestilences + "\n" + + EnumChatFormatting.WHITE + ZombieTracker.zombieBooks + "\n" + + EnumChatFormatting.AQUA + ZombieTracker.zombieUndeadCatas + "\n" + + EnumChatFormatting.DARK_PURPLE + ZombieTracker.zombieBeheadeds + "\n" + + EnumChatFormatting.RED + ZombieTracker.zombieRevCatas + "\n" + + EnumChatFormatting.DARK_GREEN + ZombieTracker.zombieSnakes + "\n" + + EnumChatFormatting.GOLD + ZombieTracker.zombieScythes + "\n" + + EnumChatFormatting.RED + ZombieTracker.zombieShards + "\n" + + EnumChatFormatting.RED + ZombieTracker.zombieWardenHearts + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; break; case "zombie_session": - if (LootTracker.zombieTimeSession == -1) { + if (ZombieTracker.zombieTimeSession == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.zombieTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(ZombieTracker.zombieTimeSession, timeNow); } - if (LootTracker.zombieBossesSession == -1) { + if (ZombieTracker.zombieBossesSession == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.zombieBossesSession); + bossesBetween = nf.format(ZombieTracker.zombieBossesSession); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(LootTracker.zombieFoulFleshSession); + drop20 = nf.format(ZombieTracker.zombieFoulFleshSession); } else { - drop20 = nf.format(LootTracker.zombieFoulFleshDropsSession) + " times"; + drop20 = nf.format(ZombieTracker.zombieFoulFleshDropsSession) + " times"; } dropsText = EnumChatFormatting.GOLD + "Revs Killed:\n" + @@ -274,37 +274,37 @@ public class LootDisplay { EnumChatFormatting.RED + "Warden Hearts:\n" + EnumChatFormatting.AQUA + "Time Since RNG:\n" + EnumChatFormatting.AQUA + "Bosses Since RNG:"; - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.zombieRevsSession) + "\n" + - EnumChatFormatting.GREEN + nf.format(LootTracker.zombieRevFleshSession) + "\n" + - EnumChatFormatting.GREEN + nf.format(LootTracker.zombieRevVisceraSession) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(ZombieTracker.zombieRevsSession) + "\n" + + EnumChatFormatting.GREEN + nf.format(ZombieTracker.zombieRevFleshSession) + "\n" + + EnumChatFormatting.GREEN + nf.format(ZombieTracker.zombieRevVisceraSession) + "\n" + EnumChatFormatting.BLUE + drop20 + "\n" + - EnumChatFormatting.DARK_GREEN + LootTracker.zombiePestilencesSession + "\n" + - EnumChatFormatting.WHITE + LootTracker.zombieBooksSession + "\n" + - EnumChatFormatting.AQUA + LootTracker.zombieUndeadCatasSession + "\n" + - EnumChatFormatting.DARK_PURPLE + LootTracker.zombieBeheadedsSession + "\n" + - EnumChatFormatting.RED + LootTracker.zombieRevCatasSession + "\n" + - EnumChatFormatting.DARK_GREEN + LootTracker.zombieSnakesSession + "\n" + - EnumChatFormatting.GOLD + LootTracker.zombieScythes + "\n" + - EnumChatFormatting.RED + LootTracker.zombieShardsSession + "\n" + - EnumChatFormatting.RED + LootTracker.zombieWardenHeartsSession + "\n" + + EnumChatFormatting.DARK_GREEN + ZombieTracker.zombiePestilencesSession + "\n" + + EnumChatFormatting.WHITE + ZombieTracker.zombieBooksSession + "\n" + + EnumChatFormatting.AQUA + ZombieTracker.zombieUndeadCatasSession + "\n" + + EnumChatFormatting.DARK_PURPLE + ZombieTracker.zombieBeheadedsSession + "\n" + + EnumChatFormatting.RED + ZombieTracker.zombieRevCatasSession + "\n" + + EnumChatFormatting.DARK_GREEN + ZombieTracker.zombieSnakesSession + "\n" + + EnumChatFormatting.GOLD + ZombieTracker.zombieScythes + "\n" + + EnumChatFormatting.RED + ZombieTracker.zombieShardsSession + "\n" + + EnumChatFormatting.RED + ZombieTracker.zombieWardenHeartsSession + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; break; case "enderman": - if (LootTracker.endermanTime == -1) { + if (EndermanTracker.endermanTime == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.endermanTime, timeNow); + timeBetween = Utils.getTimeBetween(EndermanTracker.endermanTime, timeNow); } - if (LootTracker.endermanBosses == -1) { + if (EndermanTracker.endermanBosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.endermanBosses); + bossesBetween = nf.format(EndermanTracker.endermanBosses); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(LootTracker.endermanTAP); + drop20 = nf.format(EndermanTracker.endermanTAP); } else { - drop20 = nf.format(LootTracker.endermanTAPDrops) + " times"; + drop20 = nf.format(EndermanTracker.endermanTAPDrops) + " times"; } dropsText = EnumChatFormatting.GOLD + "Voidglooms Killed:\n" + @@ -328,43 +328,43 @@ public class LootDisplay { EnumChatFormatting.RED + "Ender Slayer Books:\n" + EnumChatFormatting.AQUA + "Time Since RNG:\n" + EnumChatFormatting.AQUA + "Bosses Since RNG:"; - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.endermanVoidglooms) + "\n" + - EnumChatFormatting.DARK_GRAY + nf.format(LootTracker.endermanNullSpheres) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(EndermanTracker.endermanVoidglooms) + "\n" + + EnumChatFormatting.DARK_GRAY + nf.format(EndermanTracker.endermanNullSpheres) + "\n" + EnumChatFormatting.DARK_PURPLE + drop20 + "\n" + - EnumChatFormatting.LIGHT_PURPLE + LootTracker.endermanEndersnakes + "\n" + - EnumChatFormatting.DARK_GREEN + LootTracker.endermanSummoningEyes + "\n" + - EnumChatFormatting.AQUA + LootTracker.endermanManaBooks + "\n" + - EnumChatFormatting.BLUE + LootTracker.endermanTuners + "\n" + - EnumChatFormatting.YELLOW + LootTracker.endermanAtoms + "\n" + - EnumChatFormatting.AQUA + LootTracker.endermanEspressoMachines + "\n" + - EnumChatFormatting.WHITE + LootTracker.endermanSmartyBooks + "\n" + - EnumChatFormatting.LIGHT_PURPLE + LootTracker.endermanEndRunes + "\n" + - EnumChatFormatting.RED + LootTracker.endermanChalices + "\n" + - EnumChatFormatting.RED + LootTracker.endermanDice + "\n" + - EnumChatFormatting.DARK_PURPLE + LootTracker.endermanArtifacts + "\n" + - EnumChatFormatting.DARK_PURPLE + LootTracker.endermanSkins + "\n" + - EnumChatFormatting.GRAY + LootTracker.endermanEnchantRunes + "\n" + - EnumChatFormatting.GOLD + LootTracker.endermanMergers + "\n" + - EnumChatFormatting.GOLD + LootTracker.endermanCores + "\n" + - EnumChatFormatting.RED + LootTracker.endermanEnderBooks + "\n" + + EnumChatFormatting.LIGHT_PURPLE + EndermanTracker.endermanEndersnakes + "\n" + + EnumChatFormatting.DARK_GREEN + EndermanTracker.endermanSummoningEyes + "\n" + + EnumChatFormatting.AQUA + EndermanTracker.endermanManaBooks + "\n" + + EnumChatFormatting.BLUE + EndermanTracker.endermanTuners + "\n" + + EnumChatFormatting.YELLOW + EndermanTracker.endermanAtoms + "\n" + + EnumChatFormatting.AQUA + EndermanTracker.endermanEspressoMachines + "\n" + + EnumChatFormatting.WHITE + EndermanTracker.endermanSmartyBooks + "\n" + + EnumChatFormatting.LIGHT_PURPLE + EndermanTracker.endermanEndRunes + "\n" + + EnumChatFormatting.RED + EndermanTracker.endermanChalices + "\n" + + EnumChatFormatting.RED + EndermanTracker.endermanDice + "\n" + + EnumChatFormatting.DARK_PURPLE + EndermanTracker.endermanArtifacts + "\n" + + EnumChatFormatting.DARK_PURPLE + EndermanTracker.endermanSkins + "\n" + + EnumChatFormatting.GRAY + EndermanTracker.endermanEnchantRunes + "\n" + + EnumChatFormatting.GOLD + EndermanTracker.endermanMergers + "\n" + + EnumChatFormatting.GOLD + EndermanTracker.endermanCores + "\n" + + EnumChatFormatting.RED + EndermanTracker.endermanEnderBooks + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; break; case "enderman_session": - if (LootTracker.endermanTimeSession == -1) { + if (EndermanTracker.endermanTimeSession == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.endermanTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(EndermanTracker.endermanTimeSession, timeNow); } - if (LootTracker.endermanBossesSession == -1) { + if (EndermanTracker.endermanBossesSession == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.endermanBossesSession); + bossesBetween = nf.format(EndermanTracker.endermanBossesSession); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(LootTracker.endermanTAPSession); + drop20 = nf.format(EndermanTracker.endermanTAPSession); } else { - drop20 = nf.format(LootTracker.endermanTAPDropsSession) + " times"; + drop20 = nf.format(EndermanTracker.endermanTAPDropsSession) + " times"; } dropsText = EnumChatFormatting.GOLD + "Voidglooms Killed:\n" + @@ -388,38 +388,38 @@ public class LootDisplay { EnumChatFormatting.RED + "Ender Slayer Books:\n" + EnumChatFormatting.AQUA + "Time Since RNG:\n" + EnumChatFormatting.AQUA + "Bosses Since RNG:"; - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.endermanVoidgloomsSession) + "\n" + - EnumChatFormatting.DARK_GRAY + nf.format(LootTracker.endermanNullSpheresSession) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(EndermanTracker.endermanVoidgloomsSession) + "\n" + + EnumChatFormatting.DARK_GRAY + nf.format(EndermanTracker.endermanNullSpheresSession) + "\n" + EnumChatFormatting.DARK_PURPLE + drop20 + "\n" + - EnumChatFormatting.LIGHT_PURPLE + LootTracker.endermanEndersnakesSession + "\n" + - EnumChatFormatting.DARK_GREEN + LootTracker.endermanSummoningEyesSession + "\n" + - EnumChatFormatting.AQUA + LootTracker.endermanManaBooksSession + "\n" + - EnumChatFormatting.BLUE + LootTracker.endermanTunersSession + "\n" + - EnumChatFormatting.YELLOW + LootTracker.endermanAtomsSession + "\n" + - EnumChatFormatting.AQUA + LootTracker.endermanEspressoMachinesSession + "\n" + - EnumChatFormatting.WHITE + LootTracker.endermanSmartyBooksSession + "\n" + - EnumChatFormatting.LIGHT_PURPLE + LootTracker.endermanEndRunesSession + "\n" + - EnumChatFormatting.RED + LootTracker.endermanChalicesSession + "\n" + - EnumChatFormatting.RED + LootTracker.endermanDiceSession + "\n" + - EnumChatFormatting.DARK_PURPLE + LootTracker.endermanArtifactsSession + "\n" + - EnumChatFormatting.DARK_PURPLE + LootTracker.endermanSkinsSession + "\n" + - EnumChatFormatting.GRAY + LootTracker.endermanEnchantRunesSession + "\n" + - EnumChatFormatting.GOLD + LootTracker.endermanMergersSession + "\n" + - EnumChatFormatting.GOLD + LootTracker.endermanCoresSession + "\n" + - EnumChatFormatting.RED + LootTracker.endermanEnderBooksSession + "\n" + + EnumChatFormatting.LIGHT_PURPLE + EndermanTracker.endermanEndersnakesSession + "\n" + + EnumChatFormatting.DARK_GREEN + EndermanTracker.endermanSummoningEyesSession + "\n" + + EnumChatFormatting.AQUA + EndermanTracker.endermanManaBooksSession + "\n" + + EnumChatFormatting.BLUE + EndermanTracker.endermanTunersSession + "\n" + + EnumChatFormatting.YELLOW + EndermanTracker.endermanAtomsSession + "\n" + + EnumChatFormatting.AQUA + EndermanTracker.endermanEspressoMachinesSession + "\n" + + EnumChatFormatting.WHITE + EndermanTracker.endermanSmartyBooksSession + "\n" + + EnumChatFormatting.LIGHT_PURPLE + EndermanTracker.endermanEndRunesSession + "\n" + + EnumChatFormatting.RED + EndermanTracker.endermanChalicesSession + "\n" + + EnumChatFormatting.RED + EndermanTracker.endermanDiceSession + "\n" + + EnumChatFormatting.DARK_PURPLE + EndermanTracker.endermanArtifactsSession + "\n" + + EnumChatFormatting.DARK_PURPLE + EndermanTracker.endermanSkinsSession + "\n" + + EnumChatFormatting.GRAY + EndermanTracker.endermanEnchantRunesSession + "\n" + + EnumChatFormatting.GOLD + EndermanTracker.endermanMergersSession + "\n" + + EnumChatFormatting.GOLD + EndermanTracker.endermanCoresSession + "\n" + + EnumChatFormatting.RED + EndermanTracker.endermanEnderBooksSession + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; break; case "fishing": - if (LootTracker.empTime == -1) { + if (FishingTracker.empTime == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.empTime, timeNow); + timeBetween = Utils.getTimeBetween(FishingTracker.empTime, timeNow); } - if (LootTracker.empSCs == -1) { + if (FishingTracker.empSCs == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.empSCs); + bossesBetween = nf.format(FishingTracker.empSCs); } dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + @@ -432,16 +432,16 @@ public class LootDisplay { EnumChatFormatting.DARK_AQUA + "Sea Guardians:\n" + EnumChatFormatting.BLUE + "Sea Witches:\n" + EnumChatFormatting.GREEN + "Sea Archers:"; - countText = EnumChatFormatting.AQUA + nf.format(LootTracker.seaCreatures) + "\n" + - EnumChatFormatting.AQUA + nf.format(LootTracker.fishingMilestone) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.goodCatches) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.greatCatches) + "\n" + - EnumChatFormatting.GRAY + nf.format(LootTracker.squids) + "\n" + - EnumChatFormatting.GREEN + nf.format(LootTracker.seaWalkers) + "\n" + - EnumChatFormatting.DARK_GRAY + nf.format(LootTracker.nightSquids) + "\n" + - EnumChatFormatting.DARK_AQUA + nf.format(LootTracker.seaGuardians) + "\n" + - EnumChatFormatting.BLUE + nf.format(LootTracker.seaWitches) + "\n" + - EnumChatFormatting.GREEN + nf.format(LootTracker.seaArchers); + countText = EnumChatFormatting.AQUA + nf.format(FishingTracker.seaCreatures) + "\n" + + EnumChatFormatting.AQUA + nf.format(FishingTracker.fishingMilestone) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.goodCatches) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.greatCatches) + "\n" + + EnumChatFormatting.GRAY + nf.format(FishingTracker.squids) + "\n" + + EnumChatFormatting.GREEN + nf.format(FishingTracker.seaWalkers) + "\n" + + EnumChatFormatting.DARK_GRAY + nf.format(FishingTracker.nightSquids) + "\n" + + EnumChatFormatting.DARK_AQUA + nf.format(FishingTracker.seaGuardians) + "\n" + + EnumChatFormatting.BLUE + nf.format(FishingTracker.seaWitches) + "\n" + + EnumChatFormatting.GREEN + nf.format(FishingTracker.seaArchers); // Seperated to save vertical space dropsTextTwo = EnumChatFormatting.GREEN + "Monster of Deeps:\n" + EnumChatFormatting.YELLOW + "Catfishes:\n" + @@ -453,14 +453,14 @@ public class LootDisplay { EnumChatFormatting.GOLD + "Sea Emperors:\n" + EnumChatFormatting.AQUA + "Time Since Emp:\n" + EnumChatFormatting.AQUA + "Creatures Since Emp:"; - countTextTwo = EnumChatFormatting.GREEN + nf.format(LootTracker.monsterOfTheDeeps) + "\n" + - EnumChatFormatting.YELLOW + nf.format(LootTracker.catfishes) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.carrotKings) + "\n" + - EnumChatFormatting.GRAY + nf.format(LootTracker.seaLeeches) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.guardianDefenders) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.deepSeaProtectors) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.hydras) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.seaEmperors) + "\n" + + countTextTwo = EnumChatFormatting.GREEN + nf.format(FishingTracker.monsterOfTheDeeps) + "\n" + + EnumChatFormatting.YELLOW + nf.format(FishingTracker.catfishes) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.carrotKings) + "\n" + + EnumChatFormatting.GRAY + nf.format(FishingTracker.seaLeeches) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.guardianDefenders) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.deepSeaProtectors) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.hydras) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.seaEmperors) + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; @@ -473,15 +473,15 @@ public class LootDisplay { } break; case "fishing_session": - if (LootTracker.empTimeSession == -1) { + if (FishingTracker.empTimeSession == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.empTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(FishingTracker.empTimeSession, timeNow); } - if (LootTracker.empSCsSession == -1) { + if (FishingTracker.empSCsSession == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.empSCsSession); + bossesBetween = nf.format(FishingTracker.empSCsSession); } dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + @@ -494,16 +494,16 @@ public class LootDisplay { EnumChatFormatting.DARK_AQUA + "Sea Guardians:\n" + EnumChatFormatting.BLUE + "Sea Witches:\n" + EnumChatFormatting.GREEN + "Sea Archers:"; - countText = EnumChatFormatting.AQUA + nf.format(LootTracker.seaCreaturesSession) + "\n" + - EnumChatFormatting.AQUA + nf.format(LootTracker.fishingMilestoneSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.goodCatchesSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.greatCatchesSession) + "\n" + - EnumChatFormatting.GRAY + nf.format(LootTracker.squidsSession) + "\n" + - EnumChatFormatting.GREEN + nf.format(LootTracker.seaWalkersSession) + "\n" + - EnumChatFormatting.DARK_GRAY + nf.format(LootTracker.nightSquidsSession) + "\n" + - EnumChatFormatting.DARK_AQUA + nf.format(LootTracker.seaGuardiansSession) + "\n" + - EnumChatFormatting.BLUE + nf.format(LootTracker.seaWitchesSession) + "\n" + - EnumChatFormatting.GREEN + nf.format(LootTracker.seaArchersSession); + countText = EnumChatFormatting.AQUA + nf.format(FishingTracker.seaCreaturesSession) + "\n" + + EnumChatFormatting.AQUA + nf.format(FishingTracker.fishingMilestoneSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.goodCatchesSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.greatCatchesSession) + "\n" + + EnumChatFormatting.GRAY + nf.format(FishingTracker.squidsSession) + "\n" + + EnumChatFormatting.GREEN + nf.format(FishingTracker.seaWalkersSession) + "\n" + + EnumChatFormatting.DARK_GRAY + nf.format(FishingTracker.nightSquidsSession) + "\n" + + EnumChatFormatting.DARK_AQUA + nf.format(FishingTracker.seaGuardiansSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(FishingTracker.seaWitchesSession) + "\n" + + EnumChatFormatting.GREEN + nf.format(FishingTracker.seaArchersSession); // Seperated to save vertical space dropsTextTwo = EnumChatFormatting.GREEN + "Monster of Deeps:\n" + EnumChatFormatting.YELLOW + "Catfishes:\n" + @@ -515,14 +515,14 @@ public class LootDisplay { EnumChatFormatting.GOLD + "Sea Emperors:\n" + EnumChatFormatting.AQUA + "Time Since Emp:\n" + EnumChatFormatting.AQUA + "Creatures Since Emp:"; - countTextTwo = EnumChatFormatting.GREEN + nf.format(LootTracker.monsterOfTheDeepsSession) + "\n" + - EnumChatFormatting.YELLOW + nf.format(LootTracker.catfishesSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.carrotKingsSession) + "\n" + - EnumChatFormatting.GRAY + nf.format(LootTracker.seaLeechesSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.guardianDefendersSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.deepSeaProtectorsSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.hydrasSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.seaEmperorsSession) + "\n" + + countTextTwo = EnumChatFormatting.GREEN + nf.format(FishingTracker.monsterOfTheDeepsSession) + "\n" + + EnumChatFormatting.YELLOW + nf.format(FishingTracker.catfishesSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.carrotKingsSession) + "\n" + + EnumChatFormatting.GRAY + nf.format(FishingTracker.seaLeechesSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.guardianDefendersSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.deepSeaProtectorsSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.hydrasSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.seaEmperorsSession) + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; @@ -535,15 +535,15 @@ public class LootDisplay { } break; case "fishing_winter": - if (LootTracker.yetiTime == -1) { + if (FishingTracker.yetiTime == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.yetiTime, timeNow); + timeBetween = Utils.getTimeBetween(FishingTracker.yetiTime, timeNow); } - if (LootTracker.yetiSCs == -1) { + if (FishingTracker.yetiSCs == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.yetiSCs); + bossesBetween = nf.format(FishingTracker.yetiSCs); } dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + @@ -556,27 +556,27 @@ public class LootDisplay { EnumChatFormatting.GOLD + "Yetis:\n" + EnumChatFormatting.AQUA + "Time Since Yeti:\n" + EnumChatFormatting.AQUA + "Creatures Since Yeti:"; - countText = EnumChatFormatting.AQUA + nf.format(LootTracker.seaCreatures) + "\n" + - EnumChatFormatting.AQUA + nf.format(LootTracker.fishingMilestone) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.goodCatches) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.greatCatches) + "\n" + - EnumChatFormatting.AQUA + nf.format(LootTracker.frozenSteves) + "\n" + - EnumChatFormatting.WHITE + nf.format(LootTracker.frostyTheSnowmans) + "\n" + - EnumChatFormatting.DARK_GREEN + nf.format(LootTracker.grinches) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.yetis) + "\n" + + countText = EnumChatFormatting.AQUA + nf.format(FishingTracker.seaCreatures) + "\n" + + EnumChatFormatting.AQUA + nf.format(FishingTracker.fishingMilestone) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.goodCatches) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.greatCatches) + "\n" + + EnumChatFormatting.AQUA + nf.format(FishingTracker.frozenSteves) + "\n" + + EnumChatFormatting.WHITE + nf.format(FishingTracker.frostyTheSnowmans) + "\n" + + EnumChatFormatting.DARK_GREEN + nf.format(FishingTracker.grinches) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.yetis) + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; break; case "fishing_winter_session": - if (LootTracker.yetiTimeSession == -1) { + if (FishingTracker.yetiTimeSession == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.yetiTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(FishingTracker.yetiTimeSession, timeNow); } - if (LootTracker.yetiSCsSession == -1) { + if (FishingTracker.yetiSCsSession == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.yetiSCsSession); + bossesBetween = nf.format(FishingTracker.yetiSCsSession); } dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + @@ -589,14 +589,14 @@ public class LootDisplay { EnumChatFormatting.GOLD + "Yetis:\n" + EnumChatFormatting.AQUA + "Time Since Yeti:\n" + EnumChatFormatting.AQUA + "Creatures Since Yeti:"; - countText = EnumChatFormatting.AQUA + nf.format(LootTracker.seaCreaturesSession) + "\n" + - EnumChatFormatting.AQUA + nf.format(LootTracker.fishingMilestoneSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.goodCatchesSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.greatCatchesSession) + "\n" + - EnumChatFormatting.AQUA + nf.format(LootTracker.frozenStevesSession) + "\n" + - EnumChatFormatting.WHITE + nf.format(LootTracker.frostyTheSnowmansSession) + "\n" + - EnumChatFormatting.DARK_GREEN + nf.format(LootTracker.grinchesSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.yetisSession) + "\n" + + countText = EnumChatFormatting.AQUA + nf.format(FishingTracker.seaCreaturesSession) + "\n" + + EnumChatFormatting.AQUA + nf.format(FishingTracker.fishingMilestoneSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.goodCatchesSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.greatCatchesSession) + "\n" + + EnumChatFormatting.AQUA + nf.format(FishingTracker.frozenStevesSession) + "\n" + + EnumChatFormatting.WHITE + nf.format(FishingTracker.frostyTheSnowmansSession) + "\n" + + EnumChatFormatting.DARK_GREEN + nf.format(FishingTracker.grinchesSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.yetisSession) + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; break; @@ -609,14 +609,14 @@ public class LootDisplay { EnumChatFormatting.BLUE + "Blue Sharks:\n" + EnumChatFormatting.GOLD + "Tiger Sharks:\n" + EnumChatFormatting.WHITE + "Great White Sharks:"; - countText = EnumChatFormatting.AQUA + nf.format(LootTracker.seaCreatures) + "\n" + - EnumChatFormatting.AQUA + nf.format(LootTracker.fishingMilestone) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.goodCatches) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.greatCatches) + "\n" + - EnumChatFormatting.LIGHT_PURPLE + nf.format(LootTracker.nurseSharks) + "\n" + - EnumChatFormatting.BLUE + nf.format(LootTracker.blueSharks) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.tigerSharks) + "\n" + - EnumChatFormatting.WHITE + nf.format(LootTracker.greatWhiteSharks); + countText = EnumChatFormatting.AQUA + nf.format(FishingTracker.seaCreatures) + "\n" + + EnumChatFormatting.AQUA + nf.format(FishingTracker.fishingMilestone) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.goodCatches) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.greatCatches) + "\n" + + EnumChatFormatting.LIGHT_PURPLE + nf.format(FishingTracker.nurseSharks) + "\n" + + EnumChatFormatting.BLUE + nf.format(FishingTracker.blueSharks) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.tigerSharks) + "\n" + + EnumChatFormatting.WHITE + nf.format(FishingTracker.greatWhiteSharks); break; case "fishing_festival_session": dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + @@ -627,14 +627,14 @@ public class LootDisplay { EnumChatFormatting.BLUE + "Blue Sharks:\n" + EnumChatFormatting.GOLD + "Tiger Sharks:\n" + EnumChatFormatting.WHITE + "Great White Sharks:"; - countText = EnumChatFormatting.AQUA + nf.format(LootTracker.seaCreaturesSession) + "\n" + - EnumChatFormatting.AQUA + nf.format(LootTracker.fishingMilestoneSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.goodCatchesSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.greatCatchesSession) + "\n" + - EnumChatFormatting.LIGHT_PURPLE + nf.format(LootTracker.nurseSharksSession) + "\n" + - EnumChatFormatting.BLUE + nf.format(LootTracker.blueSharksSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.tigerSharksSession) + "\n" + - EnumChatFormatting.WHITE + nf.format(LootTracker.greatWhiteSharksSession); + countText = EnumChatFormatting.AQUA + nf.format(FishingTracker.seaCreaturesSession) + "\n" + + EnumChatFormatting.AQUA + nf.format(FishingTracker.fishingMilestoneSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.goodCatchesSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.greatCatchesSession) + "\n" + + EnumChatFormatting.LIGHT_PURPLE + nf.format(FishingTracker.nurseSharksSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(FishingTracker.blueSharksSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.tigerSharksSession) + "\n" + + EnumChatFormatting.WHITE + nf.format(FishingTracker.greatWhiteSharksSession); break; case "fishing_spooky": dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + @@ -646,15 +646,15 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + "Werewolves:\n" + EnumChatFormatting.GOLD + "Phantom Fishers:\n" + EnumChatFormatting.GOLD + "Grim Reapers:"; - countText = EnumChatFormatting.AQUA + nf.format(LootTracker.seaCreatures) + "\n" + - EnumChatFormatting.AQUA + nf.format(LootTracker.fishingMilestone) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.goodCatches) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.greatCatches) + "\n" + - EnumChatFormatting.BLUE + nf.format(LootTracker.scarecrows) + "\n" + - EnumChatFormatting.GRAY + nf.format(LootTracker.nightmares) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.werewolfs) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.phantomFishers) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.grimReapers); + countText = EnumChatFormatting.AQUA + nf.format(FishingTracker.seaCreatures) + "\n" + + EnumChatFormatting.AQUA + nf.format(FishingTracker.fishingMilestone) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.goodCatches) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.greatCatches) + "\n" + + EnumChatFormatting.BLUE + nf.format(FishingTracker.scarecrows) + "\n" + + EnumChatFormatting.GRAY + nf.format(FishingTracker.nightmares) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.werewolfs) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.phantomFishers) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.grimReapers); break; case "fishing_spooky_session": dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + @@ -666,15 +666,15 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + "Werewolves:\n" + EnumChatFormatting.GOLD + "Phantom Fishers:\n" + EnumChatFormatting.GOLD + "Grim Reapers:"; - countText = EnumChatFormatting.AQUA + nf.format(LootTracker.seaCreaturesSession) + "\n" + - EnumChatFormatting.AQUA + nf.format(LootTracker.fishingMilestoneSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.goodCatchesSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.greatCatchesSession) + "\n" + - EnumChatFormatting.BLUE + nf.format(LootTracker.scarecrowsSession) + "\n" + - EnumChatFormatting.GRAY + nf.format(LootTracker.nightmaresSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.werewolfsSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.phantomFishersSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.grimReapersSession); + countText = EnumChatFormatting.AQUA + nf.format(FishingTracker.seaCreaturesSession) + "\n" + + EnumChatFormatting.AQUA + nf.format(FishingTracker.fishingMilestoneSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.goodCatchesSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.greatCatchesSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(FishingTracker.scarecrowsSession) + "\n" + + EnumChatFormatting.GRAY + nf.format(FishingTracker.nightmaresSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.werewolfsSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.phantomFishersSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.grimReapersSession); break; case "mythological": dropsText = EnumChatFormatting.GOLD + "Coins:\n" + @@ -687,16 +687,16 @@ public class LootDisplay { EnumChatFormatting.WHITE + "Gaia Constructs:\n" + EnumChatFormatting.DARK_PURPLE + "Minos Champions:\n" + EnumChatFormatting.GOLD + "Minos Inquisitors:"; - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.mythCoins) + "\n" + - EnumChatFormatting.WHITE + nf.format(LootTracker.griffinFeathers) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.crownOfGreeds) + "\n" + - EnumChatFormatting.AQUA + nf.format(LootTracker.washedUpSouvenirs) + "\n" + - EnumChatFormatting.RED + nf.format(LootTracker.minosHunters) + "\n" + - EnumChatFormatting.GRAY + nf.format(LootTracker.siameseLynxes) + "\n" + - EnumChatFormatting.RED + nf.format(LootTracker.minotaurs) + "\n" + - EnumChatFormatting.WHITE + nf.format(LootTracker.gaiaConstructs) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.minosChampions) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.minosInquisitors); + countText = EnumChatFormatting.GOLD + nf.format(MythologicalTracker.mythCoins) + "\n" + + EnumChatFormatting.WHITE + nf.format(MythologicalTracker.griffinFeathers) + "\n" + + EnumChatFormatting.GOLD + nf.format(MythologicalTracker.crownOfGreeds) + "\n" + + EnumChatFormatting.AQUA + nf.format(MythologicalTracker.washedUpSouvenirs) + "\n" + + EnumChatFormatting.RED + nf.format(MythologicalTracker.minosHunters) + "\n" + + EnumChatFormatting.GRAY + nf.format(MythologicalTracker.siameseLynxes) + "\n" + + EnumChatFormatting.RED + nf.format(MythologicalTracker.minotaurs) + "\n" + + EnumChatFormatting.WHITE + nf.format(MythologicalTracker.gaiaConstructs) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(MythologicalTracker.minosChampions) + "\n" + + EnumChatFormatting.GOLD + nf.format(MythologicalTracker.minosInquisitors); break; case "mythological_session": dropsText = EnumChatFormatting.GOLD + "Coins:\n" + @@ -709,16 +709,16 @@ public class LootDisplay { EnumChatFormatting.WHITE + "Gaia Constructs:\n" + EnumChatFormatting.DARK_PURPLE + "Minos Champions:\n" + EnumChatFormatting.GOLD + "Minos Inquisitors:"; - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.mythCoinsSession) + "\n" + - EnumChatFormatting.WHITE + nf.format(LootTracker.griffinFeathersSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.crownOfGreedsSession) + "\n" + - EnumChatFormatting.AQUA + nf.format(LootTracker.washedUpSouvenirsSession) + "\n" + - EnumChatFormatting.RED + nf.format(LootTracker.minosHuntersSession) + "\n" + - EnumChatFormatting.GRAY + nf.format(LootTracker.siameseLynxesSession) + "\n" + - EnumChatFormatting.RED + nf.format(LootTracker.minotaursSession) + "\n" + - EnumChatFormatting.WHITE + nf.format(LootTracker.gaiaConstructsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.minosChampionsSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.minosInquisitorsSession); + countText = EnumChatFormatting.GOLD + nf.format(MythologicalTracker.mythCoinsSession) + "\n" + + EnumChatFormatting.WHITE + nf.format(MythologicalTracker.griffinFeathersSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(MythologicalTracker.crownOfGreedsSession) + "\n" + + EnumChatFormatting.AQUA + nf.format(MythologicalTracker.washedUpSouvenirsSession) + "\n" + + EnumChatFormatting.RED + nf.format(MythologicalTracker.minosHuntersSession) + "\n" + + EnumChatFormatting.GRAY + nf.format(MythologicalTracker.siameseLynxesSession) + "\n" + + EnumChatFormatting.RED + nf.format(MythologicalTracker.minotaursSession) + "\n" + + EnumChatFormatting.WHITE + nf.format(MythologicalTracker.gaiaConstructsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(MythologicalTracker.minosChampionsSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(MythologicalTracker.minosInquisitorsSession); break; case "catacombs_floor_one": dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + @@ -726,11 +726,11 @@ public class LootDisplay { EnumChatFormatting.BLUE + "Bonzo's Staffs:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.recombobulators) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.fumingPotatoBooks) + "\n" + - EnumChatFormatting.BLUE + nf.format(LootTracker.bonzoStaffs) + "\n" + - EnumChatFormatting.AQUA + Utils.getMoneySpent(LootTracker.f1CoinsSpent) + "\n" + - EnumChatFormatting.AQUA + Utils.getTimeBetween(0, LootTracker.f1TimeSpent); + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + + EnumChatFormatting.BLUE + nf.format(CatacombsTracker.bonzoStaffs) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.f1CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f1TimeSpent); break; case "catacombs_floor_one_session": dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + @@ -738,11 +738,11 @@ public class LootDisplay { EnumChatFormatting.BLUE + "Bonzo's Staffs:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.recombobulatorsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.fumingPotatoBooksSession) + "\n" + - EnumChatFormatting.BLUE + nf.format(LootTracker.bonzoStaffsSession) + "\n" + - EnumChatFormatting.AQUA + Utils.getMoneySpent(LootTracker.f1CoinsSpentSession) + "\n" + - EnumChatFormatting.AQUA + Utils.getTimeBetween(0, LootTracker.f1TimeSpentSession); + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(CatacombsTracker.bonzoStaffsSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.f1CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f1TimeSpentSession); break; case "catacombs_floor_two": dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + @@ -751,12 +751,12 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + "Adaptive Blades:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.recombobulators) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.fumingPotatoBooks) + "\n" + - EnumChatFormatting.BLUE + nf.format(LootTracker.scarfStudies) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.adaptiveSwords) + "\n" + - EnumChatFormatting.AQUA + Utils.getMoneySpent(LootTracker.f2CoinsSpent) + "\n" + - EnumChatFormatting.AQUA + Utils.getTimeBetween(0, LootTracker.f2TimeSpent); + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + + EnumChatFormatting.BLUE + nf.format(CatacombsTracker.scarfStudies) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.adaptiveSwords) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.f2CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f2TimeSpent); break; case "catacombs_floor_two_session": dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + @@ -765,12 +765,12 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + "Adaptive Blades:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.recombobulatorsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.fumingPotatoBooksSession) + "\n" + - EnumChatFormatting.BLUE + nf.format(LootTracker.scarfStudiesSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.adaptiveSwordsSession) + "\n" + - EnumChatFormatting.AQUA + Utils.getMoneySpent(LootTracker.f2CoinsSpentSession) + "\n" + - EnumChatFormatting.AQUA + Utils.getTimeBetween(0, LootTracker.f2TimeSpentSession); + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(CatacombsTracker.scarfStudiesSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.adaptiveSwordsSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.f2CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f2TimeSpentSession); break; case "catacombs_floor_three": dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + @@ -781,14 +781,14 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + "Adaptive Boots:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.recombobulators) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.fumingPotatoBooks) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.adaptiveHelms) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.adaptiveChests) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.adaptiveLegs) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.adaptiveBoots) + "\n" + - EnumChatFormatting.AQUA + Utils.getMoneySpent(LootTracker.f3CoinsSpent) + "\n" + - EnumChatFormatting.AQUA + Utils.getTimeBetween(0, LootTracker.f3TimeSpent); + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.adaptiveHelms) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.adaptiveChests) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.adaptiveLegs) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.adaptiveBoots) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.f3CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f3TimeSpent); break; case "catacombs_floor_three_session": dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + @@ -799,14 +799,14 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + "Adaptive Boots:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.recombobulatorsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.fumingPotatoBooksSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.adaptiveHelmsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.adaptiveChestsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.adaptiveLegsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.adaptiveBootsSession) + "\n" + - EnumChatFormatting.AQUA + Utils.getMoneySpent(LootTracker.f3CoinsSpentSession) + "\n" + - EnumChatFormatting.AQUA + Utils.getTimeBetween(0, LootTracker.f3TimeSpentSession); + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.adaptiveHelmsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.adaptiveChestsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.adaptiveLegsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.adaptiveBootsSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.f3CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f3TimeSpentSession); break; case "catacombs_floor_four": dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + @@ -820,17 +820,17 @@ public class LootDisplay { EnumChatFormatting.GOLD + "Leg Spirit Pets:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.recombobulators) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.fumingPotatoBooks) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.spiritWings) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.spiritBones) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.spiritBoots) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.spiritSwords) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.spiritBows) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.epicSpiritPets) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.legSpiritPets) + "\n" + - EnumChatFormatting.AQUA + Utils.getMoneySpent(LootTracker.f4CoinsSpent) + "\n" + - EnumChatFormatting.AQUA + Utils.getTimeBetween(0, LootTracker.f4TimeSpent); + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.spiritWings) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.spiritBones) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.spiritBoots) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.spiritSwords) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.spiritBows) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.epicSpiritPets) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.legSpiritPets) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.f4CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f4TimeSpent); break; case "catacombs_floor_four_session": dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + @@ -844,17 +844,17 @@ public class LootDisplay { EnumChatFormatting.GOLD + "Leg Spirit Pets:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.recombobulatorsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.fumingPotatoBooksSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.spiritWingsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.spiritBonesSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.spiritBootsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.spiritSwordsSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.spiritBowsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.epicSpiritPetsSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.legSpiritPetsSession) + "\n" + - EnumChatFormatting.AQUA + Utils.getMoneySpent(LootTracker.f4CoinsSpentSession) + "\n" + - EnumChatFormatting.AQUA + Utils.getTimeBetween(0, LootTracker.f4TimeSpentSession); + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.spiritWingsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.spiritBonesSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.spiritBootsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.spiritSwordsSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.spiritBowsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.epicSpiritPetsSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.legSpiritPetsSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.f4CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f4TimeSpentSession); break; case "catacombs_floor_five": dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + @@ -869,18 +869,18 @@ public class LootDisplay { EnumChatFormatting.GOLD + "Shadow Furys:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.recombobulators) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.fumingPotatoBooks) + "\n" + - EnumChatFormatting.BLUE + nf.format(LootTracker.warpedStones) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.shadowAssHelms) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.shadowAssChests) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.shadowAssLegs) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.shadowAssBoots) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.lastBreaths) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.lividDaggers) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.shadowFurys) + "\n" + - EnumChatFormatting.AQUA + Utils.getMoneySpent(LootTracker.f5CoinsSpent) + "\n" + - EnumChatFormatting.AQUA + Utils.getTimeBetween(0, LootTracker.f5TimeSpent); + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + + EnumChatFormatting.BLUE + nf.format(CatacombsTracker.warpedStones) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.shadowAssHelms) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.shadowAssChests) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.shadowAssLegs) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.shadowAssBoots) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.lastBreaths) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.lividDaggers) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.shadowFurys) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.f5CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f5TimeSpent); break; case "catacombs_floor_five_session": dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + @@ -895,18 +895,18 @@ public class LootDisplay { EnumChatFormatting.GOLD + "Shadow Furys:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.recombobulatorsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.fumingPotatoBooksSession) + "\n" + - EnumChatFormatting.BLUE + nf.format(LootTracker.warpedStonesSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.shadowAssHelmsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.shadowAssChestsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.shadowAssLegsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.shadowAssBootsSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.lastBreathsSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.lividDaggersSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.shadowFurysSession) + "\n" + - EnumChatFormatting.AQUA + Utils.getMoneySpent(LootTracker.f5CoinsSpentSession) + "\n" + - EnumChatFormatting.AQUA + Utils.getTimeBetween(0, LootTracker.f5TimeSpentSession); + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(CatacombsTracker.warpedStonesSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.shadowAssHelmsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.shadowAssChestsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.shadowAssLegsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.shadowAssBootsSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.lastBreathsSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.lividDaggersSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.shadowFurysSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.f5CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f5TimeSpentSession); break; case "catacombs_floor_six": dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + @@ -921,18 +921,18 @@ public class LootDisplay { EnumChatFormatting.GOLD + "Necro Swords:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.recombobulators) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.fumingPotatoBooks) + "\n" + - EnumChatFormatting.BLUE + nf.format(LootTracker.ancientRoses) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.precursorEyes) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.giantsSwords) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.necroLordHelms) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.necroLordChests) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.necroLordLegs) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.necroLordBoots) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.necroSwords) + "\n" + - EnumChatFormatting.AQUA + Utils.getMoneySpent(LootTracker.f6CoinsSpent) + "\n" + - EnumChatFormatting.AQUA + Utils.getTimeBetween(0, LootTracker.f6TimeSpent); + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + + EnumChatFormatting.BLUE + nf.format(CatacombsTracker.ancientRoses) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.precursorEyes) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.giantsSwords) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.necroLordHelms) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.necroLordChests) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.necroLordLegs) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.necroLordBoots) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.necroSwords) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.f6CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f6TimeSpent); break; case "catacombs_floor_six_session": dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + @@ -947,18 +947,18 @@ public class LootDisplay { EnumChatFormatting.GOLD + "Necro Swords:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.recombobulatorsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.fumingPotatoBooksSession) + "\n" + - EnumChatFormatting.BLUE + nf.format(LootTracker.ancientRosesSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.precursorEyesSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.giantsSwordsSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.necroLordHelmsSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.necroLordChestsSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.necroLordLegsSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.necroLordBootsSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.necroSwordsSession) + "\n" + - EnumChatFormatting.AQUA + Utils.getMoneySpent(LootTracker.f6CoinsSpentSession) + "\n" + - EnumChatFormatting.AQUA + Utils.getTimeBetween(0, LootTracker.f6TimeSpentSession); + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(CatacombsTracker.ancientRosesSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.precursorEyesSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.giantsSwordsSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.necroLordHelmsSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.necroLordChestsSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.necroLordLegsSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.necroLordBootsSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.necroSwordsSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.f6CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f6TimeSpentSession); break; case "catacombs_floor_seven": dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + @@ -976,21 +976,21 @@ public class LootDisplay { EnumChatFormatting.GOLD + "Wither Boots:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.recombobulators) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.fumingPotatoBooks) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.witherBloods) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.witherCloaks) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.implosions) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.witherShields) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.shadowWarps) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.necronsHandles) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.autoRecombs) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.witherHelms) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.witherChests) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.witherLegs) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.witherBoots) + "\n" + - EnumChatFormatting.AQUA + Utils.getMoneySpent(LootTracker.f7CoinsSpent) + "\n" + - EnumChatFormatting.AQUA + Utils.getTimeBetween(0, LootTracker.f7TimeSpent); + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.witherBloods) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.witherCloaks) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.implosions) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.witherShields) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.shadowWarps) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.necronsHandles) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.autoRecombs) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.witherHelms) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.witherChests) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.witherLegs) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.witherBoots) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.f7CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f7TimeSpent); break; case "catacombs_floor_seven_session": dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + @@ -1008,21 +1008,21 @@ public class LootDisplay { EnumChatFormatting.GOLD + "Wither Boots:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.recombobulatorsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.fumingPotatoBooksSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.witherBloodsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.witherCloaksSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.implosionsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.witherShieldsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.shadowWarpsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.necronsHandlesSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.autoRecombsSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.witherHelmsSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.witherChestsSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.witherLegsSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(LootTracker.witherBootsSession) + "\n" + - EnumChatFormatting.AQUA + Utils.getMoneySpent(LootTracker.f7CoinsSpentSession) + "\n" + - EnumChatFormatting.AQUA + Utils.getTimeBetween(0, LootTracker.f7TimeSpentSession); + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.witherBloodsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.witherCloaksSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.implosionsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.witherShieldsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.shadowWarpsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.necronsHandlesSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.autoRecombsSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.witherHelmsSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.witherChestsSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.witherLegsSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.witherBootsSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.f7CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f7TimeSpentSession); break; case "ghost_session": dropsText = EnumChatFormatting.GOLD + "Bags of Cash:\n" + @@ -1031,12 +1031,12 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + "Voltas:\n" + EnumChatFormatting.DARK_PURPLE + "Plasmas:" ; // + \n // EnumChatFormatting.AQUA + "Time Spent:" + - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.bagOfCashSession) + "\n" + - EnumChatFormatting.BLUE + nf.format(LootTracker.sorrowSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.ghostlyBootsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.voltaSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.plasmaSession); //+ "\n" + - // EnumChatFormatting.AQUA + nf.format(LootTracker.ghostsTimeSpentSession); + countText = EnumChatFormatting.GOLD + nf.format(GhostTracker.bagOfCashSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(GhostTracker.sorrowSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(GhostTracker.ghostlyBootsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(GhostTracker.voltaSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(GhostTracker.plasmaSession); //+ "\n" + + // EnumChatFormatting.AQUA + nf.format(GhostTracker.ghostsTimeSpentSession); break; case "ghost": dropsText = EnumChatFormatting.GOLD + "Bags of Cash:\n" + @@ -1045,12 +1045,12 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + "Voltas:\n" + EnumChatFormatting.DARK_PURPLE + "Plasmas:" ; // + \n // EnumChatFormatting.AQUA + "Time Spent:" + - countText = EnumChatFormatting.GOLD + nf.format(LootTracker.bagOfCashSession) + "\n" + - EnumChatFormatting.BLUE + nf.format(LootTracker.sorrowSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.ghostlyBootsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.voltaSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.plasmaSession); //+ "\n" + - // EnumChatFormatting.AQUA + nf.format(LootTracker.ghostsTimeSpentSession); + countText = EnumChatFormatting.GOLD + nf.format(GhostTracker.bagOfCashSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(GhostTracker.sorrowSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(GhostTracker.ghostlyBootsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(GhostTracker.voltaSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(GhostTracker.plasmaSession); //+ "\n" + + // EnumChatFormatting.AQUA + nf.format(GhostTracker.ghostsTimeSpentSession); break; diff --git a/src/main/java/me/Danker/features/loot/LootTracker.java b/src/main/java/me/Danker/features/loot/LootTracker.java index 8a2739a..5371ddc 100644 --- a/src/main/java/me/Danker/features/loot/LootTracker.java +++ b/src/main/java/me/Danker/features/loot/LootTracker.java @@ -1,15 +1,8 @@ package me.Danker.features.loot; -import me.Danker.commands.ToggleCommand; -import me.Danker.events.ChestSlotClickedEvent; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.ScoreboardHandler; import me.Danker.utils.Utils; -import net.minecraft.client.Minecraft; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StringUtils; -import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.sound.PlaySoundEvent; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -18,1239 +11,14 @@ import java.util.List; public class LootTracker { - // Wolf - public static int wolfSvens; - public static int wolfTeeth; - public static int wolfWheels; - public static int wolfWheelsDrops; - public static int wolfSpirits; - public static int wolfBooks; - public static int wolfEggs; - public static int wolfCoutures; - public static int wolfBaits; - public static int wolfFluxes; - public static double wolfTime; - public static int wolfBosses; - // Spider - public static int spiderTarantulas; - public static int spiderWebs; - public static int spiderTAP; - public static int spiderTAPDrops; - public static int spiderBites; - public static int spiderCatalysts; - public static int spiderBooks; - public static int spiderSwatters; - public static int spiderTalismans; - public static int spiderMosquitos; - public static double spiderTime; - public static int spiderBosses; - // Zombie - public static int zombieRevs; - public static int zombieRevFlesh; - public static int zombieRevViscera; - public static int zombieFoulFlesh; - public static int zombieFoulFleshDrops; - public static int zombiePestilences; - public static int zombieUndeadCatas; - public static int zombieBooks; - public static int zombieBeheadeds; - public static int zombieRevCatas; - public static int zombieSnakes; - public static int zombieScythes; - public static int zombieShards; - public static int zombieWardenHearts; - public static double zombieTime; - public static int zombieBosses; - // Enderman - public static int endermanVoidglooms; - public static int endermanNullSpheres; - public static int endermanTAP; - public static int endermanTAPDrops; - public static int endermanEndersnakes; - public static int endermanSummoningEyes; - public static int endermanManaBooks; - public static int endermanTuners; - public static int endermanAtoms; - public static int endermanEspressoMachines; - public static int endermanSmartyBooks; - public static int endermanEndRunes; - public static int endermanChalices; - public static int endermanDice; - public static int endermanArtifacts; - public static int endermanSkins; - public static int endermanMergers; - public static int endermanCores; - public static int endermanEnchantRunes; - public static int endermanEnderBooks; - public static double endermanTime; - public static int endermanBosses; - - // Fishing - public static int seaCreatures; - public static int goodCatches; - public static int greatCatches; - public static int squids; - public static int seaWalkers; - public static int nightSquids; - public static int seaGuardians; - public static int seaWitches; - public static int seaArchers; - public static int monsterOfTheDeeps; - public static int catfishes; - public static int carrotKings; - public static int seaLeeches; - public static int guardianDefenders; - public static int deepSeaProtectors; - public static int hydras; - public static int seaEmperors; - public static double empTime; - public static int empSCs; - public static int fishingMilestone; - // Fishing Winter - public static int frozenSteves; - public static int frostyTheSnowmans; - public static int grinches; - public static int yetis; - public static double yetiTime; - public static int yetiSCs; - // Fishing Festival - public static int nurseSharks; - public static int blueSharks; - public static int tigerSharks; - public static int greatWhiteSharks; - // Spooky Fishing - public static int scarecrows; - public static int nightmares; - public static int werewolfs; - public static int phantomFishers; - public static int grimReapers; - - // Mythological - public static double mythCoins; - public static int griffinFeathers; - public static int crownOfGreeds; - public static int washedUpSouvenirs; - public static int minosHunters; - public static int siameseLynxes; - public static int minotaurs; - public static int gaiaConstructs; - public static int minosChampions; - public static int minosInquisitors; - - // Catacombs Dungeons - public static int recombobulators; - public static int fumingPotatoBooks; - // F1 - public static int bonzoStaffs; - public static double f1CoinsSpent; - public static double f1TimeSpent; - // F2 - public static int scarfStudies; - public static int adaptiveSwords; - public static double f2CoinsSpent; - public static double f2TimeSpent; - // F3 - public static int adaptiveHelms; - public static int adaptiveChests; - public static int adaptiveLegs; - public static int adaptiveBoots; - public static double f3CoinsSpent; - public static double f3TimeSpent; - // F4 - public static int spiritWings; - public static int spiritBones; - public static int spiritBoots; - public static int spiritSwords; - public static int spiritBows; - public static int epicSpiritPets; - public static int legSpiritPets; - public static double f4CoinsSpent; - public static double f4TimeSpent; - // F5 - public static int warpedStones; - public static int shadowAssHelms; - public static int shadowAssChests; - public static int shadowAssLegs; - public static int shadowAssBoots; - public static int lastBreaths; - public static int lividDaggers; - public static int shadowFurys; - public static double f5CoinsSpent; - public static double f5TimeSpent; - // F6 - public static int ancientRoses; - public static int precursorEyes; - public static int giantsSwords; - public static int necroLordHelms; - public static int necroLordChests; - public static int necroLordLegs; - public static int necroLordBoots; - public static int necroSwords; - public static double f6CoinsSpent; - public static double f6TimeSpent; - // F7 - public static int witherBloods; - public static int witherCloaks; - public static int implosions; - public static int witherShields; - public static int shadowWarps; - public static int necronsHandles; - public static int autoRecombs; - public static int witherHelms; - public static int witherChests; - public static int witherLegs; - public static int witherBoots; - public static double f7CoinsSpent; - public static double f7TimeSpent; - // Ghosts - public static int sorrows = 0; - public static int bagOfCashs = 0; - public static int voltas = 0; - public static int plasmas = 0; - public static int ghostlyBoots = 0; - // public static double ghostsTimeSpent = -1; - - // Single sessions (No config saves) - // Wolf - public static int wolfSvensSession = 0; - public static int wolfTeethSession = 0; - public static int wolfWheelsSession = 0; - public static int wolfWheelsDropsSession = 0; - public static int wolfSpiritsSession = 0; - public static int wolfBooksSession = 0; - public static int wolfEggsSession = 0; - public static int wolfCouturesSession = 0; - public static int wolfBaitsSession = 0; - public static int wolfFluxesSession = 0; - public static double wolfTimeSession = -1; - public static int wolfBossesSession = -1; - // Spider - public static int spiderTarantulasSession = 0; - public static int spiderWebsSession = 0; - public static int spiderTAPSession = 0; - public static int spiderTAPDropsSession = 0; - public static int spiderBitesSession = 0; - public static int spiderCatalystsSession = 0; - public static int spiderBooksSession = 0; - public static int spiderSwattersSession = 0; - public static int spiderTalismansSession = 0; - public static int spiderMosquitosSession = 0; - public static double spiderTimeSession = -1; - public static int spiderBossesSession = -1; - // Zombie - public static int zombieRevsSession = 0; - public static int zombieRevFleshSession = 0; - public static int zombieRevVisceraSession = 0; - public static int zombieFoulFleshSession = 0; - public static int zombieFoulFleshDropsSession = 0; - public static int zombiePestilencesSession = 0; - public static int zombieUndeadCatasSession = 0; - public static int zombieBooksSession = 0; - public static int zombieBeheadedsSession = 0; - public static int zombieRevCatasSession = 0; - public static int zombieSnakesSession = 0; - public static int zombieScythesSession = 0; - public static int zombieShardsSession = 0; - public static int zombieWardenHeartsSession = 0; - public static double zombieTimeSession = -1; - public static int zombieBossesSession = -1; - // Enderman - public static int endermanVoidgloomsSession = 0; - public static int endermanNullSpheresSession = 0; - public static int endermanTAPSession = 0; - public static int endermanTAPDropsSession = 0; - public static int endermanEndersnakesSession = 0; - public static int endermanSummoningEyesSession = 0; - public static int endermanManaBooksSession = 0; - public static int endermanTunersSession = 0; - public static int endermanAtomsSession = 0; - public static int endermanEspressoMachinesSession = 0; - public static int endermanSmartyBooksSession = 0; - public static int endermanEndRunesSession = 0; - public static int endermanChalicesSession = 0; - public static int endermanDiceSession = 0; - public static int endermanArtifactsSession = 0; - public static int endermanSkinsSession = 0; - public static int endermanMergersSession = 0; - public static int endermanCoresSession = 0; - public static int endermanEnchantRunesSession = 0; - public static int endermanEnderBooksSession = 0; - public static double endermanTimeSession = -1; - public static int endermanBossesSession = -1; - - // Fishing - public static int seaCreaturesSession = 0; - public static int goodCatchesSession = 0; - public static int greatCatchesSession = 0; - public static int squidsSession = 0; - public static int seaWalkersSession = 0; - public static int nightSquidsSession = 0; - public static int seaGuardiansSession = 0; - public static int seaWitchesSession = 0; - public static int seaArchersSession = 0; - public static int monsterOfTheDeepsSession = 0; - public static int catfishesSession = 0; - public static int carrotKingsSession = 0; - public static int seaLeechesSession = 0; - public static int guardianDefendersSession = 0; - public static int deepSeaProtectorsSession = 0; - public static int hydrasSession = 0; - public static int seaEmperorsSession = 0; - public static double empTimeSession = -1; - public static int empSCsSession = -1; - public static int fishingMilestoneSession = 0; - // Fishing Winter - public static int frozenStevesSession = 0; - public static int frostyTheSnowmansSession = 0; - public static int grinchesSession = 0; - public static int yetisSession = 0; - public static double yetiTimeSession = -1; - public static int yetiSCsSession = -1; - // Fishing Festival - public static int nurseSharksSession = 0; - public static int blueSharksSession = 0; - public static int tigerSharksSession = 0; - public static int greatWhiteSharksSession = 0; - // Spooky Fishing - public static int scarecrowsSession = 0; - public static int nightmaresSession = 0; - public static int werewolfsSession = 0; - public static int phantomFishersSession = 0; - public static int grimReapersSession = 0; - - // Mythological - public static double mythCoinsSession = 0; - public static int griffinFeathersSession = 0; - public static int crownOfGreedsSession = 0; - public static int washedUpSouvenirsSession = 0; - public static int minosHuntersSession = 0; - public static int siameseLynxesSession = 0; - public static int minotaursSession = 0; - public static int gaiaConstructsSession = 0; - public static int minosChampionsSession = 0; - public static int minosInquisitorsSession = 0; - - // Catacombs Dungeons - public static int recombobulatorsSession = 0; - public static int fumingPotatoBooksSession = 0; - // F1 - public static int bonzoStaffsSession = 0; - public static double f1CoinsSpentSession = 0; - public static double f1TimeSpentSession = 0; - // F2 - public static int scarfStudiesSession = 0; - public static int adaptiveSwordsSession = 0; - public static double f2CoinsSpentSession = 0; - public static double f2TimeSpentSession = 0; - // F3 - public static int adaptiveHelmsSession = 0; - public static int adaptiveChestsSession = 0; - public static int adaptiveLegsSession = 0; - public static int adaptiveBootsSession = 0; - public static double f3CoinsSpentSession = 0; - public static double f3TimeSpentSession = 0; - // F4 - public static int spiritWingsSession = 0; - public static int spiritBonesSession = 0; - public static int spiritBootsSession = 0; - public static int spiritSwordsSession = 0; - public static int spiritBowsSession = 0; - public static int epicSpiritPetsSession = 0; - public static int legSpiritPetsSession = 0; - public static double f4CoinsSpentSession = 0; - public static double f4TimeSpentSession = 0; - // F5 - public static int warpedStonesSession = 0; - public static int shadowAssHelmsSession = 0; - public static int shadowAssChestsSession = 0; - public static int shadowAssLegsSession = 0; - public static int shadowAssBootsSession = 0; - public static int lastBreathsSession = 0; - public static int lividDaggersSession = 0; - public static int shadowFurysSession = 0; - public static double f5CoinsSpentSession = 0; - public static double f5TimeSpentSession = 0; - // F6 - public static int ancientRosesSession = 0; - public static int precursorEyesSession = 0; - public static int giantsSwordsSession = 0; - public static int necroLordHelmsSession = 0; - public static int necroLordChestsSession = 0; - public static int necroLordLegsSession = 0; - public static int necroLordBootsSession = 0; - public static int necroSwordsSession = 0; - public static double f6CoinsSpentSession = 0; - public static double f6TimeSpentSession = 0; - // F7 - public static int witherBloodsSession = 0; - public static int witherCloaksSession = 0; - public static int implosionsSession = 0; - public static int witherShieldsSession = 0; - public static int shadowWarpsSession = 0; - public static int necronsHandlesSession = 0; - public static int autoRecombsSession = 0; - public static int witherHelmsSession = 0; - public static int witherChestsSession = 0; - public static int witherLegsSession = 0; - public static int witherBootsSession = 0; - public static double f7CoinsSpentSession = 0; - public static double f7TimeSpentSession = 0; - // Ghosts - public static int sorrowSession = 0; - public static int bagOfCashSession = 0; - public static int voltaSession = 0; - public static int plasmaSession = 0; - public static int ghostlyBootsSession = 0; - // public static double ghostsSecondsSinceStarts = 0; - - static double checkItemsNow = 0; - static double itemsChecked = 0; - - @SubscribeEvent(priority = EventPriority.HIGHEST) - public void onChat(ClientChatReceivedEvent event) { - String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); - - if (!Utils.inSkyblock) return; - if (event.type == 2) return; - if (message.contains(":")) return; - - boolean wolfRNG = false; - boolean spiderRNG = false; - boolean zombieRNG = false; - boolean endermanRNG = false; - - // Slayer tracker - // T6 books - if (message.contains("VERY RARE DROP! (Enchanted Book)") || message.contains("CRAZY RARE DROP! (Enchanted Book)")) { - // Loop through scoreboard to see what boss you're doing - List scoreboard = ScoreboardHandler.getSidebarLines(); - for (String s : scoreboard) { - String sCleaned = ScoreboardHandler.cleanSB(s); - if (sCleaned.contains("Sven Packmaster")) { - wolfBooks++; - ConfigHandler.writeIntConfig("wolf", "book", wolfBooks); - } else if (sCleaned.contains("Tarantula Broodfather")) { - spiderBooks++; - ConfigHandler.writeIntConfig("spider", "book", spiderBooks); - } else if (sCleaned.contains("Revenant Horror")) { - zombieBooks++; - ConfigHandler.writeIntConfig("zombie", "book", zombieBooks); - } - - } - } - - // Wolf - if (message.contains(" Wolf Slayer LVL ")) { - wolfSvens++; - wolfSvensSession++; - if (wolfBosses != -1) { - wolfBosses++; - } - if (wolfBossesSession != -1) { - wolfBossesSession++; - } - ConfigHandler.writeIntConfig("wolf", "svens", wolfSvens); - ConfigHandler.writeIntConfig("wolf", "bossRNG", wolfBosses); - } else if (message.contains("RARE DROP! (") && message.contains("Hamster Wheel)")) { - int amount = getAmountfromMessage(message); - wolfWheels += amount; - wolfWheelsSession += amount; - wolfWheelsDrops++; - wolfWheelsDropsSession++; - ConfigHandler.writeIntConfig("wolf", "wheel", wolfWheels); - ConfigHandler.writeIntConfig("wolf", "wheelDrops", wolfWheelsDrops); - } else if (message.contains("VERY RARE DROP! (") && message.contains(" Spirit Rune I)")) { // Removing the unicode here *should* fix rune drops not counting - wolfSpirits++; - wolfSpiritsSession++; - ConfigHandler.writeIntConfig("wolf", "spirit", wolfSpirits); - } else if (message.contains("CRAZY RARE DROP! (Red Claw Egg)")) { - wolfRNG = true; - wolfEggs++; - wolfEggsSession++; - ConfigHandler.writeIntConfig("wolf", "egg", wolfEggs); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_RED + "RED CLAW EGG!", 3); - } else if (message.contains("CRAZY RARE DROP! (") && message.contains(" Couture Rune I)")) { - wolfRNG = true; - wolfCoutures++; - wolfCouturesSession++; - ConfigHandler.writeIntConfig("wolf", "couture", wolfCoutures); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GOLD + "COUTURE RUNE!", 3); - } else if (message.contains("CRAZY RARE DROP! (Grizzly Bait)") || message.contains("CRAZY RARE DROP! (Rename Me)")) { // How did Skyblock devs even manage to make this item Rename Me - wolfRNG = true; - wolfBaits++; - wolfBaitsSession++; - ConfigHandler.writeIntConfig("wolf", "bait", wolfBaits); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.AQUA + "GRIZZLY BAIT!", 3); - } else if (message.contains("CRAZY RARE DROP! (Overflux Capacitor)")) { - wolfRNG = true; - wolfFluxes++; - wolfFluxesSession++; - ConfigHandler.writeIntConfig("wolf", "flux", wolfFluxes); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "OVERFLUX CAPACITOR!", 5); - } else if (message.contains(" Spider Slayer LVL ")) { // Spider - spiderTarantulas++; - spiderTarantulasSession++; - if (spiderBosses != -1) { - spiderBosses++; - } - if (spiderBossesSession != -1) { - spiderBossesSession++; - } - ConfigHandler.writeIntConfig("spider", "tarantulas", spiderTarantulas); - ConfigHandler.writeIntConfig("spider", "bossRNG", spiderBosses); - } else if (message.contains("RARE DROP! (") && message.contains("Toxic Arrow Poison)")) { - int amount = getAmountfromMessage(message); - spiderTAP += amount; - spiderTAPSession += amount; - spiderTAPDrops++; - spiderTAPDropsSession++; - ConfigHandler.writeIntConfig("spider", "tap", spiderTAP); - ConfigHandler.writeIntConfig("spider", "tapDrops", spiderTAPDrops); - } else if (message.contains("VERY RARE DROP! (") && message.contains(" Bite Rune I)")) { - spiderBites++; - spiderBitesSession++; - ConfigHandler.writeIntConfig("spider", "bite", spiderBites); - } else if (message.contains("VERY RARE DROP! (Spider Catalyst)")) { - spiderCatalysts++; - spiderCatalystsSession++; - ConfigHandler.writeIntConfig("spider", "catalyst", spiderCatalysts); - } else if (message.contains("CRAZY RARE DROP! (Fly Swatter)")) { - spiderRNG = true; - spiderSwatters++; - spiderSwattersSession++; - ConfigHandler.writeIntConfig("spider", "swatter", spiderSwatters); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.LIGHT_PURPLE + "FLY SWATTER!", 3); - } else if (message.contains("CRAZY RARE DROP! (Tarantula Talisman")) { - spiderRNG = true; - spiderTalismans++; - spiderTalismansSession++; - ConfigHandler.writeIntConfig("spider", "talisman", spiderTalismans); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "TARANTULA TALISMAN!", 3); - } else if (message.contains("CRAZY RARE DROP! (Digested Mosquito)")) { - spiderRNG = true; - spiderMosquitos++; - spiderMosquitosSession++; - ConfigHandler.writeIntConfig("spider", "mosquito", spiderMosquitos); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GOLD + "DIGESTED MOSQUITO!", 5); - } else if (message.contains(" Zombie Slayer LVL ")) { // Zombie - zombieRevs++; - zombieRevsSession++; - if (zombieBosses != -1) { - zombieBosses++; - } - if (zombieBossesSession != 1) { - zombieBossesSession++; - } - ConfigHandler.writeIntConfig("zombie", "revs", zombieRevs); - ConfigHandler.writeIntConfig("zombie", "bossRNG", zombieBosses); - } else if (message.contains("RARE DROP! (") && message.contains("Revenant Viscera)")) { - int amount = getAmountfromMessage(message); - zombieRevViscera += amount; - zombieRevVisceraSession += amount; - ConfigHandler.writeIntConfig("zombie", "revViscera", zombieRevViscera); - } else if (message.contains("RARE DROP! (") && message.contains("Foul Flesh)")) { - int amount = getAmountfromMessage(message); - zombieFoulFlesh += amount; - zombieFoulFleshSession += amount; - zombieFoulFleshDrops++; - zombieFoulFleshDropsSession++; - ConfigHandler.writeIntConfig("zombie", "foulFlesh", zombieFoulFlesh); - ConfigHandler.writeIntConfig("zombie", "foulFleshDrops", zombieFoulFleshDrops); - } else if (message.contains("VERY RARE DROP! (Revenant Catalyst)")) { - zombieRevCatas++; - zombieRevCatasSession++; - ConfigHandler.writeIntConfig("zombie", "revCatalyst", zombieRevCatas); - } else if (message.contains("VERY RARE DROP! (") && message.contains(" Pestilence Rune I)")) { - zombiePestilences++; - zombiePestilencesSession++; - ConfigHandler.writeIntConfig("zombie", "pestilence", zombiePestilences); - } else if (message.contains("VERY RARE DROP! (Undead Catalyst)")) { - zombieUndeadCatas++; - zombieUndeadCatasSession++; - ConfigHandler.writeIntConfig("zombie", "undeadCatalyst", zombieUndeadCatas); - } else if (message.contains("CRAZY RARE DROP! (Beheaded Horror)")) { - zombieRNG = true; - zombieBeheadeds++; - zombieBeheadedsSession++; - ConfigHandler.writeIntConfig("zombie", "beheaded", zombieBeheadeds); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "BEHEADED HORROR!", 3); - } else if (message.contains("CRAZY RARE DROP! (") && message.contains(" Snake Rune I)")) { - zombieRNG = true; - zombieSnakes++; - zombieSnakesSession++; - ConfigHandler.writeIntConfig("zombie", "snake", zombieSnakes); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_GREEN + "SNAKE RUNE!", 3); - } else if (message.contains("CRAZY RARE DROP! (Scythe Blade)")) { - zombieRNG = true; - zombieScythes++; - zombieScythesSession++; - ConfigHandler.writeIntConfig("zombie", "scythe", zombieScythes); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GOLD + "SCYTHE BLADE!", 5); - } else if (message.contains("CRAZY RARE DROP! (Shard of the Shredded)")) { - zombieRNG = true; - zombieShards++; - zombieShardsSession++; - ConfigHandler.writeIntConfig("zombie", "shard", zombieShards); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.RED + "SHARD OF THE SHREDDED!", 5); - } else if (message.contains("INSANE DROP! (Warden Heart)") || message.contains("CRAZY RARE DROP! (Warden Heart)")) { - zombieRNG = true; - zombieWardenHearts++; - zombieWardenHeartsSession++; - ConfigHandler.writeIntConfig("zombie", "heart", zombieWardenHearts); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.RED + "WARDEN HEART!", 5); - } else if (message.contains(" Enderman Slayer LVL ")) { - endermanVoidglooms++; - endermanVoidgloomsSession++; - if (endermanBosses != -1) { - endermanBosses++; - } - if (endermanBossesSession != -1) { - endermanBossesSession++; - } - ConfigHandler.writeIntConfig("enderman", "voidglooms", endermanVoidglooms); - ConfigHandler.writeIntConfig("enderman", "bossRNG", endermanBosses); - } else if (message.contains("RARE DROP! (") && message.contains("Twilight Arrow Poison)")) { - int amount = getAmountfromMessage(message); - endermanTAP += amount; - endermanTAPSession += amount; - endermanTAPDrops++; - endermanTAPDropsSession++; - ConfigHandler.writeIntConfig("enderman", "tap", endermanTAP); - ConfigHandler.writeIntConfig("enderman", "tapDrops", endermanTAPDrops); - } else if (message.contains("VERY RARE DROP! (") && message.contains(" Endersnake Rune I)")) { - endermanEndersnakes++; - endermanEndersnakesSession++; - ConfigHandler.writeIntConfig("enderman", "endersnakes", endermanEndersnakes); - } else if (message.contains("VERY RARE DROP! (Summoning Eye)")) { - endermanSummoningEyes++; - endermanSummoningEyesSession++; - ConfigHandler.writeIntConfig("enderman", "summoningEyes", endermanSummoningEyes); - } else if (message.contains("VERY RARE DROP! (Mana Steal I)")) { - endermanManaBooks++; - endermanManaBooksSession++; - ConfigHandler.writeIntConfig("enderman", "manaBooks", endermanManaBooks); - } else if (message.contains("VERY RARE DROP! (Transmission Tuner)")) { - endermanTuners++; - endermanTunersSession++; - ConfigHandler.writeIntConfig("enderman", "tuners", endermanTuners); - } else if (message.contains("VERY RARE DROP! (Null Atom)")) { - endermanAtoms++; - endermanAtomsSession++; - ConfigHandler.writeIntConfig("enderman", "atoms", endermanAtoms); - } else if (message.contains("CRAZY RARE DROP! (Pocket Espresso Machine)")) { - endermanRNG = true; - endermanEspressoMachines++; - endermanEspressoMachinesSession++; - ConfigHandler.writeIntConfig("enderman", "espressoMachines", endermanEspressoMachines); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.AQUA + "POCKET ESPRESSO MACHINE!", 3); - } else if (message.contains("VERY RARE DROP! (Smarty Pants I)")) { - endermanSmartyBooks++; - endermanSmartyBooksSession++; - ConfigHandler.writeIntConfig("enderman", "smartyBooks", endermanSmartyBooks); - } else if (message.contains("VERY RARE DROP! (") && message.contains(" End Rune I)")) { - endermanEndRunes++; - endermanEndRunesSession++; - ConfigHandler.writeIntConfig("enderman", "endRunes", endermanEndRunes); - } else if (message.contains("CRAZY RARE DROP! (Handy Blood Chalice)")) { - endermanRNG = true; - endermanChalices++; - endermanChalicesSession++; - ConfigHandler.writeIntConfig("enderman", "chalices", endermanChalices); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.RED + "HANDY BLOOD CHALICE!", 3); - } else if (message.contains("VERY RARE DROP! (Sinful Dice)")) { - endermanDice++; - endermanDiceSession++; - ConfigHandler.writeIntConfig("enderman", "dice", endermanDice); - } else if (message.contains("CRAZY RARE DROP! (Exceedingly Rare Ender Artifact Upgrader)")) { - endermanRNG = true; - endermanArtifacts++; - endermanArtifactsSession++; - ConfigHandler.writeIntConfig("enderman", "artifacts", endermanArtifacts); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "ENDER ARTIFACT UPGRADER!", 3); - } else if (message.contains("CRAZY RARE DROP! (Void Conqueror Enderman Skin)")) { - endermanRNG = true; - endermanSkins++; - endermanSkinsSession++; - ConfigHandler.writeIntConfig("enderman", "skins", endermanSkins); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "ENDERMAN SKIN!", 3); - } else if (message.contains("VERY RARE DROP! (Etherwarp Merger)")) { - endermanMergers++; - endermanMergersSession++; - ConfigHandler.writeIntConfig("enderman", "mergers", endermanMergers); - } else if (message.contains("CRAZY RARE DROP! (Judgement Core)")) { - endermanRNG = true; - endermanCores++; - endermanCoresSession++; - ConfigHandler.writeIntConfig("enderman", "cores", endermanCores); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GOLD + "JUDGEMENT CORE!", 5); - } else if (message.contains("CRAZY RARE DROP! (") && message.contains(" Enchant Rune I)")) { - endermanRNG = true; - endermanEnchantRunes++; - endermanEnchantRunesSession++; - ConfigHandler.writeIntConfig("enderman", "enchantRunes", endermanEnchantRunes); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GRAY + "ENCHANT RUNE!", 3); - } else if (message.contains("INSANE DROP! (Ender Slayer VII)") || message.contains("CRAZY RARE DROP! (Ender Slayer VII)")) { - endermanRNG = true; - endermanEnderBooks++; - endermanEnderBooksSession++; - ConfigHandler.writeIntConfig("enderman", "enderBooks", endermanEnderBooks); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.RED + "ENDER SLAYER VII!", 3); - } - - if (wolfRNG) { - wolfTime = System.currentTimeMillis() / 1000; - wolfBosses = 0; - wolfTimeSession = System.currentTimeMillis() / 1000; - wolfBossesSession = 0; - ConfigHandler.writeDoubleConfig("wolf", "timeRNG", wolfTime); - ConfigHandler.writeIntConfig("wolf", "bossRNG", 0); - } - if (spiderRNG) { - spiderTime = System.currentTimeMillis() / 1000; - spiderBosses = 0; - spiderTimeSession = System.currentTimeMillis() / 1000; - spiderBossesSession = 0; - ConfigHandler.writeDoubleConfig("spider", "timeRNG", spiderTime); - ConfigHandler.writeIntConfig("spider", "bossRNG", 0); - } - if (zombieRNG) { - zombieTime = System.currentTimeMillis() / 1000; - zombieBosses = 0; - zombieTimeSession = System.currentTimeMillis() / 1000; - zombieBossesSession = 0; - ConfigHandler.writeDoubleConfig("zombie", "timeRNG", zombieTime); - ConfigHandler.writeIntConfig("zombie", "bossRNG", 0); - } - if (endermanRNG) { - endermanTime = System.currentTimeMillis() / 1000; - endermanBosses = 0; - endermanTimeSession = System.currentTimeMillis() / 1000; - endermanBossesSession = 0; - ConfigHandler.writeDoubleConfig("enderman", "timeRNG", endermanTime); - ConfigHandler.writeIntConfig("enderman", "bossRNG", 0); - } - - // Fishing tracker - if (message.contains("GOOD CATCH!")) { - goodCatches++; - goodCatchesSession++; - ConfigHandler.writeIntConfig("fishing", "goodCatch", goodCatches); - } else if (message.contains("GREAT CATCH!")) { - greatCatches++; - greatCatchesSession++; - ConfigHandler.writeIntConfig("fishing", "greatCatch", greatCatches); - } else if (message.contains("A Squid appeared")) { - squids++; - squidsSession++; - ConfigHandler.writeIntConfig("fishing", "squid", squids); - increaseSeaCreatures(); - } else if (message.contains("You caught a Sea Walker")) { - seaWalkers++; - seaWalkersSession++; - ConfigHandler.writeIntConfig("fishing", "seaWalker", seaWalkers); - increaseSeaCreatures(); - } else if (message.contains("Pitch darkness reveals a Night Squid")) { - nightSquids++; - nightSquidsSession++; - ConfigHandler.writeIntConfig("fishing", "nightSquid", nightSquids); - increaseSeaCreatures(); - } else if (message.contains("You stumbled upon a Sea Guardian")) { - seaGuardians++; - seaGuardiansSession++; - ConfigHandler.writeIntConfig("fishing", "seaGuardian", seaGuardians); - increaseSeaCreatures(); - } else if (message.contains("It looks like you've disrupted the Sea Witch's brewing session. Watch out, she's furious")) { - seaWitches++; - seaWitchesSession++; - ConfigHandler.writeIntConfig("fishing", "seaWitch", seaWitches); - increaseSeaCreatures(); - } else if (message.contains("You reeled in a Sea Archer")) { - seaArchers++; - seaArchersSession++; - ConfigHandler.writeIntConfig("fishing", "seaArcher", seaArchers); - increaseSeaCreatures(); - } else if (message.contains("The Monster of the Deep has emerged")) { - monsterOfTheDeeps++; - monsterOfTheDeepsSession++; - ConfigHandler.writeIntConfig("fishing", "monsterOfDeep", monsterOfTheDeeps); - increaseSeaCreatures(); - } else if (message.contains("Huh? A Catfish")) { - catfishes++; - catfishesSession++; - ConfigHandler.writeIntConfig("fishing", "catfish", catfishes); - increaseSeaCreatures(); - } else if (message.contains("Is this even a fish? It's the Carrot King")) { - carrotKings++; - carrotKingsSession++; - ConfigHandler.writeIntConfig("fishing", "carrotKing", carrotKings); - increaseSeaCreatures(); - } else if (message.contains("Gross! A Sea Leech")) { - seaLeeches++; - seaLeechesSession++; - ConfigHandler.writeIntConfig("fishing", "seaLeech", seaLeeches); - increaseSeaCreatures(); - } else if (message.contains("You've discovered a Guardian Defender of the sea")) { - guardianDefenders++; - guardianDefendersSession++; - ConfigHandler.writeIntConfig("fishing", "guardianDefender", guardianDefenders); - increaseSeaCreatures(); - } else if (message.contains("You have awoken the Deep Sea Protector, prepare for a battle")) { - deepSeaProtectors++; - deepSeaProtectorsSession++; - ConfigHandler.writeIntConfig("fishing", "deepSeaProtector", deepSeaProtectors); - increaseSeaCreatures(); - } else if (message.contains("The Water Hydra has come to test your strength")) { - hydras++; - hydrasSession++; - ConfigHandler.writeIntConfig("fishing", "hydra", hydras); - increaseSeaCreatures(); - } else if (message.contains("The Sea Emperor arises from the depths")) { - increaseSeaCreatures(); - - seaEmperors++; - empTime = System.currentTimeMillis() / 1000; - empSCs = 0; - seaEmperorsSession++; - empTimeSession = System.currentTimeMillis() / 1000; - empSCsSession = 0; - ConfigHandler.writeIntConfig("fishing", "seaEmperor", seaEmperors); - ConfigHandler.writeDoubleConfig("fishing", "empTime", empTime); - ConfigHandler.writeIntConfig("fishing", "empSC", empSCs); - } else if (message.contains("Frozen Steve fell into the pond long ago")) { // Fishing Winter - frozenSteves++; - frozenStevesSession++; - ConfigHandler.writeIntConfig("fishing", "frozenSteve", frozenSteves); - increaseSeaCreatures(); - } else if (message.contains("It's a snowman! He looks harmless")) { - frostyTheSnowmans++; - frostyTheSnowmansSession++; - ConfigHandler.writeIntConfig("fishing", "snowman", frostyTheSnowmans); - increaseSeaCreatures(); - } else if (message.contains("stole Jerry's Gifts...get them back")) { - grinches++; - grinchesSession++; - ConfigHandler.writeIntConfig("fishing", "grinch", grinches); - increaseSeaCreatures(); - } else if (message.contains("What is this creature")) { - yetis++; - yetiTime = System.currentTimeMillis() / 1000; - yetiSCs = 0; - yetisSession++; - yetiTimeSession = System.currentTimeMillis() / 1000; - yetiSCsSession = 0; - ConfigHandler.writeIntConfig("fishing", "yeti", yetis); - ConfigHandler.writeDoubleConfig("fishing", "yetiTime", yetiTime); - ConfigHandler.writeIntConfig("fishing", "yetiSC", yetiSCs); - increaseSeaCreatures(); - } else if (message.contains("A tiny fin emerges from the water, you've caught a Nurse Shark")) { // Fishing Festival - nurseSharks++; - nurseSharksSession++; - ConfigHandler.writeIntConfig("fishing", "nurseShark", nurseSharks); - increaseSeaCreatures(); - } else if (message.contains("You spot a fin as blue as the water it came from, it's a Blue Shark")) { - blueSharks++; - blueSharksSession++; - ConfigHandler.writeIntConfig("fishing", "blueShark", blueSharks); - increaseSeaCreatures(); - } else if (message.contains("A striped beast bounds from the depths, the wild Tiger Shark")) { - tigerSharks++; - tigerSharksSession++; - ConfigHandler.writeIntConfig("fishing", "tigerShark", tigerSharks); - increaseSeaCreatures(); - } else if (message.contains("Hide no longer, a Great White Shark has tracked your scent and thirsts for your blood")) { - greatWhiteSharks++; - greatWhiteSharksSession++; - ConfigHandler.writeIntConfig("fishing", "greatWhiteShark", greatWhiteSharks); - increaseSeaCreatures(); - } else if (message.contains("Phew! It's only a Scarecrow")) { - scarecrows++; - scarecrowsSession++; - ConfigHandler.writeIntConfig("fishing", "scarecrow", scarecrows); - increaseSeaCreatures(); - } else if (message.contains("You hear trotting from beneath the waves, you caught a Nightmare")) { - nightmares++; - nightmaresSession++; - ConfigHandler.writeIntConfig("fishing", "nightmare", nightmares); - increaseSeaCreatures(); - } else if (message.contains("It must be a full moon, a Werewolf appears")) { - werewolfs++; - werewolfsSession++; - ConfigHandler.writeIntConfig("fishing", "werewolf", werewolfs); - increaseSeaCreatures(); - } else if (message.contains("The spirit of a long lost Phantom Fisher has come to haunt you")) { - phantomFishers++; - phantomFishersSession++; - ConfigHandler.writeIntConfig("fishing", "phantomFisher", phantomFishers); - increaseSeaCreatures(); - } else if (message.contains("This can't be! The manifestation of death himself")) { - grimReapers++; - grimReapersSession++; - ConfigHandler.writeIntConfig("fishing", "grimReaper", grimReapers); - increaseSeaCreatures(); - } - - // Dungeons tracker - if (message.contains(" ")) { - if (message.contains("Recombobulator 3000")) { - recombobulators++; - recombobulatorsSession++; - ConfigHandler.writeIntConfig("catacombs", "recombobulator", recombobulators); - } else if (message.contains("Fuming Potato Book")) { - fumingPotatoBooks++; - fumingPotatoBooksSession++; - ConfigHandler.writeIntConfig("catacombs", "fumingBooks", fumingPotatoBooks); - } else if (message.contains("Bonzo's Staff")) { // F1 - bonzoStaffs++; - bonzoStaffsSession++; - ConfigHandler.writeIntConfig("catacombs", "bonzoStaff", bonzoStaffs); - } else if (message.contains("Scarf's Studies")) { // F2 - scarfStudies++; - scarfStudiesSession++; - ConfigHandler.writeIntConfig("catacombs", "scarfStudies", scarfStudies); - } else if (message.contains("Adaptive Helmet")) { // F3 - adaptiveHelms++; - adaptiveHelmsSession++; - ConfigHandler.writeIntConfig("catacombs", "adaptiveHelm", adaptiveHelms); - } else if (message.contains("Adaptive Chestplate")) { - adaptiveChests++; - adaptiveChestsSession++; - ConfigHandler.writeIntConfig("catacombs", "adaptiveChest", adaptiveChests); - } else if (message.contains("Adaptive Leggings")) { - adaptiveLegs++; - adaptiveLegsSession++; - ConfigHandler.writeIntConfig("catacombs", "adaptiveLegging", adaptiveLegs); - } else if (message.contains("Adaptive Boots")) { - adaptiveBoots++; - adaptiveBootsSession++; - ConfigHandler.writeIntConfig("catacombs", "adaptiveBoot", adaptiveBoots); - } else if (message.contains("Adaptive Blade")) { - adaptiveSwords++; - adaptiveSwordsSession++; - ConfigHandler.writeIntConfig("catacombs", "adaptiveSword", adaptiveSwords); - } else if (message.contains("Spirit Wing")) { // F4 - spiritWings++; - spiritWingsSession++; - ConfigHandler.writeIntConfig("catacombs", "spiritWing", spiritWings); - } else if (message.contains("Spirit Bone")) { - spiritBones++; - spiritBonesSession++; - ConfigHandler.writeIntConfig("catacombs", "spiritBone", spiritBones); - } else if (message.contains("Spirit Boots")) { - spiritBoots++; - spiritBootsSession++; - ConfigHandler.writeIntConfig("catacombs", "spiritBoot", spiritBoots); - } else if (message.contains("[Lvl 1] Spirit")) { - String formattedMessage = event.message.getFormattedText(); - // Unicode colour code messes up here, just gonna remove the symbols - if (formattedMessage.contains("5Spirit")) { - epicSpiritPets++; - epicSpiritPetsSession++; - ConfigHandler.writeIntConfig("catacombs", "spiritPetEpic", epicSpiritPets); - } else if (formattedMessage.contains("6Spirit")) { - legSpiritPets++; - legSpiritPetsSession++; - ConfigHandler.writeIntConfig("catacombs", "spiritPetLeg", legSpiritPets); - } - } else if (message.contains("Spirit Sword")) { - spiritSwords++; - spiritSwordsSession++; - ConfigHandler.writeIntConfig("catacombs", "spiritSword", spiritSwords); - } else if (message.contains("Spirit Bow")) { - spiritBows++; - spiritBowsSession++; - ConfigHandler.writeIntConfig("catacombs", "spiritBow", spiritBows); - } else if (message.contains("Warped Stone")) { // F5 - warpedStones++; - warpedStonesSession++; - ConfigHandler.writeIntConfig("catacombs", "warpedStone", warpedStones); - } else if (message.contains("Shadow Assassin Helmet")) { - shadowAssHelms++; - shadowAssHelmsSession++; - ConfigHandler.writeIntConfig("catacombs", "shadowAssassinHelm", shadowAssHelms); - } else if (message.contains("Shadow Assassin Chestplate")) { - shadowAssChests++; - shadowAssChestsSession++; - ConfigHandler.writeIntConfig("catacombs", "shadowAssassinChest", shadowAssChests); - } else if (message.contains("Shadow Assassin Leggings")) { - shadowAssLegs++; - shadowAssLegsSession++; - ConfigHandler.writeIntConfig("catacombs", "shadowAssassinLegging", shadowAssLegs); - } else if (message.contains("Shadow Assassin Boots")) { - shadowAssBoots++; - shadowAssBootsSession++; - ConfigHandler.writeIntConfig("catacombs", "shadowAssassinBoot", shadowAssBoots); - } else if (message.contains("Livid Dagger")) { - lividDaggers++; - lividDaggersSession++; - ConfigHandler.writeIntConfig("catacombs", "lividDagger", lividDaggers); - } else if (message.contains("Shadow Fury")) { - shadowFurys++; - shadowFurysSession++; - ConfigHandler.writeIntConfig("catacombs", "shadowFury", shadowFurys); - } else if (message.contains("Ancient Rose")) { // F6 - ancientRoses++; - ancientRosesSession++; - ConfigHandler.writeIntConfig("catacombs", "ancientRose", ancientRoses); - } else if (message.contains("Precursor Eye")) { - precursorEyes++; - precursorEyesSession++; - ConfigHandler.writeIntConfig("catacombs", "precursorEye", precursorEyes); - } else if (message.contains("Giant's Sword")) { - giantsSwords++; - giantsSwordsSession++; - ConfigHandler.writeIntConfig("catacombs", "giantsSword", giantsSwords); - } else if (message.contains("Necromancer Lord Helmet")) { - necroLordHelms++; - necroLordHelmsSession++; - ConfigHandler.writeIntConfig("catacombs", "necroLordHelm", necroLordHelms); - } else if (message.contains("Necromancer Lord Chestplate")) { - necroLordChests++; - necroLordChestsSession++; - ConfigHandler.writeIntConfig("catacombs", "necroLordChest", necroLordChests); - } else if (message.contains("Necromancer Lord Leggings")) { - necroLordLegs++; - necroLordLegsSession++; - ConfigHandler.writeIntConfig("catacombs", "necroLordLegging", necroLordLegs); - } else if (message.contains("Necromancer Lord Boots")) { - necroLordBoots++; - necroLordBootsSession++; - ConfigHandler.writeIntConfig("catacombs", "necroLordBoot", necroLordBoots); - } else if (message.contains("Necromancer Sword")) { - necroSwords++; - necroSwordsSession++; - ConfigHandler.writeIntConfig("catacombs", "necroSword", necroSwords); - } else if (message.contains("Wither Blood")) { // F7 - witherBloods++; - witherBloodsSession++; - ConfigHandler.writeIntConfig("catacombs", "witherBlood", witherBloods); - } else if (message.contains("Wither Cloak")) { - witherCloaks++; - witherCloaksSession++; - ConfigHandler.writeIntConfig("catacombs", "witherCloak", witherCloaks); - } else if (message.contains("Implosion")) { - implosions++; - implosionsSession++; - ConfigHandler.writeIntConfig("catacombs", "implosion", implosions); - } else if (message.contains("Wither Shield")) { - witherShields++; - witherShieldsSession++; - ConfigHandler.writeIntConfig("catacombs", "witherShield", witherShields); - } else if (message.contains("Shadow Warp")) { - shadowWarps++; - shadowWarpsSession++; - ConfigHandler.writeIntConfig("catacombs", "shadowWarp", shadowWarps); - } else if (message.contains("Necron's Handle")) { - necronsHandles++; - necronsHandlesSession++; - ConfigHandler.writeIntConfig("catacombs", "necronsHandle", necronsHandles); - } else if (message.contains("Auto Recombobulator")) { - autoRecombs++; - autoRecombsSession++; - ConfigHandler.writeIntConfig("catacombs", "autoRecomb", autoRecombs); - } else if (message.contains("Wither Helmet")) { - witherHelms++; - witherHelmsSession++; - ConfigHandler.writeIntConfig("catacombs", "witherHelm", witherHelms); - } else if (message.contains("Wither Chestplate")) { - witherChests++; - witherChestsSession++; - ConfigHandler.writeIntConfig("catacombs", "witherChest", witherChests); - } else if (message.contains("Wither Leggings")) { - witherLegs++; - witherLegsSession++; - ConfigHandler.writeIntConfig("catacombs", "witherLegging", witherLegs); - } else if (message.contains("Wither Boots")) { - witherBoots++; - witherBootsSession++; - ConfigHandler.writeIntConfig("catacombs", "witherBoot", witherBoots); - } - } - - if (message.contains("EXTRA STATS ")) { - List scoreboard = ScoreboardHandler.getSidebarLines(); - int timeToAdd = 0; - for (String s : scoreboard) { - String sCleaned = ScoreboardHandler.cleanSB(s); - if (sCleaned.contains("The Catacombs (")) { - // Add time to floor - if (sCleaned.contains("F1")) { - f1TimeSpent = Math.floor(f1TimeSpent + timeToAdd); - f1TimeSpentSession = Math.floor(f1TimeSpentSession + timeToAdd); - ConfigHandler.writeDoubleConfig("catacombs", "floorOneTime", f1TimeSpent); - } else if (sCleaned.contains("F2")) { - f2TimeSpent = Math.floor(f2TimeSpent + timeToAdd); - f2TimeSpentSession = Math.floor(f2TimeSpentSession + timeToAdd); - ConfigHandler.writeDoubleConfig("catacombs", "floorTwoTime", f2TimeSpent); - } else if (sCleaned.contains("F3")) { - f3TimeSpent = Math.floor(f3TimeSpent + timeToAdd); - f3TimeSpentSession = Math.floor(f3TimeSpentSession + timeToAdd); - ConfigHandler.writeDoubleConfig("catacombs", "floorThreeTime", f3TimeSpent); - } else if (sCleaned.contains("F4")) { - f4TimeSpent = Math.floor(f4TimeSpent + timeToAdd); - f4TimeSpentSession = Math.floor(f4TimeSpentSession + timeToAdd); - ConfigHandler.writeDoubleConfig("catacombs", "floorFourTime", f4TimeSpent); - } else if (sCleaned.contains("F5")) { - f5TimeSpent = Math.floor(f5TimeSpent + timeToAdd); - f5TimeSpentSession = Math.floor(f5TimeSpentSession + timeToAdd); - ConfigHandler.writeDoubleConfig("catacombs", "floorFiveTime", f5TimeSpent); - } else if (sCleaned.contains("F6")) { - f6TimeSpent = Math.floor(f6TimeSpent + timeToAdd); - f6TimeSpentSession = Math.floor(f6TimeSpentSession + timeToAdd); - ConfigHandler.writeDoubleConfig("catacombs", "floorSixTime", f6TimeSpent); - } else if (sCleaned.contains("F7")) { - f7TimeSpent = Math.floor(f7TimeSpent + timeToAdd); - f7TimeSpentSession = Math.floor(f7TimeSpentSession + timeToAdd); - ConfigHandler.writeDoubleConfig("catacombs", "floorSevenTime", f7TimeSpent); - } - } else if (sCleaned.contains("Time Elapsed:")) { - // Get floor time - String time = sCleaned.substring(sCleaned.indexOf(":") + 2); - time = time.replaceAll("\\s", ""); - int minutes = Integer.parseInt(time.substring(0, time.indexOf("m"))); - int seconds = Integer.parseInt(time.substring(time.indexOf("m") + 1, time.indexOf("s"))); - timeToAdd = (minutes * 60) + seconds; - } - } - } - - // Mythological Tracker - if (message.contains("You dug out")) { - if (message.contains(" coins!")) { - double coinsEarned = Double.parseDouble(message.replaceAll("[^\\d]", "")); - mythCoins += coinsEarned; - mythCoinsSession += coinsEarned; - ConfigHandler.writeDoubleConfig("mythological", "coins", mythCoins); - } else if (message.contains("a Griffin Feather!")) { - griffinFeathers++; - griffinFeathersSession++; - ConfigHandler.writeIntConfig("mythological", "griffinFeather", griffinFeathers); - } else if (message.contains("a Crown of Greed!")) { - crownOfGreeds++; - crownOfGreedsSession++; - ConfigHandler.writeIntConfig("mythological", "crownOfGreed", crownOfGreeds); - } else if (message.contains("a Washed-up Souvenir!")) { - washedUpSouvenirs++; - washedUpSouvenirsSession++; - ConfigHandler.writeIntConfig("mythological", "washedUpSouvenir", washedUpSouvenirs); - } else if (message.contains("a Minos Hunter!")) { - minosHunters++; - minosHuntersSession++; - ConfigHandler.writeIntConfig("mythological", "minosHunter", minosHunters); - } else if (message.contains("Siamese Lynxes!")) { - siameseLynxes++; - siameseLynxesSession++; - ConfigHandler.writeIntConfig("mythological", "siameseLynx", siameseLynxes); - } else if (message.contains("a Minotaur!")) { - minotaurs++; - minotaursSession++; - ConfigHandler.writeIntConfig("mythological", "minotaur", minotaurs); - } else if (message.contains("a Gaia Construct!")) { - gaiaConstructs++; - gaiaConstructsSession++; - ConfigHandler.writeIntConfig("mythological", "gaiaConstruct", gaiaConstructs); - } else if (message.contains("a Minos Champion!")) { - minosChampions++; - minosChampionsSession++; - ConfigHandler.writeIntConfig("mythological", "minosChampion", minosChampions); - } else if (message.contains("a Minos Inquisitor!")) { - minosInquisitors++; - minosInquisitorsSession++; - ConfigHandler.writeIntConfig("mythological", "minosInquisitor", minosInquisitors); - } - } - - - if (message.contains("RARE DROP!")) { - if (message.contains("Sorrow")) { - sorrows++; - sorrowSession++; - ConfigHandler.writeIntConfig("ghosts", "sorrow", sorrows); - } - if (message.contains("Volta")) { - voltas++; - voltaSession++; - ConfigHandler.writeIntConfig("ghosts", "volta", voltas); - } - if (message.contains("Plasma")) { - plasmas++; - plasmaSession++; - ConfigHandler.writeIntConfig("ghosts", "plasma", plasmas); - } - if (message.contains("Ghostly Boots")) { - ghostlyBoots++; - ghostlyBootsSession++; - ConfigHandler.writeIntConfig("ghosts", "ghostlyBoots", ghostlyBoots); - } - if (message.contains("The ghost's death materialized ")) { - bagOfCashs++; - bagOfCashSession++; - ConfigHandler.writeIntConfig("ghosts", "bagOfCash", bagOfCashs); - } - } - } - - @SubscribeEvent - public void onSlotClick(ChestSlotClickedEvent event) { - ItemStack item = event.item; - - if (event.inventoryName.endsWith(" Chest") && item != null && item.getDisplayName().contains("Open Reward Chest")) { - List tooltip = item.getTooltip(Minecraft.getMinecraft().thePlayer, Minecraft.getMinecraft().gameSettings.advancedItemTooltips); - for (String lineUnclean : tooltip) { - String line = StringUtils.stripControlCodes(lineUnclean); - if (line.contains("FREE")) { - break; - } else if (line.contains(" Coins")) { - int coinsSpent = Integer.parseInt(line.substring(0, line.indexOf(" ")).replaceAll(",", "")); - - List scoreboard = ScoreboardHandler.getSidebarLines(); - for (String s : scoreboard) { - String sCleaned = ScoreboardHandler.cleanSB(s); - if (sCleaned.contains("The Catacombs (")) { - if (sCleaned.contains("F1")) { - f1CoinsSpent += coinsSpent; - f1CoinsSpentSession += coinsSpent; - ConfigHandler.writeDoubleConfig("catacombs", "floorOneCoins", f1CoinsSpent); - } else if (sCleaned.contains("F2")) { - f2CoinsSpent += coinsSpent; - f2CoinsSpentSession += coinsSpent; - ConfigHandler.writeDoubleConfig("catacombs", "floorTwoCoins", f2CoinsSpent); - } else if (sCleaned.contains("F3")) { - f3CoinsSpent += coinsSpent; - f3CoinsSpentSession += coinsSpent; - ConfigHandler.writeDoubleConfig("catacombs", "floorThreeCoins", f3CoinsSpent); - } else if (sCleaned.contains("F4")) { - f4CoinsSpent += coinsSpent; - f4CoinsSpentSession += coinsSpent; - ConfigHandler.writeDoubleConfig("catacombs", "floorFourCoins", f4CoinsSpent); - } else if (sCleaned.contains("F5")) { - f5CoinsSpent += coinsSpent; - f5CoinsSpentSession += coinsSpent; - ConfigHandler.writeDoubleConfig("catacombs", "floorFiveCoins", f5CoinsSpent); - } else if (sCleaned.contains("F6")) { - f6CoinsSpent += coinsSpent; - f6CoinsSpentSession += coinsSpent; - ConfigHandler.writeDoubleConfig("catacombs", "floorSixCoins", f6CoinsSpent); - } else if (sCleaned.contains("F7")) { - f7CoinsSpent += coinsSpent; - f7CoinsSpentSession += coinsSpent; - ConfigHandler.writeDoubleConfig("catacombs", "floorSevenCoins", f7CoinsSpent); - } - break; - } - } - break; - } - } - } - } + public static long itemsChecked = 0; @SubscribeEvent(priority = EventPriority.HIGHEST) public void onSound(PlaySoundEvent event) { if (!Utils.inSkyblock) return; if (event.name.equals("note.pling")) { // Don't check twice within 3 seconds - checkItemsNow = System.currentTimeMillis() / 1000; + long checkItemsNow = System.currentTimeMillis() / 1000; if (checkItemsNow - itemsChecked < 3) return; List scoreboard = ScoreboardHandler.getSidebarLines(); @@ -1267,57 +35,26 @@ public class LootTracker { // If no items, are detected, allow check again. Should fix items not being found if (itemTeeth + itemWebs + itemRev + itemNullSphere > 0) { itemsChecked = System.currentTimeMillis() / 1000; - wolfTeeth += itemTeeth; - spiderWebs += itemWebs; - zombieRevFlesh += itemRev; - endermanNullSpheres += itemNullSphere; - wolfTeethSession += itemTeeth; - spiderWebsSession += itemWebs; - zombieRevFleshSession += itemRev; - endermanNullSpheresSession += itemNullSphere; - - ConfigHandler.writeIntConfig("wolf", "teeth", wolfTeeth); - ConfigHandler.writeIntConfig("spider", "web", spiderWebs); - ConfigHandler.writeIntConfig("zombie", "revFlesh", zombieRevFlesh); - ConfigHandler.writeIntConfig("enderman", "nullSpheres", endermanNullSpheres); + WolfTracker.wolfTeeth += itemTeeth; + SpiderTracker.spiderWebs += itemWebs; + ZombieTracker.zombieRevFlesh += itemRev; + EndermanTracker.endermanNullSpheres += itemNullSphere; + WolfTracker.wolfTeethSession += itemTeeth; + SpiderTracker.spiderWebsSession += itemWebs; + ZombieTracker.zombieRevFleshSession += itemRev; + EndermanTracker.endermanNullSpheresSession += itemNullSphere; + + ConfigHandler.writeIntConfig("wolf", "teeth", WolfTracker.wolfTeeth); + ConfigHandler.writeIntConfig("spider", "web", SpiderTracker.spiderWebs); + ConfigHandler.writeIntConfig("zombie", "revFlesh", ZombieTracker.zombieRevFlesh); + ConfigHandler.writeIntConfig("enderman", "nullSpheres", EndermanTracker.endermanNullSpheres); } } } } } - - public void increaseSeaCreatures() { - if (empSCs != -1) { - empSCs++; - } - if (empSCsSession != -1) { - empSCsSession++; - } - // Only increment Yetis when in Jerry's Workshop - List scoreboard = ScoreboardHandler.getSidebarLines(); - for (String s : scoreboard) { - String sCleaned = ScoreboardHandler.cleanSB(s); - if (sCleaned.contains("Jerry's Workshop") || sCleaned.contains("Jerry Pond")) { - if (yetiSCs != -1) { - yetiSCs++; - } - if (yetiSCsSession != -1) { - yetiSCsSession++; - } - } - } - - seaCreatures++; - fishingMilestone++; - seaCreaturesSession++; - fishingMilestoneSession++; - ConfigHandler.writeIntConfig("fishing", "seaCreature", seaCreatures); - ConfigHandler.writeIntConfig("fishing", "milestone", fishingMilestone); - ConfigHandler.writeIntConfig("fishing", "empSC", empSCs); - ConfigHandler.writeIntConfig("fishing", "yetiSC", yetiSCs); - } - public int getAmountfromMessage(String message) { + public static int getAmountfromMessage(String message) { if (message.charAt(message.indexOf("(") + 2) == 'x') { return Integer.parseInt(message.substring(message.indexOf("(") + 1, message.indexOf("x"))); } else { diff --git a/src/main/java/me/Danker/features/loot/MythologicalTracker.java b/src/main/java/me/Danker/features/loot/MythologicalTracker.java new file mode 100644 index 0000000..1784b41 --- /dev/null +++ b/src/main/java/me/Danker/features/loot/MythologicalTracker.java @@ -0,0 +1,87 @@ +package me.Danker.features.loot; + +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.Utils; +import net.minecraft.util.StringUtils; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class MythologicalTracker { + + public static double mythCoins; + public static int griffinFeathers; + public static int crownOfGreeds; + public static int washedUpSouvenirs; + public static int minosHunters; + public static int siameseLynxes; + public static int minotaurs; + public static int gaiaConstructs; + public static int minosChampions; + public static int minosInquisitors; + + public static double mythCoinsSession = 0; + public static int griffinFeathersSession = 0; + public static int crownOfGreedsSession = 0; + public static int washedUpSouvenirsSession = 0; + public static int minosHuntersSession = 0; + public static int siameseLynxesSession = 0; + public static int minotaursSession = 0; + public static int gaiaConstructsSession = 0; + public static int minosChampionsSession = 0; + public static int minosInquisitorsSession = 0; + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent event) { + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + + if (!Utils.inSkyblock) return; + if (event.type == 2) return; + if (message.contains(":")) return; + + if (message.contains("You dug out")) { + if (message.contains(" coins!")) { + double coinsEarned = Double.parseDouble(message.replaceAll("[^\\d]", "")); + mythCoins += coinsEarned; + mythCoinsSession += coinsEarned; + ConfigHandler.writeDoubleConfig("mythological", "coins", mythCoins); + } else if (message.contains("a Griffin Feather!")) { + griffinFeathers++; + griffinFeathersSession++; + ConfigHandler.writeIntConfig("mythological", "griffinFeather", griffinFeathers); + } else if (message.contains("a Crown of Greed!")) { + crownOfGreeds++; + crownOfGreedsSession++; + ConfigHandler.writeIntConfig("mythological", "crownOfGreed", crownOfGreeds); + } else if (message.contains("a Washed-up Souvenir!")) { + washedUpSouvenirs++; + washedUpSouvenirsSession++; + ConfigHandler.writeIntConfig("mythological", "washedUpSouvenir", washedUpSouvenirs); + } else if (message.contains("a Minos Hunter!")) { + minosHunters++; + minosHuntersSession++; + ConfigHandler.writeIntConfig("mythological", "minosHunter", minosHunters); + } else if (message.contains("Siamese Lynxes!")) { + siameseLynxes++; + siameseLynxesSession++; + ConfigHandler.writeIntConfig("mythological", "siameseLynx", siameseLynxes); + } else if (message.contains("a Minotaur!")) { + minotaurs++; + minotaursSession++; + ConfigHandler.writeIntConfig("mythological", "minotaur", minotaurs); + } else if (message.contains("a Gaia Construct!")) { + gaiaConstructs++; + gaiaConstructsSession++; + ConfigHandler.writeIntConfig("mythological", "gaiaConstruct", gaiaConstructs); + } else if (message.contains("a Minos Champion!")) { + minosChampions++; + minosChampionsSession++; + ConfigHandler.writeIntConfig("mythological", "minosChampion", minosChampions); + } else if (message.contains("a Minos Inquisitor!")) { + minosInquisitors++; + minosInquisitorsSession++; + ConfigHandler.writeIntConfig("mythological", "minosInquisitor", minosInquisitors); + } + } + } + +} diff --git a/src/main/java/me/Danker/features/loot/SpiderTracker.java b/src/main/java/me/Danker/features/loot/SpiderTracker.java new file mode 100644 index 0000000..e6227b2 --- /dev/null +++ b/src/main/java/me/Danker/features/loot/SpiderTracker.java @@ -0,0 +1,114 @@ +package me.Danker.features.loot; + +import me.Danker.commands.ToggleCommand; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.Utils; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StringUtils; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class SpiderTracker { + + public static int spiderTarantulas; + public static int spiderWebs; + public static int spiderTAP; + public static int spiderTAPDrops; + public static int spiderBites; + public static int spiderCatalysts; + public static int spiderBooks; + public static int spiderSwatters; + public static int spiderTalismans; + public static int spiderMosquitos; + public static double spiderTime; + public static int spiderBosses; + + public static int spiderTarantulasSession = 0; + public static int spiderWebsSession = 0; + public static int spiderTAPSession = 0; + public static int spiderTAPDropsSession = 0; + public static int spiderBitesSession = 0; + public static int spiderCatalystsSession = 0; + public static int spiderBooksSession = 0; + public static int spiderSwattersSession = 0; + public static int spiderTalismansSession = 0; + public static int spiderMosquitosSession = 0; + public static double spiderTimeSession = -1; + public static int spiderBossesSession = -1; + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent event) { + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + + if (!Utils.inSkyblock) return; + if (event.type == 2) return; + if (message.contains(":")) return; + + boolean rng = false; + + if (message.contains("VERY RARE DROP! (Enchanted Book)") || message.contains("CRAZY RARE DROP! (Enchanted Book)")) { + if (Utils.isInScoreboard("Tarantula Broodfather")) { + spiderBooks++; + spiderBooksSession++; + ConfigHandler.writeIntConfig("spider", "book", spiderBooks); + } + } + + if (message.contains(" Spider Slayer LVL ")) { // Spider + spiderTarantulas++; + spiderTarantulasSession++; + if (spiderBosses != -1) { + spiderBosses++; + } + if (spiderBossesSession != -1) { + spiderBossesSession++; + } + ConfigHandler.writeIntConfig("spider", "tarantulas", spiderTarantulas); + ConfigHandler.writeIntConfig("spider", "bossRNG", spiderBosses); + } else if (message.contains("RARE DROP! (") && message.contains("Toxic Arrow Poison)")) { + int amount = LootTracker.getAmountfromMessage(message); + spiderTAP += amount; + spiderTAPSession += amount; + spiderTAPDrops++; + spiderTAPDropsSession++; + ConfigHandler.writeIntConfig("spider", "tap", spiderTAP); + ConfigHandler.writeIntConfig("spider", "tapDrops", spiderTAPDrops); + } else if (message.contains("VERY RARE DROP! (") && message.contains(" Bite Rune I)")) { + spiderBites++; + spiderBitesSession++; + ConfigHandler.writeIntConfig("spider", "bite", spiderBites); + } else if (message.contains("VERY RARE DROP! (Spider Catalyst)")) { + spiderCatalysts++; + spiderCatalystsSession++; + ConfigHandler.writeIntConfig("spider", "catalyst", spiderCatalysts); + } else if (message.contains("CRAZY RARE DROP! (Fly Swatter)")) { + rng = true; + spiderSwatters++; + spiderSwattersSession++; + ConfigHandler.writeIntConfig("spider", "swatter", spiderSwatters); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.LIGHT_PURPLE + "FLY SWATTER!", 3); + } else if (message.contains("CRAZY RARE DROP! (Tarantula Talisman")) { + rng = true; + spiderTalismans++; + spiderTalismansSession++; + ConfigHandler.writeIntConfig("spider", "talisman", spiderTalismans); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "TARANTULA TALISMAN!", 3); + } else if (message.contains("CRAZY RARE DROP! (Digested Mosquito)")) { + rng = true; + spiderMosquitos++; + spiderMosquitosSession++; + ConfigHandler.writeIntConfig("spider", "mosquito", spiderMosquitos); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GOLD + "DIGESTED MOSQUITO!", 5); + } + + if (rng) { + spiderTime = System.currentTimeMillis() / 1000; + spiderBosses = 0; + spiderTimeSession = System.currentTimeMillis() / 1000; + spiderBossesSession = 0; + ConfigHandler.writeDoubleConfig("spider", "timeRNG", spiderTime); + ConfigHandler.writeIntConfig("spider", "bossRNG", 0); + } + } + +} diff --git a/src/main/java/me/Danker/features/loot/WolfTracker.java b/src/main/java/me/Danker/features/loot/WolfTracker.java new file mode 100644 index 0000000..f248914 --- /dev/null +++ b/src/main/java/me/Danker/features/loot/WolfTracker.java @@ -0,0 +1,116 @@ +package me.Danker.features.loot; + +import me.Danker.commands.ToggleCommand; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.Utils; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StringUtils; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class WolfTracker { + + public static int wolfSvens; + public static int wolfTeeth; + public static int wolfWheels; + public static int wolfWheelsDrops; + public static int wolfSpirits; + public static int wolfBooks; + public static int wolfEggs; + public static int wolfCoutures; + public static int wolfBaits; + public static int wolfFluxes; + public static double wolfTime; + public static int wolfBosses; + + public static int wolfSvensSession = 0; + public static int wolfTeethSession = 0; + public static int wolfWheelsSession = 0; + public static int wolfWheelsDropsSession = 0; + public static int wolfSpiritsSession = 0; + public static int wolfBooksSession = 0; + public static int wolfEggsSession = 0; + public static int wolfCouturesSession = 0; + public static int wolfBaitsSession = 0; + public static int wolfFluxesSession = 0; + public static double wolfTimeSession = -1; + public static int wolfBossesSession = -1; + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent event) { + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + + if (!Utils.inSkyblock) return; + if (event.type == 2) return; + if (message.contains(":")) return; + + boolean rng = false; + + if (message.contains("VERY RARE DROP! (Enchanted Book)") || message.contains("CRAZY RARE DROP! (Enchanted Book)")) { + if (Utils.isInScoreboard("Sven Packmaster")) { + wolfBooks++; + wolfBooksSession++; + ConfigHandler.writeIntConfig("wolf", "book", wolfBooks); + } + } + + if (message.contains(" Wolf Slayer LVL ")) { + wolfSvens++; + wolfSvensSession++; + if (wolfBosses != -1) { + wolfBosses++; + } + if (wolfBossesSession != -1) { + wolfBossesSession++; + } + ConfigHandler.writeIntConfig("wolf", "svens", wolfSvens); + ConfigHandler.writeIntConfig("wolf", "bossRNG", wolfBosses); + } else if (message.contains("RARE DROP! (") && message.contains("Hamster Wheel)")) { + int amount = LootTracker.getAmountfromMessage(message); + wolfWheels += amount; + wolfWheelsSession += amount; + wolfWheelsDrops++; + wolfWheelsDropsSession++; + ConfigHandler.writeIntConfig("wolf", "wheel", wolfWheels); + ConfigHandler.writeIntConfig("wolf", "wheelDrops", wolfWheelsDrops); + } else if (message.contains("VERY RARE DROP! (") && message.contains(" Spirit Rune I)")) { // Removing the unicode here *should* fix rune drops not counting + wolfSpirits++; + wolfSpiritsSession++; + ConfigHandler.writeIntConfig("wolf", "spirit", wolfSpirits); + } else if (message.contains("CRAZY RARE DROP! (Red Claw Egg)")) { + rng = true; + wolfEggs++; + wolfEggsSession++; + ConfigHandler.writeIntConfig("wolf", "egg", wolfEggs); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_RED + "RED CLAW EGG!", 3); + } else if (message.contains("CRAZY RARE DROP! (") && message.contains(" Couture Rune I)")) { + rng = true; + wolfCoutures++; + wolfCouturesSession++; + ConfigHandler.writeIntConfig("wolf", "couture", wolfCoutures); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GOLD + "COUTURE RUNE!", 3); + } else if (message.contains("CRAZY RARE DROP! (Grizzly Bait)") || message.contains("CRAZY RARE DROP! (Rename Me)")) { // How did Skyblock devs even manage to make this item Rename Me + rng = true; + wolfBaits++; + wolfBaitsSession++; + ConfigHandler.writeIntConfig("wolf", "bait", wolfBaits); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.AQUA + "GRIZZLY BAIT!", 3); + } else if (message.contains("CRAZY RARE DROP! (Overflux Capacitor)")) { + rng = true; + wolfFluxes++; + wolfFluxesSession++; + ConfigHandler.writeIntConfig("wolf", "flux", wolfFluxes); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "OVERFLUX CAPACITOR!", 5); + } + + if (rng) { + wolfTime = System.currentTimeMillis() / 1000; + wolfBosses = 0; + wolfTimeSession = System.currentTimeMillis() / 1000; + wolfBossesSession = 0; + ConfigHandler.writeDoubleConfig("wolf", "timeRNG", wolfTime); + ConfigHandler.writeIntConfig("wolf", "bossRNG", 0); + } + } + +} diff --git a/src/main/java/me/Danker/features/loot/ZombieTracker.java b/src/main/java/me/Danker/features/loot/ZombieTracker.java new file mode 100644 index 0000000..5914599 --- /dev/null +++ b/src/main/java/me/Danker/features/loot/ZombieTracker.java @@ -0,0 +1,143 @@ +package me.Danker.features.loot; + +import me.Danker.commands.ToggleCommand; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.Utils; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StringUtils; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class ZombieTracker { + + public static int zombieRevs; + public static int zombieRevFlesh; + public static int zombieRevViscera; + public static int zombieFoulFlesh; + public static int zombieFoulFleshDrops; + public static int zombiePestilences; + public static int zombieUndeadCatas; + public static int zombieBooks; + public static int zombieBeheadeds; + public static int zombieRevCatas; + public static int zombieSnakes; + public static int zombieScythes; + public static int zombieShards; + public static int zombieWardenHearts; + public static double zombieTime; + public static int zombieBosses; + + public static int zombieRevsSession = 0; + public static int zombieRevFleshSession = 0; + public static int zombieRevVisceraSession = 0; + public static int zombieFoulFleshSession = 0; + public static int zombieFoulFleshDropsSession = 0; + public static int zombiePestilencesSession = 0; + public static int zombieUndeadCatasSession = 0; + public static int zombieBooksSession = 0; + public static int zombieBeheadedsSession = 0; + public static int zombieRevCatasSession = 0; + public static int zombieSnakesSession = 0; + public static int zombieScythesSession = 0; + public static int zombieShardsSession = 0; + public static int zombieWardenHeartsSession = 0; + public static double zombieTimeSession = -1; + public static int zombieBossesSession = -1; + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent event) { + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + + if (!Utils.inSkyblock) return; + if (event.type == 2) return; + if (message.contains(":")) return; + + boolean rng = false; + + if (message.contains("VERY RARE DROP! (Enchanted Book)") || message.contains("CRAZY RARE DROP! (Enchanted Book)")) { + if (Utils.isInScoreboard("Revenant Horror")) { + zombieBooks++; + zombieBooksSession++; + ConfigHandler.writeIntConfig("zombie", "book", zombieBooks); + } + } + + if (message.contains(" Zombie Slayer LVL ")) { // Zombie + zombieRevs++; + zombieRevsSession++; + if (zombieBosses != -1) { + zombieBosses++; + } + if (zombieBossesSession != 1) { + zombieBossesSession++; + } + ConfigHandler.writeIntConfig("zombie", "revs", zombieRevs); + ConfigHandler.writeIntConfig("zombie", "bossRNG", zombieBosses); + } else if (message.contains("RARE DROP! (") && message.contains("Revenant Viscera)")) { + int amount = LootTracker.getAmountfromMessage(message); + zombieRevViscera += amount; + zombieRevVisceraSession += amount; + ConfigHandler.writeIntConfig("zombie", "revViscera", zombieRevViscera); + } else if (message.contains("RARE DROP! (") && message.contains("Foul Flesh)")) { + int amount = LootTracker.getAmountfromMessage(message); + zombieFoulFlesh += amount; + zombieFoulFleshSession += amount; + zombieFoulFleshDrops++; + zombieFoulFleshDropsSession++; + ConfigHandler.writeIntConfig("zombie", "foulFlesh", zombieFoulFlesh); + ConfigHandler.writeIntConfig("zombie", "foulFleshDrops", zombieFoulFleshDrops); + } else if (message.contains("VERY RARE DROP! (Revenant Catalyst)")) { + zombieRevCatas++; + zombieRevCatasSession++; + ConfigHandler.writeIntConfig("zombie", "revCatalyst", zombieRevCatas); + } else if (message.contains("VERY RARE DROP! (") && message.contains(" Pestilence Rune I)")) { + zombiePestilences++; + zombiePestilencesSession++; + ConfigHandler.writeIntConfig("zombie", "pestilence", zombiePestilences); + } else if (message.contains("VERY RARE DROP! (Undead Catalyst)")) { + zombieUndeadCatas++; + zombieUndeadCatasSession++; + ConfigHandler.writeIntConfig("zombie", "undeadCatalyst", zombieUndeadCatas); + } else if (message.contains("CRAZY RARE DROP! (Beheaded Horror)")) { + rng = true; + zombieBeheadeds++; + zombieBeheadedsSession++; + ConfigHandler.writeIntConfig("zombie", "beheaded", zombieBeheadeds); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "BEHEADED HORROR!", 3); + } else if (message.contains("CRAZY RARE DROP! (") && message.contains(" Snake Rune I)")) { + rng = true; + zombieSnakes++; + zombieSnakesSession++; + ConfigHandler.writeIntConfig("zombie", "snake", zombieSnakes); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_GREEN + "SNAKE RUNE!", 3); + } else if (message.contains("CRAZY RARE DROP! (Scythe Blade)")) { + rng = true; + zombieScythes++; + zombieScythesSession++; + ConfigHandler.writeIntConfig("zombie", "scythe", zombieScythes); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GOLD + "SCYTHE BLADE!", 5); + } else if (message.contains("CRAZY RARE DROP! (Shard of the Shredded)")) { + rng = true; + zombieShards++; + zombieShardsSession++; + ConfigHandler.writeIntConfig("zombie", "shard", zombieShards); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.RED + "SHARD OF THE SHREDDED!", 5); + } else if (message.contains("INSANE DROP! (Warden Heart)") || message.contains("CRAZY RARE DROP! (Warden Heart)")) { + rng = true; + zombieWardenHearts++; + zombieWardenHeartsSession++; + ConfigHandler.writeIntConfig("zombie", "heart", zombieWardenHearts); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.RED + "WARDEN HEART!", 5); + } + + if (rng) { + zombieTime = System.currentTimeMillis() / 1000; + zombieBosses = 0; + zombieTimeSession = System.currentTimeMillis() / 1000; + zombieBossesSession = 0; + ConfigHandler.writeDoubleConfig("zombie", "timeRNG", zombieTime); + ConfigHandler.writeIntConfig("zombie", "bossRNG", 0); + } + } + +} diff --git a/src/main/java/me/Danker/features/puzzlesolvers/BlazeSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/BlazeSolver.java index affe416..b76e3ca 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/BlazeSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/BlazeSolver.java @@ -2,6 +2,7 @@ package me.Danker.features.puzzlesolvers; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; @@ -102,28 +103,28 @@ public class BlazeSolver { if (foundChest) { if (lowestBlaze != null && !higherToLower) { BlockPos stringPos = new BlockPos(lowestBlaze.posX, lowestBlaze.posY + 1, lowestBlaze.posZ); - Utils.draw3DString(stringPos, EnumChatFormatting.BOLD + "Shoot me!", LOWEST_BLAZE_COLOUR, event.partialTicks); + RenderUtils.draw3DString(stringPos, EnumChatFormatting.BOLD + "Shoot me!", LOWEST_BLAZE_COLOUR, event.partialTicks); AxisAlignedBB aabb = new AxisAlignedBB(lowestBlaze.posX - 0.5, lowestBlaze.posY - 2, lowestBlaze.posZ - 0.5, lowestBlaze.posX + 0.5, lowestBlaze.posY, lowestBlaze.posZ + 0.5); - Utils.draw3DBox(aabb, LOWEST_BLAZE_COLOUR, event.partialTicks); + RenderUtils.draw3DBox(aabb, LOWEST_BLAZE_COLOUR, event.partialTicks); } if (highestBlaze != null && higherToLower) { BlockPos stringPos = new BlockPos(highestBlaze.posX, highestBlaze.posY + 1, highestBlaze.posZ); - Utils.draw3DString(stringPos, EnumChatFormatting.BOLD + "Shoot me!", LOWEST_BLAZE_COLOUR, event.partialTicks); + RenderUtils.draw3DString(stringPos, EnumChatFormatting.BOLD + "Shoot me!", LOWEST_BLAZE_COLOUR, event.partialTicks); AxisAlignedBB aabb = new AxisAlignedBB(highestBlaze.posX - 0.5, highestBlaze.posY - 2, highestBlaze.posZ - 0.5, highestBlaze.posX + 0.5, highestBlaze.posY, highestBlaze.posZ + 0.5); - Utils.draw3DBox(aabb, LOWEST_BLAZE_COLOUR, event.partialTicks); + RenderUtils.draw3DBox(aabb, LOWEST_BLAZE_COLOUR, event.partialTicks); } } else { if (lowestBlaze != null) { BlockPos stringPos = new BlockPos(lowestBlaze.posX, lowestBlaze.posY + 1, lowestBlaze.posZ); - Utils.draw3DString(stringPos, EnumChatFormatting.BOLD + "Smallest", LOWEST_BLAZE_COLOUR, event.partialTicks); + RenderUtils.draw3DString(stringPos, EnumChatFormatting.BOLD + "Smallest", LOWEST_BLAZE_COLOUR, event.partialTicks); AxisAlignedBB aabb = new AxisAlignedBB(lowestBlaze.posX - 0.5, lowestBlaze.posY - 2, lowestBlaze.posZ - 0.5, lowestBlaze.posX + 0.5, lowestBlaze.posY, lowestBlaze.posZ + 0.5); - Utils.draw3DBox(aabb, LOWEST_BLAZE_COLOUR, event.partialTicks); + RenderUtils.draw3DBox(aabb, LOWEST_BLAZE_COLOUR, event.partialTicks); } if (highestBlaze != null) { BlockPos stringPos = new BlockPos(highestBlaze.posX, highestBlaze.posY + 1, highestBlaze.posZ); - Utils.draw3DString(stringPos, EnumChatFormatting.BOLD + "Biggest", HIGHEST_BLAZE_COLOUR, event.partialTicks); + RenderUtils.draw3DString(stringPos, EnumChatFormatting.BOLD + "Biggest", HIGHEST_BLAZE_COLOUR, event.partialTicks); AxisAlignedBB aabb = new AxisAlignedBB(highestBlaze.posX - 0.5, highestBlaze.posY - 2, highestBlaze.posZ - 0.5, highestBlaze.posX + 0.5, highestBlaze.posY, highestBlaze.posZ + 0.5); - Utils.draw3DBox(aabb, HIGHEST_BLAZE_COLOUR, event.partialTicks); + RenderUtils.draw3DBox(aabb, HIGHEST_BLAZE_COLOUR, event.partialTicks); } } } diff --git a/src/main/java/me/Danker/features/puzzlesolvers/BoulderSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/BoulderSolver.java index 0089038..3096e16 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/BoulderSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/BoulderSolver.java @@ -3,6 +3,7 @@ package me.Danker.features.puzzlesolvers; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; import me.Danker.utils.BoulderUtils; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; @@ -145,7 +146,7 @@ public class BoulderSolver { int[] currentBlockArray = route.get(currentStep); AxisAlignedBB currentBoulder = BoulderUtils.getBoulder(currentBlockArray[0], currentBlockArray[1], chest, boulderRoomDirection); if (currentBoulder == null) return; - Utils.drawFilled3DBox(currentBoulder, BOULDER_COLOUR, true, false, event.partialTicks); + RenderUtils.drawFilled3DBox(currentBoulder, BOULDER_COLOUR, true, false, event.partialTicks); char direction; switch (currentBlockArray[2]) { case 1: diff --git a/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java index 1fff07a..ed4adca 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java @@ -4,6 +4,7 @@ import me.Danker.commands.ToggleCommand; import me.Danker.events.ChestSlotClickedEvent; import me.Danker.events.GuiChestBackgroundDrawnEvent; import me.Danker.handlers.TextRenderer; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; @@ -69,9 +70,9 @@ public class ChronomatronSolver { if (glass.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks))) { - Utils.drawOnSlot(chestSize, glassSlot.xDisplayPosition, glassSlot.yDisplayPosition, CHRONOMATRON_NEXT + 0xE5000000); + RenderUtils.drawOnSlot(chestSize, glassSlot.xDisplayPosition, glassSlot.yDisplayPosition, CHRONOMATRON_NEXT + 0xE5000000); } else if (chronomatronMouseClicks + 1 < chronomatronPattern.size() && glass.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks + 1))) { - Utils.drawOnSlot(chestSize, glassSlot.xDisplayPosition, glassSlot.yDisplayPosition, CHRONOMATRON_NEXT_TO_NEXT + 0XBE000000); + RenderUtils.drawOnSlot(chestSize, glassSlot.xDisplayPosition, glassSlot.yDisplayPosition, CHRONOMATRON_NEXT_TO_NEXT + 0XBE000000); } } diff --git a/src/main/java/me/Danker/features/puzzlesolvers/ClickInOrderSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/ClickInOrderSolver.java index e503b37..1665ba7 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/ClickInOrderSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/ClickInOrderSolver.java @@ -2,6 +2,7 @@ package me.Danker.features.puzzlesolvers; import me.Danker.commands.ToggleCommand; import me.Danker.events.GuiChestBackgroundDrawnEvent; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; @@ -91,10 +92,10 @@ public class ClickInOrderSolver { int chestSize = event.chestSize; List invSlots = event.slots; Slot slot = invSlots.get(terminalNumberNeeded[1]); - Utils.drawOnSlot(chestSize, slot.xDisplayPosition, slot.yDisplayPosition, CLICK_IN_ORDER_NEXT + 0xFF000000); + RenderUtils.drawOnSlot(chestSize, slot.xDisplayPosition, slot.yDisplayPosition, CLICK_IN_ORDER_NEXT + 0xFF000000); Slot nextSlot = invSlots.get(terminalNumberNeeded[3]); if (nextSlot != slot && nextSlot.getSlotIndex() != 0) { - Utils.drawOnSlot(chestSize, nextSlot.xDisplayPosition, nextSlot.yDisplayPosition, CLICK_IN_ORDER_NEXT_TO_NEXT + 0xFF000000); + RenderUtils.drawOnSlot(chestSize, nextSlot.xDisplayPosition, nextSlot.yDisplayPosition, CLICK_IN_ORDER_NEXT_TO_NEXT + 0xFF000000); } } } diff --git a/src/main/java/me/Danker/features/puzzlesolvers/CreeperSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/CreeperSolver.java index eb9e268..e35abe3 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/CreeperSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/CreeperSolver.java @@ -2,6 +2,7 @@ package me.Danker.features.puzzlesolvers; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; @@ -82,9 +83,9 @@ public class CreeperSolver { Vec3 pos2 = creeperLines.get(i)[1]; int colour = CREEPER_COLOURS[i % 10]; - if (ToggleCommand.creeperLinesToggled) Utils.draw3DLine(pos1, pos2, colour, 2, true, event.partialTicks); - Utils.drawFilled3DBox(new AxisAlignedBB(pos1.xCoord - 0.51, pos1.yCoord - 0.51, pos1.zCoord - 0.51, pos1.xCoord + 0.51, pos1.yCoord + 0.51, pos1.zCoord + 0.51), colour, true, true, event.partialTicks); - Utils.drawFilled3DBox(new AxisAlignedBB(pos2.xCoord - 0.51, pos2.yCoord - 0.51, pos2.zCoord - 0.51, pos2.xCoord + 0.51, pos2.yCoord + 0.51, pos2.zCoord + 0.51), colour, true, true, event.partialTicks); + if (ToggleCommand.creeperLinesToggled) RenderUtils.draw3DLine(pos1, pos2, colour, 2, true, event.partialTicks); + RenderUtils.drawFilled3DBox(new AxisAlignedBB(pos1.xCoord - 0.51, pos1.yCoord - 0.51, pos1.zCoord - 0.51, pos1.xCoord + 0.51, pos1.yCoord + 0.51, pos1.zCoord + 0.51), colour, true, true, event.partialTicks); + RenderUtils.drawFilled3DBox(new AxisAlignedBB(pos2.xCoord - 0.51, pos2.yCoord - 0.51, pos2.zCoord - 0.51, pos2.xCoord + 0.51, pos2.yCoord + 0.51, pos2.zCoord + 0.51), colour, true, true, event.partialTicks); } } } diff --git a/src/main/java/me/Danker/features/puzzlesolvers/IceWalkSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/IceWalkSolver.java index eaabf6e..fdcf503 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/IceWalkSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/IceWalkSolver.java @@ -3,6 +3,7 @@ package me.Danker.features.puzzlesolvers; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; import me.Danker.utils.IceWalkUtils; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; @@ -214,7 +215,7 @@ public class IceWalkSolver { default: return; } - Utils.draw3DLine(pos1, pos2, ICE_WALK_LINE_COLOUR, 5, true, event.partialTicks); + RenderUtils.draw3DLine(pos1, pos2, ICE_WALK_LINE_COLOUR, 5, true, event.partialTicks); } } @@ -242,7 +243,7 @@ public class IceWalkSolver { default: return; } - Utils.draw3DLine(pos1, pos2, ICE_WALK_LINE_COLOUR, 5, true, event.partialTicks); + RenderUtils.draw3DLine(pos1, pos2, ICE_WALK_LINE_COLOUR, 5, true, event.partialTicks); } } @@ -270,7 +271,7 @@ public class IceWalkSolver { default: return; } - Utils.draw3DLine(pos1, pos2, ICE_WALK_LINE_COLOUR, 5, true, event.partialTicks); + RenderUtils.draw3DLine(pos1, pos2, ICE_WALK_LINE_COLOUR, 5, true, event.partialTicks); } } } diff --git a/src/main/java/me/Danker/features/puzzlesolvers/LividSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/LividSolver.java index 6f02982..4e9f498 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/LividSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/LividSolver.java @@ -4,7 +4,7 @@ import me.Danker.DankersSkyblockMod; import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; import me.Danker.commands.ToggleCommand; -import me.Danker.events.RenderOverlay; +import me.Danker.events.RenderOverlayEvent; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; @@ -57,7 +57,7 @@ public class LividSolver { } @SubscribeEvent - public void renderPlayerInfo(RenderOverlay event) { + public void renderPlayerInfo(RenderOverlayEvent event) { if (ToggleCommand.lividSolverToggled && foundLivid && livid != null) { new TextRenderer(Minecraft.getMinecraft(), livid.getName().replace("" + EnumChatFormatting.BOLD, ""), MoveCommand.lividHpXY[0], MoveCommand.lividHpXY[1], ScaleCommand.lividHpScale); } diff --git a/src/main/java/me/Danker/features/puzzlesolvers/SelectAllColourSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/SelectAllColourSolver.java index 16125db..e43a971 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/SelectAllColourSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/SelectAllColourSolver.java @@ -2,6 +2,7 @@ package me.Danker.features.puzzlesolvers; import me.Danker.commands.ToggleCommand; import me.Danker.events.GuiChestBackgroundDrawnEvent; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.inventory.Slot; @@ -45,7 +46,7 @@ public class SelectAllColourSolver { (terminalColorNeeded.equals("BLACK") && itemName.equals("INK SACK")) || (terminalColorNeeded.equals("BLUE") && itemName.equals("LAPIS LAZULI")) || (terminalColorNeeded.equals("BROWN") && itemName.equals("COCOA BEAN"))) { - Utils.drawOnSlot(event.chestSize, slot.xDisplayPosition, slot.yDisplayPosition, 0xBF40FF40); + RenderUtils.drawOnSlot(event.chestSize, slot.xDisplayPosition, slot.yDisplayPosition, 0xBF40FF40); } } } diff --git a/src/main/java/me/Danker/features/puzzlesolvers/SilverfishSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/SilverfishSolver.java index 575dcd3..541a298 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/SilverfishSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/SilverfishSolver.java @@ -2,6 +2,7 @@ package me.Danker.features.puzzlesolvers; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; +import me.Danker.utils.RenderUtils; import me.Danker.utils.SilverfishUtils; import me.Danker.utils.Utils; import net.minecraft.block.BlockHopper; @@ -171,7 +172,7 @@ public class SilverfishSolver { default: return; } - Utils.draw3DLine(pos1, pos2, SILVERFISH_LINE_COLOUR, 5, true, event.partialTicks); + RenderUtils.draw3DLine(pos1, pos2, SILVERFISH_LINE_COLOUR, 5, true, event.partialTicks); } } } diff --git a/src/main/java/me/Danker/features/puzzlesolvers/StartsWithSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/StartsWithSolver.java index 8f15fa7..8b79af5 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/StartsWithSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/StartsWithSolver.java @@ -2,6 +2,7 @@ package me.Danker.features.puzzlesolvers; import me.Danker.commands.ToggleCommand; import me.Danker.events.GuiChestBackgroundDrawnEvent; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.inventory.Slot; @@ -22,7 +23,7 @@ public class StartsWithSolver { if (item == null) continue; if (item.isItemEnchanted()) continue; if (StringUtils.stripControlCodes(item.getDisplayName()).charAt(0) == letter) { - Utils.drawOnSlot(event.chestSize, slot.xDisplayPosition, slot.yDisplayPosition, 0xBF40FF40); + RenderUtils.drawOnSlot(event.chestSize, slot.xDisplayPosition, slot.yDisplayPosition, 0xBF40FF40); } } } diff --git a/src/main/java/me/Danker/features/puzzlesolvers/SuperpairsSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/SuperpairsSolver.java index c6e1d76..6f532bd 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/SuperpairsSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/SuperpairsSolver.java @@ -2,6 +2,7 @@ package me.Danker.features.puzzlesolvers; import me.Danker.commands.ToggleCommand; import me.Danker.events.GuiChestBackgroundDrawnEvent; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; @@ -135,9 +136,7 @@ public class SuperpairsSolver { ArrayList slots = new ArrayList<>(); slotSet.forEach(slotNum -> slots.add(event.slots.get(slotNum))); Color color = colorIterator.next(); - slots.forEach(slot -> { - Utils.drawOnSlot(event.chestSize, slot.xDisplayPosition, slot.yDisplayPosition, color.getRGB()); - }); + slots.forEach(slot -> RenderUtils.drawOnSlot(event.chestSize, slot.xDisplayPosition, slot.yDisplayPosition, color.getRGB())); }); } } diff --git a/src/main/java/me/Danker/features/puzzlesolvers/ThreeManSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/ThreeManSolver.java index 500c8eb..b0935c3 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/ThreeManSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/ThreeManSolver.java @@ -3,6 +3,7 @@ package me.Danker.features.puzzlesolvers; import com.google.gson.JsonArray; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; @@ -59,7 +60,7 @@ public class ThreeManSolver { @SubscribeEvent public void onWorldRender(RenderWorldLastEvent event) { if (ToggleCommand.threeManToggled && riddleChest != null) { - Utils.drawFilled3DBox(new AxisAlignedBB(riddleChest.getX() - 0.05, riddleChest.getY(), riddleChest.getZ() - 0.05, riddleChest.getX() + 1.05, riddleChest.getY() + 1, riddleChest.getZ() + 1.05), 0x197F19, true, true, event.partialTicks); + RenderUtils.drawFilled3DBox(new AxisAlignedBB(riddleChest.getX() - 0.05, riddleChest.getY(), riddleChest.getZ() - 0.05, riddleChest.getX() + 1.05, riddleChest.getY() + 1, riddleChest.getZ() + 1.05), 0x197F19, true, true, event.partialTicks); } } diff --git a/src/main/java/me/Danker/features/puzzlesolvers/TicTacToeSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/TicTacToeSolver.java index 1b4a2e1..a50a7b8 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/TicTacToeSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/TicTacToeSolver.java @@ -2,6 +2,7 @@ package me.Danker.features.puzzlesolvers; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; +import me.Danker.utils.RenderUtils; import me.Danker.utils.TicTacToeUtils; import me.Danker.utils.Utils; import net.minecraft.block.Block; @@ -128,7 +129,7 @@ public class TicTacToeSolver { @SubscribeEvent public void onWorldRender(RenderWorldLastEvent event) { if (ToggleCommand.ticTacToeToggled && correctTicTacToeButton != null) { - Utils.draw3DBox(correctTicTacToeButton, 0x40FF40, event.partialTicks); + RenderUtils.draw3DBox(correctTicTacToeButton, 0x40FF40, event.partialTicks); } } diff --git a/src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java index 3df6fc4..6813b7f 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java @@ -2,6 +2,7 @@ package me.Danker.features.puzzlesolvers; import me.Danker.commands.ToggleCommand; import me.Danker.events.GuiChestBackgroundDrawnEvent; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; @@ -66,12 +67,12 @@ public class UltrasequencerSolver { } if (clickInOrderSlots[lastUltraSequencerClicked] != null) { Slot nextSlot = clickInOrderSlots[lastUltraSequencerClicked]; - Utils.drawOnSlot(event.chestSize, nextSlot.xDisplayPosition, nextSlot.yDisplayPosition, ULTRASEQUENCER_NEXT + 0xE5000000); + RenderUtils.drawOnSlot(event.chestSize, nextSlot.xDisplayPosition, nextSlot.yDisplayPosition, ULTRASEQUENCER_NEXT + 0xE5000000); } if (lastUltraSequencerClicked + 1 < clickInOrderSlots.length) { if (clickInOrderSlots[lastUltraSequencerClicked + 1] != null) { Slot nextSlot = clickInOrderSlots[lastUltraSequencerClicked + 1]; - Utils.drawOnSlot(event.chestSize, nextSlot.xDisplayPosition, nextSlot.yDisplayPosition, ULTRASEQUENCER_NEXT_TO_NEXT + 0xD7000000); + RenderUtils.drawOnSlot(event.chestSize, nextSlot.xDisplayPosition, nextSlot.yDisplayPosition, ULTRASEQUENCER_NEXT_TO_NEXT + 0xD7000000); } } } diff --git a/src/main/java/me/Danker/features/puzzlesolvers/WaterSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/WaterSolver.java index 2be92f9..c3a379e 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/WaterSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/WaterSolver.java @@ -4,7 +4,7 @@ import me.Danker.DankersSkyblockMod; import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; import me.Danker.commands.ToggleCommand; -import me.Danker.events.RenderOverlay; +import me.Danker.events.RenderOverlayEvent; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; import net.minecraft.block.Block; @@ -153,7 +153,7 @@ public class WaterSolver { } @SubscribeEvent - public void renderPlayerInfo(RenderOverlay event) { + public void renderPlayerInfo(RenderOverlayEvent event) { if (ToggleCommand.waterToggled && Utils.inDungeons && waterAnswers != null) { new TextRenderer(Minecraft.getMinecraft(), waterAnswers, MoveCommand.waterAnswerXY[0], MoveCommand.waterAnswerXY[1], ScaleCommand.waterAnswerScale); } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 98368e1..6655d43 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -5,8 +5,7 @@ import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; import me.Danker.commands.ToggleCommand; import me.Danker.features.*; -import me.Danker.features.loot.LootDisplay; -import me.Danker.features.loot.LootTracker; +import me.Danker.features.loot.*; import me.Danker.features.puzzlesolvers.*; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; @@ -295,196 +294,196 @@ public class ConfigHandler { if (!hasKey("api", "APIKey")) writeStringConfig("api", "APIKey", ""); // Wolf - LootTracker.wolfSvens = initInt("wolf", "svens", 0); - LootTracker.wolfTeeth = initInt("wolf", "teeth", 0); - LootTracker.wolfWheels = initInt("wolf", "wheel", 0); - LootTracker.wolfWheelsDrops = initInt("wolf", "wheelDrops", 0); - LootTracker.wolfSpirits = initInt("wolf", "spirit", 0); - LootTracker.wolfBooks = initInt("wolf", "book", 0); - LootTracker.wolfEggs = initInt("wolf", "egg", 0); - LootTracker.wolfCoutures = initInt("wolf", "couture", 0); - LootTracker.wolfBaits = initInt("wolf", "bait", 0); - LootTracker.wolfFluxes = initInt("wolf", "flux", 0); - LootTracker.wolfTime = initDouble("wolf", "timeRNG", -1); - LootTracker.wolfBosses = initInt("wolf", "bossRNG", -1); + WolfTracker.wolfSvens = initInt("wolf", "svens", 0); + WolfTracker.wolfTeeth = initInt("wolf", "teeth", 0); + WolfTracker.wolfWheels = initInt("wolf", "wheel", 0); + WolfTracker.wolfWheelsDrops = initInt("wolf", "wheelDrops", 0); + WolfTracker.wolfSpirits = initInt("wolf", "spirit", 0); + WolfTracker.wolfBooks = initInt("wolf", "book", 0); + WolfTracker.wolfEggs = initInt("wolf", "egg", 0); + WolfTracker.wolfCoutures = initInt("wolf", "couture", 0); + WolfTracker.wolfBaits = initInt("wolf", "bait", 0); + WolfTracker.wolfFluxes = initInt("wolf", "flux", 0); + WolfTracker.wolfTime = initDouble("wolf", "timeRNG", -1); + WolfTracker.wolfBosses = initInt("wolf", "bossRNG", -1); // Spider - LootTracker.spiderTarantulas = initInt("spider", "tarantulas", 0); - LootTracker.spiderWebs = initInt("spider", "web", 0); - LootTracker.spiderTAP = initInt("spider", "tap", 0); - LootTracker.spiderTAPDrops = initInt("spider", "tapDrops", 0); - LootTracker.spiderBites = initInt("spider", "bite", 0); - LootTracker.spiderCatalysts = initInt("spider", "catalyst", 0); - LootTracker.spiderBooks = initInt("spider", "book", 0); - LootTracker.spiderSwatters = initInt("spider", "swatter", 0); - LootTracker.spiderTalismans = initInt("spider", "talisman", 0); - LootTracker.spiderMosquitos = initInt("spider", "mosquito", 0); - LootTracker.spiderTime = initDouble("spider", "timeRNG", -1); - LootTracker.spiderBosses = initInt("spider", "bossRNG", -1); + SpiderTracker.spiderTarantulas = initInt("spider", "tarantulas", 0); + SpiderTracker.spiderWebs = initInt("spider", "web", 0); + SpiderTracker.spiderTAP = initInt("spider", "tap", 0); + SpiderTracker.spiderTAPDrops = initInt("spider", "tapDrops", 0); + SpiderTracker.spiderBites = initInt("spider", "bite", 0); + SpiderTracker.spiderCatalysts = initInt("spider", "catalyst", 0); + SpiderTracker.spiderBooks = initInt("spider", "book", 0); + SpiderTracker.spiderSwatters = initInt("spider", "swatter", 0); + SpiderTracker.spiderTalismans = initInt("spider", "talisman", 0); + SpiderTracker.spiderMosquitos = initInt("spider", "mosquito", 0); + SpiderTracker.spiderTime = initDouble("spider", "timeRNG", -1); + SpiderTracker.spiderBosses = initInt("spider", "bossRNG", -1); // Zombie - LootTracker.zombieRevs = initInt("zombie", "revs", 0); - LootTracker.zombieRevFlesh = initInt("zombie", "revFlesh", 0); - LootTracker.zombieRevViscera = initInt("zombie", "revViscera", 0); - LootTracker.zombieFoulFlesh = initInt("zombie", "foulFlesh", 0); - LootTracker.zombieFoulFleshDrops = initInt("zombie", "foulFleshDrops", 0); - LootTracker.zombiePestilences = initInt("zombie", "pestilence", 0); - LootTracker.zombieUndeadCatas = initInt("zombie", "undeadCatalyst", 0); - LootTracker.zombieBooks = initInt("zombie", "book", 0); - LootTracker.zombieBeheadeds = initInt("zombie", "beheaded", 0); - LootTracker.zombieRevCatas = initInt("zombie", "revCatalyst", 0); - LootTracker.zombieSnakes = initInt("zombie", "snake", 0); - LootTracker.zombieScythes = initInt("zombie", "scythe", 0); - LootTracker.zombieShards = initInt("zombie", "shard", 0); - LootTracker.zombieWardenHearts = initInt("zombie", "heart", 0); - LootTracker.zombieTime = initDouble("zombie", "timeRNG", -1); - LootTracker.zombieBosses = initInt("zombie", "bossRNG", -1); + ZombieTracker.zombieRevs = initInt("zombie", "revs", 0); + ZombieTracker.zombieRevFlesh = initInt("zombie", "revFlesh", 0); + ZombieTracker.zombieRevViscera = initInt("zombie", "revViscera", 0); + ZombieTracker.zombieFoulFlesh = initInt("zombie", "foulFlesh", 0); + ZombieTracker.zombieFoulFleshDrops = initInt("zombie", "foulFleshDrops", 0); + ZombieTracker.zombiePestilences = initInt("zombie", "pestilence", 0); + ZombieTracker.zombieUndeadCatas = initInt("zombie", "undeadCatalyst", 0); + ZombieTracker.zombieBooks = initInt("zombie", "book", 0); + ZombieTracker.zombieBeheadeds = initInt("zombie", "beheaded", 0); + ZombieTracker.zombieRevCatas = initInt("zombie", "revCatalyst", 0); + ZombieTracker.zombieSnakes = initInt("zombie", "snake", 0); + ZombieTracker.zombieScythes = initInt("zombie", "scythe", 0); + ZombieTracker.zombieShards = initInt("zombie", "shard", 0); + ZombieTracker.zombieWardenHearts = initInt("zombie", "heart", 0); + ZombieTracker.zombieTime = initDouble("zombie", "timeRNG", -1); + ZombieTracker.zombieBosses = initInt("zombie", "bossRNG", -1); // Enderman - LootTracker.endermanVoidglooms = initInt("enderman", "voidglooms", 0); - LootTracker.endermanNullSpheres = initInt("enderman", "nullSpheres", 0); - LootTracker.endermanTAP = initInt("enderman", "tap", 0); - LootTracker.endermanTAPDrops = initInt("enderman", "tapDrops", 0); - LootTracker.endermanEndersnakes = initInt("enderman", "endersnakes", 0); - LootTracker.endermanSummoningEyes = initInt("enderman", "summoningEyes", 0); - LootTracker.endermanManaBooks = initInt("enderman", "manaBooks", 0); - LootTracker.endermanTuners = initInt("enderman", "tuners", 0); - LootTracker.endermanAtoms = initInt("enderman", "atoms", 0); - LootTracker.endermanEspressoMachines = initInt("enderman", "espressoMachines", 0); - LootTracker.endermanSmartyBooks = initInt("enderman", "smartyBooks", 0); - LootTracker.endermanEndRunes = initInt("enderman", "endRunes", 0); - LootTracker.endermanChalices = initInt("enderman", "chalices", 0); - LootTracker.endermanDice = initInt("enderman", "dice", 0); - LootTracker.endermanArtifacts = initInt("enderman", "artifacts", 0); - LootTracker.endermanSkins = initInt("enderman", "skins", 0); - LootTracker.endermanMergers = initInt("enderman", "mergers", 0); - LootTracker.endermanCores = initInt("enderman", "cores", 0); - LootTracker.endermanEnchantRunes = initInt("enderman", "enchantRunes", 0); - LootTracker.endermanEnderBooks = initInt("enderman", "enderBooks", 0); - LootTracker.endermanTime = initDouble("enderman", "timeRNG", -1); - LootTracker.endermanBosses = initInt("enderman", "bossRNG", -1); + EndermanTracker.endermanVoidglooms = initInt("enderman", "voidglooms", 0); + EndermanTracker.endermanNullSpheres = initInt("enderman", "nullSpheres", 0); + EndermanTracker.endermanTAP = initInt("enderman", "tap", 0); + EndermanTracker.endermanTAPDrops = initInt("enderman", "tapDrops", 0); + EndermanTracker.endermanEndersnakes = initInt("enderman", "endersnakes", 0); + EndermanTracker.endermanSummoningEyes = initInt("enderman", "summoningEyes", 0); + EndermanTracker.endermanManaBooks = initInt("enderman", "manaBooks", 0); + EndermanTracker.endermanTuners = initInt("enderman", "tuners", 0); + EndermanTracker.endermanAtoms = initInt("enderman", "atoms", 0); + EndermanTracker.endermanEspressoMachines = initInt("enderman", "espressoMachines", 0); + EndermanTracker.endermanSmartyBooks = initInt("enderman", "smartyBooks", 0); + EndermanTracker.endermanEndRunes = initInt("enderman", "endRunes", 0); + EndermanTracker.endermanChalices = initInt("enderman", "chalices", 0); + EndermanTracker.endermanDice = initInt("enderman", "dice", 0); + EndermanTracker.endermanArtifacts = initInt("enderman", "artifacts", 0); + EndermanTracker.endermanSkins = initInt("enderman", "skins", 0); + EndermanTracker.endermanMergers = initInt("enderman", "mergers", 0); + EndermanTracker.endermanCores = initInt("enderman", "cores", 0); + EndermanTracker.endermanEnchantRunes = initInt("enderman", "enchantRunes", 0); + EndermanTracker.endermanEnderBooks = initInt("enderman", "enderBooks", 0); + EndermanTracker.endermanTime = initDouble("enderman", "timeRNG", -1); + EndermanTracker.endermanBosses = initInt("enderman", "bossRNG", -1); // Fishing - LootTracker.seaCreatures = initInt("fishing", "seaCreature", 0); - LootTracker.goodCatches = initInt("fishing", "goodCatch", 0); - LootTracker.greatCatches = initInt("fishing", "greatCatch", 0); - LootTracker.squids = initInt("fishing", "squid", 0); - LootTracker.seaWalkers = initInt("fishing", "seaWalker", 0); - LootTracker.nightSquids = initInt("fishing", "nightSquid", 0); - LootTracker.seaGuardians = initInt("fishing", "seaGuardian", 0); - LootTracker.seaWitches = initInt("fishing", "seaWitch", 0); - LootTracker.seaArchers = initInt("fishing", "seaArcher", 0); - LootTracker.monsterOfTheDeeps = initInt("fishing", "monsterOfDeep", 0); - LootTracker.catfishes = initInt("fishing", "catfish", 0); - LootTracker.carrotKings = initInt("fishing", "carrotKing", 0); - LootTracker.seaLeeches = initInt("fishing", "seaLeech", 0); - LootTracker.guardianDefenders = initInt("fishing", "guardianDefender", 0); - LootTracker.deepSeaProtectors = initInt("fishing", "deepSeaProtector", 0); - LootTracker.hydras = initInt("fishing", "hydra", 0); - LootTracker.seaEmperors = initInt("fishing", "seaEmperor", 0); - LootTracker.empTime = initDouble("fishing", "empTime", -1); - LootTracker.empSCs = initInt("fishing", "empSC", -1); - LootTracker.fishingMilestone = initInt("fishing", "milestone", 0); + FishingTracker.seaCreatures = initInt("fishing", "seaCreature", 0); + FishingTracker.goodCatches = initInt("fishing", "goodCatch", 0); + FishingTracker.greatCatches = initInt("fishing", "greatCatch", 0); + FishingTracker.squids = initInt("fishing", "squid", 0); + FishingTracker.seaWalkers = initInt("fishing", "seaWalker", 0); + FishingTracker.nightSquids = initInt("fishing", "nightSquid", 0); + FishingTracker.seaGuardians = initInt("fishing", "seaGuardian", 0); + FishingTracker.seaWitches = initInt("fishing", "seaWitch", 0); + FishingTracker.seaArchers = initInt("fishing", "seaArcher", 0); + FishingTracker.monsterOfTheDeeps = initInt("fishing", "monsterOfDeep", 0); + FishingTracker.catfishes = initInt("fishing", "catfish", 0); + FishingTracker.carrotKings = initInt("fishing", "carrotKing", 0); + FishingTracker.seaLeeches = initInt("fishing", "seaLeech", 0); + FishingTracker.guardianDefenders = initInt("fishing", "guardianDefender", 0); + FishingTracker.deepSeaProtectors = initInt("fishing", "deepSeaProtector", 0); + FishingTracker.hydras = initInt("fishing", "hydra", 0); + FishingTracker.seaEmperors = initInt("fishing", "seaEmperor", 0); + FishingTracker.empTime = initDouble("fishing", "empTime", -1); + FishingTracker.empSCs = initInt("fishing", "empSC", -1); + FishingTracker.fishingMilestone = initInt("fishing", "milestone", 0); // Fishing Winter - LootTracker.frozenSteves = initInt("fishing", "frozenSteve", 0); - LootTracker.frostyTheSnowmans = initInt("fishing", "snowman", 0); - LootTracker.grinches = initInt("fishing", "grinch", 0); - LootTracker.yetis = initInt("fishing", "yeti", 0); - LootTracker.yetiTime = initDouble("fishing", "yetiTime", -1); - LootTracker.yetiSCs = initInt("fishing", "yetiSC", -1); + FishingTracker.frozenSteves = initInt("fishing", "frozenSteve", 0); + FishingTracker.frostyTheSnowmans = initInt("fishing", "snowman", 0); + FishingTracker.grinches = initInt("fishing", "grinch", 0); + FishingTracker.yetis = initInt("fishing", "yeti", 0); + FishingTracker.yetiTime = initDouble("fishing", "yetiTime", -1); + FishingTracker.yetiSCs = initInt("fishing", "yetiSC", -1); // Fishing Festival - LootTracker.nurseSharks = initInt("fishing", "nurseShark", 0); - LootTracker.blueSharks = initInt("fishing", "blueShark", 0); - LootTracker.tigerSharks = initInt("fishing", "tigerShark", 0); - LootTracker.greatWhiteSharks = initInt("fishing", "greatWhiteShark", 0); + FishingTracker.nurseSharks = initInt("fishing", "nurseShark", 0); + FishingTracker.blueSharks = initInt("fishing", "blueShark", 0); + FishingTracker.tigerSharks = initInt("fishing", "tigerShark", 0); + FishingTracker.greatWhiteSharks = initInt("fishing", "greatWhiteShark", 0); // Spooky Fishing - LootTracker.scarecrows = initInt("fishing", "scarecrow", 0); - LootTracker.nightmares = initInt("fishing", "nightmare", 0); - LootTracker.werewolfs = initInt("fishing", "werewolf", 0); - LootTracker.phantomFishers = initInt("fishing", "phantomFisher", 0); - LootTracker.grimReapers = initInt("fishing", "grimReaper", 0); + FishingTracker.scarecrows = initInt("fishing", "scarecrow", 0); + FishingTracker.nightmares = initInt("fishing", "nightmare", 0); + FishingTracker.werewolfs = initInt("fishing", "werewolf", 0); + FishingTracker.phantomFishers = initInt("fishing", "phantomFisher", 0); + FishingTracker.grimReapers = initInt("fishing", "grimReaper", 0); // Mythological - LootTracker.mythCoins = initDouble("mythological", "coins", 0); - LootTracker.griffinFeathers = initInt("mythological", "griffinFeather", 0); - LootTracker.crownOfGreeds = initInt("mythological", "crownOfGreed", 0); - LootTracker.washedUpSouvenirs = initInt("mythological", "washedUpSouvenir", 0); - LootTracker.minosHunters = initInt("mythological", "minosHunter", 0); - LootTracker.siameseLynxes = initInt("mythological", "siameseLynx", 0); - LootTracker.minotaurs = initInt("mythological", "minotaur", 0); - LootTracker.gaiaConstructs = initInt("mythological", "gaiaConstruct", 0); - LootTracker.minosChampions = initInt("mythological", "minosChampion", 0); - LootTracker.minosInquisitors = initInt("mythological", "minosInquisitor", 0); + MythologicalTracker.mythCoins = initDouble("mythological", "coins", 0); + MythologicalTracker.griffinFeathers = initInt("mythological", "griffinFeather", 0); + MythologicalTracker.crownOfGreeds = initInt("mythological", "crownOfGreed", 0); + MythologicalTracker.washedUpSouvenirs = initInt("mythological", "washedUpSouvenir", 0); + MythologicalTracker.minosHunters = initInt("mythological", "minosHunter", 0); + MythologicalTracker.siameseLynxes = initInt("mythological", "siameseLynx", 0); + MythologicalTracker.minotaurs = initInt("mythological", "minotaur", 0); + MythologicalTracker.gaiaConstructs = initInt("mythological", "gaiaConstruct", 0); + MythologicalTracker.minosChampions = initInt("mythological", "minosChampion", 0); + MythologicalTracker.minosInquisitors = initInt("mythological", "minosInquisitor", 0); // Dungeons - LootTracker.recombobulators = initInt("catacombs", "recombobulator", 0); - LootTracker.fumingPotatoBooks = initInt("catacombs", "fumingBooks", 0); + CatacombsTracker.recombobulators = initInt("catacombs", "recombobulator", 0); + CatacombsTracker.fumingPotatoBooks = initInt("catacombs", "fumingBooks", 0); // F1 - LootTracker.bonzoStaffs = initInt("catacombs", "bonzoStaff", 0); - LootTracker.f1CoinsSpent = initDouble("catacombs", "floorOneCoins", 0); - LootTracker.f1TimeSpent = initDouble("catacombs", "floorOneTime", 0); + CatacombsTracker.bonzoStaffs = initInt("catacombs", "bonzoStaff", 0); + CatacombsTracker.f1CoinsSpent = initDouble("catacombs", "floorOneCoins", 0); + CatacombsTracker.f1TimeSpent = initDouble("catacombs", "floorOneTime", 0); // F2 - LootTracker.scarfStudies = initInt("catacombs", "scarfStudies", 0); - LootTracker.f2CoinsSpent = initDouble("catacombs", "floorTwoCoins", 0); - LootTracker.f2TimeSpent = initDouble("catacombs", "floorTwoTime", 0); + CatacombsTracker.scarfStudies = initInt("catacombs", "scarfStudies", 0); + CatacombsTracker.f2CoinsSpent = initDouble("catacombs", "floorTwoCoins", 0); + CatacombsTracker.f2TimeSpent = initDouble("catacombs", "floorTwoTime", 0); // F3 - LootTracker.adaptiveHelms = initInt("catacombs", "adaptiveHelm", 0); - LootTracker.adaptiveChests = initInt("catacombs", "adaptiveChest", 0); - LootTracker.adaptiveLegs = initInt("catacombs", "adaptiveLegging", 0); - LootTracker.adaptiveBoots = initInt("catacombs", "adaptiveBoot", 0); - LootTracker.adaptiveSwords = initInt("catacombs", "adaptiveSword", 0); - LootTracker.f3CoinsSpent = initDouble("catacombs", "floorThreeCoins", 0); - LootTracker.f3TimeSpent = initDouble("catacombs", "floorThreeTime", 0); + CatacombsTracker.adaptiveHelms = initInt("catacombs", "adaptiveHelm", 0); + CatacombsTracker.adaptiveChests = initInt("catacombs", "adaptiveChest", 0); + CatacombsTracker.adaptiveLegs = initInt("catacombs", "adaptiveLegging", 0); + CatacombsTracker.adaptiveBoots = initInt("catacombs", "adaptiveBoot", 0); + CatacombsTracker.adaptiveSwords = initInt("catacombs", "adaptiveSword", 0); + CatacombsTracker.f3CoinsSpent = initDouble("catacombs", "floorThreeCoins", 0); + CatacombsTracker.f3TimeSpent = initDouble("catacombs", "floorThreeTime", 0); // F4 - LootTracker.spiritWings = initInt("catacombs", "spiritWing", 0); - LootTracker.spiritBones = initInt("catacombs", "spiritBone", 0); - LootTracker.spiritBoots = initInt("catacombs", "spiritBoot", 0); - LootTracker.spiritSwords = initInt("catacombs", "spiritSword", 0); - LootTracker.spiritBows = initInt("catacombs", "spiritBow", 0); - LootTracker.epicSpiritPets = initInt("catacombs", "spiritPetEpic", 0); - LootTracker.legSpiritPets = initInt("catacombs", "spiritPetLeg", 0); - LootTracker.f4CoinsSpent = initDouble("catacombs", "floorFourCoins", 0); - LootTracker.f4TimeSpent = initDouble("catacombs", "floorFourTime", 0); + CatacombsTracker.spiritWings = initInt("catacombs", "spiritWing", 0); + CatacombsTracker.spiritBones = initInt("catacombs", "spiritBone", 0); + CatacombsTracker.spiritBoots = initInt("catacombs", "spiritBoot", 0); + CatacombsTracker.spiritSwords = initInt("catacombs", "spiritSword", 0); + CatacombsTracker.spiritBows = initInt("catacombs", "spiritBow", 0); + CatacombsTracker.epicSpiritPets = initInt("catacombs", "spiritPetEpic", 0); + CatacombsTracker.legSpiritPets = initInt("catacombs", "spiritPetLeg", 0); + CatacombsTracker.f4CoinsSpent = initDouble("catacombs", "floorFourCoins", 0); + CatacombsTracker.f4TimeSpent = initDouble("catacombs", "floorFourTime", 0); // F5 - LootTracker.warpedStones = initInt("catacombs", "warpedStone", 0); - LootTracker.shadowAssHelms = initInt("catacombs", "shadowAssassinHelm", 0); - LootTracker.shadowAssChests = initInt("catacombs", "shadowAssassinChest", 0); - LootTracker.shadowAssLegs = initInt("catacombs", "shadowAssassinLegging", 0); - LootTracker.shadowAssBoots = initInt("catacombs", "shadowAssassinBoot", 0); - LootTracker.lastBreaths = initInt("catacombs", "lastBreath", 0); - LootTracker.lividDaggers = initInt("catacombs", "lividDagger", 0); - LootTracker.shadowFurys = initInt("catacombs", "shadowFury", 0); - LootTracker.f5CoinsSpent = initDouble("catacombs", "floorFiveCoins", 0); - LootTracker.f5TimeSpent = initDouble("catacombs", "floorFiveTime", 0); + CatacombsTracker.warpedStones = initInt("catacombs", "warpedStone", 0); + CatacombsTracker.shadowAssHelms = initInt("catacombs", "shadowAssassinHelm", 0); + CatacombsTracker.shadowAssChests = initInt("catacombs", "shadowAssassinChest", 0); + CatacombsTracker.shadowAssLegs = initInt("catacombs", "shadowAssassinLegging", 0); + CatacombsTracker.shadowAssBoots = initInt("catacombs", "shadowAssassinBoot", 0); + CatacombsTracker.lastBreaths = initInt("catacombs", "lastBreath", 0); + CatacombsTracker.lividDaggers = initInt("catacombs", "lividDagger", 0); + CatacombsTracker.shadowFurys = initInt("catacombs", "shadowFury", 0); + CatacombsTracker.f5CoinsSpent = initDouble("catacombs", "floorFiveCoins", 0); + CatacombsTracker.f5TimeSpent = initDouble("catacombs", "floorFiveTime", 0); // F6 - LootTracker.ancientRoses = initInt("catacombs", "ancientRose", 0); - LootTracker.precursorEyes = initInt("catacombs", "precursorEye", 0); - LootTracker.giantsSwords = initInt("catacombs", "giantsSword", 0); - LootTracker.necroLordHelms = initInt("catacombs", "necroLordHelm", 0); - LootTracker.necroLordChests = initInt("catacombs", "necroLordChest", 0); - LootTracker.necroLordLegs = initInt("catacombs", "necroLordLegging", 0); - LootTracker.necroLordBoots = initInt("catacombs", "necroLordBoot", 0); - LootTracker.necroSwords = initInt("catacombs", "necroSword", 0); - LootTracker.f6CoinsSpent = initDouble("catacombs", "floorSixCoins", 0); - LootTracker.f6TimeSpent = initDouble("catacombs", "floorSixTime", 0); + CatacombsTracker.ancientRoses = initInt("catacombs", "ancientRose", 0); + CatacombsTracker.precursorEyes = initInt("catacombs", "precursorEye", 0); + CatacombsTracker.giantsSwords = initInt("catacombs", "giantsSword", 0); + CatacombsTracker.necroLordHelms = initInt("catacombs", "necroLordHelm", 0); + CatacombsTracker.necroLordChests = initInt("catacombs", "necroLordChest", 0); + CatacombsTracker.necroLordLegs = initInt("catacombs", "necroLordLegging", 0); + CatacombsTracker.necroLordBoots = initInt("catacombs", "necroLordBoot", 0); + CatacombsTracker.necroSwords = initInt("catacombs", "necroSword", 0); + CatacombsTracker.f6CoinsSpent = initDouble("catacombs", "floorSixCoins", 0); + CatacombsTracker.f6TimeSpent = initDouble("catacombs", "floorSixTime", 0); // F7 - LootTracker.witherBloods = initInt("catacombs", "witherBlood", 0); - LootTracker.witherCloaks = initInt("catacombs", "witherCloak", 0); - LootTracker.implosions = initInt("catacombs", "implosion", 0); - LootTracker.witherShields = initInt("catacombs", "witherShield", 0); - LootTracker.shadowWarps = initInt("catacombs", "shadowWarp", 0); - LootTracker.necronsHandles = initInt("catacombs", "necronsHandle", 0); - LootTracker.autoRecombs = initInt("catacombs", "autoRecomb", 0); - LootTracker.witherHelms = initInt("catacombs", "witherHelm", 0); - LootTracker.witherChests = initInt("catacombs", "witherChest", 0); - LootTracker.witherLegs = initInt("catacombs", "witherLegging", 0); - LootTracker.witherBoots = initInt("catacombs", "witherBoot", 0); - LootTracker.f7CoinsSpent = initDouble("catacombs", "floorSevenCoins", 0); - LootTracker.f7TimeSpent = initDouble("catacombs", "floorSevenTime", 0); + CatacombsTracker.witherBloods = initInt("catacombs", "witherBlood", 0); + CatacombsTracker.witherCloaks = initInt("catacombs", "witherCloak", 0); + CatacombsTracker.implosions = initInt("catacombs", "implosion", 0); + CatacombsTracker.witherShields = initInt("catacombs", "witherShield", 0); + CatacombsTracker.shadowWarps = initInt("catacombs", "shadowWarp", 0); + CatacombsTracker.necronsHandles = initInt("catacombs", "necronsHandle", 0); + CatacombsTracker.autoRecombs = initInt("catacombs", "autoRecomb", 0); + CatacombsTracker.witherHelms = initInt("catacombs", "witherHelm", 0); + CatacombsTracker.witherChests = initInt("catacombs", "witherChest", 0); + CatacombsTracker.witherLegs = initInt("catacombs", "witherLegging", 0); + CatacombsTracker.witherBoots = initInt("catacombs", "witherBoot", 0); + CatacombsTracker.f7CoinsSpent = initDouble("catacombs", "floorSevenCoins", 0); + CatacombsTracker.f7TimeSpent = initDouble("catacombs", "floorSevenTime", 0); // Ghost - LootTracker.sorrows = initInt("ghosts", "sorrow", 0); - LootTracker.voltas = initInt("ghosts", "volta", 0); - LootTracker.plasmas = initInt("ghosts", "plasma", 0); - LootTracker.ghostlyBoots = initInt("ghosts", "ghostlyBoots", 0); - LootTracker.bagOfCashs = initInt("ghosts", "bagOfCash", 0); + GhostTracker.sorrows = initInt("ghosts", "sorrow", 0); + GhostTracker.voltas = initInt("ghosts", "volta", 0); + GhostTracker.plasmas = initInt("ghosts", "plasma", 0); + GhostTracker.ghostlyBoots = initInt("ghosts", "ghostlyBoots", 0); + GhostTracker.bagOfCashs = initInt("ghosts", "bagOfCash", 0); // Misc LootDisplay.display = initString("misc", "display", "off"); diff --git a/src/main/java/me/Danker/handlers/PacketHandler.java b/src/main/java/me/Danker/handlers/PacketHandler.java index a4fd85e..a5a858b 100644 --- a/src/main/java/me/Danker/handlers/PacketHandler.java +++ b/src/main/java/me/Danker/handlers/PacketHandler.java @@ -2,29 +2,30 @@ package me.Danker.handlers; import io.netty.channel.ChannelDuplexHandler; import io.netty.channel.ChannelHandlerContext; -import me.Danker.utils.Utils; -import net.minecraft.client.Minecraft; +import io.netty.channel.ChannelPromise; +import me.Danker.events.PacketReadEvent; +import me.Danker.events.PacketWriteEvent; import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S04PacketEntityEquipment; - -import java.lang.reflect.Field; +import net.minecraftforge.common.MinecraftForge; public class PacketHandler extends ChannelDuplexHandler { - - // Spirit boots fix + @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { - if (Utils.inSkyblock && msg instanceof Packet && msg.getClass().getName().endsWith("S04PacketEntityEquipment")) { // Inventory packet name - S04PacketEntityEquipment packet = (S04PacketEntityEquipment) msg; - if (packet.getEntityID() == Minecraft.getMinecraft().thePlayer.getEntityId()) { - Field slot = packet.getClass().getDeclaredField("field_149392_b"); // equipmentSlot - slot.setAccessible(true); - slot.setInt(packet, slot.getInt(packet) + 1); - msg = packet; - } + if (msg instanceof Packet) { + if (MinecraftForge.EVENT_BUS.post(new PacketReadEvent((Packet) msg))) return; } - + super.channelRead(ctx, msg); } + + @Override + public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { + if (msg instanceof Packet) { + if (MinecraftForge.EVENT_BUS.post(new PacketWriteEvent((Packet) msg))) return; + } + + super.write(ctx, msg, promise); + } } diff --git a/src/main/java/me/Danker/utils/BoulderUtils.java b/src/main/java/me/Danker/utils/BoulderUtils.java index 2d437d0..ca26c96 100644 --- a/src/main/java/me/Danker/utils/BoulderUtils.java +++ b/src/main/java/me/Danker/utils/BoulderUtils.java @@ -254,26 +254,26 @@ public class BoulderUtils { double averageZ = (aabb.minZ + aabb.maxZ) / 2; if (((boulderRoomDirection.equals("north") || boulderRoomDirection.equals("south")) && (direction == 'u' || direction == 'd')) || ((boulderRoomDirection.equals("east") || boulderRoomDirection.equals("west")) && (direction == 'l' || direction == 'r'))) { - Utils.draw3DLine(new Vec3(averageX, aabb.minY, aabb.minZ), new Vec3(averageX, aabb.minY, aabb.maxZ), colourInt, 10, false, partialTicks); + RenderUtils.draw3DLine(new Vec3(averageX, aabb.minY, aabb.minZ), new Vec3(averageX, aabb.minY, aabb.maxZ), colourInt, 10, false, partialTicks); } else { - Utils.draw3DLine(new Vec3(aabb.minX, aabb.minY, averageZ), new Vec3(aabb.maxX, aabb.minY, averageZ), colourInt, 10, false, partialTicks); + RenderUtils.draw3DLine(new Vec3(aabb.minX, aabb.minY, averageZ), new Vec3(aabb.maxX, aabb.minY, averageZ), colourInt, 10, false, partialTicks); } if ((boulderRoomDirection.equals("north") && direction == 'u') || (boulderRoomDirection.equals("south") && direction == 'd') || (boulderRoomDirection.equals("east") && direction == 'l') || (boulderRoomDirection.equals("west") && direction == 'r')) { - Utils.draw3DLine(new Vec3(averageX, aabb.minY, aabb.minZ), new Vec3(aabb.minX + thirtyPercent, aabb.minY, aabb.minZ + thirtyPercent), colourInt, 10, false, partialTicks); - Utils.draw3DLine(new Vec3(averageX, aabb.minY, aabb.minZ), new Vec3(aabb.maxX - thirtyPercent, aabb.minY, aabb.minZ + thirtyPercent), colourInt, 10, false, partialTicks); + RenderUtils.draw3DLine(new Vec3(averageX, aabb.minY, aabb.minZ), new Vec3(aabb.minX + thirtyPercent, aabb.minY, aabb.minZ + thirtyPercent), colourInt, 10, false, partialTicks); + RenderUtils.draw3DLine(new Vec3(averageX, aabb.minY, aabb.minZ), new Vec3(aabb.maxX - thirtyPercent, aabb.minY, aabb.minZ + thirtyPercent), colourInt, 10, false, partialTicks); } else if ((boulderRoomDirection.equals("north") && direction == 'd') || (boulderRoomDirection.equals("south") && direction == 'u') || (boulderRoomDirection.equals("east") && direction == 'r') || (boulderRoomDirection.equals("west") && direction == 'l')) { - Utils.draw3DLine(new Vec3(averageX, aabb.minY, aabb.maxZ), new Vec3(aabb.minX + thirtyPercent, aabb.minY, aabb.maxZ - thirtyPercent), colourInt, 10, false, partialTicks); - Utils.draw3DLine(new Vec3(averageX, aabb.minY, aabb.maxZ), new Vec3(aabb.maxX - thirtyPercent, aabb.minY, aabb.maxZ - thirtyPercent), colourInt, 10, false, partialTicks); + RenderUtils.draw3DLine(new Vec3(averageX, aabb.minY, aabb.maxZ), new Vec3(aabb.minX + thirtyPercent, aabb.minY, aabb.maxZ - thirtyPercent), colourInt, 10, false, partialTicks); + RenderUtils.draw3DLine(new Vec3(averageX, aabb.minY, aabb.maxZ), new Vec3(aabb.maxX - thirtyPercent, aabb.minY, aabb.maxZ - thirtyPercent), colourInt, 10, false, partialTicks); } else if ((boulderRoomDirection.equals("north") && direction == 'l') || (boulderRoomDirection.equals("south") && direction == 'r') || (boulderRoomDirection.equals("east") && direction == 'd') || (boulderRoomDirection.equals("west") && direction == 'u')) { - Utils.draw3DLine(new Vec3(aabb.minX, aabb.minY, averageZ), new Vec3(aabb.minX + thirtyPercent, aabb.minY, aabb.minZ + thirtyPercent), colourInt, 10, false, partialTicks); - Utils.draw3DLine(new Vec3(aabb.minX, aabb.minY, averageZ), new Vec3(aabb.minX + thirtyPercent, aabb.minY, aabb.maxZ - thirtyPercent), colourInt, 10, false, partialTicks); + RenderUtils.draw3DLine(new Vec3(aabb.minX, aabb.minY, averageZ), new Vec3(aabb.minX + thirtyPercent, aabb.minY, aabb.minZ + thirtyPercent), colourInt, 10, false, partialTicks); + RenderUtils.draw3DLine(new Vec3(aabb.minX, aabb.minY, averageZ), new Vec3(aabb.minX + thirtyPercent, aabb.minY, aabb.maxZ - thirtyPercent), colourInt, 10, false, partialTicks); } else { - Utils.draw3DLine(new Vec3(aabb.maxX, aabb.minY, averageZ), new Vec3(aabb.maxX - thirtyPercent, aabb.minY, aabb.minZ + thirtyPercent), colourInt, 10, false, partialTicks); - Utils.draw3DLine(new Vec3(aabb.maxX, aabb.minY, averageZ), new Vec3(aabb.maxX - thirtyPercent, aabb.minY, aabb.maxZ - thirtyPercent), colourInt, 10, false, partialTicks); + RenderUtils.draw3DLine(new Vec3(aabb.maxX, aabb.minY, averageZ), new Vec3(aabb.maxX - thirtyPercent, aabb.minY, aabb.minZ + thirtyPercent), colourInt, 10, false, partialTicks); + RenderUtils.draw3DLine(new Vec3(aabb.maxX, aabb.minY, averageZ), new Vec3(aabb.maxX - thirtyPercent, aabb.minY, aabb.maxZ - thirtyPercent), colourInt, 10, false, partialTicks); } } diff --git a/src/main/java/me/Danker/utils/RenderUtils.java b/src/main/java/me/Danker/utils/RenderUtils.java new file mode 100644 index 0000000..f117969 --- /dev/null +++ b/src/main/java/me/Danker/utils/RenderUtils.java @@ -0,0 +1,366 @@ +package me.Danker.utils; + +import me.Danker.features.CrystalHollowWaypoints; +import me.Danker.handlers.TextRenderer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.*; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.Vec3; +import org.lwjgl.opengl.GL11; + +import java.awt.*; + +public class RenderUtils { + + public static void drawTitle(String text) { + Minecraft mc = Minecraft.getMinecraft(); + ScaledResolution scaledResolution = new ScaledResolution(mc); + + int height = scaledResolution.getScaledHeight(); + int width = scaledResolution.getScaledWidth(); + int drawHeight = 0; + String[] splitText = text.split("\n"); + for (String title : splitText) { + int textLength = mc.fontRendererObj.getStringWidth(title); + + double scale = 4; + if (textLength * scale > (width * 0.9F)) { + scale = (width * 0.9F) / (float) textLength; + } + + int titleX = (int) ((width / 2) - (textLength * scale / 2)); + int titleY = (int) ((height * 0.45) / scale) + (int) (drawHeight * scale); + new TextRenderer(mc, title, titleX, titleY, scale); + drawHeight += mc.fontRendererObj.FONT_HEIGHT; + } + } + + public static void drawOnSlot(int size, int xSlotPos, int ySlotPos, int colour) { + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int guiLeft = (sr.getScaledWidth() - 176) / 2; + int guiTop = (sr.getScaledHeight() - 222) / 2; + int x = guiLeft + xSlotPos; + int y = guiTop + ySlotPos; + // Move down when chest isn't 6 rows + if (size != 90) y += (6 - (size - 36) / 9) * 9; + + GL11.glTranslated(0, 0, 1); + Gui.drawRect(x, y, x + 16, y + 16, colour); + GL11.glTranslated(0, 0, -1); + } + + public static void draw3DLine(Vec3 pos1, Vec3 pos2, int colourInt, int lineWidth, boolean depth, float partialTicks) { + Entity render = Minecraft.getMinecraft().getRenderViewEntity(); + WorldRenderer worldRenderer = Tessellator.getInstance().getWorldRenderer(); + Color colour = new Color(colourInt); + + double realX = render.lastTickPosX + (render.posX - render.lastTickPosX) * partialTicks; + double realY = render.lastTickPosY + (render.posY - render.lastTickPosY) * partialTicks; + double realZ = render.lastTickPosZ + (render.posZ - render.lastTickPosZ) * partialTicks; + + GlStateManager.pushMatrix(); + GlStateManager.translate(-realX, -realY, -realZ); + GlStateManager.disableTexture2D(); + GlStateManager.enableBlend(); + GlStateManager.disableAlpha(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GL11.glLineWidth(lineWidth); + if (!depth) { + GL11.glDisable(GL11.GL_DEPTH_TEST); + GlStateManager.depthMask(false); + } + GlStateManager.color(colour.getRed() / 255f, colour.getGreen() / 255f, colour.getBlue() / 255f, colour.getAlpha() / 255f); + worldRenderer.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION); + + worldRenderer.pos(pos1.xCoord, pos1.yCoord, pos1.zCoord).endVertex(); + worldRenderer.pos(pos2.xCoord, pos2.yCoord, pos2.zCoord).endVertex(); + Tessellator.getInstance().draw(); + + GlStateManager.translate(realX, realY, realZ); + if (!depth) { + GL11.glEnable(GL11.GL_DEPTH_TEST); + GlStateManager.depthMask(true); + } + GlStateManager.disableBlend(); + GlStateManager.enableAlpha(); + GlStateManager.enableTexture2D(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.popMatrix(); + } + + public static void draw3DString(BlockPos pos, String text, int colour, float partialTicks) { + Minecraft mc = Minecraft.getMinecraft(); + EntityPlayer player = mc.thePlayer; + double x = (pos.getX() - player.lastTickPosX) + ((pos.getX() - player.posX) - (pos.getX() - player.lastTickPosX)) * partialTicks; + double y = (pos.getY() - player.lastTickPosY) + ((pos.getY() - player.posY) - (pos.getY() - player.lastTickPosY)) * partialTicks; + double z = (pos.getZ() - player.lastTickPosZ) + ((pos.getZ() - player.posZ) - (pos.getZ() - player.lastTickPosZ)) * partialTicks; + RenderManager renderManager = mc.getRenderManager(); + + float f = 1.6F; + float f1 = 0.016666668F * f; + int width = mc.fontRendererObj.getStringWidth(text) / 2; + GlStateManager.pushMatrix(); + GlStateManager.translate(x, y, z); + GL11.glNormal3f(0f, 1f, 0f); + GlStateManager.rotate(-renderManager.playerViewY, 0f, 1f, 0f); + GlStateManager.rotate(renderManager.playerViewX, 1f, 0f, 0f); + GlStateManager.scale(-f1, -f1, -f1); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + mc.fontRendererObj.drawString(text, -width, 0, colour); + GlStateManager.disableBlend(); + GlStateManager.popMatrix(); + } + + // I couldnt get waypoint strings to work so in the end I just copied from NEU + // If anyone sees this please help + /*public static void draw3DWaypointString(CrystalHollowWaypoints.Waypoint waypoint, float partialTicks) { + Minecraft mc = Minecraft.getMinecraft(); + EntityPlayer player = mc.thePlayer; + BlockPos pos = waypoint.pos; + double x = (pos.getX() - player.lastTickPosX) + ((pos.getX() - player.posX) - (pos.getX() - player.lastTickPosX)) * partialTicks; + double y = (pos.getY() - player.lastTickPosY) + ((pos.getY() - player.posY) - (pos.getY() - player.lastTickPosY)) * partialTicks; + double z = (pos.getZ() - player.lastTickPosZ) + ((pos.getZ() - player.posZ) - (pos.getZ() - player.lastTickPosZ)) * partialTicks; + + double distance = player.getDistance(x, y, z); + if (distance > 12) { + x *= 12 / distance; + y *= 12 / distance; + z *= 12 / distance; + } + + RenderManager renderManager = mc.getRenderManager(); + Entity viewer = Minecraft.getMinecraft().getRenderViewEntity(); + + float f = 1.6F; + float f1 = 0.016666668F * f; + int width = mc.fontRendererObj.getStringWidth(waypoint.location) / 2; + int width2 = mc.fontRendererObj.getStringWidth(waypoint.getDistance(player)) / 2; + GlStateManager.pushMatrix(); + GlStateManager.translate(x, y, z); + GL11.glNormal3f(0f, 1f, 0f); + GlStateManager.rotate(-renderManager.playerViewY, 0f, 1f, 0f); + GlStateManager.rotate(renderManager.playerViewX, 1f, 0f, 0f); + GlStateManager.scale(-f1, -f1, -f1); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GlStateManager.depthMask(false); + + mc.fontRendererObj.drawString(waypoint.location, -width, 0, 0x55FFFF); + + GlStateManager.rotate(-renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + GlStateManager.translate(0, -1, 0); + GlStateManager.rotate(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + + mc.fontRendererObj.drawString(waypoint.getDistance(player), -width2, 0, 0xFFFF55); + + GL11.glEnable(GL11.GL_DEPTH_TEST); + GlStateManager.depthMask(true); + GlStateManager.disableBlend(); + GlStateManager.popMatrix(); + }*/ + + // https://github.com/Moulberry/NotEnoughUpdates/blob/master/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesWaypoints.java#L261 + public static void draw3DWaypointString(CrystalHollowWaypoints.Waypoint waypoint, float partialTicks) { + GlStateManager.alphaFunc(516, 0.1F); + + GlStateManager.pushMatrix(); + + Entity viewer = Minecraft.getMinecraft().getRenderViewEntity(); + double viewerX = viewer.lastTickPosX + (viewer.posX - viewer.lastTickPosX) * partialTicks; + double viewerY = viewer.lastTickPosY + (viewer.posY - viewer.lastTickPosY) * partialTicks; + double viewerZ = viewer.lastTickPosZ + (viewer.posZ - viewer.lastTickPosZ) * partialTicks; + + double x = waypoint.pos.getX()-viewerX+0.5f; + double y = waypoint.pos.getY()-viewerY-viewer.getEyeHeight(); + double z = waypoint.pos.getZ()-viewerZ+0.5f; + + double distSq = x*x + y*y + z*z; + double dist = Math.sqrt(distSq); + if(distSq > 144) { + x *= 12/dist; + y *= 12/dist; + z *= 12/dist; + } + GlStateManager.translate(x, y, z); + GlStateManager.translate(0, viewer.getEyeHeight(), 0); + + renderNametag(EnumChatFormatting.AQUA + waypoint.location); + + GlStateManager.rotate(-Minecraft.getMinecraft().getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(Minecraft.getMinecraft().getRenderManager().playerViewX, 1.0F, 0.0F, 0.0F); + GlStateManager.translate(0, -0.25f, 0); + GlStateManager.rotate(-Minecraft.getMinecraft().getRenderManager().playerViewX, 1.0F, 0.0F, 0.0F); + GlStateManager.rotate(Minecraft.getMinecraft().getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F); + + renderNametag(EnumChatFormatting.YELLOW + waypoint.getDistance(Minecraft.getMinecraft().thePlayer)); + + GlStateManager.popMatrix(); + + GlStateManager.disableLighting(); + } + + // https://github.com/Moulberry/NotEnoughUpdates/blob/master/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesWaypoints.java#L300 + public static void renderNametag(String str) { + FontRenderer fontrenderer = Minecraft.getMinecraft().fontRendererObj; + float f = 1.6F; + float f1 = 0.016666668F * f; + GlStateManager.pushMatrix(); + GL11.glNormal3f(0.0F, 1.0F, 0.0F); + GlStateManager.rotate(-Minecraft.getMinecraft().getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(Minecraft.getMinecraft().getRenderManager().playerViewX, 1.0F, 0.0F, 0.0F); + GlStateManager.scale(-f1, -f1, f1); + GlStateManager.disableLighting(); + GlStateManager.depthMask(false); + GlStateManager.disableDepth(); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + int i = 0; + + int j = fontrenderer.getStringWidth(str) / 2; + GlStateManager.disableTexture2D(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.pos(-j - 1, -1 + i, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos(-j - 1, 8 + i, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos(j + 1, 8 + i, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + worldrenderer.pos(j + 1, -1 + i, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + tessellator.draw(); + GlStateManager.enableTexture2D(); + fontrenderer.drawString(str, -fontrenderer.getStringWidth(str) / 2, i, 553648127); + GlStateManager.depthMask(true); + + fontrenderer.drawString(str, -fontrenderer.getStringWidth(str) / 2, i, -1); + + GlStateManager.enableDepth(); + GlStateManager.enableBlend(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.popMatrix(); + } + + public static void draw3DBox(AxisAlignedBB aabb, int colourInt, float partialTicks) { + Entity render = Minecraft.getMinecraft().getRenderViewEntity(); + Color colour = new Color(colourInt); + + double realX = render.lastTickPosX + (render.posX - render.lastTickPosX) * partialTicks; + double realY = render.lastTickPosY + (render.posY - render.lastTickPosY) * partialTicks; + double realZ = render.lastTickPosZ + (render.posZ - render.lastTickPosZ) * partialTicks; + + GlStateManager.pushMatrix(); + GlStateManager.translate(-realX, -realY, -realZ); + GlStateManager.disableTexture2D(); + GlStateManager.enableBlend(); + GlStateManager.disableAlpha(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GL11.glLineWidth(2); + + RenderGlobal.drawOutlinedBoundingBox(aabb, colour.getRed(), colour.getGreen(), colour.getBlue(), colour.getAlpha()); + + GlStateManager.translate(realX, realY, realZ); + GlStateManager.disableBlend(); + GlStateManager.enableAlpha(); + GlStateManager.enableTexture2D(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.popMatrix(); + } + + public static void drawFilled3DBox(AxisAlignedBB aabb, int colourInt, boolean translucent, boolean depth, float partialTicks) { + Entity render = Minecraft.getMinecraft().getRenderViewEntity(); + WorldRenderer worldRenderer = Tessellator.getInstance().getWorldRenderer(); + Color colour = new Color(colourInt); + + double realX = render.lastTickPosX + (render.posX - render.lastTickPosX) * partialTicks; + double realY = render.lastTickPosY + (render.posY - render.lastTickPosY) * partialTicks; + double realZ = render.lastTickPosZ + (render.posZ - render.lastTickPosZ) * partialTicks; + + GlStateManager.pushMatrix(); + GlStateManager.pushAttrib(); + GlStateManager.translate(-realX, -realY, -realZ); + GlStateManager.disableTexture2D(); + GlStateManager.enableAlpha(); + GlStateManager.enableBlend(); + GlStateManager.disableCull(); + GlStateManager.tryBlendFuncSeparate(770, translucent ? 1 : 771, 1, 0); + if (!depth) { + GL11.glDisable(GL11.GL_DEPTH_TEST); + GlStateManager.depthMask(false); + } + GlStateManager.color(colour.getRed() / 255f, colour.getGreen() / 255f, colour.getBlue() / 255f, colour.getAlpha() / 255f); + worldRenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); + // Bottom + worldRenderer.pos(aabb.minX, aabb.minY, aabb.minZ).endVertex(); + worldRenderer.pos(aabb.maxX, aabb.minY, aabb.minZ).endVertex(); + worldRenderer.pos(aabb.maxX, aabb.minY, aabb.maxZ).endVertex(); + worldRenderer.pos(aabb.minX, aabb.minY, aabb.maxZ).endVertex(); + // Top + worldRenderer.pos(aabb.minX, aabb.maxY, aabb.minZ).endVertex(); + worldRenderer.pos(aabb.maxX, aabb.maxY, aabb.minZ).endVertex(); + worldRenderer.pos(aabb.maxX, aabb.maxY, aabb.maxZ).endVertex(); + worldRenderer.pos(aabb.minX, aabb.maxY, aabb.maxZ).endVertex(); + // West + worldRenderer.pos(aabb.minX, aabb.minY, aabb.minZ).endVertex(); + worldRenderer.pos(aabb.minX, aabb.maxY, aabb.minZ).endVertex(); + worldRenderer.pos(aabb.minX, aabb.maxY, aabb.maxZ).endVertex(); + worldRenderer.pos(aabb.minX, aabb.minY, aabb.maxZ).endVertex(); + // East + worldRenderer.pos(aabb.maxX, aabb.minY, aabb.minZ).endVertex(); + worldRenderer.pos(aabb.maxX, aabb.maxY, aabb.minZ).endVertex(); + worldRenderer.pos(aabb.maxX, aabb.maxY, aabb.maxZ).endVertex(); + worldRenderer.pos(aabb.maxX, aabb.minY, aabb.maxZ).endVertex(); + // North + worldRenderer.pos(aabb.minX, aabb.minY, aabb.minZ).endVertex(); + worldRenderer.pos(aabb.maxX, aabb.minY, aabb.minZ).endVertex(); + worldRenderer.pos(aabb.maxX, aabb.maxY, aabb.minZ).endVertex(); + worldRenderer.pos(aabb.minX, aabb.maxY, aabb.minZ).endVertex(); + // South + worldRenderer.pos(aabb.minX, aabb.minY, aabb.maxZ).endVertex(); + worldRenderer.pos(aabb.maxX, aabb.minY, aabb.maxZ).endVertex(); + worldRenderer.pos(aabb.maxX, aabb.maxY, aabb.maxZ).endVertex(); + worldRenderer.pos(aabb.minX, aabb.maxY, aabb.maxZ).endVertex(); + Tessellator.getInstance().draw(); + + GlStateManager.translate(realX, realY, realZ); + if (!depth) { + GL11.glEnable(GL11.GL_DEPTH_TEST); + GlStateManager.depthMask(true); + } + GlStateManager.enableCull(); + GlStateManager.disableAlpha(); + GlStateManager.disableBlend(); + GlStateManager.enableTexture2D(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.popAttrib(); + GlStateManager.popMatrix(); + } + + public static void renderItem(ItemStack item, float x, float y, float z) { + + GlStateManager.enableRescaleNormal(); + RenderHelper.enableGUIStandardItemLighting(); + GlStateManager.enableDepth(); + + GlStateManager.pushMatrix(); + GlStateManager.translate(x, y, z); + Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(item, 0, 0); + GlStateManager.popMatrix(); + + GlStateManager.disableDepth(); + RenderHelper.disableStandardItemLighting(); + GlStateManager.disableRescaleNormal(); + } + +} diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 31c791a..71fc4ba 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -2,22 +2,13 @@ package me.Danker.utils; import me.Danker.DankersSkyblockMod; import me.Danker.features.ColouredNames; -import me.Danker.features.CrystalHollowWaypoints; import me.Danker.features.GoldenEnchants; import me.Danker.handlers.APIHandler; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.ScoreboardHandler; -import me.Danker.handlers.TextRenderer; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.network.NetworkPlayerInfo; -import net.minecraft.client.renderer.*; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItemFrame; import net.minecraft.entity.player.EntityPlayer; @@ -27,10 +18,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.scoreboard.ScoreObjective; import net.minecraft.util.*; -import org.lwjgl.opengl.GL11; -import java.awt.*; -import java.util.List; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -113,29 +101,6 @@ public class Utils { DankersSkyblockMod.showTitle = true; DankersSkyblockMod.titleText = text; } - - public static void drawTitle(String text) { - Minecraft mc = Minecraft.getMinecraft(); - ScaledResolution scaledResolution = new ScaledResolution(mc); - - int height = scaledResolution.getScaledHeight(); - int width = scaledResolution.getScaledWidth(); - int drawHeight = 0; - String[] splitText = text.split("\n"); - for (String title : splitText) { - int textLength = mc.fontRendererObj.getStringWidth(title); - - double scale = 4; - if (textLength * scale > (width * 0.9F)) { - scale = (width * 0.9F) / (float) textLength; - } - - int titleX = (int) ((width / 2) - (textLength * scale / 2)); - int titleY = (int) ((height * 0.45) / scale) + (int) (drawHeight * scale); - new TextRenderer(mc, title, titleX, titleY, scale); - drawHeight += mc.fontRendererObj.FONT_HEIGHT; - } - } public static boolean isOnHypixel() { Minecraft mc = Minecraft.getMinecraft(); @@ -211,20 +176,6 @@ public class Utils { return result; } - public static void drawOnSlot(int size, int xSlotPos, int ySlotPos, int colour) { - ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); - int guiLeft = (sr.getScaledWidth() - 176) / 2; - int guiTop = (sr.getScaledHeight() - 222) / 2; - int x = guiLeft + xSlotPos; - int y = guiTop + ySlotPos; - // Move down when chest isn't 6 rows - if (size != 90) y += (6 - (size - 36) / 9) * 9; - - GL11.glTranslated(0, 0, 1); - Gui.drawRect(x, y, x + 16, y + 16, colour); - GL11.glTranslated(0, 0, -1); - } - public static String getTimeBetween(double timeOne, double timeTwo) { double secondsBetween = Math.floor(timeTwo - timeOne); @@ -352,310 +303,6 @@ public class Utils { }); } - public static void draw3DLine(Vec3 pos1, Vec3 pos2, int colourInt, int lineWidth, boolean depth, float partialTicks) { - Entity render = Minecraft.getMinecraft().getRenderViewEntity(); - WorldRenderer worldRenderer = Tessellator.getInstance().getWorldRenderer(); - Color colour = new Color(colourInt); - - double realX = render.lastTickPosX + (render.posX - render.lastTickPosX) * partialTicks; - double realY = render.lastTickPosY + (render.posY - render.lastTickPosY) * partialTicks; - double realZ = render.lastTickPosZ + (render.posZ - render.lastTickPosZ) * partialTicks; - - GlStateManager.pushMatrix(); - GlStateManager.translate(-realX, -realY, -realZ); - GlStateManager.disableTexture2D(); - GlStateManager.enableBlend(); - GlStateManager.disableAlpha(); - GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); - GL11.glLineWidth(lineWidth); - if (!depth) { - GL11.glDisable(GL11.GL_DEPTH_TEST); - GlStateManager.depthMask(false); - } - GlStateManager.color(colour.getRed() / 255f, colour.getGreen() / 255f, colour.getBlue() / 255f, colour.getAlpha() / 255f); - worldRenderer.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION); - - worldRenderer.pos(pos1.xCoord, pos1.yCoord, pos1.zCoord).endVertex(); - worldRenderer.pos(pos2.xCoord, pos2.yCoord, pos2.zCoord).endVertex(); - Tessellator.getInstance().draw(); - - GlStateManager.translate(realX, realY, realZ); - if (!depth) { - GL11.glEnable(GL11.GL_DEPTH_TEST); - GlStateManager.depthMask(true); - } - GlStateManager.disableBlend(); - GlStateManager.enableAlpha(); - GlStateManager.enableTexture2D(); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - GlStateManager.popMatrix(); - } - - public static void draw3DString(BlockPos pos, String text, int colour, float partialTicks) { - Minecraft mc = Minecraft.getMinecraft(); - EntityPlayer player = mc.thePlayer; - double x = (pos.getX() - player.lastTickPosX) + ((pos.getX() - player.posX) - (pos.getX() - player.lastTickPosX)) * partialTicks; - double y = (pos.getY() - player.lastTickPosY) + ((pos.getY() - player.posY) - (pos.getY() - player.lastTickPosY)) * partialTicks; - double z = (pos.getZ() - player.lastTickPosZ) + ((pos.getZ() - player.posZ) - (pos.getZ() - player.lastTickPosZ)) * partialTicks; - RenderManager renderManager = mc.getRenderManager(); - - float f = 1.6F; - float f1 = 0.016666668F * f; - int width = mc.fontRendererObj.getStringWidth(text) / 2; - GlStateManager.pushMatrix(); - GlStateManager.translate(x, y, z); - GL11.glNormal3f(0f, 1f, 0f); - GlStateManager.rotate(-renderManager.playerViewY, 0f, 1f, 0f); - GlStateManager.rotate(renderManager.playerViewX, 1f, 0f, 0f); - GlStateManager.scale(-f1, -f1, -f1); - GlStateManager.enableBlend(); - GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); - mc.fontRendererObj.drawString(text, -width, 0, colour); - GlStateManager.disableBlend(); - GlStateManager.popMatrix(); - } - - // I couldnt get waypoint strings to work so in the end I just copied from NEU - // If anyone sees this please help - /*public static void draw3DWaypointString(CrystalHollowWaypoints.Waypoint waypoint, float partialTicks) { - Minecraft mc = Minecraft.getMinecraft(); - EntityPlayer player = mc.thePlayer; - BlockPos pos = waypoint.pos; - double x = (pos.getX() - player.lastTickPosX) + ((pos.getX() - player.posX) - (pos.getX() - player.lastTickPosX)) * partialTicks; - double y = (pos.getY() - player.lastTickPosY) + ((pos.getY() - player.posY) - (pos.getY() - player.lastTickPosY)) * partialTicks; - double z = (pos.getZ() - player.lastTickPosZ) + ((pos.getZ() - player.posZ) - (pos.getZ() - player.lastTickPosZ)) * partialTicks; - - double distance = player.getDistance(x, y, z); - if (distance > 12) { - x *= 12 / distance; - y *= 12 / distance; - z *= 12 / distance; - } - - RenderManager renderManager = mc.getRenderManager(); - Entity viewer = Minecraft.getMinecraft().getRenderViewEntity(); - - float f = 1.6F; - float f1 = 0.016666668F * f; - int width = mc.fontRendererObj.getStringWidth(waypoint.location) / 2; - int width2 = mc.fontRendererObj.getStringWidth(waypoint.getDistance(player)) / 2; - GlStateManager.pushMatrix(); - GlStateManager.translate(x, y, z); - GL11.glNormal3f(0f, 1f, 0f); - GlStateManager.rotate(-renderManager.playerViewY, 0f, 1f, 0f); - GlStateManager.rotate(renderManager.playerViewX, 1f, 0f, 0f); - GlStateManager.scale(-f1, -f1, -f1); - GlStateManager.enableBlend(); - GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); - GL11.glDisable(GL11.GL_DEPTH_TEST); - GlStateManager.depthMask(false); - - mc.fontRendererObj.drawString(waypoint.location, -width, 0, 0x55FFFF); - - GlStateManager.rotate(-renderManager.playerViewY, 0.0F, 1.0F, 0.0F); - GlStateManager.rotate(renderManager.playerViewX, 1.0F, 0.0F, 0.0F); - GlStateManager.translate(0, -1, 0); - GlStateManager.rotate(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F); - GlStateManager.rotate(renderManager.playerViewY, 0.0F, 1.0F, 0.0F); - - mc.fontRendererObj.drawString(waypoint.getDistance(player), -width2, 0, 0xFFFF55); - - GL11.glEnable(GL11.GL_DEPTH_TEST); - GlStateManager.depthMask(true); - GlStateManager.disableBlend(); - GlStateManager.popMatrix(); - }*/ - - // https://github.com/Moulberry/NotEnoughUpdates/blob/master/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesWaypoints.java#L261 - public static void draw3DWaypointString(CrystalHollowWaypoints.Waypoint waypoint, float partialTicks) { - GlStateManager.alphaFunc(516, 0.1F); - - GlStateManager.pushMatrix(); - - Entity viewer = Minecraft.getMinecraft().getRenderViewEntity(); - double viewerX = viewer.lastTickPosX + (viewer.posX - viewer.lastTickPosX) * partialTicks; - double viewerY = viewer.lastTickPosY + (viewer.posY - viewer.lastTickPosY) * partialTicks; - double viewerZ = viewer.lastTickPosZ + (viewer.posZ - viewer.lastTickPosZ) * partialTicks; - - double x = waypoint.pos.getX()-viewerX+0.5f; - double y = waypoint.pos.getY()-viewerY-viewer.getEyeHeight(); - double z = waypoint.pos.getZ()-viewerZ+0.5f; - - double distSq = x*x + y*y + z*z; - double dist = Math.sqrt(distSq); - if(distSq > 144) { - x *= 12/dist; - y *= 12/dist; - z *= 12/dist; - } - GlStateManager.translate(x, y, z); - GlStateManager.translate(0, viewer.getEyeHeight(), 0); - - renderNametag(EnumChatFormatting.AQUA + waypoint.location); - - GlStateManager.rotate(-Minecraft.getMinecraft().getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F); - GlStateManager.rotate(Minecraft.getMinecraft().getRenderManager().playerViewX, 1.0F, 0.0F, 0.0F); - GlStateManager.translate(0, -0.25f, 0); - GlStateManager.rotate(-Minecraft.getMinecraft().getRenderManager().playerViewX, 1.0F, 0.0F, 0.0F); - GlStateManager.rotate(Minecraft.getMinecraft().getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F); - - renderNametag(EnumChatFormatting.YELLOW + waypoint.getDistance(Minecraft.getMinecraft().thePlayer)); - - GlStateManager.popMatrix(); - - GlStateManager.disableLighting(); - } - - // https://github.com/Moulberry/NotEnoughUpdates/blob/master/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DwarvenMinesWaypoints.java#L300 - public static void renderNametag(String str) { - FontRenderer fontrenderer = Minecraft.getMinecraft().fontRendererObj; - float f = 1.6F; - float f1 = 0.016666668F * f; - GlStateManager.pushMatrix(); - GL11.glNormal3f(0.0F, 1.0F, 0.0F); - GlStateManager.rotate(-Minecraft.getMinecraft().getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F); - GlStateManager.rotate(Minecraft.getMinecraft().getRenderManager().playerViewX, 1.0F, 0.0F, 0.0F); - GlStateManager.scale(-f1, -f1, f1); - GlStateManager.disableLighting(); - GlStateManager.depthMask(false); - GlStateManager.disableDepth(); - GlStateManager.enableBlend(); - GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); - Tessellator tessellator = Tessellator.getInstance(); - WorldRenderer worldrenderer = tessellator.getWorldRenderer(); - int i = 0; - - int j = fontrenderer.getStringWidth(str) / 2; - GlStateManager.disableTexture2D(); - worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); - worldrenderer.pos(-j - 1, -1 + i, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); - worldrenderer.pos(-j - 1, 8 + i, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); - worldrenderer.pos(j + 1, 8 + i, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); - worldrenderer.pos(j + 1, -1 + i, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); - tessellator.draw(); - GlStateManager.enableTexture2D(); - fontrenderer.drawString(str, -fontrenderer.getStringWidth(str) / 2, i, 553648127); - GlStateManager.depthMask(true); - - fontrenderer.drawString(str, -fontrenderer.getStringWidth(str) / 2, i, -1); - - GlStateManager.enableDepth(); - GlStateManager.enableBlend(); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - GlStateManager.popMatrix(); - } - - public static void draw3DBox(AxisAlignedBB aabb, int colourInt, float partialTicks) { - Entity render = Minecraft.getMinecraft().getRenderViewEntity(); - Color colour = new Color(colourInt); - - double realX = render.lastTickPosX + (render.posX - render.lastTickPosX) * partialTicks; - double realY = render.lastTickPosY + (render.posY - render.lastTickPosY) * partialTicks; - double realZ = render.lastTickPosZ + (render.posZ - render.lastTickPosZ) * partialTicks; - - GlStateManager.pushMatrix(); - GlStateManager.translate(-realX, -realY, -realZ); - GlStateManager.disableTexture2D(); - GlStateManager.enableBlend(); - GlStateManager.disableAlpha(); - GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); - GL11.glLineWidth(2); - - RenderGlobal.drawOutlinedBoundingBox(aabb, colour.getRed(), colour.getGreen(), colour.getBlue(), colour.getAlpha()); - - GlStateManager.translate(realX, realY, realZ); - GlStateManager.disableBlend(); - GlStateManager.enableAlpha(); - GlStateManager.enableTexture2D(); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - GlStateManager.popMatrix(); - } - - public static void drawFilled3DBox(AxisAlignedBB aabb, int colourInt, boolean translucent, boolean depth, float partialTicks) { - Entity render = Minecraft.getMinecraft().getRenderViewEntity(); - WorldRenderer worldRenderer = Tessellator.getInstance().getWorldRenderer(); - Color colour = new Color(colourInt); - - double realX = render.lastTickPosX + (render.posX - render.lastTickPosX) * partialTicks; - double realY = render.lastTickPosY + (render.posY - render.lastTickPosY) * partialTicks; - double realZ = render.lastTickPosZ + (render.posZ - render.lastTickPosZ) * partialTicks; - - GlStateManager.pushMatrix(); - GlStateManager.pushAttrib(); - GlStateManager.translate(-realX, -realY, -realZ); - GlStateManager.disableTexture2D(); - GlStateManager.enableAlpha(); - GlStateManager.enableBlend(); - GlStateManager.disableCull(); - GlStateManager.tryBlendFuncSeparate(770, translucent ? 1 : 771, 1, 0); - if (!depth) { - GL11.glDisable(GL11.GL_DEPTH_TEST); - GlStateManager.depthMask(false); - } - GlStateManager.color(colour.getRed() / 255f, colour.getGreen() / 255f, colour.getBlue() / 255f, colour.getAlpha() / 255f); - worldRenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); - // Bottom - worldRenderer.pos(aabb.minX, aabb.minY, aabb.minZ).endVertex(); - worldRenderer.pos(aabb.maxX, aabb.minY, aabb.minZ).endVertex(); - worldRenderer.pos(aabb.maxX, aabb.minY, aabb.maxZ).endVertex(); - worldRenderer.pos(aabb.minX, aabb.minY, aabb.maxZ).endVertex(); - // Top - worldRenderer.pos(aabb.minX, aabb.maxY, aabb.minZ).endVertex(); - worldRenderer.pos(aabb.maxX, aabb.maxY, aabb.minZ).endVertex(); - worldRenderer.pos(aabb.maxX, aabb.maxY, aabb.maxZ).endVertex(); - worldRenderer.pos(aabb.minX, aabb.maxY, aabb.maxZ).endVertex(); - // West - worldRenderer.pos(aabb.minX, aabb.minY, aabb.minZ).endVertex(); - worldRenderer.pos(aabb.minX, aabb.maxY, aabb.minZ).endVertex(); - worldRenderer.pos(aabb.minX, aabb.maxY, aabb.maxZ).endVertex(); - worldRenderer.pos(aabb.minX, aabb.minY, aabb.maxZ).endVertex(); - // East - worldRenderer.pos(aabb.maxX, aabb.minY, aabb.minZ).endVertex(); - worldRenderer.pos(aabb.maxX, aabb.maxY, aabb.minZ).endVertex(); - worldRenderer.pos(aabb.maxX, aabb.maxY, aabb.maxZ).endVertex(); - worldRenderer.pos(aabb.maxX, aabb.minY, aabb.maxZ).endVertex(); - // North - worldRenderer.pos(aabb.minX, aabb.minY, aabb.minZ).endVertex(); - worldRenderer.pos(aabb.maxX, aabb.minY, aabb.minZ).endVertex(); - worldRenderer.pos(aabb.maxX, aabb.maxY, aabb.minZ).endVertex(); - worldRenderer.pos(aabb.minX, aabb.maxY, aabb.minZ).endVertex(); - // South - worldRenderer.pos(aabb.minX, aabb.minY, aabb.maxZ).endVertex(); - worldRenderer.pos(aabb.maxX, aabb.minY, aabb.maxZ).endVertex(); - worldRenderer.pos(aabb.maxX, aabb.maxY, aabb.maxZ).endVertex(); - worldRenderer.pos(aabb.minX, aabb.maxY, aabb.maxZ).endVertex(); - Tessellator.getInstance().draw(); - - GlStateManager.translate(realX, realY, realZ); - if (!depth) { - GL11.glEnable(GL11.GL_DEPTH_TEST); - GlStateManager.depthMask(true); - } - GlStateManager.enableCull(); - GlStateManager.disableAlpha(); - GlStateManager.disableBlend(); - GlStateManager.enableTexture2D(); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - GlStateManager.popAttrib(); - GlStateManager.popMatrix(); - } - - public static void renderItem(ItemStack item, float x, float y, float z) { - - GlStateManager.enableRescaleNormal(); - RenderHelper.enableGUIStandardItemLighting(); - GlStateManager.enableDepth(); - - GlStateManager.pushMatrix(); - GlStateManager.translate(x, y, z); - Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(item, 0, 0); - GlStateManager.popMatrix(); - - GlStateManager.disableDepth(); - RenderHelper.disableStandardItemLighting(); - GlStateManager.disableRescaleNormal(); - } - public static BlockPos getFirstBlockPosAfterVectors(Minecraft mc, Vec3 pos1, Vec3 pos2, int strength, int distance) { double x = pos2.xCoord - pos1.xCoord; double y = pos2.yCoord - pos1.yCoord; -- cgit From 948058741199d41b1e5e76970da28d45e166c244 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 2 Sep 2021 15:03:53 -0400 Subject: Fix slayer book tracking and add smite 7 --- src/main/java/me/Danker/commands/LootCommand.java | 2 ++ src/main/java/me/Danker/commands/ResetLootCommand.java | 1 + src/main/java/me/Danker/features/PetColours.java | 1 - src/main/java/me/Danker/features/SpiritBootsFix.java | 2 +- src/main/java/me/Danker/features/loot/LootDisplay.java | 4 ++++ .../java/me/Danker/features/loot/SpiderTracker.java | 12 ++++-------- src/main/java/me/Danker/features/loot/WolfTracker.java | 12 ++++-------- .../java/me/Danker/features/loot/ZombieTracker.java | 18 ++++++++++-------- .../features/puzzlesolvers/ChronomatronSolver.java | 1 - .../features/puzzlesolvers/UltrasequencerSolver.java | 1 - 10 files changed, 26 insertions(+), 28 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/LootCommand.java b/src/main/java/me/Danker/commands/LootCommand.java index 40b215d..e91c656 100644 --- a/src/main/java/me/Danker/commands/LootCommand.java +++ b/src/main/java/me/Danker/commands/LootCommand.java @@ -227,6 +227,7 @@ public class LootCommand extends CommandBase { EnumChatFormatting.BLUE + " Foul Flesh: " + drop20 + "\n" + EnumChatFormatting.DARK_GREEN + " Pestilence Runes: " +ZombieTracker.zombiePestilencesSession + "\n" + EnumChatFormatting.WHITE + " Smite VI Books: " + ZombieTracker.zombieBooksSession + "\n" + + EnumChatFormatting.WHITE + " Smite VII Books: " + ZombieTracker.zombieBooksT7Session + "\n" + EnumChatFormatting.AQUA + " Undead Catalysts: " + ZombieTracker.zombieUndeadCatasSession + "\n" + EnumChatFormatting.DARK_PURPLE + " Beheaded Horrors: " + ZombieTracker.zombieBeheadedsSession + "\n" + EnumChatFormatting.RED + " Revenant Catalysts: " + ZombieTracker.zombieRevCatasSession + "\n" + @@ -264,6 +265,7 @@ public class LootCommand extends CommandBase { EnumChatFormatting.BLUE + " Foul Flesh: " + drop20 + "\n" + EnumChatFormatting.DARK_GREEN + " Pestilence Runes: " + ZombieTracker.zombiePestilences + "\n" + EnumChatFormatting.WHITE + " Smite VI Books: " + ZombieTracker.zombieBooks + "\n" + + EnumChatFormatting.WHITE + " Smite VII Books: " + ZombieTracker.zombieBooksT7 + "\n" + EnumChatFormatting.AQUA + " Undead Catalysts: " + ZombieTracker.zombieUndeadCatas + "\n" + EnumChatFormatting.DARK_PURPLE + " Beheaded Horrors: " + ZombieTracker.zombieBeheadeds + "\n" + EnumChatFormatting.RED + " Revenant Catalysts: " + ZombieTracker.zombieRevCatas + "\n" + diff --git a/src/main/java/me/Danker/commands/ResetLootCommand.java b/src/main/java/me/Danker/commands/ResetLootCommand.java index 974d50c..f64ceb1 100644 --- a/src/main/java/me/Danker/commands/ResetLootCommand.java +++ b/src/main/java/me/Danker/commands/ResetLootCommand.java @@ -130,6 +130,7 @@ public class ResetLootCommand extends CommandBase { ZombieTracker.zombiePestilencesSession = 0; ZombieTracker.zombieUndeadCatasSession = 0; ZombieTracker.zombieBooksSession = 0; + ZombieTracker.zombieBooksT7Session = 0; ZombieTracker.zombieBeheadedsSession = 0; ZombieTracker.zombieRevCatasSession = 0; ZombieTracker.zombieSnakesSession = 0; diff --git a/src/main/java/me/Danker/features/PetColours.java b/src/main/java/me/Danker/features/PetColours.java index 940bb08..0e219db 100644 --- a/src/main/java/me/Danker/features/PetColours.java +++ b/src/main/java/me/Danker/features/PetColours.java @@ -3,7 +3,6 @@ package me.Danker.features; import me.Danker.commands.ToggleCommand; import me.Danker.events.GuiChestBackgroundDrawnEvent; import me.Danker.utils.RenderUtils; -import me.Danker.utils.Utils; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.util.StringUtils; diff --git a/src/main/java/me/Danker/features/SpiritBootsFix.java b/src/main/java/me/Danker/features/SpiritBootsFix.java index c50b538..8719fcf 100644 --- a/src/main/java/me/Danker/features/SpiritBootsFix.java +++ b/src/main/java/me/Danker/features/SpiritBootsFix.java @@ -11,7 +11,7 @@ import java.lang.reflect.Field; public class SpiritBootsFix { - static Field slot = ReflectionHelper.findField(S04PacketEntityEquipment.class, "equipmentSlot", "field_149392_b"); + static Field slot = ReflectionHelper.findField(S04PacketEntityEquipment.class, "equipmentSlot", "field_149392_b", "b"); @SubscribeEvent public void onPacketRead(PacketReadEvent event) throws IllegalAccessException { diff --git a/src/main/java/me/Danker/features/loot/LootDisplay.java b/src/main/java/me/Danker/features/loot/LootDisplay.java index 9f7f0e3..b1c584d 100644 --- a/src/main/java/me/Danker/features/loot/LootDisplay.java +++ b/src/main/java/me/Danker/features/loot/LootDisplay.java @@ -217,6 +217,7 @@ public class LootDisplay { EnumChatFormatting.BLUE + "Foul Flesh:\n" + EnumChatFormatting.DARK_GREEN + "Pestilence Runes:\n" + EnumChatFormatting.WHITE + "Smite VI Books:\n" + + EnumChatFormatting.WHITE + "Smite VII Books:\n" + EnumChatFormatting.AQUA + "Undead Catalysts:\n" + EnumChatFormatting.DARK_PURPLE + "Beheaded Horrors:\n" + EnumChatFormatting.RED + "Revenant Catalysts:\n" + @@ -232,6 +233,7 @@ public class LootDisplay { EnumChatFormatting.BLUE + drop20 + "\n" + EnumChatFormatting.DARK_GREEN + ZombieTracker.zombiePestilences + "\n" + EnumChatFormatting.WHITE + ZombieTracker.zombieBooks + "\n" + + EnumChatFormatting.WHITE + ZombieTracker.zombieBooksT7 + "\n" + EnumChatFormatting.AQUA + ZombieTracker.zombieUndeadCatas + "\n" + EnumChatFormatting.DARK_PURPLE + ZombieTracker.zombieBeheadeds + "\n" + EnumChatFormatting.RED + ZombieTracker.zombieRevCatas + "\n" + @@ -265,6 +267,7 @@ public class LootDisplay { EnumChatFormatting.BLUE + "Foul Flesh:\n" + EnumChatFormatting.DARK_GREEN + "Pestilence Runes:\n" + EnumChatFormatting.WHITE + "Smite VI Books:\n" + + EnumChatFormatting.WHITE + "Smite VII Books:\n" + EnumChatFormatting.AQUA + "Undead Catalysts:\n" + EnumChatFormatting.DARK_PURPLE + "Beheaded Horrors:\n" + EnumChatFormatting.RED + "Revenant Catalysts:\n" + @@ -280,6 +283,7 @@ public class LootDisplay { EnumChatFormatting.BLUE + drop20 + "\n" + EnumChatFormatting.DARK_GREEN + ZombieTracker.zombiePestilencesSession + "\n" + EnumChatFormatting.WHITE + ZombieTracker.zombieBooksSession + "\n" + + EnumChatFormatting.WHITE + ZombieTracker.zombieBooksT7Session + "\n" + EnumChatFormatting.AQUA + ZombieTracker.zombieUndeadCatasSession + "\n" + EnumChatFormatting.DARK_PURPLE + ZombieTracker.zombieBeheadedsSession + "\n" + EnumChatFormatting.RED + ZombieTracker.zombieRevCatasSession + "\n" + diff --git a/src/main/java/me/Danker/features/loot/SpiderTracker.java b/src/main/java/me/Danker/features/loot/SpiderTracker.java index e6227b2..34ee695 100644 --- a/src/main/java/me/Danker/features/loot/SpiderTracker.java +++ b/src/main/java/me/Danker/features/loot/SpiderTracker.java @@ -46,14 +46,6 @@ public class SpiderTracker { boolean rng = false; - if (message.contains("VERY RARE DROP! (Enchanted Book)") || message.contains("CRAZY RARE DROP! (Enchanted Book)")) { - if (Utils.isInScoreboard("Tarantula Broodfather")) { - spiderBooks++; - spiderBooksSession++; - ConfigHandler.writeIntConfig("spider", "book", spiderBooks); - } - } - if (message.contains(" Spider Slayer LVL ")) { // Spider spiderTarantulas++; spiderTarantulasSession++; @@ -77,6 +69,10 @@ public class SpiderTracker { spiderBites++; spiderBitesSession++; ConfigHandler.writeIntConfig("spider", "bite", spiderBites); + } else if (message.contains("VERY RARE DROP! (Bane of Arthropods VI)")) { + spiderBooks++; + spiderBooksSession++; + ConfigHandler.writeIntConfig("spider", "book", spiderBooks); } else if (message.contains("VERY RARE DROP! (Spider Catalyst)")) { spiderCatalysts++; spiderCatalystsSession++; diff --git a/src/main/java/me/Danker/features/loot/WolfTracker.java b/src/main/java/me/Danker/features/loot/WolfTracker.java index f248914..449a3b4 100644 --- a/src/main/java/me/Danker/features/loot/WolfTracker.java +++ b/src/main/java/me/Danker/features/loot/WolfTracker.java @@ -46,14 +46,6 @@ public class WolfTracker { boolean rng = false; - if (message.contains("VERY RARE DROP! (Enchanted Book)") || message.contains("CRAZY RARE DROP! (Enchanted Book)")) { - if (Utils.isInScoreboard("Sven Packmaster")) { - wolfBooks++; - wolfBooksSession++; - ConfigHandler.writeIntConfig("wolf", "book", wolfBooks); - } - } - if (message.contains(" Wolf Slayer LVL ")) { wolfSvens++; wolfSvensSession++; @@ -77,6 +69,10 @@ public class WolfTracker { wolfSpirits++; wolfSpiritsSession++; ConfigHandler.writeIntConfig("wolf", "spirit", wolfSpirits); + } else if (message.contains("VERY RARE DROP! (Critical VI)")) { + wolfBooks++; + wolfBooksSession++; + ConfigHandler.writeIntConfig("wolf", "book", wolfBooks); } else if (message.contains("CRAZY RARE DROP! (Red Claw Egg)")) { rng = true; wolfEggs++; diff --git a/src/main/java/me/Danker/features/loot/ZombieTracker.java b/src/main/java/me/Danker/features/loot/ZombieTracker.java index 5914599..1d71222 100644 --- a/src/main/java/me/Danker/features/loot/ZombieTracker.java +++ b/src/main/java/me/Danker/features/loot/ZombieTracker.java @@ -18,6 +18,7 @@ public class ZombieTracker { public static int zombiePestilences; public static int zombieUndeadCatas; public static int zombieBooks; + public static int zombieBooksT7; public static int zombieBeheadeds; public static int zombieRevCatas; public static int zombieSnakes; @@ -35,6 +36,7 @@ public class ZombieTracker { public static int zombiePestilencesSession = 0; public static int zombieUndeadCatasSession = 0; public static int zombieBooksSession = 0; + public static int zombieBooksT7Session = 0; public static int zombieBeheadedsSession = 0; public static int zombieRevCatasSession = 0; public static int zombieSnakesSession = 0; @@ -54,14 +56,6 @@ public class ZombieTracker { boolean rng = false; - if (message.contains("VERY RARE DROP! (Enchanted Book)") || message.contains("CRAZY RARE DROP! (Enchanted Book)")) { - if (Utils.isInScoreboard("Revenant Horror")) { - zombieBooks++; - zombieBooksSession++; - ConfigHandler.writeIntConfig("zombie", "book", zombieBooks); - } - } - if (message.contains(" Zombie Slayer LVL ")) { // Zombie zombieRevs++; zombieRevsSession++; @@ -94,6 +88,14 @@ public class ZombieTracker { zombiePestilences++; zombiePestilencesSession++; ConfigHandler.writeIntConfig("zombie", "pestilence", zombiePestilences); + } else if (message.contains("VERY RARE DROP! (Smite VI)")) { + zombieBooks++; + zombieBooksSession++; + ConfigHandler.writeIntConfig("zombie", "book", zombieBooks); + } else if (message.contains("VERY RARE DROP! (Smite VII)")) { + zombieBooksT7++; + zombieBooksT7Session++; + ConfigHandler.writeIntConfig("zombie", "bookT7", zombieBooksT7); } else if (message.contains("VERY RARE DROP! (Undead Catalyst)")) { zombieUndeadCatas++; zombieUndeadCatasSession++; diff --git a/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java index ed4adca..51ffd0d 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java @@ -5,7 +5,6 @@ import me.Danker.events.ChestSlotClickedEvent; import me.Danker.events.GuiChestBackgroundDrawnEvent; import me.Danker.handlers.TextRenderer; import me.Danker.utils.RenderUtils; -import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.init.Blocks; diff --git a/src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java index 6813b7f..a3a97b6 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java @@ -3,7 +3,6 @@ package me.Danker.features.puzzlesolvers; import me.Danker.commands.ToggleCommand; import me.Danker.events.GuiChestBackgroundDrawnEvent; import me.Danker.utils.RenderUtils; -import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.inventory.GuiChest; -- cgit From aa78d52025faa74568ccdb3d299c0eb51f29aa90 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 2 Sep 2021 16:24:39 -0400 Subject: Reduce memory issues with custom music --- .../me/Danker/commands/CustomMusicCommand.java | 9 +--- src/main/java/me/Danker/features/CustomMusic.java | 52 ++++++++++++---------- 2 files changed, 30 insertions(+), 31 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/CustomMusicCommand.java b/src/main/java/me/Danker/commands/CustomMusicCommand.java index c07ab45..d21d08e 100644 --- a/src/main/java/me/Danker/commands/CustomMusicCommand.java +++ b/src/main/java/me/Danker/commands/CustomMusicCommand.java @@ -63,13 +63,8 @@ public class CustomMusicCommand extends CommandBase { player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Stopped custom music.")); break; case "reload": - try { - CustomMusic.init(DankersSkyblockMod.configDirectory); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Reloaded custom music.")); - } catch (IOException | LineUnavailableException | UnsupportedAudioFileException e) { - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "An error occurred while trying to reload music.")); - e.printStackTrace(); - } + CustomMusic.init(DankersSkyblockMod.configDirectory); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Reloaded custom music.")); break; case "volume": if (arg1.length < 3) { diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java index 7309462..1f609cc 100644 --- a/src/main/java/me/Danker/features/CustomMusic.java +++ b/src/main/java/me/Danker/features/CustomMusic.java @@ -65,7 +65,7 @@ public class CustomMusic { } @SubscribeEvent(priority = EventPriority.LOW) - public void onTick(TickEvent.ClientTickEvent event) { + public void onTick(TickEvent.ClientTickEvent event) throws UnsupportedAudioFileException, LineUnavailableException, IOException { if (event.phase != TickEvent.Phase.START) return; Minecraft mc = Minecraft.getMinecraft(); @@ -135,7 +135,7 @@ public class CustomMusic { } @SubscribeEvent(receiveCanceled = true) - public void onChat(ClientChatReceivedEvent event) { + public void onChat(ClientChatReceivedEvent event) throws UnsupportedAudioFileException, LineUnavailableException, IOException { String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); if (ToggleCommand.dungeonMusic && Utils.inDungeons) { @@ -165,7 +165,7 @@ public class CustomMusic { } } - public static void init(String configDirectory) throws IOException, LineUnavailableException, UnsupportedAudioFileException { + public static void init(String configDirectory) { if (configDirectory == null) return; File directory = new File(configDirectory + "/dsmmusic"); if (!directory.exists()) directory.mkdir(); @@ -210,33 +210,30 @@ public class CustomMusic { public static class Song { public Clip music; - private final List playlist = new ArrayList<>(); + private final List playlist = new ArrayList<>(); + private int volume; - public Song(File directory, String songName, int volume) throws IOException, UnsupportedAudioFileException, LineUnavailableException { + public Song(File directory, String songName, int volume) { File[] files = directory.listFiles(); if (files != null) { for (File file : files) { if (!file.isDirectory() && file.getName().matches(songName + "\\d*(?:\\.wav)?\\.wav")) { // .wav.wav moment - Clip music = AudioSystem.getClip(); - AudioInputStream ais = AudioSystem.getAudioInputStream(file); - music.open(ais); - playlist.add(music); + playlist.add(file); System.out.println("Added " + file.getName() + " to " + songName + " playlist."); } } } - setVolume(volume); - - if (playlist.size() > 0) { - music = playlist.get(0); - } + this.volume = volume; } - public void start() { - if (music != null && !music.isRunning()) { + public void start() throws UnsupportedAudioFileException, LineUnavailableException, IOException { + + if (music == null) music = AudioSystem.getClip(); + if (!music.isRunning()) { reset(); shuffle(); + setVolume(volume); cancelNotes = true; music.setMicrosecondPosition(0); music.start(); @@ -245,14 +242,23 @@ public class CustomMusic { public void stop() { cancelNotes = false; - if (music != null) music.stop(); + if (music != null) { + music.stop(); + if (music.isOpen()) music.close(); + } } - public void shuffle() { - if (playlist.size() > 0) music = playlist.get(new Random().nextInt(playlist.size())); + public void shuffle() throws LineUnavailableException, UnsupportedAudioFileException, IOException { + if (playlist.size() > 0) { + File file = playlist.get(new Random().nextInt(playlist.size())); + music = AudioSystem.getClip(); + AudioInputStream ais = AudioSystem.getAudioInputStream(file); + music.open(ais); + } } public boolean setVolume(int volume) { + this.volume = volume; if (playlist.size() < 1) return false; if (volume <= 0 || volume > 100) { EntityPlayer player = Minecraft.getMinecraft().thePlayer; @@ -261,11 +267,9 @@ public class CustomMusic { } float decibels = (float) (20 * Math.log(volume / 100.0)); - for (Clip music : playlist) { - FloatControl control = (FloatControl) music.getControl(FloatControl.Type.MASTER_GAIN); - if (decibels <= control.getMinimum() || decibels >= control.getMaximum()) return false; - control.setValue(decibels); - } + FloatControl control = (FloatControl) music.getControl(FloatControl.Type.MASTER_GAIN); + if (decibels <= control.getMinimum() || decibels >= control.getMaximum()) return false; + control.setValue(decibels); return true; } -- cgit From 39741480a6321e49dd36f72b41d99478efe88184 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 2 Sep 2021 22:45:50 -0400 Subject: Add /inventory command Also add returns on API commands when API key is not set --- src/main/java/me/Danker/DankersSkyblockMod.java | 9 ++ .../java/me/Danker/commands/ArmourCommand.java | 1 + src/main/java/me/Danker/commands/BankCommand.java | 1 + .../java/me/Danker/commands/DungeonsCommand.java | 1 + .../java/me/Danker/commands/FairySoulsCommand.java | 1 + .../java/me/Danker/commands/GuildOfCommand.java | 1 + .../me/Danker/commands/ImportFishingCommand.java | 1 + .../java/me/Danker/commands/InventoryCommand.java | 161 +++++++++++++++++++++ src/main/java/me/Danker/commands/PetsCommand.java | 1 + .../java/me/Danker/commands/SkillsCommand.java | 1 + .../me/Danker/commands/SkyblockPlayersCommand.java | 1 + .../java/me/Danker/commands/SlayerCommand.java | 1 + 12 files changed, 180 insertions(+) create mode 100644 src/main/java/me/Danker/commands/InventoryCommand.java (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index d9da871..d1b797f 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -197,6 +197,7 @@ public class DankersSkyblockMod { ClientCommandHandler.instance.registerCommand(new GetkeyCommand()); ClientCommandHandler.instance.registerCommand(new GuildOfCommand()); ClientCommandHandler.instance.registerCommand(new ImportFishingCommand()); + ClientCommandHandler.instance.registerCommand(new InventoryCommand()); ClientCommandHandler.instance.registerCommand(new LobbyBankCommand()); ClientCommandHandler.instance.registerCommand(new LobbySkillsCommand()); ClientCommandHandler.instance.registerCommand(new LootCommand()); @@ -442,6 +443,9 @@ public class DankersSkyblockMod { case "crystalwaypoints": mc.displayGuiScreen(new CrystalHollowWaypointsGui(1)); break; + case "inventory": + mc.displayGuiScreen(InventoryCommand.chest); + break; } } guiToOpen = null; @@ -467,6 +471,11 @@ public class DankersSkyblockMod { return; // Left click, middle click or right click if (!Mouse.getEventButtonState()) return; + if (event.gui == InventoryCommand.chest) { + event.setCanceled(true); + return; + } + if (event.gui instanceof GuiChest) { Container containerChest = ((GuiChest) event.gui).inventorySlots; if (containerChest instanceof ContainerChest) { diff --git a/src/main/java/me/Danker/commands/ArmourCommand.java b/src/main/java/me/Danker/commands/ArmourCommand.java index 9b6630c..e9a20ee 100644 --- a/src/main/java/me/Danker/commands/ArmourCommand.java +++ b/src/main/java/me/Danker/commands/ArmourCommand.java @@ -67,6 +67,7 @@ public class ArmourCommand extends CommandBase { String key = ConfigHandler.getString("api", "APIKey"); if (key.equals("")) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "API key not set. Use /setkey.")); + return; } // Get UUID for Hypixel API requests diff --git a/src/main/java/me/Danker/commands/BankCommand.java b/src/main/java/me/Danker/commands/BankCommand.java index 0de6bde..e4a8eee 100644 --- a/src/main/java/me/Danker/commands/BankCommand.java +++ b/src/main/java/me/Danker/commands/BankCommand.java @@ -62,6 +62,7 @@ public class BankCommand extends CommandBase { String key = ConfigHandler.getString("api", "APIKey"); if (key.equals("")) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "API key not set. Use /setkey.")); + return; } // Get UUID for Hypixel API requests diff --git a/src/main/java/me/Danker/commands/DungeonsCommand.java b/src/main/java/me/Danker/commands/DungeonsCommand.java index 482bcd0..31df680 100644 --- a/src/main/java/me/Danker/commands/DungeonsCommand.java +++ b/src/main/java/me/Danker/commands/DungeonsCommand.java @@ -55,6 +55,7 @@ public class DungeonsCommand extends CommandBase { String key = ConfigHandler.getString("api", "APIKey"); if (key.equals("")) { player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "API key not set. Use /setkey.")); + return; } // Get UUID for Hypixel API requests diff --git a/src/main/java/me/Danker/commands/FairySoulsCommand.java b/src/main/java/me/Danker/commands/FairySoulsCommand.java index 00ac7bb..b0c67b2 100644 --- a/src/main/java/me/Danker/commands/FairySoulsCommand.java +++ b/src/main/java/me/Danker/commands/FairySoulsCommand.java @@ -52,6 +52,7 @@ public class FairySoulsCommand extends CommandBase { String key = ConfigHandler.getString("api", "APIKey"); if(key.equals("")) { player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "API key not set. Use /setkey.")); + return; } // Get UUID for Hypixel API requests diff --git a/src/main/java/me/Danker/commands/GuildOfCommand.java b/src/main/java/me/Danker/commands/GuildOfCommand.java index e9ac8ba..a97196e 100644 --- a/src/main/java/me/Danker/commands/GuildOfCommand.java +++ b/src/main/java/me/Danker/commands/GuildOfCommand.java @@ -56,6 +56,7 @@ public class GuildOfCommand extends CommandBase { String key = ConfigHandler.getString("api", "APIKey"); if (key.equals("")) { player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "API key not set. Use /setkey.")); + return; } // Get UUID for Hypixel API requests diff --git a/src/main/java/me/Danker/commands/ImportFishingCommand.java b/src/main/java/me/Danker/commands/ImportFishingCommand.java index f27aa8a..3ee5ebd 100644 --- a/src/main/java/me/Danker/commands/ImportFishingCommand.java +++ b/src/main/java/me/Danker/commands/ImportFishingCommand.java @@ -42,6 +42,7 @@ public class ImportFishingCommand extends CommandBase { String key = ConfigHandler.getString("api", "APIKey"); if (key.equals("")) { player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "API key not set. Use /setkey.")); + return; } player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Importing your fishing stats...")); diff --git a/src/main/java/me/Danker/commands/InventoryCommand.java b/src/main/java/me/Danker/commands/InventoryCommand.java new file mode 100644 index 0000000..c1f5cbf --- /dev/null +++ b/src/main/java/me/Danker/commands/InventoryCommand.java @@ -0,0 +1,161 @@ +package me.Danker.commands; + +import com.google.gson.JsonObject; +import me.Danker.DankersSkyblockMod; +import me.Danker.handlers.APIHandler; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiChest; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryBasic; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Base64; +import java.util.List; + +public class InventoryCommand extends CommandBase { + + public static GuiChest chest = null; + + @Override + public String getCommandName() { + return "inventory"; + } + + @Override + public String getCommandUsage(ICommandSender arg0) { + return "/" + getCommandName() + " [name]"; + } + + public static String usage(ICommandSender arg0) { + return new InventoryCommand().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + if (args.length == 1) { + return Utils.getMatchingPlayers(args[0]); + } + return null; + } + + @Override + public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { + // MULTI THREAD DRIFTING + new Thread(() -> { + EntityPlayer player = (EntityPlayer) arg0; + Minecraft mc = Minecraft.getMinecraft(); + + // Check key + String key = ConfigHandler.getString("api", "APIKey"); + if (key.equals("")) { + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "API key not set. Use /setkey.")); + return; + } + + // Get UUID for Hypixel API requests + String username; + String uuid; + if (arg1.length == 0) { + username = player.getName(); + uuid = player.getUniqueID().toString().replaceAll("[\\-]", ""); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking inventory of " + DankersSkyblockMod.SECONDARY_COLOUR + username)); + } else { + username = arg1[0]; + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking inventory of " + DankersSkyblockMod.SECONDARY_COLOUR + username)); + uuid = APIHandler.getUUID(username); + } + + // Find stats of latest profile + String latestProfile = APIHandler.getLatestProfileID(uuid, key); + if (latestProfile == null) return; + + String profileURL = "https://api.hypixel.net/skyblock/profile?profile=" + latestProfile + "&key=" + key; + System.out.println("Fetching profile..."); + JsonObject profileResponse = APIHandler.getResponse(profileURL, true); + if (!profileResponse.get("success").getAsBoolean()) { + String reason = profileResponse.get("cause").getAsString(); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Failed with reason: " + reason)); + return; + } + + System.out.println("Fetching inventory..."); + JsonObject userObject = profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject(); + + IInventory inventory = new InventoryBasic(username + "'s Inventory:", true, 54); + + String armourBase64 = userObject.get("inv_armor").getAsJsonObject().get("data").getAsString(); + InputStream armourStream = new ByteArrayInputStream(Base64.getDecoder().decode(armourBase64)); + + try { + // Armour + NBTTagCompound armour = CompressedStreamTools.readCompressed(armourStream); + NBTTagList armourList = armour.getTagList("i", 10); + + for (int i = 0; i < armourList.tagCount(); i++) { + NBTTagCompound item = armourList.getCompoundTagAt(i); + if (item.hasNoTags()) continue; + inventory.setInventorySlotContents(7 - i * 2, ItemStack.loadItemStackFromNBT(item)); + } + + ItemStack glass = new ItemStack(Blocks.stained_glass_pane, 1, 15); + glass.setStackDisplayName(""); + for (int i = 0; i < 18; i++) { + if (i < 8 && i % 2 == 1) continue; + inventory.setInventorySlotContents(i, glass); + } + + // Inventory + if (userObject.has("inv_contents")) { + String invBase64 = userObject.get("inv_contents").getAsJsonObject().get("data").getAsString(); + InputStream invStream = new ByteArrayInputStream(Base64.getDecoder().decode(invBase64)); + + NBTTagCompound inv = CompressedStreamTools.readCompressed(invStream); + NBTTagList invList = inv.getTagList("i", 10); + + for (int i = 0; i < invList.tagCount(); i++) { + NBTTagCompound item = invList.getCompoundTagAt(i); + if (item.hasNoTags()) continue; + inventory.setInventorySlotContents(i < 9 ? i + 45 : i + 9, ItemStack.loadItemStackFromNBT(item)); + } + } else { + ItemStack notEnabled = new ItemStack(Blocks.barrier, 1, 0); + notEnabled.setStackDisplayName(EnumChatFormatting.RED + "Inventory API not enabled."); + for (int i = 18; i < 54; i++) { + inventory.setInventorySlotContents(i, notEnabled); + } + } + } catch (IOException ex) { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "An error has occurred while reading inventory data. See logs for more info.")); + ex.printStackTrace(); + } + + chest = new GuiChest(player.inventory, inventory); + DankersSkyblockMod.guiToOpen = "inventory"; + + // mc.displayGuiScreen(new GuiChest(player.inventory, inventory)); + }).start(); + } + +} diff --git a/src/main/java/me/Danker/commands/PetsCommand.java b/src/main/java/me/Danker/commands/PetsCommand.java index f35fee4..e909fab 100644 --- a/src/main/java/me/Danker/commands/PetsCommand.java +++ b/src/main/java/me/Danker/commands/PetsCommand.java @@ -155,6 +155,7 @@ public class PetsCommand extends CommandBase { String key = ConfigHandler.getString("api", "APIKey"); if (key.equals("")) { player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "API key not set. Use /setkey.")); + return; } // Get UUID for Hypixel API requests diff --git a/src/main/java/me/Danker/commands/SkillsCommand.java b/src/main/java/me/Danker/commands/SkillsCommand.java index 533c804..f17c79d 100644 --- a/src/main/java/me/Danker/commands/SkillsCommand.java +++ b/src/main/java/me/Danker/commands/SkillsCommand.java @@ -54,6 +54,7 @@ public class SkillsCommand extends CommandBase { String key = ConfigHandler.getString("api", "APIKey"); if (key.equals("")) { player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "API key not set. Use /setkey.")); + return; } // Get UUID for Hypixel API requests diff --git a/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java b/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java index ced8906..0923b57 100644 --- a/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java +++ b/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java @@ -53,6 +53,7 @@ public class SkyblockPlayersCommand extends CommandBase { String key = ConfigHandler.getString("api", "APIKey"); if (key.equals("")) { player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "API key not set. Use /setkey.")); + return; } String playersURL = "https://api.hypixel.net/gameCounts?key=" + key; diff --git a/src/main/java/me/Danker/commands/SlayerCommand.java b/src/main/java/me/Danker/commands/SlayerCommand.java index 4d17534..5444754 100644 --- a/src/main/java/me/Danker/commands/SlayerCommand.java +++ b/src/main/java/me/Danker/commands/SlayerCommand.java @@ -62,6 +62,7 @@ public class SlayerCommand extends CommandBase { String key = ConfigHandler.getString("api", "APIKey"); if (key.equals("")) { player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "API key not set. Use /setkey.")); + return; } // Get UUID for Hypixel API requests -- cgit From 6bc2a39f06664f55e8fe2eae06ddecb38173c6b5 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 3 Sep 2021 20:04:01 -0400 Subject: Add S+ runs and rerolls to catacombs tracker --- src/main/java/me/Danker/commands/LootCommand.java | 18 +++ .../java/me/Danker/commands/ResetLootCommand.java | 9 ++ .../me/Danker/features/loot/CatacombsTracker.java | 156 ++++++++++++++++----- .../java/me/Danker/features/loot/LootDisplay.java | 92 ++++++++---- .../java/me/Danker/handlers/ConfigHandler.java | 9 ++ 5 files changed, 218 insertions(+), 66 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/LootCommand.java b/src/main/java/me/Danker/commands/LootCommand.java index e91c656..617a957 100644 --- a/src/main/java/me/Danker/commands/LootCommand.java +++ b/src/main/java/me/Danker/commands/LootCommand.java @@ -568,6 +568,7 @@ public class LootCommand extends CommandBase { if (showSession) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F1 Summary (Current Session):\n" + + EnumChatFormatting.GOLD + " S+ Runs: " + nf.format(CatacombsTracker.f1SPlusSession) + "\n" + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + EnumChatFormatting.BLUE + " Bonzo's Staffs: " + nf.format(CatacombsTracker.bonzoStaffsSession) + "\n" + @@ -578,6 +579,7 @@ public class LootCommand extends CommandBase { } player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F1 Summary:\n" + + EnumChatFormatting.GOLD + " S+ Runs: " + nf.format(CatacombsTracker.f1SPlus) + "\n" + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + EnumChatFormatting.BLUE + " Bonzo's Staffs: " + nf.format(CatacombsTracker.bonzoStaffs) + "\n" + @@ -590,6 +592,7 @@ public class LootCommand extends CommandBase { if (showSession) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F2 Summary (Current Session):\n" + + EnumChatFormatting.GOLD + " S+ Runs: " + nf.format(CatacombsTracker.f2SPlusSession) + "\n" + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + EnumChatFormatting.BLUE + " Scarf's Studies: " + nf.format(CatacombsTracker.scarfStudiesSession) + "\n" + @@ -601,6 +604,7 @@ public class LootCommand extends CommandBase { } player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F2 Summary:\n" + + EnumChatFormatting.GOLD + " S+ Runs: " + nf.format(CatacombsTracker.f2SPlus) + "\n" + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + EnumChatFormatting.BLUE + " Scarf's Studies: " + nf.format(CatacombsTracker.scarfStudies) + "\n" + @@ -614,6 +618,7 @@ public class LootCommand extends CommandBase { if (showSession) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F3 Summary (Current Session):\n" + + EnumChatFormatting.GOLD + " S+ Runs: " + nf.format(CatacombsTracker.f3SPlusSession) + "\n" + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " Adaptive Helmets: " + nf.format(CatacombsTracker.adaptiveHelmsSession) + "\n" + @@ -627,6 +632,7 @@ public class LootCommand extends CommandBase { } player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F3 Summary:\n" + + EnumChatFormatting.GOLD + " S+ Runs: " + nf.format(CatacombsTracker.f3SPlus) + "\n" + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + EnumChatFormatting.DARK_PURPLE + " Adaptive Helmets: " + nf.format(CatacombsTracker.adaptiveHelms) + "\n" + @@ -642,6 +648,7 @@ public class LootCommand extends CommandBase { if (showSession) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F4 Summary (Current Session):\n" + + EnumChatFormatting.GOLD + " S+ Runs: " + nf.format(CatacombsTracker.f4SPlusSession) + "\n" + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " Spirit Wings: " + nf.format(CatacombsTracker.spiritWingsSession) + "\n" + @@ -658,6 +665,7 @@ public class LootCommand extends CommandBase { } player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F4 Summary:\n" + + EnumChatFormatting.GOLD + " S+ Runs: " + nf.format(CatacombsTracker.f4SPlus) + "\n" + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + EnumChatFormatting.DARK_PURPLE + " Spirit Wings: " + nf.format(CatacombsTracker.spiritWings) + "\n" + @@ -676,6 +684,7 @@ public class LootCommand extends CommandBase { if (showSession) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F5 Summary (Current Session):\n" + + EnumChatFormatting.GOLD + " S+ Runs: " + nf.format(CatacombsTracker.f5SPlusSession) + "\n" + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + EnumChatFormatting.BLUE + " Warped Stones: " + nf.format(CatacombsTracker.warpedStonesSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + @@ -693,6 +702,7 @@ public class LootCommand extends CommandBase { } player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F5 Summary:\n" + + EnumChatFormatting.GOLD + " S+ Runs: " + nf.format(CatacombsTracker.f5SPlus) + "\n" + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + EnumChatFormatting.BLUE + " Warped Stones: " + nf.format(CatacombsTracker.warpedStones) + "\n" + @@ -712,6 +722,7 @@ public class LootCommand extends CommandBase { if (showSession) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F6 Summary (Current Session):\n" + + EnumChatFormatting.GOLD + " S+ Runs: " + nf.format(CatacombsTracker.f6SPlusSession) + "\n" + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + EnumChatFormatting.BLUE + " Ancient Roses: " + nf.format(CatacombsTracker.ancientRosesSession) + "\n" + @@ -722,6 +733,7 @@ public class LootCommand extends CommandBase { EnumChatFormatting.GOLD + " Necro Lord Leggings: " + nf.format(CatacombsTracker.necroLordLegsSession) + "\n" + EnumChatFormatting.GOLD + " Necro Lord Boots: " + nf.format(CatacombsTracker.necroLordBootsSession) + "\n" + EnumChatFormatting.GOLD + " Necro Swords: " + nf.format(CatacombsTracker.necroSwordsSession) + "\n" + + EnumChatFormatting.WHITE + " Rerolls: " + nf.format(CatacombsTracker.f6RerollsSession) + "\n" + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(CatacombsTracker.f6CoinsSpentSession) + "\n" + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, CatacombsTracker.f6TimeSpentSession) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); @@ -729,6 +741,7 @@ public class LootCommand extends CommandBase { } player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F6 Summary:\n" + + EnumChatFormatting.GOLD + " S+ Runs: " + nf.format(CatacombsTracker.f6SPlus) + "\n" + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + EnumChatFormatting.BLUE + " Ancient Roses: " + nf.format(CatacombsTracker.ancientRoses) + "\n" + @@ -739,6 +752,7 @@ public class LootCommand extends CommandBase { EnumChatFormatting.GOLD + " Necro Lord Leggings: " + nf.format(CatacombsTracker.necroLordLegs) + "\n" + EnumChatFormatting.GOLD + " Necro Lord Boots: " + nf.format(CatacombsTracker.necroLordBoots) + "\n" + EnumChatFormatting.GOLD + " Necro Swords: " + nf.format(CatacombsTracker.necroSwords) + "\n" + + EnumChatFormatting.WHITE + " Rerolls: " + nf.format(CatacombsTracker.f6Rerolls) + "\n" + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(CatacombsTracker.f6CoinsSpent) + "\n" + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, CatacombsTracker.f6TimeSpent) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); @@ -748,6 +762,7 @@ public class LootCommand extends CommandBase { if (showSession) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F7 Summary (Current Session):\n" + + EnumChatFormatting.GOLD + " S+ Runs: " + nf.format(CatacombsTracker.f7SPlusSession) + "\n" + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " Wither Bloods: " + nf.format(CatacombsTracker.witherBloodsSession) + "\n" + @@ -761,6 +776,7 @@ public class LootCommand extends CommandBase { EnumChatFormatting.GOLD + " Wither Chesplates: " + nf.format(CatacombsTracker.witherChestsSession) + "\n" + EnumChatFormatting.GOLD + " Wither Leggings: " + nf.format(CatacombsTracker.witherLegsSession) + "\n" + EnumChatFormatting.GOLD + " Wither Boots: " + nf.format(CatacombsTracker.witherBootsSession) + "\n" + + EnumChatFormatting.WHITE + " Rerolls: " + nf.format(CatacombsTracker.f7RerollsSession) + "\n" + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(CatacombsTracker.f7CoinsSpentSession) + "\n" + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, CatacombsTracker.f7TimeSpentSession) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); @@ -768,6 +784,7 @@ public class LootCommand extends CommandBase { } player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs F7 Summary:\n" + + EnumChatFormatting.GOLD + " S+ Runs: " + nf.format(CatacombsTracker.f7SPlus) + "\n" + EnumChatFormatting.GOLD + " Recombobulator 3000s: " + nf.format(CatacombsTracker.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + EnumChatFormatting.DARK_PURPLE + " Wither Bloods: " + nf.format(CatacombsTracker.witherBloods) + "\n" + @@ -781,6 +798,7 @@ public class LootCommand extends CommandBase { EnumChatFormatting.GOLD + " Wither Chesplates: " + nf.format(CatacombsTracker.witherChests) + "\n" + EnumChatFormatting.GOLD + " Wither Leggings: " + nf.format(CatacombsTracker.witherLegs) + "\n" + EnumChatFormatting.GOLD + " Wither Boots: " + nf.format(CatacombsTracker.witherBoots) + "\n" + + EnumChatFormatting.WHITE + " Rerolls: " + nf.format(CatacombsTracker.f7Rerolls) + "\n" + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(CatacombsTracker.f7CoinsSpent) + "\n" + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, CatacombsTracker.f7TimeSpent) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); diff --git a/src/main/java/me/Danker/commands/ResetLootCommand.java b/src/main/java/me/Danker/commands/ResetLootCommand.java index f64ceb1..2c5c947 100644 --- a/src/main/java/me/Danker/commands/ResetLootCommand.java +++ b/src/main/java/me/Danker/commands/ResetLootCommand.java @@ -260,12 +260,15 @@ public class ResetLootCommand extends CommandBase { static void resetCatacombs() { CatacombsTracker.recombobulatorsSession = 0; CatacombsTracker.fumingPotatoBooksSession = 0; + CatacombsTracker.f1SPlusSession = 0; CatacombsTracker.bonzoStaffsSession = 0; CatacombsTracker.f1CoinsSpentSession = 0; CatacombsTracker.f1TimeSpentSession = 0; + CatacombsTracker.f2SPlusSession = 0; CatacombsTracker.scarfStudiesSession = 0; CatacombsTracker.f2CoinsSpentSession = 0; CatacombsTracker.f2TimeSpentSession = 0; + CatacombsTracker.f3SPlusSession = 0; CatacombsTracker.adaptiveHelmsSession = 0; CatacombsTracker.adaptiveChestsSession = 0; CatacombsTracker.adaptiveLegsSession = 0; @@ -273,6 +276,7 @@ public class ResetLootCommand extends CommandBase { CatacombsTracker.adaptiveSwordsSession = 0; CatacombsTracker.f3CoinsSpentSession = 0; CatacombsTracker.f3TimeSpentSession = 0; + CatacombsTracker.f4SPlusSession = 0; CatacombsTracker.spiritWingsSession = 0; CatacombsTracker.spiritBonesSession = 0; CatacombsTracker.spiritBootsSession = 0; @@ -280,6 +284,7 @@ public class ResetLootCommand extends CommandBase { CatacombsTracker.epicSpiritPetsSession = 0; CatacombsTracker.f4CoinsSpentSession = 0; CatacombsTracker.f4TimeSpentSession = 0; + CatacombsTracker.f5SPlusSession = 0; CatacombsTracker.warpedStonesSession = 0; CatacombsTracker.shadowAssHelmsSession = 0; CatacombsTracker.shadowAssChestsSession = 0; @@ -289,6 +294,7 @@ public class ResetLootCommand extends CommandBase { CatacombsTracker.shadowFurysSession = 0; CatacombsTracker.f5CoinsSpentSession = 0; CatacombsTracker.f5TimeSpentSession = 0; + CatacombsTracker.f6SPlusSession = 0; CatacombsTracker.ancientRosesSession = 0; CatacombsTracker.precursorEyesSession = 0; CatacombsTracker.giantsSwordsSession = 0; @@ -297,8 +303,10 @@ public class ResetLootCommand extends CommandBase { CatacombsTracker.necroLordLegsSession = 0; CatacombsTracker.necroLordBootsSession = 0; CatacombsTracker.necroSwordsSession = 0; + CatacombsTracker.f6RerollsSession = 0; CatacombsTracker.f6CoinsSpentSession = 0; CatacombsTracker.f6TimeSpentSession = 0; + CatacombsTracker.f7SPlusSession = 0; CatacombsTracker.witherBloodsSession = 0; CatacombsTracker.witherCloaksSession = 0; CatacombsTracker.implosionsSession = 0; @@ -310,6 +318,7 @@ public class ResetLootCommand extends CommandBase { CatacombsTracker.witherChestsSession = 0; CatacombsTracker.witherLegsSession = 0; CatacombsTracker.witherBootsSession = 0; + CatacombsTracker.f7RerollsSession = 0; CatacombsTracker.f7CoinsSpentSession = 0; CatacombsTracker.f7TimeSpentSession = 0; ConfigHandler.deleteCategory("catacombs"); diff --git a/src/main/java/me/Danker/features/loot/CatacombsTracker.java b/src/main/java/me/Danker/features/loot/CatacombsTracker.java index 9de197c..a581db5 100644 --- a/src/main/java/me/Danker/features/loot/CatacombsTracker.java +++ b/src/main/java/me/Danker/features/loot/CatacombsTracker.java @@ -18,15 +18,18 @@ public class CatacombsTracker { public static int recombobulators; public static int fumingPotatoBooks; // F1 + public static int f1SPlus; public static int bonzoStaffs; public static double f1CoinsSpent; public static double f1TimeSpent; // F2 + public static int f2SPlus; public static int scarfStudies; public static int adaptiveSwords; public static double f2CoinsSpent; public static double f2TimeSpent; // F3 + public static int f3SPlus; public static int adaptiveHelms; public static int adaptiveChests; public static int adaptiveLegs; @@ -34,6 +37,7 @@ public class CatacombsTracker { public static double f3CoinsSpent; public static double f3TimeSpent; // F4 + public static int f4SPlus; public static int spiritWings; public static int spiritBones; public static int spiritBoots; @@ -44,6 +48,7 @@ public class CatacombsTracker { public static double f4CoinsSpent; public static double f4TimeSpent; // F5 + public static int f5SPlus; public static int warpedStones; public static int shadowAssHelms; public static int shadowAssChests; @@ -55,6 +60,7 @@ public class CatacombsTracker { public static double f5CoinsSpent; public static double f5TimeSpent; // F6 + public static int f6SPlus; public static int ancientRoses; public static int precursorEyes; public static int giantsSwords; @@ -63,9 +69,11 @@ public class CatacombsTracker { public static int necroLordLegs; public static int necroLordBoots; public static int necroSwords; + public static int f6Rerolls; public static double f6CoinsSpent; public static double f6TimeSpent; // F7 + public static int f7SPlus; public static int witherBloods; public static int witherCloaks; public static int implosions; @@ -77,6 +85,7 @@ public class CatacombsTracker { public static int witherChests; public static int witherLegs; public static int witherBoots; + public static int f7Rerolls; public static double f7CoinsSpent; public static double f7TimeSpent; @@ -84,15 +93,18 @@ public class CatacombsTracker { public static int recombobulatorsSession = 0; public static int fumingPotatoBooksSession = 0; // F1 + public static int f1SPlusSession = 0; public static int bonzoStaffsSession = 0; public static double f1CoinsSpentSession = 0; public static double f1TimeSpentSession = 0; // F2 + public static int f2SPlusSession = 0; public static int scarfStudiesSession = 0; public static int adaptiveSwordsSession = 0; public static double f2CoinsSpentSession = 0; public static double f2TimeSpentSession = 0; // F3 + public static int f3SPlusSession = 0; public static int adaptiveHelmsSession = 0; public static int adaptiveChestsSession = 0; public static int adaptiveLegsSession = 0; @@ -100,6 +112,7 @@ public class CatacombsTracker { public static double f3CoinsSpentSession = 0; public static double f3TimeSpentSession = 0; // F4 + public static int f4SPlusSession = 0; public static int spiritWingsSession = 0; public static int spiritBonesSession = 0; public static int spiritBootsSession = 0; @@ -110,6 +123,7 @@ public class CatacombsTracker { public static double f4CoinsSpentSession = 0; public static double f4TimeSpentSession = 0; // F5 + public static int f5SPlusSession = 0; public static int warpedStonesSession = 0; public static int shadowAssHelmsSession = 0; public static int shadowAssChestsSession = 0; @@ -121,6 +135,7 @@ public class CatacombsTracker { public static double f5CoinsSpentSession = 0; public static double f5TimeSpentSession = 0; // F6 + public static int f6SPlusSession = 0; public static int ancientRosesSession = 0; public static int precursorEyesSession = 0; public static int giantsSwordsSession = 0; @@ -129,9 +144,11 @@ public class CatacombsTracker { public static int necroLordLegsSession = 0; public static int necroLordBootsSession = 0; public static int necroSwordsSession = 0; + public static int f6RerollsSession = 0; public static double f6CoinsSpentSession = 0; public static double f6TimeSpentSession = 0; // F7 + public static int f7SPlusSession = 0; public static int witherBloodsSession = 0; public static int witherCloaksSession = 0; public static int implosionsSession = 0; @@ -143,6 +160,7 @@ public class CatacombsTracker { public static int witherChestsSession = 0; public static int witherLegsSession = 0; public static int witherBootsSession = 0; + public static int f7RerollsSession = 0; public static double f7CoinsSpentSession = 0; public static double f7TimeSpentSession = 0; @@ -152,6 +170,45 @@ public class CatacombsTracker { if (!Utils.inSkyblock) return; if (event.type == 2) return; + + if (message.contains(" Team Score: ") && message.contains("(S+)")) { + List scoreboard = ScoreboardHandler.getSidebarLines(); + for (String s : scoreboard) { + String sCleaned = ScoreboardHandler.cleanSB(s); + if (sCleaned.contains("The Catacombs (")) { + if (sCleaned.contains("F1")) { + f1SPlus++; + f1SPlusSession++; + ConfigHandler.writeDoubleConfig("catacombs", "floorOneSPlus", f1SPlus); + } else if (sCleaned.contains("F2")) { + f2SPlus++; + f2SPlusSession++; + ConfigHandler.writeDoubleConfig("catacombs", "floorTwoSPlus", f2SPlus); + } else if (sCleaned.contains("F3")) { + f3SPlus++; + f3SPlusSession++; + ConfigHandler.writeDoubleConfig("catacombs", "floorThreeSPlus", f3SPlus); + } else if (sCleaned.contains("F4")) { + f4SPlus++; + f4SPlusSession++; + ConfigHandler.writeDoubleConfig("catacombs", "floorFourSPlus", f4SPlus); + } else if (sCleaned.contains("F5")) { + f5SPlus++; + f5SPlusSession++; + ConfigHandler.writeDoubleConfig("catacombs", "floorFiveSPlus", f5SPlus); + } else if (sCleaned.contains("F6")) { + f6SPlus++; + f6SPlusSession++; + ConfigHandler.writeDoubleConfig("catacombs", "floorSixSPlus", f6SPlus); + } else if (sCleaned.contains("F7")) { + f7SPlus++; + f7SPlusSession++; + ConfigHandler.writeDoubleConfig("catacombs", "floorSevenSPlus", f7SPlus); + } + } + } + } + if (message.contains(":")) return; if (message.contains(" ")) { @@ -382,47 +439,70 @@ public class CatacombsTracker { public void onSlotClick(ChestSlotClickedEvent event) { ItemStack item = event.item; - if (event.inventoryName.endsWith(" Chest") && item != null && item.getDisplayName().contains("Open Reward Chest")) { - List tooltip = item.getTooltip(Minecraft.getMinecraft().thePlayer, Minecraft.getMinecraft().gameSettings.advancedItemTooltips); - for (String lineUnclean : tooltip) { - String line = StringUtils.stripControlCodes(lineUnclean); - if (line.contains("FREE")) { - break; - } else if (line.contains(" Coins")) { - int coinsSpent = Integer.parseInt(line.substring(0, line.indexOf(" ")).replaceAll(",", "")); + if (event.inventoryName.endsWith(" Chest") && item != null) { + if (item.getDisplayName().contains("Open Reward Chest")) { + List tooltip = item.getTooltip(Minecraft.getMinecraft().thePlayer, Minecraft.getMinecraft().gameSettings.advancedItemTooltips); + for (String lineUnclean : tooltip) { + String line = StringUtils.stripControlCodes(lineUnclean); + if (line.contains("FREE")) { + break; + } else if (line.contains(" Coins") && !line.contains("NOTE:")) { + int coinsSpent = Integer.parseInt(line.substring(0, line.indexOf(" ")).replaceAll(",", "")); - if (Utils.isInScoreboard("The Catacombs (")) { - if (Utils.isInScoreboard("F1")) { - f1CoinsSpent += coinsSpent; - f1CoinsSpentSession += coinsSpent; - ConfigHandler.writeDoubleConfig("catacombs", "floorOneCoins", f1CoinsSpent); - } else if (Utils.isInScoreboard("F2")) { - f2CoinsSpent += coinsSpent; - f2CoinsSpentSession += coinsSpent; - ConfigHandler.writeDoubleConfig("catacombs", "floorTwoCoins", f2CoinsSpent); - } else if (Utils.isInScoreboard("F3")) { - f3CoinsSpent += coinsSpent; - f3CoinsSpentSession += coinsSpent; - ConfigHandler.writeDoubleConfig("catacombs", "floorThreeCoins", f3CoinsSpent); - } else if (Utils.isInScoreboard("F4")) { - f4CoinsSpent += coinsSpent; - f4CoinsSpentSession += coinsSpent; - ConfigHandler.writeDoubleConfig("catacombs", "floorFourCoins", f4CoinsSpent); - } else if (Utils.isInScoreboard("F5")) { - f5CoinsSpent += coinsSpent; - f5CoinsSpentSession += coinsSpent; - ConfigHandler.writeDoubleConfig("catacombs", "floorFiveCoins", f5CoinsSpent); - } else if (Utils.isInScoreboard("F6")) { - f6CoinsSpent += coinsSpent; - f6CoinsSpentSession += coinsSpent; - ConfigHandler.writeDoubleConfig("catacombs", "floorSixCoins", f6CoinsSpent); - } else if (Utils.isInScoreboard("F7")) { - f7CoinsSpent += coinsSpent; - f7CoinsSpentSession += coinsSpent; - ConfigHandler.writeDoubleConfig("catacombs", "floorSevenCoins", f7CoinsSpent); + List scoreboard = ScoreboardHandler.getSidebarLines(); + for (String s : scoreboard) { + String sCleaned = ScoreboardHandler.cleanSB(s); + if (sCleaned.contains("The Catacombs (")) { + if (sCleaned.contains("F1")) { + f1CoinsSpent += coinsSpent; + f1CoinsSpentSession += coinsSpent; + ConfigHandler.writeDoubleConfig("catacombs", "floorOneCoins", f1CoinsSpent); + } else if (sCleaned.contains("F2")) { + f2CoinsSpent += coinsSpent; + f2CoinsSpentSession += coinsSpent; + ConfigHandler.writeDoubleConfig("catacombs", "floorTwoCoins", f2CoinsSpent); + } else if (sCleaned.contains("F3")) { + f3CoinsSpent += coinsSpent; + f3CoinsSpentSession += coinsSpent; + ConfigHandler.writeDoubleConfig("catacombs", "floorThreeCoins", f3CoinsSpent); + } else if (sCleaned.contains("F4")) { + f4CoinsSpent += coinsSpent; + f4CoinsSpentSession += coinsSpent; + ConfigHandler.writeDoubleConfig("catacombs", "floorFourCoins", f4CoinsSpent); + } else if (sCleaned.contains("F5")) { + f5CoinsSpent += coinsSpent; + f5CoinsSpentSession += coinsSpent; + ConfigHandler.writeDoubleConfig("catacombs", "floorFiveCoins", f5CoinsSpent); + } else if (sCleaned.contains("F6")) { + f6CoinsSpent += coinsSpent; + f6CoinsSpentSession += coinsSpent; + ConfigHandler.writeDoubleConfig("catacombs", "floorSixCoins", f6CoinsSpent); + } else if (sCleaned.contains("F7")) { + f7CoinsSpent += coinsSpent; + f7CoinsSpentSession += coinsSpent; + ConfigHandler.writeDoubleConfig("catacombs", "floorSevenCoins", f7CoinsSpent); + } + } + break; + } + } + } + } else if (item.getDisplayName().contains("Reroll Chest")) { + List scoreboard = ScoreboardHandler.getSidebarLines(); + for (String s : scoreboard) { + String sCleaned = ScoreboardHandler.cleanSB(s); + if (sCleaned.contains("The Catacombs (")) { + if (sCleaned.contains("F6")) { + f6Rerolls++; + f6RerollsSession++; + ConfigHandler.writeDoubleConfig("catacombs", "floorSixRerolls", f6Rerolls); + } else if (sCleaned.contains("F7")) { + f7Rerolls++; + f7RerollsSession++; + ConfigHandler.writeDoubleConfig("catacombs", "floorSevenRerolls", f7Rerolls); } + break; } - break; } } } diff --git a/src/main/java/me/Danker/features/loot/LootDisplay.java b/src/main/java/me/Danker/features/loot/LootDisplay.java index b1c584d..d7a5f74 100644 --- a/src/main/java/me/Danker/features/loot/LootDisplay.java +++ b/src/main/java/me/Danker/features/loot/LootDisplay.java @@ -725,37 +725,43 @@ public class LootDisplay { EnumChatFormatting.GOLD + nf.format(MythologicalTracker.minosInquisitorsSession); break; case "catacombs_floor_one": - dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + + dropsText = EnumChatFormatting.GOLD + "S+ Runs:\n" + + EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + EnumChatFormatting.BLUE + "Bonzo's Staffs:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulators) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.f1SPlus) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + EnumChatFormatting.BLUE + nf.format(CatacombsTracker.bonzoStaffs) + "\n" + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.f1CoinsSpent) + "\n" + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f1TimeSpent); break; case "catacombs_floor_one_session": - dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + + dropsText = EnumChatFormatting.GOLD + "S+ Runs:\n" + + EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + EnumChatFormatting.BLUE + "Bonzo's Staffs:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.f1SPlusSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + EnumChatFormatting.BLUE + nf.format(CatacombsTracker.bonzoStaffsSession) + "\n" + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.f1CoinsSpentSession) + "\n" + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f1TimeSpentSession); break; case "catacombs_floor_two": - dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + + dropsText = EnumChatFormatting.GOLD + "S+ Runs:\n" + + EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + EnumChatFormatting.BLUE + "Scarf's Studies:\n" + EnumChatFormatting.DARK_PURPLE + "Adaptive Blades:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulators) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.f2SPlus) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + EnumChatFormatting.BLUE + nf.format(CatacombsTracker.scarfStudies) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.adaptiveSwords) + "\n" + @@ -763,13 +769,15 @@ public class LootDisplay { EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f2TimeSpent); break; case "catacombs_floor_two_session": - dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + + dropsText = EnumChatFormatting.GOLD + "S+ Runs:\n" + + EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + EnumChatFormatting.BLUE + "Scarf's Studies:\n" + EnumChatFormatting.DARK_PURPLE + "Adaptive Blades:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.f2SPlusSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + EnumChatFormatting.BLUE + nf.format(CatacombsTracker.scarfStudiesSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.adaptiveSwordsSession) + "\n" + @@ -777,7 +785,8 @@ public class LootDisplay { EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f2TimeSpentSession); break; case "catacombs_floor_three": - dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + + dropsText = EnumChatFormatting.GOLD + "S+ Runs:\n" + + EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + EnumChatFormatting.DARK_PURPLE + "Adaptive Helmets:\n" + EnumChatFormatting.DARK_PURPLE + "Adaptive Chestplates:\n" + @@ -785,7 +794,8 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + "Adaptive Boots:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulators) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.f3SPlus) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.adaptiveHelms) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.adaptiveChests) + "\n" + @@ -795,7 +805,8 @@ public class LootDisplay { EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f3TimeSpent); break; case "catacombs_floor_three_session": - dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + + dropsText = EnumChatFormatting.GOLD + "S+ Runs:\n" + + EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + EnumChatFormatting.DARK_PURPLE + "Adaptive Helmets:\n" + EnumChatFormatting.DARK_PURPLE + "Adaptive Chestplates:\n" + @@ -803,7 +814,8 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + "Adaptive Boots:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.f3SPlusSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.adaptiveHelmsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.adaptiveChestsSession) + "\n" + @@ -813,7 +825,8 @@ public class LootDisplay { EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f3TimeSpentSession); break; case "catacombs_floor_four": - dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + + dropsText = EnumChatFormatting.GOLD + "S+ Runs:\n" + + EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + EnumChatFormatting.DARK_PURPLE + "Spirit Wings:\n" + EnumChatFormatting.DARK_PURPLE + "Spirit Bones:\n" + @@ -824,7 +837,8 @@ public class LootDisplay { EnumChatFormatting.GOLD + "Leg Spirit Pets:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulators) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.f4SPlus) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.spiritWings) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.spiritBones) + "\n" + @@ -837,7 +851,8 @@ public class LootDisplay { EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f4TimeSpent); break; case "catacombs_floor_four_session": - dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + + dropsText = EnumChatFormatting.GOLD + "S+ Runs:\n" + + EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + EnumChatFormatting.DARK_PURPLE + "Spirit Wings:\n" + EnumChatFormatting.DARK_PURPLE + "Spirit Bones:\n" + @@ -848,7 +863,8 @@ public class LootDisplay { EnumChatFormatting.GOLD + "Leg Spirit Pets:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.f4SPlusSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.spiritWingsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.spiritBonesSession) + "\n" + @@ -861,7 +877,8 @@ public class LootDisplay { EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f4TimeSpentSession); break; case "catacombs_floor_five": - dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + + dropsText = EnumChatFormatting.GOLD + "S+ Runs:\n" + + EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + EnumChatFormatting.BLUE + "Warped Stones:\n" + EnumChatFormatting.DARK_PURPLE + "Shadow Helmets:\n" + @@ -873,7 +890,8 @@ public class LootDisplay { EnumChatFormatting.GOLD + "Shadow Furys:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulators) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.f5SPlus) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + EnumChatFormatting.BLUE + nf.format(CatacombsTracker.warpedStones) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.shadowAssHelms) + "\n" + @@ -887,7 +905,8 @@ public class LootDisplay { EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f5TimeSpent); break; case "catacombs_floor_five_session": - dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + + dropsText = EnumChatFormatting.GOLD + "S+ Runs:\n" + + EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + EnumChatFormatting.BLUE + "Warped Stones:\n" + EnumChatFormatting.DARK_PURPLE + "Shadow Helmets:\n" + @@ -899,7 +918,8 @@ public class LootDisplay { EnumChatFormatting.GOLD + "Shadow Furys:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.f5SPlusSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + EnumChatFormatting.BLUE + nf.format(CatacombsTracker.warpedStonesSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.shadowAssHelmsSession) + "\n" + @@ -913,7 +933,8 @@ public class LootDisplay { EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f5TimeSpentSession); break; case "catacombs_floor_six": - dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + + dropsText = EnumChatFormatting.GOLD + "S+ Runs:\n" + + EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + EnumChatFormatting.BLUE + "Ancient Roses:\n" + EnumChatFormatting.GOLD + "Precursor Eyes:\n" + @@ -923,9 +944,11 @@ public class LootDisplay { EnumChatFormatting.GOLD + "Necro Lord Leggings:\n" + EnumChatFormatting.GOLD + "Necro Lord Boots:\n" + EnumChatFormatting.GOLD + "Necro Swords:\n" + + EnumChatFormatting.WHITE + "Rerolls:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulators) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.f6SPlus) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + EnumChatFormatting.BLUE + nf.format(CatacombsTracker.ancientRoses) + "\n" + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.precursorEyes) + "\n" + @@ -935,11 +958,13 @@ public class LootDisplay { EnumChatFormatting.GOLD + nf.format(CatacombsTracker.necroLordLegs) + "\n" + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.necroLordBoots) + "\n" + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.necroSwords) + "\n" + + EnumChatFormatting.WHITE + nf.format(CatacombsTracker.f6Rerolls) + "\n" + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.f6CoinsSpent) + "\n" + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f6TimeSpent); break; case "catacombs_floor_six_session": - dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + + dropsText = EnumChatFormatting.GOLD + "S+ Runs:\n" + + EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + EnumChatFormatting.BLUE + "Ancient Roses:\n" + EnumChatFormatting.GOLD + "Precursor Eyes:\n" + @@ -949,9 +974,11 @@ public class LootDisplay { EnumChatFormatting.GOLD + "Necro Lord Leggings:\n" + EnumChatFormatting.GOLD + "Necro Lord Boots:\n" + EnumChatFormatting.GOLD + "Necro Swords:\n" + + EnumChatFormatting.WHITE + "Rerolls:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.f6SPlusSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + EnumChatFormatting.BLUE + nf.format(CatacombsTracker.ancientRosesSession) + "\n" + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.precursorEyesSession) + "\n" + @@ -961,11 +988,13 @@ public class LootDisplay { EnumChatFormatting.GOLD + nf.format(CatacombsTracker.necroLordLegsSession) + "\n" + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.necroLordBootsSession) + "\n" + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.necroSwordsSession) + "\n" + + EnumChatFormatting.WHITE + nf.format(CatacombsTracker.f6RerollsSession) + "\n" + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.f6CoinsSpentSession) + "\n" + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f6TimeSpentSession); break; case "catacombs_floor_seven": - dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + + dropsText = EnumChatFormatting.GOLD + "S+ Runs:\n" + + EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + EnumChatFormatting.DARK_PURPLE + "Wither Bloods:\n" + EnumChatFormatting.DARK_PURPLE + "Wither Cloaks:\n" + @@ -978,9 +1007,11 @@ public class LootDisplay { EnumChatFormatting.GOLD + "Wither Chests:\n" + EnumChatFormatting.GOLD + "Wither Leggings:\n" + EnumChatFormatting.GOLD + "Wither Boots:\n" + + EnumChatFormatting.WHITE + "Rerolls:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulators) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.f7SPlus) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.witherBloods) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.witherCloaks) + "\n" + @@ -993,11 +1024,13 @@ public class LootDisplay { EnumChatFormatting.GOLD + nf.format(CatacombsTracker.witherChests) + "\n" + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.witherLegs) + "\n" + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.witherBoots) + "\n" + + EnumChatFormatting.WHITE + nf.format(CatacombsTracker.f7Rerolls) + "\n" + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.f7CoinsSpent) + "\n" + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f7TimeSpent); break; case "catacombs_floor_seven_session": - dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + + dropsText = EnumChatFormatting.GOLD + "S+ Runs:\n" + + EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + EnumChatFormatting.DARK_PURPLE + "Wither Bloods:\n" + EnumChatFormatting.DARK_PURPLE + "Wither Cloaks:\n" + @@ -1010,9 +1043,11 @@ public class LootDisplay { EnumChatFormatting.GOLD + "Wither Chests:\n" + EnumChatFormatting.GOLD + "Wither Leggings:\n" + EnumChatFormatting.GOLD + "Wither Boots:\n" + + EnumChatFormatting.WHITE + "Rerolls:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.f7SPlusSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.witherBloodsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.witherCloaksSession) + "\n" + @@ -1025,6 +1060,7 @@ public class LootDisplay { EnumChatFormatting.GOLD + nf.format(CatacombsTracker.witherChestsSession) + "\n" + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.witherLegsSession) + "\n" + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.witherBootsSession) + "\n" + + EnumChatFormatting.WHITE + nf.format(CatacombsTracker.f7RerollsSession) + "\n" + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.f7CoinsSpentSession) + "\n" + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f7TimeSpentSession); break; diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 6655d43..5323202 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -416,14 +416,17 @@ public class ConfigHandler { CatacombsTracker.recombobulators = initInt("catacombs", "recombobulator", 0); CatacombsTracker.fumingPotatoBooks = initInt("catacombs", "fumingBooks", 0); // F1 + CatacombsTracker.f1SPlus = initInt("catacombs", "floorOneSPlus", 0); CatacombsTracker.bonzoStaffs = initInt("catacombs", "bonzoStaff", 0); CatacombsTracker.f1CoinsSpent = initDouble("catacombs", "floorOneCoins", 0); CatacombsTracker.f1TimeSpent = initDouble("catacombs", "floorOneTime", 0); // F2 + CatacombsTracker.f2SPlus = initInt("catacombs", "floorTwoSPlus", 0); CatacombsTracker.scarfStudies = initInt("catacombs", "scarfStudies", 0); CatacombsTracker.f2CoinsSpent = initDouble("catacombs", "floorTwoCoins", 0); CatacombsTracker.f2TimeSpent = initDouble("catacombs", "floorTwoTime", 0); // F3 + CatacombsTracker.f3SPlus = initInt("catacombs", "floorThreeSPlus", 0); CatacombsTracker.adaptiveHelms = initInt("catacombs", "adaptiveHelm", 0); CatacombsTracker.adaptiveChests = initInt("catacombs", "adaptiveChest", 0); CatacombsTracker.adaptiveLegs = initInt("catacombs", "adaptiveLegging", 0); @@ -432,6 +435,7 @@ public class ConfigHandler { CatacombsTracker.f3CoinsSpent = initDouble("catacombs", "floorThreeCoins", 0); CatacombsTracker.f3TimeSpent = initDouble("catacombs", "floorThreeTime", 0); // F4 + CatacombsTracker.f4SPlus = initInt("catacombs", "floorFourSPlus", 0); CatacombsTracker.spiritWings = initInt("catacombs", "spiritWing", 0); CatacombsTracker.spiritBones = initInt("catacombs", "spiritBone", 0); CatacombsTracker.spiritBoots = initInt("catacombs", "spiritBoot", 0); @@ -442,6 +446,7 @@ public class ConfigHandler { CatacombsTracker.f4CoinsSpent = initDouble("catacombs", "floorFourCoins", 0); CatacombsTracker.f4TimeSpent = initDouble("catacombs", "floorFourTime", 0); // F5 + CatacombsTracker.f5SPlus = initInt("catacombs", "floorFiveSPlus", 0); CatacombsTracker.warpedStones = initInt("catacombs", "warpedStone", 0); CatacombsTracker.shadowAssHelms = initInt("catacombs", "shadowAssassinHelm", 0); CatacombsTracker.shadowAssChests = initInt("catacombs", "shadowAssassinChest", 0); @@ -453,6 +458,7 @@ public class ConfigHandler { CatacombsTracker.f5CoinsSpent = initDouble("catacombs", "floorFiveCoins", 0); CatacombsTracker.f5TimeSpent = initDouble("catacombs", "floorFiveTime", 0); // F6 + CatacombsTracker.f6SPlus = initInt("catacombs", "floorSixSPlus", 0); CatacombsTracker.ancientRoses = initInt("catacombs", "ancientRose", 0); CatacombsTracker.precursorEyes = initInt("catacombs", "precursorEye", 0); CatacombsTracker.giantsSwords = initInt("catacombs", "giantsSword", 0); @@ -461,9 +467,11 @@ public class ConfigHandler { CatacombsTracker.necroLordLegs = initInt("catacombs", "necroLordLegging", 0); CatacombsTracker.necroLordBoots = initInt("catacombs", "necroLordBoot", 0); CatacombsTracker.necroSwords = initInt("catacombs", "necroSword", 0); + CatacombsTracker.f6Rerolls = initInt("catacombs", "floorSixRerolls", 0); CatacombsTracker.f6CoinsSpent = initDouble("catacombs", "floorSixCoins", 0); CatacombsTracker.f6TimeSpent = initDouble("catacombs", "floorSixTime", 0); // F7 + CatacombsTracker.f7SPlus = initInt("catacombs", "floorSevenSPlus", 0); CatacombsTracker.witherBloods = initInt("catacombs", "witherBlood", 0); CatacombsTracker.witherCloaks = initInt("catacombs", "witherCloak", 0); CatacombsTracker.implosions = initInt("catacombs", "implosion", 0); @@ -475,6 +483,7 @@ public class ConfigHandler { CatacombsTracker.witherChests = initInt("catacombs", "witherChest", 0); CatacombsTracker.witherLegs = initInt("catacombs", "witherLegging", 0); CatacombsTracker.witherBoots = initInt("catacombs", "witherBoot", 0); + CatacombsTracker.f7Rerolls = initInt("catacombs", "floorSevenRerolls", 0); CatacombsTracker.f7CoinsSpent = initDouble("catacombs", "floorSevenCoins", 0); CatacombsTracker.f7TimeSpent = initDouble("catacombs", "floorSevenTime", 0); -- cgit From 0707ac473037146819c5a43c808b6ee41f014a63 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Mon, 6 Sep 2021 22:16:11 -0400 Subject: Add ability cooldown display --- README.md | 5 +- src/main/java/me/Danker/DankersSkyblockMod.java | 1 + .../java/me/Danker/commands/DankerGuiCommand.java | 6 ++ src/main/java/me/Danker/commands/MoveCommand.java | 13 +++- src/main/java/me/Danker/commands/ScaleCommand.java | 11 ++- .../java/me/Danker/commands/ToggleCommand.java | 11 ++- .../java/me/Danker/features/AbilityCooldowns.java | 81 ++++++++++++++++++++++ .../features/puzzlesolvers/TeleportPadSolver.java | 45 ++++++++++++ src/main/java/me/Danker/gui/DankerGui.java | 13 +++- src/main/java/me/Danker/gui/EditLocationsGui.java | 16 +++++ .../java/me/Danker/handlers/ConfigHandler.java | 8 ++- src/main/java/me/Danker/utils/Utils.java | 42 +++++++++++ 12 files changed, 239 insertions(+), 13 deletions(-) create mode 100644 src/main/java/me/Danker/features/AbilityCooldowns.java create mode 100644 src/main/java/me/Danker/features/puzzlesolvers/TeleportPadSolver.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 69c7aaf..4efae05 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ Discord Server: https://discord.gg/QsEkNQS - Hide pet candy in pet tooltip - Custom name colors - Crystal Hollows waypoints (with SkyblockExtras support) +- Ability cooldowns display ## Commands - /dhelp - Returns this message in-game. @@ -69,8 +70,8 @@ Discord Server: https://discord.gg/QsEkNQS - /loot [winter/festival/spooky/f(1-7)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. - /display [winter/festival/spooky/f(1-7)/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active. - /resetloot - - Resets loot for trackers. /resetloot confirm confirms the reset. -- /move - Moves text display to specified X and Y coordinates. -- /scale - Scales text display to a specified multipler between 0.1x and 10x. +- /move - Moves text display to specified X and Y coordinates. +- /scale - Scales text display to a specified multipler between 0.1x and 10x. - /slayer [player] - Uses API to get slayer xp of a person. If no name is provided, it checks yours. - /skill [player] - Uses API to get skill levels of a person. If no name is provided, it checks yours. - /lobbyskills - Uses API to find the average skills of the lobby, as well the three players with the highest skill average. diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index d1b797f..b0e0de0 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -127,6 +127,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new HideTooltipsInExperiments()); MinecraftForge.EVENT_BUS.register(new HighlightSkeletonMasters()); MinecraftForge.EVENT_BUS.register(new IceWalkSolver()); + MinecraftForge.EVENT_BUS.register(new AbilityCooldowns()); MinecraftForge.EVENT_BUS.register(new LividSolver()); MinecraftForge.EVENT_BUS.register(new LowHealthNotifications()); MinecraftForge.EVENT_BUS.register(new NecronNotifications()); diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index d6b92eb..0f3b527 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -110,6 +110,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[crystalhollowwaypoints][").append(ToggleCommand.crystalHollowWaypoints).append("]\n"); debug.append("[crystalautowaypoints][").append(ToggleCommand.crystalAutoWaypoints).append("]\n"); debug.append("[autoacceptreparty][").append(ToggleCommand.autoAcceptReparty).append("]\n"); + debug.append("[abilitycooldowns][").append(ToggleCommand.abilityCooldowns).append("]\n"); debug.append("[dungeonbossmusic][").append(ToggleCommand.dungeonBossMusic).append("]\n"); debug.append("[bloodroommusic][").append(ToggleCommand.bloodRoomMusic).append("]\n"); debug.append("[dungeonmusic][").append(ToggleCommand.dungeonMusic).append("]\n"); @@ -122,6 +123,11 @@ public class DankerGuiCommand extends CommandBase { debug.append("[caketimer][").append(MoveCommand.cakeTimerXY[0]).append(", ").append(MoveCommand.cakeTimerXY[1]).append("]\n"); debug.append("[skilltracker][").append(MoveCommand.skillTrackerXY[0]).append(", ").append(MoveCommand.skillTrackerXY[1]).append("]\n"); debug.append("[wateranswer][").append(MoveCommand.waterAnswerXY[0]).append(", ").append(MoveCommand.waterAnswerXY[1]).append("]\n"); + debug.append("[bonzotimer][").append(MoveCommand.bonzoTimerXY[0]).append(", ").append(MoveCommand.bonzoTimerXY[1]).append("]\n"); + debug.append("[golemtimer][").append(MoveCommand.golemTimerXY[0]).append(", ").append(MoveCommand.golemTimerXY[1]).append("]\n"); + debug.append("[teammatesinradius][").append(MoveCommand.teammatesInRadiusXY[0]).append(", ").append(MoveCommand.teammatesInRadiusXY[1]).append("]\n"); + debug.append("[gianthp][").append(MoveCommand.giantHPXY[0]).append(", ").append(MoveCommand.giantHPXY[1]).append("]\n"); + debug.append("[abilitycooldowns][").append(MoveCommand.abilityCooldownsXY[0]).append(", ").append(MoveCommand.abilityCooldownsXY[1]).append("]\n"); debug.append("# Other Settings\n"); debug.append("[Current Display][").append(LootDisplay.display).append("]\n"); debug.append("[Auto Display][").append(LootDisplay.auto).append("]\n"); diff --git a/src/main/java/me/Danker/commands/MoveCommand.java b/src/main/java/me/Danker/commands/MoveCommand.java index b17794c..a43d09b 100644 --- a/src/main/java/me/Danker/commands/MoveCommand.java +++ b/src/main/java/me/Danker/commands/MoveCommand.java @@ -25,6 +25,7 @@ public class MoveCommand extends CommandBase { public static int[] golemTimerXY = {0 ,0}; public static int[] teammatesInRadiusXY = {0, 0}; public static int[] giantHPXY = {0, 0}; + public static int[] abilityCooldownsXY = {0, 0}; @Override public String getCommandName() { @@ -33,7 +34,8 @@ public class MoveCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " "; + return "/" + getCommandName() + " "; } public static String usage(ICommandSender arg0) { @@ -50,7 +52,7 @@ public class MoveCommand extends CommandBase { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", "skilltracker", "wateranswer", "bonzotimer", "golemtimer", "teammatesinradius", - "gianthp"); + "gianthp", "abilitycooldowns"); } return null; } @@ -149,6 +151,13 @@ public class MoveCommand extends CommandBase { ConfigHandler.writeIntConfig("locations", "giantHPY", giantHPXY[1]); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Giant HP has been moved to " + DankersSkyblockMod.SECONDARY_COLOUR + arg1[1] + ", " + arg1[2])); break; + case "abilitycooldowns": + abilityCooldownsXY[0] = Integer.parseInt(arg1[1]); + abilityCooldownsXY[1] = Integer.parseInt(arg1[2]); + ConfigHandler.writeIntConfig("locations", "abilityCooldownsX", abilityCooldownsXY[0]); + ConfigHandler.writeIntConfig("locations", "abilityCooldownsY", abilityCooldownsXY[1]); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Ability cooldowns has been moved to " + DankersSkyblockMod.SECONDARY_COLOUR + arg1[1] + ", " + arg1[2])); + break; default: player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); } diff --git a/src/main/java/me/Danker/commands/ScaleCommand.java b/src/main/java/me/Danker/commands/ScaleCommand.java index def0e57..b38d57e 100644 --- a/src/main/java/me/Danker/commands/ScaleCommand.java +++ b/src/main/java/me/Danker/commands/ScaleCommand.java @@ -25,6 +25,7 @@ public class ScaleCommand extends CommandBase { public static double golemTimerScale; public static double teammatesInRadiusScale; public static double giantHPScale; + public static double abilityCooldownsScale; @Override public String getCommandName() { @@ -33,7 +34,8 @@ public class ScaleCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " "; + return "/" + getCommandName() + " "; } public static String usage(ICommandSender arg0) { @@ -50,7 +52,7 @@ public class ScaleCommand extends CommandBase { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", "skilltracker", "wateranswer", "bonzotimer", "golemtimer", "teammatesinradius", - "gianthp"); + "gianthp", "abilitycooldowns"); } return null; } @@ -131,6 +133,11 @@ public class ScaleCommand extends CommandBase { ConfigHandler.writeDoubleConfig("scales", "giantHPScale", giantHPScale); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Giant hp has been scaled to " + DankersSkyblockMod.SECONDARY_COLOUR + giantHPScale + "x")); break; + case "abilitycooldowns": + abilityCooldownsScale = scaleAmount; + ConfigHandler.writeDoubleConfig("scales", "abilityCooldownsScale", abilityCooldownsScale); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Ability cooldowns has been scaled to " + DankersSkyblockMod.SECONDARY_COLOUR + abilityCooldownsScale + "x")); + break; default: player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); } diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 7d1020a..0255915 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -45,6 +45,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean crystalHollowWaypoints; public static boolean crystalAutoWaypoints; public static boolean autoAcceptReparty; + public static boolean abilityCooldowns; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; @@ -118,7 +119,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/" + "melodytooltips/highlightslayers/highlightarachne/highlightskeletonmasters/teammatesinradius/" + "gianthp/hidepetcandy/customcolorednames/endoffarmalert/gemstonelore/crystalhollowwaypoints/crystalautowaypoints/" + - "autoacceptreparty/dungeonbossmusic/bloodroommusic/dungeonmusic/hubmusic/islandmusic/dungeonhubmusic/" + + "autoacceptreparty/abilitycooldowns/dungeonbossmusic/bloodroommusic/dungeonmusic/hubmusic/islandmusic/dungeonhubmusic/" + "farmingislandsmusic/goldminemusic/deepcavernsmusic/crystalhollowsmusic/spidersdenmusic/blazingfortressmusic/endmusic/" + "parkmusic/list>"; } @@ -151,7 +152,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "highlightskeletonmasters", "dungeonbossmusic", "bloodroommusic", "dungeonmusic", "teammatesinradius", "gianthp", "hidepetcandy", "customcolorednames", "endoffarmalert", "gemstonelore", "crystalhollowwaypoints", "crystalautowaypoints", "autoacceptreparty", - "hubmusic", "islandmusic", "dungeonhubmusic", "farmingislandsmusic", "goldminemusic", + "itemcooldowns", "hubmusic", "islandmusic", "dungeonhubmusic", "farmingislandsmusic", "goldminemusic", "deepcavernsmusic", "dwarvenminesmusic", "crystalhollowsmusic", "spidersdenmusic", "blazingfortressmusic", "endmusic", "parkmusic", "list"); } @@ -485,6 +486,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "AutoAcceptReparty", autoAcceptReparty); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Auto accept reparty has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + autoAcceptReparty + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "abilitycooldowns": + abilityCooldowns = !abilityCooldowns; + ConfigHandler.writeBooleanConfig("toggles", "AbilityCooldowns", abilityCooldowns); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Ability cooldowns display as been set to " + DankersSkyblockMod.SECONDARY_COLOUR + abilityCooldowns + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "dungeonbossmusic": dungeonBossMusic = !dungeonBossMusic; CustomMusic.dungeonboss.stop(); @@ -631,6 +637,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Crystal Hollows waypoints: " + DankersSkyblockMod.VALUE_COLOUR + crystalHollowWaypoints + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Auto Crystal Hollows waypoints: " + DankersSkyblockMod.VALUE_COLOUR + crystalAutoWaypoints + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Auto accept reparty: " + DankersSkyblockMod.VALUE_COLOUR + autoAcceptReparty + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Ability cooldown display: " + DankersSkyblockMod.VALUE_COLOUR + abilityCooldowns + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon boss music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonBossMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom blood room music: " + DankersSkyblockMod.VALUE_COLOUR + bloodRoomMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonMusic + "\n" + diff --git a/src/main/java/me/Danker/features/AbilityCooldowns.java b/src/main/java/me/Danker/features/AbilityCooldowns.java new file mode 100644 index 0000000..ed6767e --- /dev/null +++ b/src/main/java/me/Danker/features/AbilityCooldowns.java @@ -0,0 +1,81 @@ +package me.Danker.features; + +import me.Danker.commands.MoveCommand; +import me.Danker.commands.ScaleCommand; +import me.Danker.events.RenderOverlayEvent; +import me.Danker.handlers.TextRenderer; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StringUtils; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.util.ArrayList; +import java.util.List; + +public class AbilityCooldowns { + + List cooldowns = new ArrayList<>(); + + @SubscribeEvent(priority = EventPriority.LOW) + public void onChat(ClientChatReceivedEvent event) { + if (!Utils.inSkyblock || event.type != 2) return; + + String[] actionBarSections = StringUtils.stripControlCodes(event.message.getUnformattedText()).split(" {3,}"); + + for (String section : actionBarSections) { + if (section.charAt(0) == '-' && section.contains("(") && section.charAt(section.length() - 1) == ')') { + String ability = section.substring(section.indexOf("(") + 1, section.length() - 1); + + for (Ability cooldown : cooldowns) { + if (cooldown.ability.equals(ability)) return; + } + + cooldowns.add(new Ability(ability, Utils.getCooldownFromAbility(ability))); + } + } + } + + @SubscribeEvent + public void renderPlayerInfo(RenderOverlayEvent event) { + if (Utils.inSkyblock) { + StringBuilder sb = new StringBuilder(); + + for (int i = cooldowns.size() - 1; i >= 0; i--) { + Ability ability = cooldowns.get(i); + + if (ability.getCooldown() <= 0) { + cooldowns.remove(i); + continue; + } + + sb.insert(0, ability.getTimer() + "\n"); + } + + new TextRenderer(Minecraft.getMinecraft(), sb.toString(), MoveCommand.abilityCooldownsXY[0], MoveCommand.abilityCooldownsXY[1], ScaleCommand.abilityCooldownsScale); + } + } + + public static class Ability { + + public final String ability; + private final long cooldown; + + public Ability(String ability, int cooldown) { + this.ability = ability; + this.cooldown = System.currentTimeMillis() + cooldown * 1000L; + } + + public String getTimer() { + return EnumChatFormatting.GREEN + ability + ": " + EnumChatFormatting.YELLOW + getCooldown() + "s"; + } + + public double getCooldown() { + return (cooldown - System.currentTimeMillis()) / 1000D; + } + + } + +} diff --git a/src/main/java/me/Danker/features/puzzlesolvers/TeleportPadSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/TeleportPadSolver.java new file mode 100644 index 0000000..8e03671 --- /dev/null +++ b/src/main/java/me/Danker/features/puzzlesolvers/TeleportPadSolver.java @@ -0,0 +1,45 @@ +package me.Danker.features.puzzlesolvers; + +import me.Danker.DankersSkyblockMod; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + +import java.util.ArrayList; +import java.util.List; + +public class TeleportPadSolver { + + static List usedPads = new ArrayList<>(); + static BlockPos finalPad = null; + + @SubscribeEvent + public void onWorldChange(WorldEvent.Load event) { + usedPads.clear(); + finalPad = null; + } + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + if (event.phase != TickEvent.Phase.START) return; + + Minecraft mc = Minecraft.getMinecraft(); + EntityPlayerSP player = mc.thePlayer; + World world = mc.theWorld; + + if (DankersSkyblockMod.tickAmount % 20 == 0) { + + } + } + + @SubscribeEvent + public void onWorldRender(RenderWorldLastEvent event) { + + } + +} diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index f2d3bf3..7f407a6 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -23,9 +23,9 @@ import java.util.List; public class DankerGui extends GuiScreen { - private int page; - private List allButtons = new ArrayList<>(); - private List foundButtons = new ArrayList<>(); + private final int page; + private final List allButtons = new ArrayList<>(); + private final List foundButtons = new ArrayList<>(); String initSearchText; private GuiButton closeGUI; @@ -71,6 +71,7 @@ public class DankerGui extends GuiScreen { private GuiButton endOfFarmAlert; private GuiButton gemstoneLore; private GuiButton autoAcceptReparty; + private GuiButton abilityCooldown; // Chat Messages private GuiButton sceptreMessages; private GuiButton midasStaffMessages; @@ -163,6 +164,7 @@ public class DankerGui extends GuiScreen { endOfFarmAlert = new FeatureButton("Alert When Reaching End of Farm: " + Utils.getColouredBoolean(ToggleCommand.endOfFarmAlert), "Alerts when you go past coords set with /dsmfarmlength."); gemstoneLore = new FeatureButton("Applied Gemstones in Lore: " + Utils.getColouredBoolean(ToggleCommand.gemstoneLore), "Adds applied gemstones to item tooltip."); autoAcceptReparty = new FeatureButton("Auto Accept Reparty: " + Utils.getColouredBoolean(ToggleCommand.autoAcceptReparty), "Automatically rejoins parties when disbanded and invited."); + abilityCooldown = new FeatureButton("Ability Cooldowns: " + Utils.getColouredBoolean(ToggleCommand.abilityCooldowns), "Displays ability cooldowns."); allButtons.clear(); allButtons.add(changeDisplay); @@ -213,6 +215,7 @@ public class DankerGui extends GuiScreen { allButtons.add(endOfFarmAlert); allButtons.add(gemstoneLore); allButtons.add(autoAcceptReparty); + allButtons.add(abilityCooldown); search.setText(initSearchText); search.setVisible(true); @@ -473,6 +476,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.autoAcceptReparty = !ToggleCommand.autoAcceptReparty; ConfigHandler.writeBooleanConfig("toggles", "AutoAcceptReparty", ToggleCommand.autoAcceptReparty); autoAcceptReparty.displayString = "Auto Accept Reparty: " + Utils.getColouredBoolean(ToggleCommand.autoAcceptReparty); + } else if (button == abilityCooldown) { + ToggleCommand.abilityCooldowns = !ToggleCommand.abilityCooldowns; + ConfigHandler.writeBooleanConfig("toggles", "AbilityCooldowns", ToggleCommand.abilityCooldowns); + abilityCooldown.displayString = "Ability Cooldowns: " + Utils.getColouredBoolean(ToggleCommand.abilityCooldowns); } } diff --git a/src/main/java/me/Danker/gui/EditLocationsGui.java b/src/main/java/me/Danker/gui/EditLocationsGui.java index fed6ee9..e24de8b 100644 --- a/src/main/java/me/Danker/gui/EditLocationsGui.java +++ b/src/main/java/me/Danker/gui/EditLocationsGui.java @@ -31,6 +31,7 @@ public class EditLocationsGui extends GuiScreen { private LocationButton golemTimer; private LocationButton teammatesInRadius; private LocationButton giantHP; + private LocationButton abilityCooldown; @Override public boolean doesGuiPauseGame() { @@ -99,6 +100,9 @@ public class EditLocationsGui extends GuiScreen { EnumChatFormatting.LIGHT_PURPLE + "Jolly Pink Giant " + EnumChatFormatting.GREEN + "25M" + EnumChatFormatting.RED + "❤\n" + EnumChatFormatting.DARK_AQUA + "The Diamond Giant " + EnumChatFormatting.GREEN + "25M" + EnumChatFormatting.RED + "❤"; + String abilityCooldownText = EnumChatFormatting.GREEN + "Spirit Glide: " + EnumChatFormatting.YELLOW + "32.734s\n" + + EnumChatFormatting.GREEN + "Parley: " + EnumChatFormatting.YELLOW + "2.652s\n" + + EnumChatFormatting.GREEN + "Ice Spray: " + EnumChatFormatting.YELLOW + "1.429s"; display = new LocationButton(MoveCommand.displayXY[0], MoveCommand.displayXY[1], ScaleCommand.displayScale, displayText, displayNums, 110); dungeonTimer = new LocationButton(MoveCommand.dungeonTimerXY[0], MoveCommand.dungeonTimerXY[1], ScaleCommand.dungeonTimerScale, dungeonTimerText, dungeonTimerNums, 80); @@ -112,6 +116,7 @@ public class EditLocationsGui extends GuiScreen { golemTimer = new LocationButton(MoveCommand.golemTimerXY[0], MoveCommand.golemTimerXY[1] + 5, ScaleCommand.golemTimerScale, GolemSpawningAlert.GOLEM_COLOUR + " 20s", null, null); teammatesInRadius = new LocationButton(MoveCommand.teammatesInRadiusXY[0], MoveCommand.teammatesInRadiusXY[1], ScaleCommand.teammatesInRadiusScale, teammatesInRadiusText, null, null); giantHP = new LocationButton(MoveCommand.giantHPXY[0], MoveCommand.giantHPXY[1], ScaleCommand.giantHPScale, giantHPText, null, null); + abilityCooldown = new LocationButton(MoveCommand.abilityCooldownsXY[0], MoveCommand.abilityCooldownsXY[1], ScaleCommand.abilityCooldownsScale, abilityCooldownText, null, null); this.buttonList.add(coords); this.buttonList.add(dungeonTimer); @@ -125,6 +130,7 @@ public class EditLocationsGui extends GuiScreen { this.buttonList.add(golemTimer); this.buttonList.add(teammatesInRadius); this.buttonList.add(giantHP); + this.buttonList.add(abilityCooldown); } @Override @@ -234,6 +240,12 @@ public class EditLocationsGui extends GuiScreen { giantHP.xPosition = MoveCommand.giantHPXY[0]; giantHP.yPosition = MoveCommand.giantHPXY[1]; break; + case "abilityCooldown": + MoveCommand.abilityCooldownsXY[0] += xMoved; + MoveCommand.abilityCooldownsXY[1] += yMoved; + abilityCooldown.xPosition = MoveCommand.abilityCooldownsXY[0]; + abilityCooldown.yPosition = MoveCommand.abilityCooldownsXY[1]; + break; } this.buttonList.clear(); initGui(); @@ -270,6 +282,8 @@ public class EditLocationsGui extends GuiScreen { moving = "teammatesInRadius"; } else if (button == giantHP) { moving = "giantHP"; + } else if (button == abilityCooldown) { + moving = "abilityCooldown"; } } } @@ -302,6 +316,8 @@ public class EditLocationsGui extends GuiScreen { ConfigHandler.writeIntConfig("locations", "teammatesInRadiusY", MoveCommand.teammatesInRadiusXY[1]); ConfigHandler.writeIntConfig("locations", "giantHPX", MoveCommand.giantHPXY[0]); ConfigHandler.writeIntConfig("locations", "giantHPY", MoveCommand.giantHPXY[1]); + ConfigHandler.writeIntConfig("locations", "abilityCooldownsX", MoveCommand.abilityCooldownsXY[0]); + ConfigHandler.writeIntConfig("locations", "abilityCooldownsY", MoveCommand.abilityCooldownsXY[1]); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 5323202..9195184 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -217,8 +217,9 @@ public class ConfigHandler { ToggleCommand.endOfFarmAlert = initBoolean("toggles", "EndOfFarmAlert", false); ToggleCommand.gemstoneLore = initBoolean("toggles", "GemstoneLore", false); ToggleCommand.crystalHollowWaypoints = initBoolean("toggles", "CrystalHollowWaypoints", false); - ToggleCommand.crystalAutoWaypoints = initBoolean("toggles", "CrystalAutoWaypoints", true); + ToggleCommand.crystalAutoWaypoints = initBoolean("toggles", "CrystalAutoWaypoints", true); // enabled by default ToggleCommand.autoAcceptReparty = initBoolean("toggles", "AutoAcceptReparty", false); + ToggleCommand.abilityCooldowns = initBoolean("toggles", "AbilityCooldowns", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); @@ -531,6 +532,8 @@ public class ConfigHandler { MoveCommand.teammatesInRadiusXY[1] = initInt("locations", "teammatesInRadiusY", 100); MoveCommand.giantHPXY[0] = initInt("locations", "giantHPX", 80); MoveCommand.giantHPXY[1] = initInt("locations", "giantHPY", 150); + MoveCommand.abilityCooldownsXY[0] = initInt("locations", "abilityCooldownsX", 120); + MoveCommand.abilityCooldownsXY[1] = initInt("locations", "abilityCooldownsY", 150); // Scales ScaleCommand.coordsScale = initDouble("scales", "coordsScale", 1); @@ -545,6 +548,7 @@ public class ConfigHandler { ScaleCommand.golemTimerScale = initDouble("scales", "golemTimerScale", 1); ScaleCommand.teammatesInRadiusScale = initDouble("scales", "teammatesInRadiusScale", 1); ScaleCommand.giantHPScale = initDouble("scales", "giantHPScale", 1); + ScaleCommand.abilityCooldownsScale = initDouble("scales", "abilityCooldownsScale", 1); // Skills DankersSkyblockMod.farmingLevel = initInt("skills", "farming", -1); @@ -559,7 +563,7 @@ public class ConfigHandler { // Colours DankersSkyblockMod.MAIN_COLOUR = initString("colors", "main", EnumChatFormatting.GREEN.toString()); DankersSkyblockMod.SECONDARY_COLOUR = initString("colors", "secondary", EnumChatFormatting.DARK_GREEN.toString()); - DankersSkyblockMod.DELIMITER_COLOUR = initString("colors", "delimiter", EnumChatFormatting.AQUA.toString() + EnumChatFormatting.STRIKETHROUGH.toString()); + DankersSkyblockMod.DELIMITER_COLOUR = initString("colors", "delimiter", EnumChatFormatting.AQUA.toString() + EnumChatFormatting.STRIKETHROUGH); DankersSkyblockMod.ERROR_COLOUR = initString("colors", "error", EnumChatFormatting.RED.toString()); DankersSkyblockMod.TYPE_COLOUR = initString("colors", "type", EnumChatFormatting.GREEN.toString()); DankersSkyblockMod.VALUE_COLOUR = initString("colors", "value", EnumChatFormatting.DARK_GREEN.toString()); diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 71fc4ba..f7ebad6 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -9,6 +9,7 @@ import me.Danker.handlers.ScoreboardHandler; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.client.settings.GameSettings; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItemFrame; import net.minecraft.entity.player.EntityPlayer; @@ -421,4 +422,45 @@ public class Utils { System.out.println("Refreshed DSM repo at " + System.currentTimeMillis()); } + public static int getCooldownFromAbility(String ability) { + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + boolean foundAbility = false; + + List itemsToSearch = new ArrayList<>(); + + for (int i = 0; i < 8; i++) { + ItemStack hotbarItem = player.inventory.getStackInSlot(i); + if (hotbarItem == null) continue; + itemsToSearch.add(hotbarItem); + } + + for (int i = 0; i < 4; i++) { + ItemStack armorItem = player.inventory.armorItemInSlot(0); + if (armorItem == null) continue; + itemsToSearch.add(armorItem); + } + + for (ItemStack item : itemsToSearch) { + List tooltip = item.getTooltip(player, false); + + for (String line : tooltip) { + System.out.println(line); + if (line.contains(EnumChatFormatting.GOLD + "Ability: ")) { + if (line.contains(EnumChatFormatting.GOLD + "Ability: " + ability)) { + foundAbility = true; + continue; + } else if (foundAbility) { + break; + } + } + + if (foundAbility && line.contains(EnumChatFormatting.DARK_GRAY + "Cooldown: ")) { + return Integer.parseInt(StringUtils.stripControlCodes(line).replaceAll("[^\\d]", "")); + } + } + } + + return 0; + } + } -- cgit From f64d52798778df323f4e7778fff98e240cde4e83 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 7 Sep 2021 16:01:48 -0400 Subject: Fix S+ runs not saving and spirit boots fix NPE --- src/main/java/me/Danker/features/SpiritBootsFix.java | 6 +++++- .../java/me/Danker/features/loot/CatacombsTracker.java | 14 +++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/SpiritBootsFix.java b/src/main/java/me/Danker/features/SpiritBootsFix.java index 8719fcf..8530f17 100644 --- a/src/main/java/me/Danker/features/SpiritBootsFix.java +++ b/src/main/java/me/Danker/features/SpiritBootsFix.java @@ -3,6 +3,7 @@ package me.Danker.features; import me.Danker.events.PacketReadEvent; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.network.play.server.S04PacketEntityEquipment; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.relauncher.ReflectionHelper; @@ -16,8 +17,11 @@ public class SpiritBootsFix { @SubscribeEvent public void onPacketRead(PacketReadEvent event) throws IllegalAccessException { if (Utils.inSkyblock && event.packet instanceof S04PacketEntityEquipment) { + EntityPlayer player = Minecraft.getMinecraft().thePlayer; S04PacketEntityEquipment packet = (S04PacketEntityEquipment) event.packet; - if (packet.getEntityID() == Minecraft.getMinecraft().thePlayer.getEntityId()) { + + if (player == null || packet == null) return; + if (packet.getEntityID() == player.getEntityId()) { slot.setAccessible(true); slot.setInt(packet, slot.getInt(packet) + 1); event.packet = packet; diff --git a/src/main/java/me/Danker/features/loot/CatacombsTracker.java b/src/main/java/me/Danker/features/loot/CatacombsTracker.java index a581db5..6e62b45 100644 --- a/src/main/java/me/Danker/features/loot/CatacombsTracker.java +++ b/src/main/java/me/Danker/features/loot/CatacombsTracker.java @@ -179,31 +179,31 @@ public class CatacombsTracker { if (sCleaned.contains("F1")) { f1SPlus++; f1SPlusSession++; - ConfigHandler.writeDoubleConfig("catacombs", "floorOneSPlus", f1SPlus); + ConfigHandler.writeIntConfig("catacombs", "floorOneSPlus", f1SPlus); } else if (sCleaned.contains("F2")) { f2SPlus++; f2SPlusSession++; - ConfigHandler.writeDoubleConfig("catacombs", "floorTwoSPlus", f2SPlus); + ConfigHandler.writeIntConfig("catacombs", "floorTwoSPlus", f2SPlus); } else if (sCleaned.contains("F3")) { f3SPlus++; f3SPlusSession++; - ConfigHandler.writeDoubleConfig("catacombs", "floorThreeSPlus", f3SPlus); + ConfigHandler.writeIntConfig("catacombs", "floorThreeSPlus", f3SPlus); } else if (sCleaned.contains("F4")) { f4SPlus++; f4SPlusSession++; - ConfigHandler.writeDoubleConfig("catacombs", "floorFourSPlus", f4SPlus); + ConfigHandler.writeIntConfig("catacombs", "floorFourSPlus", f4SPlus); } else if (sCleaned.contains("F5")) { f5SPlus++; f5SPlusSession++; - ConfigHandler.writeDoubleConfig("catacombs", "floorFiveSPlus", f5SPlus); + ConfigHandler.writeIntConfig("catacombs", "floorFiveSPlus", f5SPlus); } else if (sCleaned.contains("F6")) { f6SPlus++; f6SPlusSession++; - ConfigHandler.writeDoubleConfig("catacombs", "floorSixSPlus", f6SPlus); + ConfigHandler.writeIntConfig("catacombs", "floorSixSPlus", f6SPlus); } else if (sCleaned.contains("F7")) { f7SPlus++; f7SPlusSession++; - ConfigHandler.writeDoubleConfig("catacombs", "floorSevenSPlus", f7SPlus); + ConfigHandler.writeIntConfig("catacombs", "floorSevenSPlus", f7SPlus); } } } -- cgit From 7b78e67b434e427b696a43a95b9bb6705da41ad8 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 7 Sep 2021 17:14:40 -0400 Subject: Make cooldown display work with mage cooldown reduction --- src/main/java/me/Danker/DankersSkyblockMod.java | 2 +- .../java/me/Danker/features/AbilityCooldowns.java | 73 ++++++++++++++++++---- src/main/java/me/Danker/utils/Utils.java | 5 +- 3 files changed, 66 insertions(+), 14 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index b0e0de0..1998f41 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -100,6 +100,7 @@ public class DankersSkyblockMod { @EventHandler public void init(FMLInitializationEvent event) throws UnsupportedAudioFileException, IOException, LineUnavailableException { MinecraftForge.EVENT_BUS.register(this); + MinecraftForge.EVENT_BUS.register(new AbilityCooldowns()); MinecraftForge.EVENT_BUS.register(new ArachneESP()); MinecraftForge.EVENT_BUS.register(new AutoAcceptReparty()); MinecraftForge.EVENT_BUS.register(new AutoDisplay()); @@ -127,7 +128,6 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new HideTooltipsInExperiments()); MinecraftForge.EVENT_BUS.register(new HighlightSkeletonMasters()); MinecraftForge.EVENT_BUS.register(new IceWalkSolver()); - MinecraftForge.EVENT_BUS.register(new AbilityCooldowns()); MinecraftForge.EVENT_BUS.register(new LividSolver()); MinecraftForge.EVENT_BUS.register(new LowHealthNotifications()); MinecraftForge.EVENT_BUS.register(new NecronNotifications()); diff --git a/src/main/java/me/Danker/features/AbilityCooldowns.java b/src/main/java/me/Danker/features/AbilityCooldowns.java index ed6767e..397857a 100644 --- a/src/main/java/me/Danker/features/AbilityCooldowns.java +++ b/src/main/java/me/Danker/features/AbilityCooldowns.java @@ -2,45 +2,63 @@ package me.Danker.features; import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; +import me.Danker.commands.ToggleCommand; import me.Danker.events.RenderOverlayEvent; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.inventory.GuiChest; +import net.minecraft.inventory.ContainerChest; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StringUtils; import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; import java.util.ArrayList; import java.util.List; public class AbilityCooldowns { - List cooldowns = new ArrayList<>(); + static List cooldowns = new ArrayList<>(); + static double mageReduction = 0D; @SubscribeEvent(priority = EventPriority.LOW) public void onChat(ClientChatReceivedEvent event) { - if (!Utils.inSkyblock || event.type != 2) return; + if (!Utils.inSkyblock || !ToggleCommand.abilityCooldowns) return; - String[] actionBarSections = StringUtils.stripControlCodes(event.message.getUnformattedText()).split(" {3,}"); + if (event.type == 2) { + String[] actionBarSections = StringUtils.stripControlCodes(event.message.getUnformattedText()).split(" {3,}"); - for (String section : actionBarSections) { - if (section.charAt(0) == '-' && section.contains("(") && section.charAt(section.length() - 1) == ')') { - String ability = section.substring(section.indexOf("(") + 1, section.length() - 1); + for (String section : actionBarSections) { + if (section.charAt(0) == '-' && section.contains("(") && section.charAt(section.length() - 1) == ')') { + String ability = section.substring(section.indexOf("(") + 1, section.length() - 1); - for (Ability cooldown : cooldowns) { - if (cooldown.ability.equals(ability)) return; + for (Ability cooldown : cooldowns) { + if (cooldown.ability.equals(ability)) return; + } + + cooldowns.add(new Ability(ability, Utils.getCooldownFromAbility(ability) * (1D - mageReduction))); } + } + } else { + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); - cooldowns.add(new Ability(ability, Utils.getCooldownFromAbility(ability))); + if (Utils.inDungeons && message.startsWith("[Mage] Cooldown Reduction ")) { + mageReduction = Integer.parseInt(message.substring(message.indexOf(">") + 2, message.length() - 1)) / 100D; } } } @SubscribeEvent public void renderPlayerInfo(RenderOverlayEvent event) { - if (Utils.inSkyblock) { + if (ToggleCommand.abilityCooldowns && Utils.inSkyblock) { StringBuilder sb = new StringBuilder(); for (int i = cooldowns.size() - 1; i >= 0; i--) { @@ -58,14 +76,45 @@ public class AbilityCooldowns { } } + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + if (event.phase != TickEvent.Phase.START) return; + + Minecraft mc = Minecraft.getMinecraft(); + EntityPlayerSP player = mc.thePlayer; + if (mc.currentScreen instanceof GuiChest) { + if (player == null) return; + ContainerChest chest = (ContainerChest) player.openContainer; + List invSlots = ((GuiChest) mc.currentScreen).inventorySlots.inventorySlots; + String chestName = chest.getLowerChestInventory().getDisplayName().getUnformattedText().trim(); + + if (ToggleCommand.abilityCooldowns && Utils.inDungeons && chestName.startsWith("Catacombs - ")) { + ItemStack mage = invSlots.get(30).getStack(); + if (mage == null || mage.getDisplayName() == null) return; + if (mage.isItemEnchanted()) { + String display = mage.getDisplayName(); + mageReduction = Utils.getCooldownReductionFromLevel(Integer.parseInt(display.substring(display.indexOf(" ") + 1, display.indexOf("]")))); + } else { + mageReduction = 0D; + } + } + } + } + + @SubscribeEvent + public void onWorldChange(WorldEvent.Load event) { + cooldowns.clear(); + mageReduction = 0D; + } + public static class Ability { public final String ability; private final long cooldown; - public Ability(String ability, int cooldown) { + public Ability(String ability, double cooldown) { this.ability = ability; - this.cooldown = System.currentTimeMillis() + cooldown * 1000L; + this.cooldown = (long) (System.currentTimeMillis() + cooldown * 1000L); } public String getTimer() { diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index f7ebad6..81a32af 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -444,7 +444,6 @@ public class Utils { List tooltip = item.getTooltip(player, false); for (String line : tooltip) { - System.out.println(line); if (line.contains(EnumChatFormatting.GOLD + "Ability: ")) { if (line.contains(EnumChatFormatting.GOLD + "Ability: " + ability)) { foundAbility = true; @@ -463,4 +462,8 @@ public class Utils { return 0; } + public static double getCooldownReductionFromLevel(int level) { + return (Math.floor(level / 2D) + 25) / 100D; + } + } -- cgit From 18005eaea949ef177edfdcbf9bd794314fd4a8ce Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Wed, 8 Sep 2021 20:41:05 -0400 Subject: Fix first coord being negative in waypoint addition --- src/main/java/me/Danker/commands/CrystalHollowWaypointCommand.java | 2 +- src/main/java/me/Danker/features/CrystalHollowWaypoints.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/CrystalHollowWaypointCommand.java b/src/main/java/me/Danker/commands/CrystalHollowWaypointCommand.java index c545447..1aacf50 100644 --- a/src/main/java/me/Danker/commands/CrystalHollowWaypointCommand.java +++ b/src/main/java/me/Danker/commands/CrystalHollowWaypointCommand.java @@ -35,7 +35,7 @@ public class CrystalHollowWaypointCommand extends CommandBase { String[] waypoints = String.join(" ", arg1).split("\\\\n"); for (String waypoint : waypoints) { - String[] parts = waypoint.split("@"); + String[] parts = waypoint.split("@-"); String[] coords = parts[1].split(","); String location = parts[0]; diff --git a/src/main/java/me/Danker/features/CrystalHollowWaypoints.java b/src/main/java/me/Danker/features/CrystalHollowWaypoints.java index fdd49f2..5b8d665 100644 --- a/src/main/java/me/Danker/features/CrystalHollowWaypoints.java +++ b/src/main/java/me/Danker/features/CrystalHollowWaypoints.java @@ -174,7 +174,7 @@ public class CrystalHollowWaypoints { } public String getFormattedWaypoint() { - return location + "@" + pos.getX() + "," + pos.getY() + "," + pos.getZ(); + return location + "@-" + pos.getX() + "," + pos.getY() + "," + pos.getZ(); } public String getDistance(EntityPlayer player) { -- cgit From fcc9c2d230244d261fe8b6215e0ed4453394b929 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sun, 12 Sep 2021 00:08:18 -0400 Subject: Add adding waypoints --- .../me/Danker/gui/CrystalHollowAddWaypointGui.java | 118 +++++++++++++++++++++ .../Danker/gui/CrystalHollowWaypointActionGui.java | 7 ++ .../me/Danker/gui/CrystalHollowWaypointsGui.java | 9 +- 3 files changed, 132 insertions(+), 2 deletions(-) create mode 100644 src/main/java/me/Danker/gui/CrystalHollowAddWaypointGui.java (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/gui/CrystalHollowAddWaypointGui.java b/src/main/java/me/Danker/gui/CrystalHollowAddWaypointGui.java new file mode 100644 index 0000000..7bb26cf --- /dev/null +++ b/src/main/java/me/Danker/gui/CrystalHollowAddWaypointGui.java @@ -0,0 +1,118 @@ +package me.Danker.gui; + +import me.Danker.features.CrystalHollowWaypoints; +import me.Danker.handlers.TextRenderer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; + +import java.io.IOException; + +public class CrystalHollowAddWaypointGui extends GuiScreen { + + private GuiButton cancel; + + private GuiTextField name; + private GuiButton curPos; + private GuiTextField x; + private GuiTextField y; + private GuiTextField z; + private GuiButton add; + + @Override + public boolean doesGuiPauseGame() { + return false; + } + + @Override + public void initGui() { + super.initGui(); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int height = sr.getScaledHeight(); + int width = sr.getScaledWidth(); + + cancel = new GuiButton(0, 2, height - 30, 100, 20, "Cancel"); + + name = new GuiTextField(0, this.fontRendererObj, width / 2 - 100, (int) (height * 0.1), 200, 20); + curPos = new GuiButton(0, width / 2 - 50, (int) (height * 0.25), 100, 20, "Current Position"); + x = new GuiTextField(0, this.fontRendererObj, width / 2 - 85, (int) (height * 0.4), 50, 20); + y = new GuiTextField(0, this.fontRendererObj, width / 2 - 25, (int) (height * 0.4), 50, 20); + z = new GuiTextField(0, this.fontRendererObj, width / 2 + 35, (int) (height * 0.4), 50, 20); + add = new GuiButton(0, width / 2 - 25, (int) (height * 0.6), 50, 20, "Add"); + + name.setVisible(true); + name.setEnabled(true); + x.setVisible(true); + x.setEnabled(true); + y.setVisible(true); + y.setEnabled(true); + z.setVisible(true); + z.setEnabled(true); + + this.buttonList.add(cancel); + this.buttonList.add(curPos); + this.buttonList.add(add); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + + name.drawTextBox(); + x.drawTextBox(); + y.drawTextBox(); + z.drawTextBox(); + + new TextRenderer(mc, "X:", width / 2 - 85, (int) (height * 0.35), 1D); + new TextRenderer(mc, "Y:", width / 2 - 25, (int) (height * 0.35), 1D); + new TextRenderer(mc, "Z:", width / 2 + 35, (int) (height * 0.35), 1D); + } + + @Override + public void actionPerformed(GuiButton button) { + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + + if (button == cancel) { + mc.displayGuiScreen(new CrystalHollowWaypointsGui(1)); + } else if (button == curPos) { + x.setText(Integer.toString(player.getPosition().getX())); + y.setText(Integer.toString(player.getPosition().getY())); + z.setText(Integer.toString(player.getPosition().getZ())); + } else if (button == add) { + String loc = name.getText().length() == 0 ? Integer.toString(CrystalHollowWaypoints.waypoints.size()) : name.getText(); + int xPos = x.getText().matches("[-]?\\d+") ? Integer.parseInt(x.getText()) : player.getPosition().getX(); + int yPos = y.getText().matches("[-]?\\d+") ? Integer.parseInt(y.getText()) : player.getPosition().getY(); + int zPos = z.getText().matches("[-]?\\d+") ? Integer.parseInt(z.getText()) : player.getPosition().getZ(); + + BlockPos pos = new BlockPos(xPos, yPos, zPos); + CrystalHollowWaypoints.waypoints.add(new CrystalHollowWaypoints.Waypoint(loc, pos)); + + mc.displayGuiScreen(new CrystalHollowWaypointsGui(1)); + } + } + + @Override + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { + super.mouseClicked(mouseX, mouseY, mouseButton); + name.mouseClicked(mouseX, mouseY, mouseButton); + x.mouseClicked(mouseX, mouseY, mouseButton); + y.mouseClicked(mouseX, mouseY, mouseButton); + z.mouseClicked(mouseX, mouseY, mouseButton); + } + + @Override + protected void keyTyped(char typedChar, int keyCode) throws IOException { + super.keyTyped(typedChar, keyCode); + name.textboxKeyTyped(typedChar, keyCode); + x.textboxKeyTyped(typedChar, keyCode); + y.textboxKeyTyped(typedChar, keyCode); + z.textboxKeyTyped(typedChar, keyCode); + } + +} diff --git a/src/main/java/me/Danker/gui/CrystalHollowWaypointActionGui.java b/src/main/java/me/Danker/gui/CrystalHollowWaypointActionGui.java index d7f598d..1575c18 100644 --- a/src/main/java/me/Danker/gui/CrystalHollowWaypointActionGui.java +++ b/src/main/java/me/Danker/gui/CrystalHollowWaypointActionGui.java @@ -2,6 +2,7 @@ package me.Danker.gui; import me.Danker.DankersSkyblockMod; import me.Danker.features.CrystalHollowWaypoints; +import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; @@ -59,6 +60,12 @@ public class CrystalHollowWaypointActionGui extends GuiScreen { public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); super.drawScreen(mouseX, mouseY, partialTicks); + + CrystalHollowWaypoints.Waypoint waypoint = CrystalHollowWaypoints.waypoints.get(id); + + String waypointText = waypoint.location + " @ " + waypoint.getPos(); + int pageWidth = mc.fontRendererObj.getStringWidth(waypointText); + new TextRenderer(mc, waypointText, width / 2 - pageWidth / 2, 10, 1D); } @Override diff --git a/src/main/java/me/Danker/gui/CrystalHollowWaypointsGui.java b/src/main/java/me/Danker/gui/CrystalHollowWaypointsGui.java index 392f16b..de20cf1 100644 --- a/src/main/java/me/Danker/gui/CrystalHollowWaypointsGui.java +++ b/src/main/java/me/Danker/gui/CrystalHollowWaypointsGui.java @@ -18,14 +18,15 @@ import java.util.List; public class CrystalHollowWaypointsGui extends GuiScreen { - private int page; - private List allButtons = new ArrayList<>(); + private final int page; + private final List allButtons = new ArrayList<>(); private GuiButton goBack; private GuiButton backPage; private GuiButton nextPage; private GuiButton sendDSM; private GuiButton sendSBE; + private GuiButton add; private FeatureButton crystalHollowWaypoints; private FeatureButton crystalAutoWaypoints; @@ -51,10 +52,12 @@ public class CrystalHollowWaypointsGui extends GuiScreen { nextPage = new GuiButton(0, width / 2 + 20, (int) (height * 0.8), 80, 20, "Next >"); sendDSM = new GuiButton(0, 2, 10, 175, 20, "Send DSM Formatted Waypoints"); sendSBE = new GuiButton(0, 2, 40, 175, 20, "Send SBE Formatted Waypoints"); + add = new GuiButton(0, 0, 0, "Add Waypoint"); crystalHollowWaypoints = new FeatureButton("Crystal Hollows Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalHollowWaypoints), "Shows waypoints to various places in the Crystal Hollows."); crystalAutoWaypoints = new FeatureButton("Auto Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalAutoWaypoints), "Automatically creates waypoints when you visit a special place in the Crystal Hollows."); allButtons.clear(); + allButtons.add(add); allButtons.add(crystalHollowWaypoints); allButtons.add(crystalAutoWaypoints); for (int i = 0; i < CrystalHollowWaypoints.waypoints.size(); i++) { @@ -123,6 +126,8 @@ public class CrystalHollowWaypointsGui extends GuiScreen { message.insert(0, "$SBECHWP:"); player.sendChatMessage(message.toString()); } + } else if (button == add) { + mc.displayGuiScreen(new CrystalHollowAddWaypointGui()); } else if (button == crystalHollowWaypoints) { ToggleCommand.crystalHollowWaypoints = !ToggleCommand.crystalHollowWaypoints; ConfigHandler.writeBooleanConfig("toggles", "CrystalHollowWaypoints", ToggleCommand.crystalHollowWaypoints); -- cgit From 0e0321b594305981af84c884d9d3183533380121 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 19 Nov 2021 22:00:14 -0500 Subject: Fix coins spent not being tracked --- src/main/java/me/Danker/features/loot/CatacombsTracker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/loot/CatacombsTracker.java b/src/main/java/me/Danker/features/loot/CatacombsTracker.java index 6e62b45..ddcb7d5 100644 --- a/src/main/java/me/Danker/features/loot/CatacombsTracker.java +++ b/src/main/java/me/Danker/features/loot/CatacombsTracker.java @@ -445,7 +445,7 @@ public class CatacombsTracker { for (String lineUnclean : tooltip) { String line = StringUtils.stripControlCodes(lineUnclean); if (line.contains("FREE")) { - break; + continue; } else if (line.contains(" Coins") && !line.contains("NOTE:")) { int coinsSpent = Integer.parseInt(line.substring(0, line.indexOf(" ")).replaceAll(",", "")); -- cgit From 8bd93c4ff81de99f73d24314e0bfd180e6f25255 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 20 Nov 2021 22:39:13 -0500 Subject: Add /hotmof command Also make API handler use UTF-8 --- README.md | 2 + src/main/java/me/Danker/DankersSkyblockMod.java | 10 +- src/main/java/me/Danker/commands/DHelpCommand.java | 1 + src/main/java/me/Danker/commands/HOTMCommand.java | 122 +++++++++++++++++ .../java/me/Danker/commands/HOTMTreeCommand.java | 151 +++++++++++++++++++++ .../java/me/Danker/commands/InventoryCommand.java | 2 - .../java/me/Danker/containers/GuiChestDynamic.java | 45 ++++++ src/main/java/me/Danker/handlers/APIHandler.java | 3 +- .../resources/assets/dsm/textures/generic_63.png | Bin 0 -> 870 bytes 9 files changed, 331 insertions(+), 5 deletions(-) create mode 100644 src/main/java/me/Danker/commands/HOTMCommand.java create mode 100644 src/main/java/me/Danker/commands/HOTMTreeCommand.java create mode 100644 src/main/java/me/Danker/containers/GuiChestDynamic.java create mode 100644 src/main/resources/assets/dsm/textures/generic_63.png (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 4efae05..11def93 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,7 @@ Discord Server: https://discord.gg/QsEkNQS - /reloadconfig - Reloads Danker's Skyblock Mod config. - /reloaddsmrepo - Reloads Danker's Skyblock Mod repository. - /dsmfarmlength - Sets coords to be used for end of farm alert. +- /hotmof [player] - Uses API to find total powder and HotM tree of a person. If no name is provided, it checks yours. ## Keybinds - Open Maddox menu - M by default. @@ -142,3 +143,4 @@ Software | License [NotEnoughUpdates](https://github.com/Moulberry/NotEnoughUpdates/) | [Creative Commons Public License](https://github.com/Moulberry/NotEnoughUpdates/blob/master/LICENSE) [HyChat](https://github.com/Moulberry/Hychat) | [Creative Commons Public License](https://github.com/Moulberry/Hychat/blob/master/LICENSE) [SkyblockCatia](https://github.com/SteveKunG/SkyBlockcatia) | [MIT License](https://github.com/SteveKunG/SkyBlockcatia/blob/1.8.9/LICENSE.md) +[MatterOverdrive (Legacy Edition)](https://bitbucket.org/hrznstudio/mo-legacy-edition/) | [GNU General Public License](https://bitbucket.org/hrznstudio/mo-legacy-edition/src/1.12.2/LICENSE.md) diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 1998f41..2730868 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -197,6 +197,8 @@ public class DankersSkyblockMod { ClientCommandHandler.instance.registerCommand(new FarmLengthCommand()); ClientCommandHandler.instance.registerCommand(new GetkeyCommand()); ClientCommandHandler.instance.registerCommand(new GuildOfCommand()); + ClientCommandHandler.instance.registerCommand(new HOTMCommand()); + ClientCommandHandler.instance.registerCommand(new HOTMTreeCommand()); ClientCommandHandler.instance.registerCommand(new ImportFishingCommand()); ClientCommandHandler.instance.registerCommand(new InventoryCommand()); ClientCommandHandler.instance.registerCommand(new LobbyBankCommand()); @@ -447,6 +449,9 @@ public class DankersSkyblockMod { case "inventory": mc.displayGuiScreen(InventoryCommand.chest); break; + case "hotminventory": + mc.displayGuiScreen(HOTMTreeCommand.chest); + break; } } guiToOpen = null; @@ -467,16 +472,17 @@ public class DankersSkyblockMod { @SubscribeEvent public void onGuiMouseInputPre(GuiScreenEvent.MouseInputEvent.Pre event) { - if (!Utils.inSkyblock) return; if (Mouse.getEventButton() != 0 && Mouse.getEventButton() != 1 && Mouse.getEventButton() != 2) return; // Left click, middle click or right click if (!Mouse.getEventButtonState()) return; - if (event.gui == InventoryCommand.chest) { + if (event.gui == InventoryCommand.chest || event.gui == HOTMTreeCommand.chest) { event.setCanceled(true); return; } + if (!Utils.inSkyblock) return; + if (event.gui instanceof GuiChest) { Container containerChest = ((GuiChest) event.gui).inventorySlots; if (containerChest instanceof ContainerChest) { diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index c82eb0e..0c81af5 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -61,6 +61,7 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + ReloadConfigCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Reloads Danker's Skyblock Mod config.\n" + EnumChatFormatting.GOLD + ReloadRepoCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Reloads Danker's Skyblock Mod repository.\n" + EnumChatFormatting.GOLD + FarmLengthCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Sets coords to be used for end of farm alert.\n" + + EnumChatFormatting.GOLD + HOTMCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find total powder and HotM tree of a person. If no name is provided, it checks yours.\n" + EnumChatFormatting.GREEN + " Open Maddox Menu" + EnumChatFormatting.AQUA + " - M by default.\n" + EnumChatFormatting.GREEN + " Start/Stop Skill Tracker" + EnumChatFormatting.AQUA + " - Numpad 5 by default.\n")); } diff --git a/src/main/java/me/Danker/commands/HOTMCommand.java b/src/main/java/me/Danker/commands/HOTMCommand.java new file mode 100644 index 0000000..bfb10f5 --- /dev/null +++ b/src/main/java/me/Danker/commands/HOTMCommand.java @@ -0,0 +1,122 @@ +package me.Danker.commands; + +import com.google.gson.JsonObject; +import me.Danker.DankersSkyblockMod; +import me.Danker.handlers.APIHandler; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.Utils; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.event.ClickEvent; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +import java.text.NumberFormat; +import java.util.List; +import java.util.Locale; + +public class HOTMCommand extends CommandBase { + + @Override + public String getCommandName() { + return "hotmof"; + } + + @Override + public String getCommandUsage(ICommandSender arg0) { + return "/" + getCommandName() + " [name]"; + } + + public static String usage(ICommandSender arg0) { + return new HOTMCommand().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + if (args.length == 1) { + return Utils.getMatchingPlayers(args[0]); + } + return null; + } + + @Override + public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { + // MULTI THREAD DRIFTING + new Thread(() -> { + EntityPlayer player = (EntityPlayer) arg0; + + // Check key + String key = ConfigHandler.getString("api", "APIKey"); + if (key.equals("")) { + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "API key not set. Use /setkey.")); + return; + } + + // Get UUID for Hypixel API requests + String username; + String uuid; + if (arg1.length == 0) { + username = player.getName(); + uuid = player.getUniqueID().toString().replaceAll("[\\-]", ""); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking HotM of " + DankersSkyblockMod.SECONDARY_COLOUR + username)); + } else { + username = arg1[0]; + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking HotM of " + DankersSkyblockMod.SECONDARY_COLOUR + username)); + uuid = APIHandler.getUUID(username); + } + + // Find stats of latest profile + String latestProfile = APIHandler.getLatestProfileID(uuid, key); + if (latestProfile == null) return; + + String profileURL = "https://api.hypixel.net/skyblock/profile?profile=" + latestProfile + "&key=" + key; + System.out.println("Fetching profile..."); + JsonObject profileResponse = APIHandler.getResponse(profileURL, true); + if (!profileResponse.get("success").getAsBoolean()) { + String reason = profileResponse.get("cause").getAsString(); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Failed with reason: " + reason)); + return; + } + + System.out.println("Fetching mining stats..."); + JsonObject miningCore = profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject().get("mining_core").getAsJsonObject(); + int mithril = miningCore.get("powder_mithril").getAsInt() + miningCore.get("powder_spent_mithril").getAsInt(); + int gemstone = miningCore.get("powder_gemstone").getAsInt() + miningCore.get("powder_spent_gemstone").getAsInt(); + String ability = Node.valueOf(miningCore.get("selected_pickaxe_ability").getAsString()).name; + + ChatComponentText tree = new ChatComponentText(EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + "[CLICK]"); + tree.setChatStyle(tree.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/hotmtree " + username + " " + latestProfile))); + + NumberFormat nf = NumberFormat.getIntegerInstance(Locale.US); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.AQUA + username + "'s HotM:\n" + + DankersSkyblockMod.TYPE_COLOUR + "Mithril Powder: " + EnumChatFormatting.DARK_GREEN + nf.format(mithril) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + "Gemstone Powder: " + EnumChatFormatting.LIGHT_PURPLE + nf.format(gemstone) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + "Pickaxe Ability: " + DankersSkyblockMod.VALUE_COLOUR + ability + "\n" + + DankersSkyblockMod.TYPE_COLOUR + "HotM Tree: ").appendSibling(tree) + .appendSibling(new ChatComponentText("\n" + DankersSkyblockMod.DELIMITER_COLOUR + EnumChatFormatting.BOLD + "-------------------"))); + }).start(); + } + + enum Node { + mining_speed_boost("Mining Speed Boost"), + pickobulus("*Pickobulus"), + vein_seeker("Vein Seeker"), + maniac_miner("*Maniac Miner"); + + public String name; + + Node(String name) { + this.name = name; + } + } + +} diff --git a/src/main/java/me/Danker/commands/HOTMTreeCommand.java b/src/main/java/me/Danker/commands/HOTMTreeCommand.java new file mode 100644 index 0000000..90b82d3 --- /dev/null +++ b/src/main/java/me/Danker/commands/HOTMTreeCommand.java @@ -0,0 +1,151 @@ +package me.Danker.commands; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import me.Danker.DankersSkyblockMod; +import me.Danker.containers.GuiChestDynamic; +import me.Danker.handlers.APIHandler; +import me.Danker.utils.Utils; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryBasic; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.*; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.util.Constants; + +import java.util.ArrayList; +import java.util.Base64; +import java.util.List; +import java.util.UUID; + +public class HOTMTreeCommand extends CommandBase { + + public static GuiChestDynamic chest = null; + + @Override + public String getCommandName() { + return "hotmtree"; + } + + @Override + public String getCommandUsage(ICommandSender arg0) { + return null; + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { + // MULTI THREAD DRIFTING + new Thread(() -> { + EntityPlayer player = (EntityPlayer) arg0; + + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking HotM tree of " + DankersSkyblockMod.SECONDARY_COLOUR + arg1[0])); + + System.out.println("Fetching profile..."); + String profileURL = "https://sky.shiiyu.moe/api/v2/profile/" + arg1[0]; + JsonObject profileResponse = APIHandler.getResponse(profileURL, true); + if (profileResponse.has("error")) { + String reason = profileResponse.get("error").getAsString(); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Failed with reason: " + reason)); + return; + } + + System.out.println("Fetching HotM tree..."); + JsonArray tree = profileResponse.get("profiles").getAsJsonObject().get(arg1[1]).getAsJsonObject().get("items").getAsJsonObject().get("hotm").getAsJsonArray(); + + IInventory inventory = new InventoryBasic(arg1[0] + "'s HotM Tree:", true, 63); + + for (JsonElement e : tree) { + JsonObject node = e.getAsJsonObject(); + + if (!node.has("tag")) continue; + + ItemStack item = new ItemStack(Item.getItemById(node.get("id").getAsInt()), node.get("Count").getAsInt(), node.get("Damage").getAsInt()); + + NBTTagCompound nbt = new NBTTagCompound(); + try { + nbt = JsonToNBT.getTagFromJson(node.get("tag").toString()); + removeDoubleQuotes(nbt); + nbt.getCompoundTag("display").getTagList("Lore", Constants.NBT.TAG_STRING).removeTag(0); + } catch (NBTException ex) { + ex.printStackTrace(); + continue; + } + + if (node.get("glowing").getAsBoolean()) { + nbt.setTag("HideFlags", new NBTTagShort((short) 1)); + } + + if (node.has("texture_path")) { + String path = node.get("texture_path").getAsString(); + NBTTagCompound skullOwner = new NBTTagCompound(); + NBTTagCompound properties = new NBTTagCompound(); + NBTTagList textures = new NBTTagList(); + NBTTagCompound value = new NBTTagCompound(); + String texture = "{\"textures\":{\"SKIN\":{\"url\":\"http://textures.minecraft.net/texture/" + path.substring(path.lastIndexOf("/") + 1) + "\"}}}"; + value.setTag("Value", new NBTTagString(Base64.getEncoder().encodeToString(texture.getBytes()))); + textures.appendTag(value); + properties.setTag("textures", textures); + skullOwner.setTag("Properties", properties); + skullOwner.setTag("Id", new NBTTagString(UUID.randomUUID().toString())); + nbt.setTag("SkullOwner", skullOwner); + } + + item.setTagCompound(nbt); + + if (node.get("glowing").getAsBoolean()) { + item.addEnchantment(Enchantment.protection, 1); + } + item.setStackDisplayName(Utils.removeBold(item.getDisplayName())); + + inventory.setInventorySlotContents(node.get("position").getAsInt() - 1, item); + } + + chest = new GuiChestDynamic(player.inventory, inventory, new ResourceLocation("dsm", "textures/generic_63.png")); + DankersSkyblockMod.guiToOpen = "hotminventory"; + }).start(); + } + + // https://bitbucket.org/hrznstudio/mo-legacy-edition/src/4cc47b2a792cc2ef19eb7e5db0169706ea2e48dd/src/main/java/matteroverdrive/util/MOJsonHelper.java#lines-164:179 + public static void removeDoubleQuotes(NBTTagCompound tagCompound) { + List cachedKeyList = new ArrayList<>(); + cachedKeyList.addAll(tagCompound.getKeySet()); + for (String key : cachedKeyList) { + NBTBase base = tagCompound.getTag(key); + tagCompound.removeTag(key); + + key = key.replace("\"", ""); + if (base instanceof NBTTagCompound) { + removeDoubleQuotes((NBTTagCompound) base); + } else if (base instanceof NBTTagList) { + removeDoubleQuotes((NBTTagList) base); + } + tagCompound.setTag(key, base); + } + } + + // https://bitbucket.org/hrznstudio/mo-legacy-edition/src/4cc47b2a792cc2ef19eb7e5db0169706ea2e48dd/src/main/java/matteroverdrive/util/MOJsonHelper.java#lines-181:189 + public static void removeDoubleQuotes(NBTTagList tagList) { + for (int i = 0; i < tagList.tagCount(); i++) { + if (tagList.get(i) instanceof NBTTagCompound) { + removeDoubleQuotes((NBTTagCompound) tagList.get(i)); + } else if (tagList.get(i) instanceof NBTTagList) { + removeDoubleQuotes((NBTTagList) tagList.get(i)); + } + } + } + +} diff --git a/src/main/java/me/Danker/commands/InventoryCommand.java b/src/main/java/me/Danker/commands/InventoryCommand.java index c1f5cbf..8fb4d5b 100644 --- a/src/main/java/me/Danker/commands/InventoryCommand.java +++ b/src/main/java/me/Danker/commands/InventoryCommand.java @@ -153,8 +153,6 @@ public class InventoryCommand extends CommandBase { chest = new GuiChest(player.inventory, inventory); DankersSkyblockMod.guiToOpen = "inventory"; - - // mc.displayGuiScreen(new GuiChest(player.inventory, inventory)); }).start(); } diff --git a/src/main/java/me/Danker/containers/GuiChestDynamic.java b/src/main/java/me/Danker/containers/GuiChestDynamic.java new file mode 100644 index 0000000..600abbc --- /dev/null +++ b/src/main/java/me/Danker/containers/GuiChestDynamic.java @@ -0,0 +1,45 @@ +package me.Danker.containers; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.inventory.ContainerChest; +import net.minecraft.inventory.IInventory; +import net.minecraft.util.ResourceLocation; + +// Hopefully this is dyanmic, only tested with 63 slots +public class GuiChestDynamic extends GuiContainer { + private final ResourceLocation CHEST_GUI_TEXTURE; + private IInventory upperChestInventory; + private IInventory lowerChestInventory; + private int inventoryRows; + + public GuiChestDynamic(IInventory upperInv, IInventory lowerInv, ResourceLocation texture) + { + super(new ContainerChest(upperInv, lowerInv, Minecraft.getMinecraft().thePlayer)); + this.upperChestInventory = upperInv; + this.lowerChestInventory = lowerInv; + this.allowUserInput = false; + this.inventoryRows = lowerInv.getSizeInventory() / 9; + int i = this.inventoryRows * 37; + int j = i - this.inventoryRows * 18; + this.ySize = j + this.inventoryRows * 18; + this.CHEST_GUI_TEXTURE = texture; + } + + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + this.fontRendererObj.drawString(this.lowerChestInventory.getDisplayName().getUnformattedText(), 8, 6, 4210752); + this.fontRendererObj.drawString(this.upperChestInventory.getDisplayName().getUnformattedText(), 8, this.ySize - this.inventoryRows * 16 - 1, 4210752); + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(CHEST_GUI_TEXTURE); + int i = (this.width - this.xSize) / 2; + int j = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.inventoryRows * 18 + 17); + this.drawTexturedModalRect(i, j + this.inventoryRows * 18 + 17, 0, this.inventoryRows * 18 + 18, this.xSize, this.inventoryRows * 16); + } +} diff --git a/src/main/java/me/Danker/handlers/APIHandler.java b/src/main/java/me/Danker/handlers/APIHandler.java index 4417973..736a7d7 100644 --- a/src/main/java/me/Danker/handlers/APIHandler.java +++ b/src/main/java/me/Danker/handlers/APIHandler.java @@ -15,6 +15,7 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; +import java.nio.charset.StandardCharsets; import java.util.Scanner; public class APIHandler { @@ -28,7 +29,7 @@ public class APIHandler { conn.setRequestProperty("User-Agent", "Dsm/1.0"); if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) { - BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream())); + BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)); String input; StringBuilder response = new StringBuilder(); diff --git a/src/main/resources/assets/dsm/textures/generic_63.png b/src/main/resources/assets/dsm/textures/generic_63.png new file mode 100644 index 0000000..0ccafd7 Binary files /dev/null and b/src/main/resources/assets/dsm/textures/generic_63.png differ -- cgit From 2f0925e3ceb2af3a96de034a3f6e390ca15ba1d9 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 20 Nov 2021 22:47:03 -0500 Subject: Add /inv alias to /inventory --- src/main/java/me/Danker/commands/InventoryCommand.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/InventoryCommand.java b/src/main/java/me/Danker/commands/InventoryCommand.java index 8fb4d5b..d4b35ae 100644 --- a/src/main/java/me/Danker/commands/InventoryCommand.java +++ b/src/main/java/me/Danker/commands/InventoryCommand.java @@ -27,6 +27,7 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.util.Base64; +import java.util.Collections; import java.util.List; public class InventoryCommand extends CommandBase { @@ -38,6 +39,11 @@ public class InventoryCommand extends CommandBase { return "inventory"; } + @Override + public List getCommandAliases() { + return Collections.singletonList("inv"); + } + @Override public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName() + " [name]"; -- cgit From 69d505b5b1d215a7bba3f1aecd31b187d1705d08 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sun, 21 Nov 2021 18:17:31 -0500 Subject: Add /networth command Uses Maro API --- README.md | 1 + src/main/java/me/Danker/DankersSkyblockMod.java | 1 + src/main/java/me/Danker/commands/DHelpCommand.java | 1 + .../java/me/Danker/commands/NetworthCommand.java | 171 +++++++++++++++++++++ src/main/java/me/Danker/handlers/APIHandler.java | 29 ++++ 5 files changed, 203 insertions(+) create mode 100644 src/main/java/me/Danker/commands/NetworthCommand.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 11def93..a571231 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,7 @@ Discord Server: https://discord.gg/QsEkNQS - /reloaddsmrepo - Reloads Danker's Skyblock Mod repository. - /dsmfarmlength - Sets coords to be used for end of farm alert. - /hotmof [player] - Uses API to find total powder and HotM tree of a person. If no name is provided, it checks yours. +- /networth [player] - Uses API to find networth of a person. If no name is provided, it checks yours. ## Keybinds - Open Maddox menu - M by default. diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 2730868..7aceb20 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -205,6 +205,7 @@ public class DankersSkyblockMod { ClientCommandHandler.instance.registerCommand(new LobbySkillsCommand()); ClientCommandHandler.instance.registerCommand(new LootCommand()); ClientCommandHandler.instance.registerCommand(new MoveCommand()); + ClientCommandHandler.instance.registerCommand(new NetworthCommand()); ClientCommandHandler.instance.registerCommand(new PetsCommand()); ClientCommandHandler.instance.registerCommand(new PlayerCommand()); ClientCommandHandler.instance.registerCommand(new ReloadConfigCommand()); diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 0c81af5..ea3a5e3 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -62,6 +62,7 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + ReloadRepoCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Reloads Danker's Skyblock Mod repository.\n" + EnumChatFormatting.GOLD + FarmLengthCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Sets coords to be used for end of farm alert.\n" + EnumChatFormatting.GOLD + HOTMCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find total powder and HotM tree of a person. If no name is provided, it checks yours.\n" + + EnumChatFormatting.GOLD + NetworthCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find networth of a person. If no name is provided, it checks yours.\n" + EnumChatFormatting.GREEN + " Open Maddox Menu" + EnumChatFormatting.AQUA + " - M by default.\n" + EnumChatFormatting.GREEN + " Start/Stop Skill Tracker" + EnumChatFormatting.AQUA + " - Numpad 5 by default.\n")); } diff --git a/src/main/java/me/Danker/commands/NetworthCommand.java b/src/main/java/me/Danker/commands/NetworthCommand.java new file mode 100644 index 0000000..be35c84 --- /dev/null +++ b/src/main/java/me/Danker/commands/NetworthCommand.java @@ -0,0 +1,171 @@ +package me.Danker.commands; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import me.Danker.DankersSkyblockMod; +import me.Danker.handlers.APIHandler; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.Utils; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +import java.io.IOException; +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public class NetworthCommand extends CommandBase { + + @Override + public String getCommandName() { + return "networth"; + } + + @Override + public List getCommandAliases() { + return Collections.singletonList("nw"); + } + + @Override + public String getCommandUsage(ICommandSender arg0) { + return "/" + getCommandName() + " [name]"; + } + + public static String usage(ICommandSender arg0) { + return new NetworthCommand().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + if (args.length == 1) { + return Utils.getMatchingPlayers(args[0]); + } + return null; + } + + @Override + public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { + // MULTI THREAD DRIFTING + new Thread(() -> { + EntityPlayer player = (EntityPlayer) arg0; + + // Check key + String key = ConfigHandler.getString("api", "APIKey"); + if (key.equals("")) { + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "API key not set. Use /setkey.")); + return; + } + + // Get UUID for Hypixel API requests + String username; + String uuid; + if (arg1.length == 0) { + username = player.getName(); + uuid = player.getUniqueID().toString().replaceAll("[\\-]", ""); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking networth of " + DankersSkyblockMod.SECONDARY_COLOUR + username)); + } else { + username = arg1[0]; + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking networth of " + DankersSkyblockMod.SECONDARY_COLOUR + username)); + uuid = APIHandler.getUUID(username); + } + + // Find stats of latest profile + String latestProfile = APIHandler.getLatestProfileID(uuid, key); + if (latestProfile == null) return; + + String profileURL = "https://api.hypixel.net/skyblock/profile?profile=" + latestProfile + "&key=" + key; + System.out.println("Fetching profile..."); + JsonObject profileResponse = APIHandler.getResponse(profileURL, true); + if (!profileResponse.get("success").getAsBoolean()) { + String reason = profileResponse.get("cause").getAsString(); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Failed with reason: " + reason)); + return; + } + + try { + System.out.println("Fetching networth..."); + + JsonObject body = new JsonObject(); + body.add("data", profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject()); + body.get("data").getAsJsonObject().add("banking", profileResponse.get("profile").getAsJsonObject().get("banking").getAsJsonObject()); + + JsonObject networth = APIHandler.getResponsePOST("https://nariah-dev.com/api/networth/categories", body, true); + if (networth.has("success") && !networth.get("success").getAsBoolean()) { + String reason = profileResponse.get("cause").getAsString(); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Failed with reason: " + reason)); + return; + } + + JsonObject data = networth.get("data").getAsJsonObject(); + JsonObject categoriesObject = data.get("categories").getAsJsonObject(); + + long total = data.get("networth").getAsLong(); + long purse = data.get("purse").getAsLong(); + long bank = data.get("bank").getAsLong(); + long sacks = data.get("sacks").getAsLong(); + + List categories = categoriesObject.entrySet().stream() + .map(Map.Entry::getKey) + .collect(Collectors.toCollection(ArrayList::new)); + StringBuilder subcategories = new StringBuilder(); + + for (String category : categories) { + JsonObject categoryObject = categoriesObject.get(category).getAsJsonObject(); + subcategories.append("\n").append(DankersSkyblockMod.TYPE_COLOUR).append(Utils.capitalizeString(category)).append(" value - ").append(formatPrice(categoryObject.get("total").getAsLong())).append("\n"); + + JsonArray topItems = categoryObject.get("top_items").getAsJsonArray(); + + for (int i = 0; i < 5 && i < topItems.size(); i++) { + JsonObject item = topItems.get(i).getAsJsonObject(); + + subcategories.append(EnumChatFormatting.AQUA); + if (item.has("count") && item.get("count").getAsInt() > 1) { + subcategories.append(item.get("count").getAsInt()).append("x").append(" "); + } + subcategories.append(item.get("name").getAsString()); + if (item.has("recomb") && item.get("recomb").getAsBoolean()) { + subcategories.append(" ⇑"); + } + subcategories.append(" ➜ ").append(EnumChatFormatting.GOLD).append(formatPrice(item.get("price").getAsLong())).append("\n"); + } + } + + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.AQUA + username + "'s Networth:\n" + + DankersSkyblockMod.TYPE_COLOUR + "Purse: " + EnumChatFormatting.GOLD + formatPrice(purse) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + "Bank: " + EnumChatFormatting.GOLD + formatPrice(bank) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + "Sacks: " + EnumChatFormatting.GOLD + formatPrice(sacks) + "\n" + + subcategories + "\n" + + DankersSkyblockMod.TYPE_COLOUR + "Total: " + EnumChatFormatting.GOLD + formatPrice(total) + "\n" + + DankersSkyblockMod.DELIMITER_COLOUR + EnumChatFormatting.BOLD + "-------------------")); + } catch (IOException ex) { + ex.printStackTrace(); + } + }).start(); + } + + String formatPrice(long price) { + String[] suffixes = {"", "K", "M", "B", "T"}; + double p = price; + int i = 0; + while ((p / 1000) >= 1) { + p /= 1000; + i++; + } + return new DecimalFormat("#.#").format(p) + suffixes[i]; + } + +} diff --git a/src/main/java/me/Danker/handlers/APIHandler.java b/src/main/java/me/Danker/handlers/APIHandler.java index 736a7d7..3c3d9b2 100644 --- a/src/main/java/me/Danker/handlers/APIHandler.java +++ b/src/main/java/me/Danker/handlers/APIHandler.java @@ -8,6 +8,12 @@ import me.Danker.DankersSkyblockMod; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ChatComponentText; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.util.EntityUtils; import java.io.BufferedReader; import java.io.IOException; @@ -64,6 +70,29 @@ public class APIHandler { return new JsonObject(); } + + public static JsonObject getResponsePOST(String urlString, JsonObject body, boolean hasError) throws IOException { + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + + CloseableHttpClient httpClient = HttpClientBuilder.create().build(); + + try { + HttpPost req = new HttpPost(urlString); + StringEntity params = new StringEntity(body.toString()); + req.addHeader("content-type", "application/json"); + req.setEntity(params); + HttpResponse response = httpClient.execute(req); + + return new Gson().fromJson(EntityUtils.toString(response.getEntity(), "UTF-8"), JsonObject.class); + } catch (Exception ex) { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "An error has occured. See logs for more details.")); + ex.printStackTrace(); + } finally { + httpClient.close(); + } + + return new JsonObject(); + } // Only used for UUID => Username public static JsonArray getArrayResponse(String urlString) { -- cgit From a63cb87198b563edd4ac88b226fd004d0c616360 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Mon, 22 Nov 2021 10:59:12 -0500 Subject: Fix /hotmof error when missing API values --- src/main/java/me/Danker/commands/HOTMCommand.java | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/HOTMCommand.java b/src/main/java/me/Danker/commands/HOTMCommand.java index bfb10f5..35c0b28 100644 --- a/src/main/java/me/Danker/commands/HOTMCommand.java +++ b/src/main/java/me/Danker/commands/HOTMCommand.java @@ -88,9 +88,23 @@ public class HOTMCommand extends CommandBase { System.out.println("Fetching mining stats..."); JsonObject miningCore = profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject().get("mining_core").getAsJsonObject(); - int mithril = miningCore.get("powder_mithril").getAsInt() + miningCore.get("powder_spent_mithril").getAsInt(); - int gemstone = miningCore.get("powder_gemstone").getAsInt() + miningCore.get("powder_spent_gemstone").getAsInt(); - String ability = Node.valueOf(miningCore.get("selected_pickaxe_ability").getAsString()).name; + + int mithril = 0; + if (miningCore.has("powder_mithril")) { + mithril = miningCore.get("powder_mithril").getAsInt(); + if (miningCore.has("powder_spent_mithril")) mithril += miningCore.get("powder_spent_mithril").getAsInt(); + } + + int gemstone = 0; + if (miningCore.has("powder_gemstone")) { + gemstone = miningCore.get("powder_gemstone").getAsInt(); + if (miningCore.has("powder_spent_gemstone")) gemstone += miningCore.get("powder_spent_gemstone").getAsInt(); + } + + String ability = EnumChatFormatting.RED + "None"; + if (miningCore.has("selected_pickaxe_ability")) { + ability = Node.valueOf(miningCore.get("selected_pickaxe_ability").getAsString()).name; + } ChatComponentText tree = new ChatComponentText(EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + "[CLICK]"); tree.setChatStyle(tree.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/hotmtree " + username + " " + latestProfile))); -- cgit From 871e4e7b1257ceb459cd78b33c9f4b107a8ab9bb Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Wed, 24 Nov 2021 17:48:30 -0500 Subject: Re-add blocking click features Add blocking starting wrong slayer quest Add block placing flower weapons Add blocking misclicks in solvers Add F7 arrow terminal solver (Source: https://cdn.discordapp.com/attachments/823769568933576764/906101631861526559/unknown.png) --- README.md | 4 +- src/main/java/me/Danker/DankersSkyblockMod.java | 8 + .../me/Danker/commands/BlockSlayerCommand.java | 105 +++++++++++++ src/main/java/me/Danker/commands/DHelpCommand.java | 1 + .../java/me/Danker/commands/DankerGuiCommand.java | 3 + .../java/me/Danker/commands/ToggleCommand.java | 43 +++--- .../me/Danker/features/BlockPlacingFlowers.java | 45 ++++++ .../java/me/Danker/features/BlockWrongSlayer.java | 42 ++++++ .../puzzlesolvers/ArrowTerminalSolver.java | 55 +++++++ .../puzzlesolvers/BlockWrongTerminalClicks.java | 112 ++++++++++++++ .../features/puzzlesolvers/ChronomatronSolver.java | 17 ++- .../puzzlesolvers/UltrasequencerSolver.java | 24 +++ src/main/java/me/Danker/gui/DankerGui.java | 27 +++- src/main/java/me/Danker/gui/OnlySlayerGui.java | 162 +++++++++++++++++++++ src/main/java/me/Danker/gui/PuzzleSolversGui.java | 20 ++- .../java/me/Danker/handlers/ConfigHandler.java | 11 ++ 16 files changed, 649 insertions(+), 30 deletions(-) create mode 100644 src/main/java/me/Danker/commands/BlockSlayerCommand.java create mode 100644 src/main/java/me/Danker/features/BlockPlacingFlowers.java create mode 100644 src/main/java/me/Danker/features/BlockWrongSlayer.java create mode 100644 src/main/java/me/Danker/features/puzzlesolvers/ArrowTerminalSolver.java create mode 100644 src/main/java/me/Danker/features/puzzlesolvers/BlockWrongTerminalClicks.java create mode 100644 src/main/java/me/Danker/gui/OnlySlayerGui.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index a571231..559b60e 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ Discord Server: https://discord.gg/QsEkNQS - RNGesus drop alerts - Click anywhere on-screen to open Maddox - Maddox menu keybind +- Block starting other slayer quests - Slayer slain alert - Fishing, jerry fishing, fishing festival, spooky fishing trackers - Expertise kills in fishing rod lore @@ -34,7 +35,7 @@ Discord Server: https://discord.gg/QsEkNQS - Dungeons puzzle solver (Riddle, trivia, blaze, creeper, water, tic tac toe, boulder, silverfish, ice walk) - Dungeons timer (watcher, boss, deaths, and puzzle fails) - Watcher ready message -- Catacombs F7 Stage 3 solvers (Starts with letter, select all colour) +- Catacombs F7 Stage 3 solvers (Starts with letter, select all colour, ignore arrows on sea lanterns) - Find correct Livid (with graphic display of HP) - Catacombs F6 and F7 Giant HP display - Use custom music in supported locations @@ -83,6 +84,7 @@ Discord Server: https://discord.gg/QsEkNQS - /weight [player] [lily] - Uses API to get weight of a person. If no name is provided, it checks yours. Adding lily uses lily's weight instead of Senither's. - /importfishing - Imports your fishing stats from your latest profile to your fishing tracker using the API. - /sbplayers - Uses API to find how many players are on each Skyblock island. +- /onlyslayer <1/2/3/4/5> - /skilltracker - Text display for skill xp/hour. - /reparty - Disbands and reparties all members in the party - /fairysouls - Check the fairysouls of a player diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 7aceb20..9fb7876 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -102,10 +102,14 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(new AbilityCooldowns()); MinecraftForge.EVENT_BUS.register(new ArachneESP()); + MinecraftForge.EVENT_BUS.register(new ArrowTerminalSolver()); MinecraftForge.EVENT_BUS.register(new AutoAcceptReparty()); MinecraftForge.EVENT_BUS.register(new AutoDisplay()); MinecraftForge.EVENT_BUS.register(new AutoSwapToPickBlock()); MinecraftForge.EVENT_BUS.register(new BlazeSolver()); + MinecraftForge.EVENT_BUS.register(new BlockPlacingFlowers()); + MinecraftForge.EVENT_BUS.register(new BlockWrongSlayer()); + MinecraftForge.EVENT_BUS.register(new BlockWrongTerminalClicks()); MinecraftForge.EVENT_BUS.register(new BonzoMaskTimer()); MinecraftForge.EVENT_BUS.register(new BoulderSolver()); MinecraftForge.EVENT_BUS.register(new CakeTimer()); @@ -187,6 +191,7 @@ public class DankersSkyblockMod { public void preInit(final FMLPreInitializationEvent event) { ClientCommandHandler.instance.registerCommand(new ArmourCommand()); ClientCommandHandler.instance.registerCommand(new BankCommand()); + ClientCommandHandler.instance.registerCommand(new BlockSlayerCommand()); ClientCommandHandler.instance.registerCommand(new CustomMusicCommand()); ClientCommandHandler.instance.registerCommand(new CrystalHollowWaypointCommand()); ClientCommandHandler.instance.registerCommand(new DHelpCommand()); @@ -429,6 +434,9 @@ public class DankersSkyblockMod { case "displaygui": mc.displayGuiScreen(new DisplayGui()); break; + case "onlyslayergui": + mc.displayGuiScreen(new OnlySlayerGui()); + break; case "editlocations": mc.displayGuiScreen(new EditLocationsGui()); break; diff --git a/src/main/java/me/Danker/commands/BlockSlayerCommand.java b/src/main/java/me/Danker/commands/BlockSlayerCommand.java new file mode 100644 index 0000000..9f51be6 --- /dev/null +++ b/src/main/java/me/Danker/commands/BlockSlayerCommand.java @@ -0,0 +1,105 @@ +package me.Danker.commands; + +import me.Danker.DankersSkyblockMod; +import me.Danker.features.BlockWrongSlayer; +import me.Danker.handlers.ConfigHandler; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; + +import java.util.List; + +public class BlockSlayerCommand extends CommandBase { + + @Override + public String getCommandName() { + return "onlyslayer"; + } + + @Override + public String getCommandUsage(ICommandSender arg0) { + return "/" + getCommandName() + " <1/2/3/4/5>"; + } + + public static String usage(ICommandSender arg0) { + return new BlockSlayerCommand().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + if (args.length == 1) { + return getListOfStringsMatchingLastWord(args, "zombie", "spider", "wolf", "enderman"); + } else if (args.length == 2) { + return getListOfStringsMatchingLastWord(args, "1", "2", "3", "4", "5"); + } + return null; + } + + @Override + public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { + final EntityPlayer player = (EntityPlayer)arg0; + + if (arg1.length == 0 || (arg1.length == 1 && !arg1[0].equalsIgnoreCase("off"))) { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); + return; + } + + switch (arg1[0].toLowerCase()) { + case "zombie": + BlockWrongSlayer.onlySlayerName = "Revenant Horror"; + break; + case "spider": + BlockWrongSlayer.onlySlayerName = "Tarantula Broodfather"; + break; + case "wolf": + BlockWrongSlayer.onlySlayerName = "Sven Packmaster"; + break; + case "off": + BlockWrongSlayer.onlySlayerName = ""; + BlockWrongSlayer.onlySlayerNumber = ""; + ConfigHandler.writeStringConfig("toggles", "BlockSlayer", ""); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Slayer blocking turned off.")); + return; + default: + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); + return; + } + + int slayerNumber = Integer.parseInt(arg1[1]); + // Just manually set to roman numeral, I don't wanna put a whole converter in here + switch (slayerNumber) { + case 1: + BlockWrongSlayer.onlySlayerNumber = "I"; + break; + case 2: + BlockWrongSlayer.onlySlayerNumber = "II"; + break; + case 3: + BlockWrongSlayer.onlySlayerNumber = "III"; + break; + case 4: + BlockWrongSlayer.onlySlayerNumber = "IV"; + break; + case 5: + BlockWrongSlayer.onlySlayerNumber = "V"; + break; + default: + BlockWrongSlayer.onlySlayerName = ""; + BlockWrongSlayer.onlySlayerNumber = ""; + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); + return; + } + + ConfigHandler.writeStringConfig("toggles", "BlockSlayer", BlockWrongSlayer.onlySlayerName + " " + BlockWrongSlayer.onlySlayerNumber); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Slayer blocking set to " + DankersSkyblockMod.SECONDARY_COLOUR + BlockWrongSlayer.onlySlayerName + " " + BlockWrongSlayer.onlySlayerNumber)); + } + +} diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index ea3a5e3..d960237 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -53,6 +53,7 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + WeightCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to get weight of a person. If no name is provided, it checks yours. Adding lily uses lily's weight instead of Senither's.\n" + EnumChatFormatting.GOLD + ImportFishingCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Imports your fishing stats from your latest profile to your fishing tracker using the API.\n" + EnumChatFormatting.GOLD + SkyblockPlayersCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find how many players are on each Skyblock island.\n" + + EnumChatFormatting.GOLD + BlockSlayerCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Stops you from starting a slayer quest other than the one specified.\n" + EnumChatFormatting.GOLD + SkillTrackerCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Text display for skill xp/hour.\n" + EnumChatFormatting.GOLD + LobbyBankCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find the average bank total of the lobby, as well the three players with the highest total money in the bank(and purse).\n" + EnumChatFormatting.GOLD + RepartyCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Disbands and reparties all members in the party.\n" + diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index 0f3b527..0bf82f9 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -57,6 +57,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[splitfishing][").append(ToggleCommand.splitFishing).append("]\n"); debug.append("[chatmaddox][").append(ToggleCommand.chatMaddoxToggled).append("]\n"); debug.append("[spiritbearalerts][").append(ToggleCommand.spiritBearAlerts).append("]\n"); + debug.append("[flowerweapons][").append(ToggleCommand.flowerWeaponsToggled).append("]\n"); debug.append("[sceptremessages][").append(ToggleCommand.sceptreMessages).append("]\n"); debug.append("[petcolors][").append(ToggleCommand.petColoursToggled).append("]\n"); debug.append("[dungeontimer][").append(ToggleCommand.dungeonTimerToggled).append("]\n"); @@ -92,6 +93,8 @@ public class DankerGuiCommand extends CommandBase { debug.append("[startswithterminal][").append(ToggleCommand.startsWithToggled).append("]\n"); debug.append("[selectallterminal][").append(ToggleCommand.selectAllToggled).append("]\n"); debug.append("[clickinorderterminal][").append(ToggleCommand.clickInOrderToggled).append("]\n"); + debug.append("[blockwrongterminalclicks][").append(ToggleCommand.blockWrongTerminalClicksToggled).append("]\n"); + debug.append("[itemframeonsealanterns][").append(ToggleCommand.itemFrameOnSeaLanternsToggled).append("]\n"); debug.append("[ultrasequencer][").append(ToggleCommand.ultrasequencerToggled).append("]\n"); debug.append("[chronomatron][").append(ToggleCommand.chronomatronToggled).append("]\n"); debug.append("[superpairs][").append(ToggleCommand.superpairsToggled).append("]\n"); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 0255915..321458e 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -54,12 +54,12 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean cooldownMessages; public static boolean manaMessages; public static boolean killComboMessages; - // Dungeons Messages public static boolean lowHealthNotifyToggled; public static boolean lividSolverToggled; public static boolean stopSalvageStarredToggled; public static boolean watcherReadyToggled; public static boolean swapToPickBlockToggled; + public static boolean flowerWeaponsToggled; public static boolean notifySlayerSlainToggled; public static boolean necronNotificationsToggled; public static boolean bonzoTimerToggled; @@ -79,6 +79,8 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean startsWithToggled; public static boolean selectAllToggled; public static boolean clickInOrderToggled; + public static boolean blockWrongTerminalClicksToggled; + public static boolean itemFrameOnSeaLanternsToggled; // Experiments public static boolean ultrasequencerToggled; public static boolean chronomatronToggled; @@ -109,23 +111,11 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " "; + return "/" + getCommandName() + " "; } public static String usage(ICommandSender arg0) { - return "/toggle "; + return new ToggleCommand().getCommandUsage(arg0); } @Override @@ -137,7 +127,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", "highlightArachne", - "splitfishing", "chatmaddox", "spiritbearalerts", + "splitfishing", "chatmaddox", "spiritbearalerts", "flowerweapons", "sceptremessages", "petcolors", "dungeontimer", "golemalerts", "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", "implosionmessages", "healmessages", "cooldownmessages", "manamessages", @@ -146,8 +136,8 @@ public class ToggleCommand extends CommandBase implements ICommand { "bonzotimer", "threemanpuzzle", "oruopuzzle", "blazepuzzle", "creeperpuzzle", "creeperlines", "waterpuzzle", "tictactoepuzzle", "boulderpuzzle", "silverfishpuzzle", "icewalkpuzzle", "watchermessage", "startswithterminal", - "selectallterminal", "clickinorderterminal", - "ultrasequencer", "chronomatron", "superpairs", + "selectallterminal", "clickinorderterminal", "blockwrongterminalclicks", + "ultrasequencer", "chronomatron", "superpairs", "itemframeonsealanterns", "hidetooltipsinaddons", "pickblock", "melodytooltips", "highlightslayers", "highlightskeletonmasters", "dungeonbossmusic", "bloodroommusic", "dungeonmusic", "teammatesinradius", "gianthp", "hidepetcandy", "customcolorednames", "endoffarmalert", @@ -219,6 +209,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "SceptreMessages", sceptreMessages); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Spirit Sceptre messages have been set to " + DankersSkyblockMod.SECONDARY_COLOUR + sceptreMessages + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "flowerweapons": + flowerWeaponsToggled = !flowerWeaponsToggled; + ConfigHandler.writeBooleanConfig("toggles", "FlowerWeapons", flowerWeaponsToggled); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Prevent Placing FoT/Spirit Sceptre been set to " + DankersSkyblockMod.SECONDARY_COLOUR + flowerWeaponsToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "midasstaffmessages": midasStaffMessages = !midasStaffMessages; ConfigHandler.writeBooleanConfig("toggles", "MidasStaffMessages", midasStaffMessages); @@ -395,6 +390,16 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "ClickInOrderTerminal", clickInOrderToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Click in order terminal helper has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + selectAllToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "blockwrongterminalclicks": + blockWrongTerminalClicksToggled = !blockWrongTerminalClicksToggled; + ConfigHandler.writeBooleanConfig("toggles", "BlockWrongTerminalClicks", blockWrongTerminalClicksToggled); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Block wrong clicks on terminals has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + blockWrongTerminalClicksToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "itemframeonsealanterns": + itemFrameOnSeaLanternsToggled = !itemFrameOnSeaLanternsToggled; + ConfigHandler.writeBooleanConfig("toggles", "IgnoreItemFrameOnSeaLanterns", itemFrameOnSeaLanternsToggled); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Ignore item frames on sea lanterns has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + itemFrameOnSeaLanternsToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "ultrasequencer": ultrasequencerToggled = !ultrasequencerToggled; ConfigHandler.writeBooleanConfig("toggles", "UltraSequencer", ultrasequencerToggled); @@ -590,6 +595,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Split fishing display: " + DankersSkyblockMod.VALUE_COLOUR + splitFishing + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Chat Maddox menu: " + DankersSkyblockMod.VALUE_COLOUR + chatMaddoxToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Spirit Bear alerts: " + DankersSkyblockMod.VALUE_COLOUR + spiritBearAlerts + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Prevent Placing FoT/Spirit Sceptre: " + DankersSkyblockMod.VALUE_COLOUR + flowerWeaponsToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Spirit Sceptre messages: " + DankersSkyblockMod.VALUE_COLOUR + sceptreMessages + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Midas Staff messages: " + DankersSkyblockMod.VALUE_COLOUR + midasStaffMessages + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Implosion messages: " + DankersSkyblockMod.VALUE_COLOUR + implosionMessages + "\n" + @@ -619,6 +625,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Watcher ready message: " + DankersSkyblockMod.VALUE_COLOUR + watcherReadyToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Starts with letter terminal solver: " + DankersSkyblockMod.VALUE_COLOUR + startsWithToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Select all color items terminal solver: " + DankersSkyblockMod.VALUE_COLOUR + selectAllToggled + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Ignore item frames on sea lanterns: " + DankersSkyblockMod.VALUE_COLOUR + itemFrameOnSeaLanternsToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Ultra sequencer solver: " + DankersSkyblockMod.VALUE_COLOUR + ultrasequencerToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Chronomatron solver: " + DankersSkyblockMod.VALUE_COLOUR + chronomatronToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Superpairs solver: " + DankersSkyblockMod.VALUE_COLOUR + superpairsToggled + "\n" + diff --git a/src/main/java/me/Danker/features/BlockPlacingFlowers.java b/src/main/java/me/Danker/features/BlockPlacingFlowers.java new file mode 100644 index 0000000..580c010 --- /dev/null +++ b/src/main/java/me/Danker/features/BlockPlacingFlowers.java @@ -0,0 +1,45 @@ +package me.Danker.features; + +import me.Danker.commands.ToggleCommand; +import me.Danker.utils.Utils; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.util.ArrayList; +import java.util.Arrays; + +public class BlockPlacingFlowers { + + ArrayList flowerPlaceable = new ArrayList<>(Arrays.asList( + Blocks.grass, + Blocks.dirt, + Blocks.flower_pot, + Blocks.tallgrass, + Blocks.double_plant + )); + + @SubscribeEvent + public void onInteract(PlayerInteractEvent event) { + if (!Utils.inSkyblock || Minecraft.getMinecraft().thePlayer != event.entityPlayer) return; + ItemStack item = event.entityPlayer.getHeldItem(); + if (item == null) return; + + if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) { + Block block = Minecraft.getMinecraft().theWorld.getBlockState(event.pos).getBlock(); + + if (flowerPlaceable.contains(block)) { + if (ToggleCommand.flowerWeaponsToggled && item.getDisplayName().contains("Flower of Truth")) { + event.setCanceled(true); + } + if (ToggleCommand.flowerWeaponsToggled && item.getDisplayName().contains("Spirit Sceptre")) { + event.setCanceled(true); + } + } + } + } + +} diff --git a/src/main/java/me/Danker/features/BlockWrongSlayer.java b/src/main/java/me/Danker/features/BlockWrongSlayer.java new file mode 100644 index 0000000..4e19053 --- /dev/null +++ b/src/main/java/me/Danker/features/BlockWrongSlayer.java @@ -0,0 +1,42 @@ +package me.Danker.features; + +import me.Danker.DankersSkyblockMod; +import me.Danker.events.ChestSlotClickedEvent; +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class BlockWrongSlayer { + + public static String onlySlayerName = ""; + public static String onlySlayerNumber = ""; + + @SubscribeEvent + public void onSlotClick(ChestSlotClickedEvent event) { + String inventoryName = event.inventoryName; + ItemStack item = event.item; + if (!onlySlayerName.equals("") && item != null) { + if (inventoryName.equals("Slayer")) { + if (!item.getDisplayName().contains("Revenant Horror") && !item.getDisplayName().contains("Tarantula Broodfather") && !item.getDisplayName().contains("Sven Packmaster")) + return; + if (!item.getDisplayName().contains(onlySlayerName)) { + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Danker's Skyblock Mod has stopped you from starting this quest (Set to " + onlySlayerName + " " + onlySlayerNumber + ")")); + Minecraft.getMinecraft().thePlayer.playSound("note.bass", 1, (float) 0.5); + event.setCanceled(true); + } + } else if (inventoryName.equals("Revenant Horror") || inventoryName.equals("Tarantula Broodfather") || inventoryName.equals("Sven Packmaster") || inventoryName.equals("Voidgloom Seraph")) { + if (item.getDisplayName().contains("Revenant Horror") || item.getDisplayName().contains("Tarantula Broodfather") || item.getDisplayName().contains("Sven Packmaster") || item.getDisplayName().contains("Voidgloom Seraph")) { + // Only check number as they passed the above check + String slayerNumber = item.getDisplayName().substring(item.getDisplayName().lastIndexOf(" ") + 1); + if (!slayerNumber.equals(onlySlayerNumber)) { + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Danker's Skyblock Mod has stopped you from starting this quest (Set to " + onlySlayerName + " " + onlySlayerNumber + ")")); + Minecraft.getMinecraft().thePlayer.playSound("note.bass", 1, (float) 0.5); + event.setCanceled(true); + } + } + } + } + } + +} diff --git a/src/main/java/me/Danker/features/puzzlesolvers/ArrowTerminalSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/ArrowTerminalSolver.java new file mode 100644 index 0000000..14870f2 --- /dev/null +++ b/src/main/java/me/Danker/features/puzzlesolvers/ArrowTerminalSolver.java @@ -0,0 +1,55 @@ +package me.Danker.features.puzzlesolvers; + +import me.Danker.commands.ToggleCommand; +import me.Danker.events.PacketWriteEvent; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.util.BlockPos; +import net.minecraftforge.event.entity.player.EntityInteractEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class ArrowTerminalSolver { + + @SubscribeEvent + public void onEntityInteract(EntityInteractEvent event) { + Minecraft mc = Minecraft.getMinecraft(); + if (mc.thePlayer != event.entityPlayer) return; + + if (ToggleCommand.itemFrameOnSeaLanternsToggled && Utils.inDungeons && event.target instanceof EntityItemFrame) { + EntityItemFrame itemFrame = (EntityItemFrame) event.target; + ItemStack item = itemFrame.getDisplayedItem(); + if (item == null || item.getItem() != Items.arrow) return; + BlockPos blockPos = Utils.getBlockUnderItemFrame(itemFrame); + if (mc.theWorld.getBlockState(blockPos).getBlock() == Blocks.sea_lantern) { + event.setCanceled(true); + } + } + } + + @SubscribeEvent + public void onPacket(PacketWriteEvent event) { + if (ToggleCommand.itemFrameOnSeaLanternsToggled && Utils.inDungeons && event.packet instanceof C02PacketUseEntity) { + Minecraft mc = Minecraft.getMinecraft(); + C02PacketUseEntity packet = (C02PacketUseEntity) event.packet; + Entity entityHit = packet.getEntityFromWorld(mc.theWorld); + if (entityHit instanceof EntityItemFrame) { + EntityItemFrame itemFrame = (EntityItemFrame) entityHit; + ItemStack item = itemFrame.getDisplayedItem(); + if (item != null && item.getItem() == Items.arrow) { + BlockPos blockPos = Utils.getBlockUnderItemFrame(itemFrame); + if (mc.theWorld.getBlockState(blockPos).getBlock() == Blocks.sea_lantern) { + event.setCanceled(true); + } + } + } + } + + } + +} diff --git a/src/main/java/me/Danker/features/puzzlesolvers/BlockWrongTerminalClicks.java b/src/main/java/me/Danker/features/puzzlesolvers/BlockWrongTerminalClicks.java new file mode 100644 index 0000000..5176e8b --- /dev/null +++ b/src/main/java/me/Danker/features/puzzlesolvers/BlockWrongTerminalClicks.java @@ -0,0 +1,112 @@ +package me.Danker.features.puzzlesolvers; + +import me.Danker.commands.ToggleCommand; +import me.Danker.events.ChestSlotClickedEvent; +import me.Danker.utils.Utils; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StringUtils; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.input.Keyboard; + +public class BlockWrongTerminalClicks { + + @SubscribeEvent + public void onSlotClick(ChestSlotClickedEvent event) { + if (ToggleCommand.blockWrongTerminalClicksToggled && Utils.inDungeons) { + IInventory inventory = event.inventory; + String inventoryName = event.inventoryName; + Slot slot = event.slot; + ItemStack item = event.item; + boolean shouldCancel = false; + + if (item == null) return; + + //most of these are extra but who cares + + switch (inventoryName) { + case "Correct all the panes!": + shouldCancel = !StringUtils.stripControlCodes(item.getDisplayName()).startsWith("Off"); + break; + case "Navigate the maze!": + if (item.getItem() != Item.getItemFromBlock(Blocks.stained_glass_pane)) { + shouldCancel = true; + break; + } + + if (item.getItemDamage() != 0) { + shouldCancel = true; + break; + } + + boolean isValid = false; + + int slotIndex = slot.getSlotIndex(); + + if (slotIndex % 9 != 8 && slotIndex != 53) { + ItemStack itemStack = inventory.getStackInSlot(slotIndex + 1); + if (itemStack != null && itemStack.getItemDamage() == 5) isValid = true; + } + + if (!isValid && slotIndex % 9 != 0 && slotIndex != 0) { + ItemStack itemStack = inventory.getStackInSlot(slotIndex - 1); + if (itemStack != null && itemStack.getItemDamage() == 5) isValid = true; + } + + if (!isValid && slotIndex <= 44) { + ItemStack itemStack = inventory.getStackInSlot(slotIndex + 9); + if (itemStack != null && itemStack.getItemDamage() == 5) isValid = true; + } + + if (!isValid && slotIndex >= 9) { + ItemStack itemStack = inventory.getStackInSlot(slotIndex - 9); + if (itemStack != null && itemStack.getItemDamage() == 5) isValid = true; + } + + shouldCancel = !isValid; + + break; + case "Click in order!": + + if (slot.getSlotIndex() > 35) { + break; + } + + if ((item.getItem() != Item.getItemFromBlock(Blocks.stained_glass_pane))) { + shouldCancel = true; + break; + } + if (item.getItemDamage() != 14) { + shouldCancel = true; + break; + } + int needed = ClickInOrderSolver.terminalNumberNeeded[0]; + if (needed == 0) break; + shouldCancel = needed != -1 && item.stackSize != needed; + break; + } + + if (!shouldCancel) { + if (inventoryName.startsWith("What starts with:")) { + char letter = inventoryName.charAt(inventoryName.indexOf("'") + 1); + shouldCancel = !(StringUtils.stripControlCodes(item.getDisplayName()).charAt(0) == letter); + } else if (inventoryName.startsWith("Select all the")) { + if (SelectAllColourSolver.terminalColorNeeded == null) return; + String itemName = StringUtils.stripControlCodes(item.getDisplayName()).toUpperCase(); + shouldCancel = !(itemName.contains(SelectAllColourSolver.terminalColorNeeded) || + (SelectAllColourSolver.terminalColorNeeded.equals("SILVER") && itemName.contains("LIGHT GRAY")) || + (SelectAllColourSolver.terminalColorNeeded.equals("WHITE") && (itemName.equals("WOOL") || itemName.equals("BONE MEAL"))) || + (SelectAllColourSolver.terminalColorNeeded.equals("BLACK") && itemName.equals("INK SACK")) || + (SelectAllColourSolver.terminalColorNeeded.equals("BLUE") && itemName.equals("LAPIS LAZULI")) || + (SelectAllColourSolver.terminalColorNeeded.equals("BROWN") && itemName.equals("COCOA BEAN"))); + } + } + + event.setCanceled(shouldCancel && !Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && !Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)); + } + } + +} diff --git a/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java index 51ffd0d..52da0ec 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java @@ -15,6 +15,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.StringUtils; import net.minecraftforge.client.event.GuiOpenEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.input.Keyboard; import java.util.ArrayList; import java.util.List; @@ -32,10 +33,22 @@ public class ChronomatronSolver { if (ToggleCommand.chronomatronToggled && event.inventoryName.startsWith("Chronomatron (")) { IInventory inventory = event.inventory; ItemStack item = event.item; - if (item == null) return; + + if (item == null) { + if (event.isCancelable() && !Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && !Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)) { + event.setCanceled(true); + } + return; + } if (inventory.getStackInSlot(49).getDisplayName().startsWith("§7Timer: §a") && (item.getItem() == Item.getItemFromBlock(Blocks.stained_glass) || item.getItem() == Item.getItemFromBlock(Blocks.stained_hardened_clay))) { - chronomatronMouseClicks++; + if (chronomatronPattern.size() > chronomatronMouseClicks && !item.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks))) { + if (event.isCancelable() && !Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && !Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)) { + event.setCanceled(true); + } + } + } else if (inventory.getStackInSlot(49).getDisplayName().startsWith("§aRemember the pattern!")) { + if (event.isCancelable()) event.setCanceled(true); } } } diff --git a/src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java index a3a97b6..6608555 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java @@ -1,17 +1,20 @@ package me.Danker.features.puzzlesolvers; import me.Danker.commands.ToggleCommand; +import me.Danker.events.ChestSlotClickedEvent; import me.Danker.events.GuiChestBackgroundDrawnEvent; import me.Danker.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.inventory.ContainerChest; +import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.util.StringUtils; import net.minecraftforge.client.event.GuiOpenEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; +import org.lwjgl.input.Keyboard; import java.util.List; @@ -49,6 +52,27 @@ public class UltrasequencerSolver { } } + @SubscribeEvent + public void onSlotClick(ChestSlotClickedEvent event) { + if (ToggleCommand.ultrasequencerToggled && event.inventoryName.startsWith("Ultrasequencer (")) { + IInventory inventory = event.inventory; + if (event.item == null) { + if (event.isCancelable() && !Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && !Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)) + event.setCanceled(true); + return; + } + if (inventory.getStackInSlot(49).getDisplayName().equals("§aRemember the pattern!")) { + if (event.isCancelable()) event.setCanceled(true); + } else if (inventory.getStackInSlot(49).getDisplayName().startsWith("§7Timer: §a")) { + if (clickInOrderSlots[lastUltraSequencerClicked] != null && event.slot.getSlotIndex() != clickInOrderSlots[lastUltraSequencerClicked].getSlotIndex()) { + if (event.isCancelable() && !Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && !Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)) { + event.setCanceled(true); + } + } + } + } + } + @SubscribeEvent public void onGuiRender(GuiChestBackgroundDrawnEvent event) { if (ToggleCommand.ultrasequencerToggled && event.displayName.startsWith("Ultrasequencer (")) { diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 7f407a6..acd997e 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -37,6 +37,7 @@ public class DankerGui extends GuiScreen { private GuiTextField search; private GuiButton changeDisplay; + private GuiButton onlySlayer; private GuiButton puzzleSolvers; private GuiButton experimentationTableSolvers; private GuiButton skillTracker; @@ -72,6 +73,14 @@ public class DankerGui extends GuiScreen { private GuiButton gemstoneLore; private GuiButton autoAcceptReparty; private GuiButton abilityCooldown; + private GuiButton dungeonTimer; + private GuiButton lowHealthNotify; + private GuiButton lividSolver; + private GuiButton stopSalvageStarred; + private GuiButton watcherReadyMessage; + private GuiButton flowerWeapons; + private GuiButton necronNotifications; + private GuiButton bonzoTimer; // Chat Messages private GuiButton sceptreMessages; private GuiButton midasStaffMessages; @@ -80,14 +89,6 @@ public class DankerGui extends GuiScreen { private GuiButton cooldownMessages; private GuiButton manaMessages; private GuiButton killComboMessages; - // Dungeons - private GuiButton dungeonTimer; - private GuiButton lowHealthNotify; - private GuiButton lividSolver; - private GuiButton stopSalvageStarred; - private GuiButton watcherReadyMessage; - private GuiButton necronNotifications; - private GuiButton bonzoTimer; public DankerGui(int page, String searchText) { this.page = page; @@ -117,6 +118,7 @@ public class DankerGui extends GuiScreen { search = new GuiTextField(0, this.fontRendererObj, width - 202, 5, 200, 20); changeDisplay = new GuiButton(0, 0, 0, "Change Display Settings"); + onlySlayer = new GuiButton(0, 0, 0, "Set Slayer Quest"); puzzleSolvers = new GuiButton(0, 0, 0, "Toggle Dungeons Puzzle Solvers"); experimentationTableSolvers = new GuiButton(0, 0, 0, "Toggle Experimentation Table Solvers"); skillTracker = new GuiButton(0, 0, 0, "Toggle Skill XP/Hour Tracking"); @@ -149,6 +151,7 @@ public class DankerGui extends GuiScreen { dungeonTimer = new FeatureButton("Display Dungeon Timers: " + Utils.getColouredBoolean(ToggleCommand.dungeonTimerToggled), "Displays timing of certain dungeon objectives and other information."); stopSalvageStarred = new FeatureButton("Stop Salvaging Starred Items: " + Utils.getColouredBoolean(ToggleCommand.stopSalvageStarredToggled), "Blocks salvaging starred items."); watcherReadyMessage = new FeatureButton("Display Watcher Ready Message: " + Utils.getColouredBoolean(ToggleCommand.watcherReadyToggled), "Alerts when Watcher finishes spawning mobs."); + flowerWeapons = new FeatureButton("Prevent Placing FoT/Spirit Sceptre: " + Utils.getColouredBoolean(ToggleCommand.flowerWeaponsToggled), "Blocks placing Flower of Truth or Spirit Sceptre."); notifySlayerSlain = new FeatureButton("Notify when Slayer Slain: " + Utils.getColouredBoolean(ToggleCommand.notifySlayerSlainToggled), "Alerts when slayer boss has been slain."); necronNotifications = new FeatureButton("Necron Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled), "Creates alert on different phases of the Necron fight."); bonzoTimer = new FeatureButton("Bonzo's Mask Timer: " + Utils.getColouredBoolean(ToggleCommand.bonzoTimerToggled), "Displays cooldown of Bonzo Mask ability."); @@ -168,6 +171,7 @@ public class DankerGui extends GuiScreen { allButtons.clear(); allButtons.add(changeDisplay); + allButtons.add(onlySlayer); allButtons.add(puzzleSolvers); allButtons.add(experimentationTableSolvers); allButtons.add(skillTracker); @@ -200,6 +204,7 @@ public class DankerGui extends GuiScreen { allButtons.add(dungeonTimer); allButtons.add(stopSalvageStarred); allButtons.add(watcherReadyMessage); + allButtons.add(flowerWeapons); allButtons.add(notifySlayerSlain); allButtons.add(necronNotifications); allButtons.add(bonzoTimer); @@ -298,6 +303,8 @@ public class DankerGui extends GuiScreen { } } else if (button == changeDisplay) { DankersSkyblockMod.guiToOpen = "displaygui"; + } else if (button == onlySlayer) { + DankersSkyblockMod.guiToOpen = "onlyslayergui"; } else if (button == puzzleSolvers) { DankersSkyblockMod.guiToOpen = "puzzlesolvers"; } else if (button == experimentationTableSolvers) { @@ -424,6 +431,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.swapToPickBlockToggled = !ToggleCommand.swapToPickBlockToggled; ConfigHandler.writeBooleanConfig("toggles", "PickBlock", ToggleCommand.swapToPickBlockToggled); pickBlock.displayString = "Auto-Swap to Pick Block: " + Utils.getColouredBoolean(ToggleCommand.swapToPickBlockToggled); + } else if (button == flowerWeapons) { + ToggleCommand.flowerWeaponsToggled = !ToggleCommand.flowerWeaponsToggled; + ConfigHandler.writeBooleanConfig("toggles", "FlowerWeapons", ToggleCommand.flowerWeaponsToggled); + flowerWeapons.displayString = "Prevent Placing FoT/Spirit Sceptre: " + Utils.getColouredBoolean(ToggleCommand.flowerWeaponsToggled); } else if (button == autoSkillTracker) { ToggleCommand.autoSkillTrackerToggled = !ToggleCommand.autoSkillTrackerToggled; ConfigHandler.writeBooleanConfig("toggles", "AutoSkillTracker", ToggleCommand.autoSkillTrackerToggled); diff --git a/src/main/java/me/Danker/gui/OnlySlayerGui.java b/src/main/java/me/Danker/gui/OnlySlayerGui.java new file mode 100644 index 0000000..8d56156 --- /dev/null +++ b/src/main/java/me/Danker/gui/OnlySlayerGui.java @@ -0,0 +1,162 @@ +package me.Danker.gui; + +import me.Danker.DankersSkyblockMod; +import me.Danker.commands.ToggleCommand; +import me.Danker.features.BlockWrongSlayer; +import me.Danker.handlers.ConfigHandler; +import me.Danker.handlers.TextRenderer; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; + +public class OnlySlayerGui extends GuiScreen { + + private int onlyNumberInt = 4; + private String onlyName = "Revenant Horror"; + + private GuiButton goBack; + private GuiButton off; + private GuiButton zombie; + private GuiButton spider; + private GuiButton wolf; + private GuiButton enderman; + private GuiButton one; + private GuiButton two; + private GuiButton three; + private GuiButton four; + private GuiButton five; + + @Override + public boolean doesGuiPauseGame() { + return false; + } + + @Override + public void initGui() { + super.initGui(); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int height = sr.getScaledHeight(); + int width = sr.getScaledWidth(); + + onlyName = BlockWrongSlayer.onlySlayerName; + switch (BlockWrongSlayer.onlySlayerNumber) { + case "I": + onlyNumberInt = 1; + break; + case "II": + onlyNumberInt = 2; + break; + case "III": + onlyNumberInt = 3; + break; + case "IV": + default: + onlyNumberInt = 4; + break; + case "V": + onlyNumberInt = 5; + break; + } + + goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); + off = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Off"); + zombie = new GuiButton(0, width / 2 - 230, (int) (height * 0.4), 100, 20, "Zombie"); + spider = new GuiButton(0, width / 2 - 110, (int) (height * 0.4), 100, 20, "Spider"); + wolf = new GuiButton(0, width / 2 + 10, (int) (height * 0.4), 100, 20, "Wolf"); + enderman = new GuiButton(0, width / 2 + 130, (int) (height * 0.4), 100, 20, "Enderman"); + one = new GuiButton(0, width / 2 - 190, (int) (height * 0.6), 60, 20, "I"); + two = new GuiButton(0, width / 2 - 110, (int) (height * 0.6), 60, 20, "II"); + three = new GuiButton(0, width / 2 - 30, (int) (height * 0.6), 60, 20, "III"); + four = new GuiButton(0, width / 2 + 50, (int) (height * 0.6), 60, 20, "IV"); + five = new GuiButton(0, width / 2 + 130, (int) (height * 0.6), 60, 20, "V"); + + this.buttonList.add(off); + this.buttonList.add(zombie); + this.buttonList.add(spider); + this.buttonList.add(wolf); + this.buttonList.add(enderman); + this.buttonList.add(one); + this.buttonList.add(two); + this.buttonList.add(three); + this.buttonList.add(four); + this.buttonList.add(five); + this.buttonList.add(goBack); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + Minecraft mc = Minecraft.getMinecraft(); + + String displayText; + if (BlockWrongSlayer.onlySlayerName.equals("")) { + displayText = "Only Allow Slayer: Off"; + } else { + displayText = "Only Allow Slayer: " + BlockWrongSlayer.onlySlayerName + " " + BlockWrongSlayer.onlySlayerNumber; + } + int displayWidth = mc.fontRendererObj.getStringWidth(displayText); + new TextRenderer(mc, displayText, width / 2 - displayWidth / 2, 10, 1D); + + super.drawScreen(mouseX, mouseY, partialTicks); + } + + @Override + public void actionPerformed(GuiButton button) { + if (button == goBack) { + DankersSkyblockMod.guiToOpen = "dankergui1"; + return; + } else if (button == off) { + BlockWrongSlayer.onlySlayerName = ""; + BlockWrongSlayer.onlySlayerNumber = ""; + ConfigHandler.writeStringConfig("toggles", "BlockSlayer", ""); + return; + } else if (button == zombie) { + onlyName = "Revenant Horror"; + } else if (button == spider) { + onlyName = "Tarantula Broodfather"; + } else if (button == wolf) { + onlyName = "Sven Packmaster"; + } else if (button == enderman) { + onlyName = "Voidgloom Seraph"; + } else if (button == one) { + onlyNumberInt = 1; + } else if (button == two) { + onlyNumberInt = 2; + } else if (button == three) { + onlyNumberInt = 3; + } else if (button == four) { + onlyNumberInt = 4; + } else if (button == five) { + onlyNumberInt = 5; + } + + String onlyNumber; + switch (onlyNumberInt) { + case 1: + onlyNumber = "I"; + break; + case 2: + onlyNumber = "II"; + break; + case 3: + onlyNumber = "III"; + break; + case 4: + onlyNumber = "IV"; + break; + case 5: + onlyNumber = "V"; + break; + default: + onlyNumber = "IV"; + } + + BlockWrongSlayer.onlySlayerName = onlyName; + BlockWrongSlayer.onlySlayerNumber = onlyNumber; + ConfigHandler.writeStringConfig("toggles", "BlockSlayer", BlockWrongSlayer.onlySlayerName + " " + BlockWrongSlayer.onlySlayerNumber); + } + +} diff --git a/src/main/java/me/Danker/gui/PuzzleSolversGui.java b/src/main/java/me/Danker/gui/PuzzleSolversGui.java index f671f33..27233d8 100644 --- a/src/main/java/me/Danker/gui/PuzzleSolversGui.java +++ b/src/main/java/me/Danker/gui/PuzzleSolversGui.java @@ -29,6 +29,8 @@ public class PuzzleSolversGui extends GuiScreen { private GuiButton startsWith; private GuiButton selectAll; private GuiButton clickOrder; + private GuiButton blockClicks; + private GuiButton itemFrameOnSeaLanterns; public PuzzleSolversGui(int page) { this.page = page; @@ -66,7 +68,10 @@ public class PuzzleSolversGui extends GuiScreen { startsWith = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Starts With Letter Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.startsWithToggled)); selectAll = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Select All Color Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.selectAllToggled)); clickOrder = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Click in Order Terminal Helper: " + Utils.getColouredBoolean(ToggleCommand.clickInOrderToggled)); - + blockClicks = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Block Wrong Clicks on Terminals: " + Utils.getColouredBoolean(ToggleCommand.blockWrongTerminalClicksToggled)); + // Page 3 + itemFrameOnSeaLanterns = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Ignore Arrows On Sea Lanterns: " + Utils.getColouredBoolean(ToggleCommand.itemFrameOnSeaLanternsToggled)); + switch (page) { case 1: this.buttonList.add(riddle); @@ -85,8 +90,13 @@ public class PuzzleSolversGui extends GuiScreen { this.buttonList.add(startsWith); this.buttonList.add(selectAll); this.buttonList.add(clickOrder); + this.buttonList.add(blockClicks); + this.buttonList.add(nextPage); this.buttonList.add(backPage); break; + case 3: + this.buttonList.add(itemFrameOnSeaLanterns); + this.buttonList.add(backPage); } this.buttonList.add(goBack); } @@ -157,6 +167,14 @@ public class PuzzleSolversGui extends GuiScreen { ToggleCommand.clickInOrderToggled = !ToggleCommand.clickInOrderToggled; ConfigHandler.writeBooleanConfig("toggles", "ClickInOrderTerminal", ToggleCommand.clickInOrderToggled); clickOrder.displayString = "Click in Order Terminal Helper: " + Utils.getColouredBoolean(ToggleCommand.clickInOrderToggled); + } else if (button == blockClicks) { + ToggleCommand.blockWrongTerminalClicksToggled = !ToggleCommand.blockWrongTerminalClicksToggled; + ConfigHandler.writeBooleanConfig("toggles", "BlockWrongTerminalClicks", ToggleCommand.blockWrongTerminalClicksToggled); + blockClicks.displayString = "Block Wrong Clicks on Terminals: " + Utils.getColouredBoolean(ToggleCommand.blockWrongTerminalClicksToggled); + } else if (button == itemFrameOnSeaLanterns) { + ToggleCommand.itemFrameOnSeaLanternsToggled = !ToggleCommand.itemFrameOnSeaLanternsToggled; + ConfigHandler.writeBooleanConfig("toggles", "IgnoreItemFrameOnSeaLanterns", ToggleCommand.itemFrameOnSeaLanternsToggled); + itemFrameOnSeaLanterns.displayString = "Ignore Arrows On Sea Lanterns: " + Utils.getColouredBoolean(ToggleCommand.itemFrameOnSeaLanternsToggled); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 9195184..2a765ad 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -238,6 +238,7 @@ public class ConfigHandler { ToggleCommand.necronNotificationsToggled = initBoolean("toggles", "NecronNotifications", false); ToggleCommand.bonzoTimerToggled = initBoolean("toggles", "BonzoTimer", false); ToggleCommand.swapToPickBlockToggled = initBoolean("toggles", "PickBlock", false); + ToggleCommand.flowerWeaponsToggled = initBoolean("toggles", "FlowerWeapons", false); ToggleCommand.autoSkillTrackerToggled = initBoolean("toggles", "AutoSkillTracker", false); // Puzzle Solvers ToggleCommand.threeManToggled = initBoolean("toggles", "ThreeManPuzzle", false); @@ -253,6 +254,8 @@ public class ConfigHandler { ToggleCommand.startsWithToggled = initBoolean("toggles", "StartsWithTerminal", false); ToggleCommand.selectAllToggled = initBoolean("toggles", "SelectAllTerminal", false); ToggleCommand.clickInOrderToggled = initBoolean("toggles", "ClickInOrderTerminal", false); + ToggleCommand.blockWrongTerminalClicksToggled = initBoolean("toggles", "BlockWrongTerminalClicks", false); + ToggleCommand.itemFrameOnSeaLanternsToggled = initBoolean("toggles", "IgnoreItemFrameOnSeaLanterns", false); // Experiment Solvers ToggleCommand.ultrasequencerToggled = initBoolean("toggles", "UltraSequencer", false); ToggleCommand.chronomatronToggled = initBoolean("toggles", "Chronomatron", false); @@ -293,6 +296,14 @@ public class ConfigHandler { // API if (!hasKey("api", "APIKey")) writeStringConfig("api", "APIKey", ""); + + // Block Wrong Slayer + if (!hasKey("toggles", "BlockSlayer")) writeStringConfig("toggles", "BlockSlayer", ""); + String onlySlayer = getString("toggles", "BlockSlayer"); + if (!onlySlayer.equals("")) { + BlockWrongSlayer.onlySlayerName = onlySlayer.substring(0, onlySlayer.lastIndexOf(" ")); + BlockWrongSlayer.onlySlayerNumber = onlySlayer.substring(onlySlayer.lastIndexOf(" ") + 1); + } // Wolf WolfTracker.wolfSvens = initInt("wolf", "svens", 0); -- cgit From b733d88cb79942d4a260293d1bb1f2d27fcc61e2 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Wed, 24 Nov 2021 18:04:34 -0500 Subject: Fix gemstone lore with mining, combat and defensive slots --- src/main/java/me/Danker/features/GemstonesLore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/GemstonesLore.java b/src/main/java/me/Danker/features/GemstonesLore.java index dfae746..c633c58 100644 --- a/src/main/java/me/Danker/features/GemstonesLore.java +++ b/src/main/java/me/Danker/features/GemstonesLore.java @@ -54,7 +54,7 @@ public class GemstonesLore { if (!Character.isDigit(last)) continue; String gemstone = " " + Utils.capitalizeString(gems.getString(gem)) + " "; - if (gem.startsWith("UNIVERSAL_")) { + if (gem.startsWith("UNIVERSAL_") || gem.startsWith("MINING_") || gem.startsWith("COMBAT_") || gem.startsWith("DEFENSIVE_")) { gemstone += Utils.capitalizeString(gems.getString(gem + "_gem")); } else { gemstone += Utils.capitalizeString(gem.substring(0, gem.indexOf("_"))); -- cgit From c466240003b130b43c17da9e585b80380154e4c4 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Wed, 24 Nov 2021 21:58:26 -0500 Subject: Add custom alerts based on chat Also move some other stuff around --- README.md | 1 + src/main/java/me/Danker/DankersSkyblockMod.java | 25 +--- .../java/me/Danker/commands/ToggleCommand.java | 11 +- src/main/java/me/Danker/features/Alerts.java | 81 ++++++++++++ .../me/Danker/gui/CrystalHollowAddWaypointGui.java | 118 ----------------- .../Danker/gui/CrystalHollowWaypointActionGui.java | 94 ------------- .../me/Danker/gui/CrystalHollowWaypointsGui.java | 144 -------------------- src/main/java/me/Danker/gui/CustomMusicGui.java | 2 +- src/main/java/me/Danker/gui/DankerGui.java | 23 ++-- src/main/java/me/Danker/gui/DisplayGui.java | 2 +- src/main/java/me/Danker/gui/ExperimentsGui.java | 2 +- src/main/java/me/Danker/gui/OnlySlayerGui.java | 2 +- src/main/java/me/Danker/gui/PuzzleSolversGui.java | 2 +- src/main/java/me/Danker/gui/SkillTrackerGui.java | 2 +- .../java/me/Danker/gui/alerts/AlertActionGui.java | 82 ++++++++++++ .../java/me/Danker/gui/alerts/AlertAddGui.java | 130 ++++++++++++++++++ src/main/java/me/Danker/gui/alerts/AlertsGui.java | 104 +++++++++++++++ .../CrystalHollowAddWaypointGui.java | 118 +++++++++++++++++ .../CrystalHollowWaypointActionGui.java | 95 ++++++++++++++ .../CrystalHollowWaypointsGui.java | 145 +++++++++++++++++++++ .../java/me/Danker/handlers/ConfigHandler.java | 42 ++++-- 21 files changed, 821 insertions(+), 404 deletions(-) create mode 100644 src/main/java/me/Danker/features/Alerts.java delete mode 100644 src/main/java/me/Danker/gui/CrystalHollowAddWaypointGui.java delete mode 100644 src/main/java/me/Danker/gui/CrystalHollowWaypointActionGui.java delete mode 100644 src/main/java/me/Danker/gui/CrystalHollowWaypointsGui.java create mode 100644 src/main/java/me/Danker/gui/alerts/AlertActionGui.java create mode 100644 src/main/java/me/Danker/gui/alerts/AlertAddGui.java create mode 100644 src/main/java/me/Danker/gui/alerts/AlertsGui.java create mode 100644 src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowAddWaypointGui.java create mode 100644 src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointActionGui.java create mode 100644 src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 559b60e..4f82ca3 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ Discord Server: https://discord.gg/QsEkNQS - Custom name colors - Crystal Hollows waypoints (with SkyblockExtras support) - Ability cooldowns display +- Custom alerts based on chat ## Commands - /dhelp - Returns this message in-game. diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 9fb7876..2ad5141 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -9,6 +9,7 @@ import me.Danker.features.*; import me.Danker.features.loot.*; import me.Danker.features.puzzlesolvers.*; import me.Danker.gui.*; +import me.Danker.gui.crystalhollowwaypoints.CrystalHollowWaypointsGui; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.PacketHandler; import me.Danker.utils.RenderUtils; @@ -101,6 +102,7 @@ public class DankersSkyblockMod { public void init(FMLInitializationEvent event) throws UnsupportedAudioFileException, IOException, LineUnavailableException { MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(new AbilityCooldowns()); + MinecraftForge.EVENT_BUS.register(new Alerts()); MinecraftForge.EVENT_BUS.register(new ArachneESP()); MinecraftForge.EVENT_BUS.register(new ArrowTerminalSolver()); MinecraftForge.EVENT_BUS.register(new AutoAcceptReparty()); @@ -170,6 +172,8 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new WolfTracker()); MinecraftForge.EVENT_BUS.register(new ZombieTracker()); + Alerts.configFile = configDirectory + "/dsmalerts.json"; + ConfigHandler.reloadConfig(); GoldenEnchants.init(); TriviaSolver.init(); @@ -434,27 +438,6 @@ public class DankersSkyblockMod { case "displaygui": mc.displayGuiScreen(new DisplayGui()); break; - case "onlyslayergui": - mc.displayGuiScreen(new OnlySlayerGui()); - break; - case "editlocations": - mc.displayGuiScreen(new EditLocationsGui()); - break; - case "puzzlesolvers": - mc.displayGuiScreen(new PuzzleSolversGui(1)); - break; - case "experimentsolvers": - mc.displayGuiScreen(new ExperimentsGui()); - break; - case "skilltracker": - mc.displayGuiScreen(new SkillTrackerGui()); - break; - case "custommusic": - mc.displayGuiScreen(new CustomMusicGui(1)); - break; - case "crystalwaypoints": - mc.displayGuiScreen(new CrystalHollowWaypointsGui(1)); - break; case "inventory": mc.displayGuiScreen(InventoryCommand.chest); break; diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 321458e..d9ef9b3 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -46,6 +46,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean crystalAutoWaypoints; public static boolean autoAcceptReparty; public static boolean abilityCooldowns; + public static boolean alerts; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; @@ -144,7 +145,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "gemstonelore", "crystalhollowwaypoints", "crystalautowaypoints", "autoacceptreparty", "itemcooldowns", "hubmusic", "islandmusic", "dungeonhubmusic", "farmingislandsmusic", "goldminemusic", "deepcavernsmusic", "dwarvenminesmusic", "crystalhollowsmusic", "spidersdenmusic", "blazingfortressmusic", - "endmusic", "parkmusic", "list"); + "endmusic", "parkmusic", "alerts", "list"); } return null; } @@ -586,6 +587,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "DungeonMusic", parkMusic); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom park music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + parkMusic + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "alert": + alerts = !alerts; + ConfigHandler.writeBooleanConfig("toggles", "Alerts", alerts); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Alerts has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + alerts + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "list": player.addChatMessage(new ChatComponentText(DankersSkyblockMod.TYPE_COLOUR + "Guild party notifications: " + DankersSkyblockMod.VALUE_COLOUR + gpartyToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Coord/Angle display: " + DankersSkyblockMod.VALUE_COLOUR + coordsToggled + "\n" + @@ -659,7 +665,8 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Custom spider's den music: " + DankersSkyblockMod.VALUE_COLOUR + spidersDenMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom blazing fortress music: " + DankersSkyblockMod.VALUE_COLOUR + blazingFortressMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom end music: " + DankersSkyblockMod.VALUE_COLOUR + endMusic + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Custom park music: " + DankersSkyblockMod.VALUE_COLOUR + parkMusic + DankersSkyblockMod.TYPE_COLOUR + " Custom park music: " + DankersSkyblockMod.VALUE_COLOUR + parkMusic + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Alerts: " + DankersSkyblockMod.VALUE_COLOUR + alerts )); break; default: diff --git a/src/main/java/me/Danker/features/Alerts.java b/src/main/java/me/Danker/features/Alerts.java new file mode 100644 index 0000000..2a00fef --- /dev/null +++ b/src/main/java/me/Danker/features/Alerts.java @@ -0,0 +1,81 @@ +package me.Danker.features; + +import com.google.gson.GsonBuilder; +import me.Danker.commands.ToggleCommand; +import me.Danker.utils.Utils; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StringUtils; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.io.FileWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +public class Alerts { + + public static List alerts = new ArrayList<>(); + public static String configFile; + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent event) { + if (!ToggleCommand.alerts || !Utils.inSkyblock || event.type == 2) return; + + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + + for (Alert alert : alerts) { + if (!alert.toggled) continue; + + boolean trigger; + switch (alert.mode) { + case "Starts With": + trigger = message.startsWith(alert.message); + break; + case "Contains": + trigger = message.contains(alert.message); + break; + case "Ends With": + trigger = message.endsWith(alert.message); + break; + default: + continue; + } + + if (trigger) { + Utils.createTitle(EnumChatFormatting.RED + alert.alert.replace("&", "§"), 2); + return; + } + } + } + + public static void saveToFile() { + try (FileWriter writer = new FileWriter(configFile)) { + new GsonBuilder().create().toJson(alerts, writer); + writer.flush(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + + public static class Alert { + + public String mode; + public String message; + public String alert; + public boolean toggled; + + public Alert(String mode, String message, String alert, boolean toggled) { + this.mode = mode; + this.message = message; + this.alert = alert; + this.toggled = toggled; + } + + public void toggle() { + toggled = !toggled; + } + + } + +} diff --git a/src/main/java/me/Danker/gui/CrystalHollowAddWaypointGui.java b/src/main/java/me/Danker/gui/CrystalHollowAddWaypointGui.java deleted file mode 100644 index 7bb26cf..0000000 --- a/src/main/java/me/Danker/gui/CrystalHollowAddWaypointGui.java +++ /dev/null @@ -1,118 +0,0 @@ -package me.Danker.gui; - -import me.Danker.features.CrystalHollowWaypoints; -import me.Danker.handlers.TextRenderer; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; - -import java.io.IOException; - -public class CrystalHollowAddWaypointGui extends GuiScreen { - - private GuiButton cancel; - - private GuiTextField name; - private GuiButton curPos; - private GuiTextField x; - private GuiTextField y; - private GuiTextField z; - private GuiButton add; - - @Override - public boolean doesGuiPauseGame() { - return false; - } - - @Override - public void initGui() { - super.initGui(); - - ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); - int height = sr.getScaledHeight(); - int width = sr.getScaledWidth(); - - cancel = new GuiButton(0, 2, height - 30, 100, 20, "Cancel"); - - name = new GuiTextField(0, this.fontRendererObj, width / 2 - 100, (int) (height * 0.1), 200, 20); - curPos = new GuiButton(0, width / 2 - 50, (int) (height * 0.25), 100, 20, "Current Position"); - x = new GuiTextField(0, this.fontRendererObj, width / 2 - 85, (int) (height * 0.4), 50, 20); - y = new GuiTextField(0, this.fontRendererObj, width / 2 - 25, (int) (height * 0.4), 50, 20); - z = new GuiTextField(0, this.fontRendererObj, width / 2 + 35, (int) (height * 0.4), 50, 20); - add = new GuiButton(0, width / 2 - 25, (int) (height * 0.6), 50, 20, "Add"); - - name.setVisible(true); - name.setEnabled(true); - x.setVisible(true); - x.setEnabled(true); - y.setVisible(true); - y.setEnabled(true); - z.setVisible(true); - z.setEnabled(true); - - this.buttonList.add(cancel); - this.buttonList.add(curPos); - this.buttonList.add(add); - } - - @Override - public void drawScreen(int mouseX, int mouseY, float partialTicks) { - this.drawDefaultBackground(); - super.drawScreen(mouseX, mouseY, partialTicks); - - name.drawTextBox(); - x.drawTextBox(); - y.drawTextBox(); - z.drawTextBox(); - - new TextRenderer(mc, "X:", width / 2 - 85, (int) (height * 0.35), 1D); - new TextRenderer(mc, "Y:", width / 2 - 25, (int) (height * 0.35), 1D); - new TextRenderer(mc, "Z:", width / 2 + 35, (int) (height * 0.35), 1D); - } - - @Override - public void actionPerformed(GuiButton button) { - EntityPlayer player = Minecraft.getMinecraft().thePlayer; - - if (button == cancel) { - mc.displayGuiScreen(new CrystalHollowWaypointsGui(1)); - } else if (button == curPos) { - x.setText(Integer.toString(player.getPosition().getX())); - y.setText(Integer.toString(player.getPosition().getY())); - z.setText(Integer.toString(player.getPosition().getZ())); - } else if (button == add) { - String loc = name.getText().length() == 0 ? Integer.toString(CrystalHollowWaypoints.waypoints.size()) : name.getText(); - int xPos = x.getText().matches("[-]?\\d+") ? Integer.parseInt(x.getText()) : player.getPosition().getX(); - int yPos = y.getText().matches("[-]?\\d+") ? Integer.parseInt(y.getText()) : player.getPosition().getY(); - int zPos = z.getText().matches("[-]?\\d+") ? Integer.parseInt(z.getText()) : player.getPosition().getZ(); - - BlockPos pos = new BlockPos(xPos, yPos, zPos); - CrystalHollowWaypoints.waypoints.add(new CrystalHollowWaypoints.Waypoint(loc, pos)); - - mc.displayGuiScreen(new CrystalHollowWaypointsGui(1)); - } - } - - @Override - protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { - super.mouseClicked(mouseX, mouseY, mouseButton); - name.mouseClicked(mouseX, mouseY, mouseButton); - x.mouseClicked(mouseX, mouseY, mouseButton); - y.mouseClicked(mouseX, mouseY, mouseButton); - z.mouseClicked(mouseX, mouseY, mouseButton); - } - - @Override - protected void keyTyped(char typedChar, int keyCode) throws IOException { - super.keyTyped(typedChar, keyCode); - name.textboxKeyTyped(typedChar, keyCode); - x.textboxKeyTyped(typedChar, keyCode); - y.textboxKeyTyped(typedChar, keyCode); - z.textboxKeyTyped(typedChar, keyCode); - } - -} diff --git a/src/main/java/me/Danker/gui/CrystalHollowWaypointActionGui.java b/src/main/java/me/Danker/gui/CrystalHollowWaypointActionGui.java deleted file mode 100644 index 1575c18..0000000 --- a/src/main/java/me/Danker/gui/CrystalHollowWaypointActionGui.java +++ /dev/null @@ -1,94 +0,0 @@ -package me.Danker.gui; - -import me.Danker.DankersSkyblockMod; -import me.Danker.features.CrystalHollowWaypoints; -import me.Danker.handlers.TextRenderer; -import me.Danker.utils.Utils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.entity.EntityPlayerSP; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.util.EnumChatFormatting; - -public class CrystalHollowWaypointActionGui extends GuiScreen { - - private int id; - - private GuiButton goBack; - private GuiButton toggle; - private GuiButton sendNormal; - private GuiButton sendDSM; - private GuiButton sendSBE; - private GuiButton delete; - - public CrystalHollowWaypointActionGui(int id) { - this.id = id; - } - - @Override - public boolean doesGuiPauseGame() { - return false; - } - - @Override - public void initGui() { - super.initGui(); - - ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); - int height = sr.getScaledHeight(); - int width = sr.getScaledWidth(); - - CrystalHollowWaypoints.Waypoint waypoint = CrystalHollowWaypoints.waypoints.get(id); - - goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); - toggle = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Set Visibility: " + Utils.getColouredBoolean(waypoint.toggled)); - sendNormal = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Send Location And Coordinates"); - sendDSM = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Send DSM Formatted Waypoint"); - sendSBE = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Send SBE Formatted Waypoint"); - delete = new GuiButton(0, width / 2 - 100, (int) (height * 0.8), EnumChatFormatting.RED + "Delete Waypoint"); - - this.buttonList.add(toggle); - this.buttonList.add(sendNormal); - this.buttonList.add(sendDSM); - this.buttonList.add(sendSBE); - this.buttonList.add(delete); - this.buttonList.add(goBack); - } - - @Override - public void drawScreen(int mouseX, int mouseY, float partialTicks) { - this.drawDefaultBackground(); - super.drawScreen(mouseX, mouseY, partialTicks); - - CrystalHollowWaypoints.Waypoint waypoint = CrystalHollowWaypoints.waypoints.get(id); - - String waypointText = waypoint.location + " @ " + waypoint.getPos(); - int pageWidth = mc.fontRendererObj.getStringWidth(waypointText); - new TextRenderer(mc, waypointText, width / 2 - pageWidth / 2, 10, 1D); - } - - @Override - public void actionPerformed(GuiButton button) { - CrystalHollowWaypoints.Waypoint waypoint = CrystalHollowWaypoints.waypoints.get(id); - EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; - if (button == goBack) { - DankersSkyblockMod.guiToOpen = "crystalwaypoints"; - } else if (button == toggle) { - waypoint.toggle(); - toggle.displayString = "Set Visibility: " + Utils.getColouredBoolean(waypoint.toggled); - } else if (button == sendNormal) { - player.sendChatMessage(waypoint.location + " @ " + waypoint.getPos()); - } else if (button == sendDSM) { - player.sendChatMessage("$DSMCHWP:" + waypoint.getFormattedWaypoint()); - } else if (button == sendSBE) { - player.sendChatMessage("$SBECHWP:" + waypoint.getFormattedWaypoint()); - } else if (button == delete) { - CrystalHollowWaypoints.waypoints.remove(id); - mc.displayGuiScreen(new CrystalHollowWaypointsGui(1)); - return; - } - CrystalHollowWaypoints.waypoints.set(id, waypoint); - } - -} diff --git a/src/main/java/me/Danker/gui/CrystalHollowWaypointsGui.java b/src/main/java/me/Danker/gui/CrystalHollowWaypointsGui.java deleted file mode 100644 index de20cf1..0000000 --- a/src/main/java/me/Danker/gui/CrystalHollowWaypointsGui.java +++ /dev/null @@ -1,144 +0,0 @@ -package me.Danker.gui; - -import me.Danker.DankersSkyblockMod; -import me.Danker.commands.ToggleCommand; -import me.Danker.features.CrystalHollowWaypoints; -import me.Danker.gui.buttons.FeatureButton; -import me.Danker.handlers.ConfigHandler; -import me.Danker.handlers.TextRenderer; -import me.Danker.utils.Utils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.entity.EntityPlayerSP; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.ScaledResolution; - -import java.util.ArrayList; -import java.util.List; - -public class CrystalHollowWaypointsGui extends GuiScreen { - - private final int page; - private final List allButtons = new ArrayList<>(); - - private GuiButton goBack; - private GuiButton backPage; - private GuiButton nextPage; - private GuiButton sendDSM; - private GuiButton sendSBE; - private GuiButton add; - private FeatureButton crystalHollowWaypoints; - private FeatureButton crystalAutoWaypoints; - - public CrystalHollowWaypointsGui(int page) { - this.page = page; - } - - @Override - public boolean doesGuiPauseGame() { - return false; - } - - @Override - public void initGui() { - super.initGui(); - - ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); - int height = sr.getScaledHeight(); - int width = sr.getScaledWidth(); - - goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); - backPage = new GuiButton(0, width / 2 - 100, (int) (height * 0.8), 80, 20, "< Back"); - nextPage = new GuiButton(0, width / 2 + 20, (int) (height * 0.8), 80, 20, "Next >"); - sendDSM = new GuiButton(0, 2, 10, 175, 20, "Send DSM Formatted Waypoints"); - sendSBE = new GuiButton(0, 2, 40, 175, 20, "Send SBE Formatted Waypoints"); - add = new GuiButton(0, 0, 0, "Add Waypoint"); - crystalHollowWaypoints = new FeatureButton("Crystal Hollows Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalHollowWaypoints), "Shows waypoints to various places in the Crystal Hollows."); - crystalAutoWaypoints = new FeatureButton("Auto Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalAutoWaypoints), "Automatically creates waypoints when you visit a special place in the Crystal Hollows."); - - allButtons.clear(); - allButtons.add(add); - allButtons.add(crystalHollowWaypoints); - allButtons.add(crystalAutoWaypoints); - for (int i = 0; i < CrystalHollowWaypoints.waypoints.size(); i++) { - CrystalHollowWaypoints.Waypoint waypoint = CrystalHollowWaypoints.waypoints.get(i); - GuiButton button = new GuiButton(i, 0, 0, waypoint.location + " >"); - allButtons.add(button); - } - - reInit(); - } - - public void reInit() { - this.buttonList.clear(); - - for (int i = (page - 1) * 7, iteration = 0; iteration < 7 && i < allButtons.size(); i++, iteration++) { - GuiButton button = allButtons.get(i); - button.xPosition = width / 2 - 100; - button.yPosition = (int) (height * (0.1 * (iteration + 1))); - this.buttonList.add(button); - } - - if (page > 1) this.buttonList.add(backPage); - if (page < Math.ceil(allButtons.size() / 7D)) this.buttonList.add(nextPage); - - this.buttonList.add(goBack); - this.buttonList.add(sendDSM); - this.buttonList.add(sendSBE); - } - - @Override - public void drawScreen(int mouseX, int mouseY, float partialTicks) { - this.drawDefaultBackground(); - super.drawScreen(mouseX, mouseY, partialTicks); - - String pageText = "Page: " + page + "/" + (int) Math.ceil(allButtons.size() / 7D); - int pageWidth = mc.fontRendererObj.getStringWidth(pageText); - new TextRenderer(mc, pageText, width / 2 - pageWidth / 2, 10, 1D); - } - - @Override - public void actionPerformed(GuiButton button) { - EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; - if (button == goBack) { - DankersSkyblockMod.guiToOpen = "dankergui1"; - } else if (button == nextPage) { - mc.displayGuiScreen(new CrystalHollowWaypointsGui(page + 1)); - } else if (button == backPage) { - mc.displayGuiScreen(new CrystalHollowWaypointsGui(page - 1)); - } else if (button == sendDSM) { - if (CrystalHollowWaypoints.waypoints.size() > 0) { - StringBuilder message = new StringBuilder(); - for (CrystalHollowWaypoints.Waypoint waypoint : CrystalHollowWaypoints.waypoints) { - if (message.length() > 0) message.append("\\n"); - message.append(waypoint.getFormattedWaypoint()); - } - message.insert(0, "$DSMCHWP:"); - player.sendChatMessage(message.toString()); - } - } else if (button == sendSBE) { - if (CrystalHollowWaypoints.waypoints.size() > 0) { - StringBuilder message = new StringBuilder(); - for (CrystalHollowWaypoints.Waypoint waypoint : CrystalHollowWaypoints.waypoints) { - if (message.length() > 0) message.append("\\n"); - message.append(waypoint.getFormattedWaypoint()); - } - message.insert(0, "$SBECHWP:"); - player.sendChatMessage(message.toString()); - } - } else if (button == add) { - mc.displayGuiScreen(new CrystalHollowAddWaypointGui()); - } else if (button == crystalHollowWaypoints) { - ToggleCommand.crystalHollowWaypoints = !ToggleCommand.crystalHollowWaypoints; - ConfigHandler.writeBooleanConfig("toggles", "CrystalHollowWaypoints", ToggleCommand.crystalHollowWaypoints); - crystalHollowWaypoints.displayString = "Crystal Hollows Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalHollowWaypoints); - } else if (button == crystalAutoWaypoints) { - ToggleCommand.crystalAutoWaypoints = !ToggleCommand.crystalAutoWaypoints; - ConfigHandler.writeBooleanConfig("toggles", "CrystalAutoWaypoints", ToggleCommand.crystalAutoWaypoints); - crystalAutoWaypoints.displayString = "Auto Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalAutoWaypoints); - } else { - mc.displayGuiScreen(new CrystalHollowWaypointActionGui(button.id)); - } - } - -} diff --git a/src/main/java/me/Danker/gui/CustomMusicGui.java b/src/main/java/me/Danker/gui/CustomMusicGui.java index 83bed09..6695b9a 100644 --- a/src/main/java/me/Danker/gui/CustomMusicGui.java +++ b/src/main/java/me/Danker/gui/CustomMusicGui.java @@ -111,7 +111,7 @@ public class CustomMusicGui extends GuiScreen { @Override public void actionPerformed(GuiButton button) { if (button == goBack) { - DankersSkyblockMod.guiToOpen = "dankergui1"; + mc.displayGuiScreen(new DankerGui(1, "")); } else if (button == backPage) { Minecraft.getMinecraft().displayGuiScreen(new CustomMusicGui(page - 1)); } else if (button == nextPage) { diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index acd997e..2a081e1 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -2,7 +2,9 @@ package me.Danker.gui; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; +import me.Danker.gui.alerts.AlertsGui; import me.Danker.gui.buttons.FeatureButton; +import me.Danker.gui.crystalhollowwaypoints.CrystalHollowWaypointsGui; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; @@ -43,6 +45,7 @@ public class DankerGui extends GuiScreen { private GuiButton skillTracker; private GuiButton customMusic; private GuiButton crystalHollowWaypoints; + private GuiButton alerts; // Toggles private GuiButton gparty; private GuiButton coords; @@ -124,6 +127,7 @@ public class DankerGui extends GuiScreen { skillTracker = new GuiButton(0, 0, 0, "Toggle Skill XP/Hour Tracking"); customMusic = new GuiButton(0, 0, 0, "Custom Music"); crystalHollowWaypoints = new GuiButton(0, 0, 0, "Crystal Hollows Waypoints"); + alerts = new GuiButton(0, 0, 0, "Alerts"); outlineText = new FeatureButton("Outline Displayed Text: " + Utils.getColouredBoolean(ToggleCommand.outlineTextToggled), "Adds bold outline to on-screen text."); pickBlock = new FeatureButton("Auto-Swap to Pick Block: " + Utils.getColouredBoolean(ToggleCommand.swapToPickBlockToggled), "Automatically changes left clicks to middle clicks.\nHelpful when lagging."); coords = new FeatureButton("Coordinate/Angle Display: " + Utils.getColouredBoolean(ToggleCommand.coordsToggled), "Displays coordinates and angle."); @@ -177,6 +181,7 @@ public class DankerGui extends GuiScreen { allButtons.add(skillTracker); allButtons.add(customMusic); allButtons.add(crystalHollowWaypoints); + allButtons.add(alerts); allButtons.add(outlineText); allButtons.add(pickBlock); allButtons.add(coords); @@ -288,7 +293,7 @@ public class DankerGui extends GuiScreen { } else if (button == backPage) { mc.displayGuiScreen(new DankerGui(page - 1, search.getText())); } else if (button == editLocations) { - DankersSkyblockMod.guiToOpen = "editlocations"; + mc.displayGuiScreen(new EditLocationsGui()); } else if (button == githubLink) { try { Desktop.getDesktop().browse(new URI("https://github.com/bowser0000/SkyblockMod")); @@ -302,19 +307,21 @@ public class DankerGui extends GuiScreen { ex.printStackTrace(); } } else if (button == changeDisplay) { - DankersSkyblockMod.guiToOpen = "displaygui"; + mc.displayGuiScreen(new DisplayGui()); } else if (button == onlySlayer) { - DankersSkyblockMod.guiToOpen = "onlyslayergui"; + mc.displayGuiScreen(new OnlySlayerGui()); } else if (button == puzzleSolvers) { - DankersSkyblockMod.guiToOpen = "puzzlesolvers"; + mc.displayGuiScreen(new PuzzleSolversGui(1)); } else if (button == experimentationTableSolvers) { - DankersSkyblockMod.guiToOpen = "experimentsolvers"; + mc.displayGuiScreen(new ExperimentsGui()); } else if (button == skillTracker) { - DankersSkyblockMod.guiToOpen = "skilltracker"; + mc.displayGuiScreen(new SkillTrackerGui()); } else if (button == customMusic) { - DankersSkyblockMod.guiToOpen = "custommusic"; + mc.displayGuiScreen(new CustomMusicGui(1)); } else if (button == crystalHollowWaypoints) { - DankersSkyblockMod.guiToOpen = "crystalwaypoints"; + mc.displayGuiScreen(new CrystalHollowWaypointsGui(1)); + } else if (button == alerts) { + mc.displayGuiScreen(new AlertsGui(1)); } else if (button == outlineText) { ToggleCommand.outlineTextToggled = !ToggleCommand.outlineTextToggled; ConfigHandler.writeBooleanConfig("toggles", "OutlineText", ToggleCommand.outlineTextToggled); diff --git a/src/main/java/me/Danker/gui/DisplayGui.java b/src/main/java/me/Danker/gui/DisplayGui.java index e5a6641..c6b1381 100644 --- a/src/main/java/me/Danker/gui/DisplayGui.java +++ b/src/main/java/me/Danker/gui/DisplayGui.java @@ -118,7 +118,7 @@ public class DisplayGui extends GuiScreen { @Override public void actionPerformed(GuiButton button) { if (button == goBack) { - DankersSkyblockMod.guiToOpen = "dankergui1"; + mc.displayGuiScreen(new DankerGui(1, "")); } else if (button == showSession) { addSession = !addSession; showSession.displayString = "Current Session Only: " + Utils.getColouredBoolean(addSession); diff --git a/src/main/java/me/Danker/gui/ExperimentsGui.java b/src/main/java/me/Danker/gui/ExperimentsGui.java index c3f4f47..3cc4929 100644 --- a/src/main/java/me/Danker/gui/ExperimentsGui.java +++ b/src/main/java/me/Danker/gui/ExperimentsGui.java @@ -52,7 +52,7 @@ public class ExperimentsGui extends GuiScreen { @Override public void actionPerformed(GuiButton button) { if (button == goBack) { - DankersSkyblockMod.guiToOpen = "dankergui1"; + mc.displayGuiScreen(new DankerGui(1, "")); } else if (button == ultrasequencer) { ToggleCommand.ultrasequencerToggled = !ToggleCommand.ultrasequencerToggled; ConfigHandler.writeBooleanConfig("toggles", "UltraSequencer", ToggleCommand.ultrasequencerToggled); diff --git a/src/main/java/me/Danker/gui/OnlySlayerGui.java b/src/main/java/me/Danker/gui/OnlySlayerGui.java index 8d56156..c203b8a 100644 --- a/src/main/java/me/Danker/gui/OnlySlayerGui.java +++ b/src/main/java/me/Danker/gui/OnlySlayerGui.java @@ -106,7 +106,7 @@ public class OnlySlayerGui extends GuiScreen { @Override public void actionPerformed(GuiButton button) { if (button == goBack) { - DankersSkyblockMod.guiToOpen = "dankergui1"; + mc.displayGuiScreen(new DankerGui(1, "")); return; } else if (button == off) { BlockWrongSlayer.onlySlayerName = ""; diff --git a/src/main/java/me/Danker/gui/PuzzleSolversGui.java b/src/main/java/me/Danker/gui/PuzzleSolversGui.java index 27233d8..3356ead 100644 --- a/src/main/java/me/Danker/gui/PuzzleSolversGui.java +++ b/src/main/java/me/Danker/gui/PuzzleSolversGui.java @@ -110,7 +110,7 @@ public class PuzzleSolversGui extends GuiScreen { @Override public void actionPerformed(GuiButton button) { if (button == goBack) { - DankersSkyblockMod.guiToOpen = "dankergui1"; + mc.displayGuiScreen(new DankerGui(1, "")); } else if (button == backPage) { Minecraft.getMinecraft().displayGuiScreen(new PuzzleSolversGui(page - 1)); } else if (button == nextPage) { diff --git a/src/main/java/me/Danker/gui/SkillTrackerGui.java b/src/main/java/me/Danker/gui/SkillTrackerGui.java index fb7a7c9..290310f 100644 --- a/src/main/java/me/Danker/gui/SkillTrackerGui.java +++ b/src/main/java/me/Danker/gui/SkillTrackerGui.java @@ -67,7 +67,7 @@ public class SkillTrackerGui extends GuiScreen { @Override public void actionPerformed(GuiButton button) { if (button == goBack) { - DankersSkyblockMod.guiToOpen = "dankergui1"; + mc.displayGuiScreen(new DankerGui(1, "")); } else if (button == start) { if (SkillTracker.skillStopwatch.isStarted() && SkillTracker.skillStopwatch.isSuspended()) { SkillTracker.skillStopwatch.resume(); diff --git a/src/main/java/me/Danker/gui/alerts/AlertActionGui.java b/src/main/java/me/Danker/gui/alerts/AlertActionGui.java new file mode 100644 index 0000000..06dfd91 --- /dev/null +++ b/src/main/java/me/Danker/gui/alerts/AlertActionGui.java @@ -0,0 +1,82 @@ +package me.Danker.gui.alerts; + +import me.Danker.features.Alerts; +import me.Danker.handlers.TextRenderer; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.util.EnumChatFormatting; + +public class AlertActionGui extends GuiScreen { + + private final int id; + + private GuiButton goBack; + private GuiButton toggle; + private GuiButton edit; + private GuiButton delete; + + public AlertActionGui(int id) { + this.id = id; + } + + @Override + public boolean doesGuiPauseGame() { + return false; + } + + @Override + public void initGui() { + super.initGui(); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int height = sr.getScaledHeight(); + int width = sr.getScaledWidth(); + + Alerts.Alert alert = Alerts.alerts.get(id); + + goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); + toggle = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Enabled: " + Utils.getColouredBoolean(alert.toggled)); + edit = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Edit >"); + delete = new GuiButton(0, width / 2 - 100, (int) (height * 0.8), EnumChatFormatting.RED + "Delete Alert"); + + this.buttonList.add(toggle); + this.buttonList.add(edit); + this.buttonList.add(delete); + this.buttonList.add(goBack); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + + Alerts.Alert alert = Alerts.alerts.get(id); + + String alertText = alert.alert; + int textWidth = mc.fontRendererObj.getStringWidth(alertText); + new TextRenderer(mc, alertText, width / 2 - textWidth / 2, 10, 1D); + } + + @Override + public void actionPerformed(GuiButton button) { + Alerts.Alert alert = Alerts.alerts.get(id); + if (button == goBack) { + mc.displayGuiScreen(new AlertsGui(1)); + } else if (button == toggle) { + alert.toggle(); + toggle.displayString = "Enabled: " + Utils.getColouredBoolean(alert.toggled); + } else if (button == edit) { + mc.displayGuiScreen(new AlertAddGui(alert, id)); + } else if (button == delete) { + Alerts.alerts.remove(id); + Alerts.saveToFile(); + mc.displayGuiScreen(new AlertsGui(1)); + return; + } + Alerts.alerts.set(id, alert); + } + +} diff --git a/src/main/java/me/Danker/gui/alerts/AlertAddGui.java b/src/main/java/me/Danker/gui/alerts/AlertAddGui.java new file mode 100644 index 0000000..9014ea1 --- /dev/null +++ b/src/main/java/me/Danker/gui/alerts/AlertAddGui.java @@ -0,0 +1,130 @@ +package me.Danker.gui.alerts; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import me.Danker.features.Alerts; +import me.Danker.handlers.TextRenderer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraftforge.fml.client.config.GuiCheckBox; + +import java.io.FileWriter; +import java.io.IOException; + +public class AlertAddGui extends GuiScreen { + + private boolean editing; + private Alerts.Alert base = null; + private int id; + + private GuiButton cancel; + + private String mode = "Contains"; + private GuiButton startsWith; + private GuiButton contains; + private GuiButton endsWith; + private GuiTextField message; + private GuiTextField alert; + private GuiCheckBox toggled; + private GuiButton add; + + public AlertAddGui() {} + + public AlertAddGui(Alerts.Alert alert, int id) { + editing = true; + base = alert; + this.id = id; + } + + @Override + public boolean doesGuiPauseGame() { + return false; + } + + @Override + public void initGui() { + super.initGui(); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int height = sr.getScaledHeight(); + int width = sr.getScaledWidth(); + + cancel = new GuiButton(0, 2, height - 30, 100, 20, "Cancel"); + + startsWith = new GuiButton(0, width / 2 - 200, (int) (height * 0.2), 120, 20, "Starts With"); + contains = new GuiButton(0, width / 2 - 60, (int) (height * 0.2), 120, 20, "Contains"); + endsWith = new GuiButton(0, width / 2 + 80, (int) (height * 0.2), 120, 20, "Ends With"); + message = new GuiTextField(0, this.fontRendererObj, width / 2 - 100, (int) (height * 0.3), 200, 20); + alert = new GuiTextField(0, this.fontRendererObj, width / 2 - 100, (int) (height * 0.4), 200, 20); + toggled = new GuiCheckBox(0, width / 2 - 26, (int) (height * 0.5), "Toggled", true); + add = new GuiButton(0, width / 2 - 25, (int) (height * 0.7), 50, 20, "Add"); + + if (editing) { + mode = base.mode; + message.setText(base.message); + alert.setText(base.alert); + toggled.setIsChecked(base.toggled); + } + + message.setVisible(true); + message.setEnabled(true); + alert.setVisible(true); + alert.setEnabled(true); + + this.buttonList.add(cancel); + this.buttonList.add(startsWith); + this.buttonList.add(contains); + this.buttonList.add(endsWith); + this.buttonList.add(toggled); + this.buttonList.add(add); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + + message.drawTextBox(); + alert.drawTextBox(); + + new TextRenderer(mc, "Mode: " + mode, width / 2 - 35, (int) (height * 0.15), 1D); + new TextRenderer(mc, "Trigger:", width / 2 - 145, (int) (height * 0.32), 1D); + new TextRenderer(mc, "Alert Text:", width / 2 - 158, (int) (height * 0.42), 1D); + } + + @Override + public void actionPerformed(GuiButton button) { + if (button == cancel) { + mc.displayGuiScreen(new AlertsGui(1)); + } else if (button == startsWith) { + mode = "Starts With"; + } else if (button == contains) { + mode = "Contains"; + } else if (button == endsWith) { + mode = "Ends With"; + } else if (button == add) { + Alerts.alerts.add(new Alerts.Alert(mode, message.getText(), alert.getText(), toggled.isChecked())); + if (editing) Alerts.alerts.remove(id); + Alerts.saveToFile(); + mc.displayGuiScreen(new AlertsGui(1)); + } + } + + @Override + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { + super.mouseClicked(mouseX, mouseY, mouseButton); + message.mouseClicked(mouseX, mouseY, mouseButton); + alert.mouseClicked(mouseX, mouseY, mouseButton); + } + + @Override + protected void keyTyped(char typedChar, int keyCode) throws IOException { + super.keyTyped(typedChar, keyCode); + message.textboxKeyTyped(typedChar, keyCode); + alert.textboxKeyTyped(typedChar, keyCode); + } + +} diff --git a/src/main/java/me/Danker/gui/alerts/AlertsGui.java b/src/main/java/me/Danker/gui/alerts/AlertsGui.java new file mode 100644 index 0000000..3ccd869 --- /dev/null +++ b/src/main/java/me/Danker/gui/alerts/AlertsGui.java @@ -0,0 +1,104 @@ +package me.Danker.gui.alerts; + +import me.Danker.commands.ToggleCommand; +import me.Danker.features.Alerts; +import me.Danker.gui.DankerGui; +import me.Danker.gui.buttons.FeatureButton; +import me.Danker.handlers.ConfigHandler; +import me.Danker.handlers.TextRenderer; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; + +import java.util.ArrayList; +import java.util.List; + +public class AlertsGui extends GuiScreen { + + private final int page; + private final List allButtons = new ArrayList<>(); + + private GuiButton goBack; + private GuiButton backPage; + private GuiButton nextPage; + private GuiButton add; + private GuiButton alerts; + + public AlertsGui(int page) { + this.page = page; + } + + @Override + public void initGui() { + super.initGui(); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int height = sr.getScaledHeight(); + int width = sr.getScaledWidth(); + + goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); + backPage = new GuiButton(0, width / 2 - 100, (int) (height * 0.8), 80, 20, "< Back"); + nextPage = new GuiButton(0, width / 2 + 20, (int) (height * 0.8), 80, 20, "Next >"); + alerts = new FeatureButton("Alerts: " + Utils.getColouredBoolean(ToggleCommand.alerts), "Sends custom alert when a message is recieved"); + add = new GuiButton(0, 0, 0, "Add Alert"); + + allButtons.clear(); + allButtons.add(alerts); + allButtons.add(add); + for (int i = 0; i < Alerts.alerts.size(); i++) { + Alerts.Alert alert = Alerts.alerts.get(i); + GuiButton button = new GuiButton(i, 0, 0, alert.alert + " >"); + allButtons.add(button); + } + + reInit(); + } + + public void reInit() { + this.buttonList.clear(); + + for (int i = (page - 1) * 7, iteration = 0; iteration < 7 && i < allButtons.size(); i++, iteration++) { + GuiButton button = allButtons.get(i); + button.xPosition = width / 2 - 100; + button.yPosition = (int) (height * (0.1 * (iteration + 1))); + this.buttonList.add(button); + } + + if (page > 1) this.buttonList.add(backPage); + if (page < Math.ceil(allButtons.size() / 7D)) this.buttonList.add(nextPage); + + this.buttonList.add(goBack); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + + String pageText = "Page: " + page + "/" + (int) Math.ceil(allButtons.size() / 7D); + int pageWidth = mc.fontRendererObj.getStringWidth(pageText); + new TextRenderer(mc, pageText, width / 2 - pageWidth / 2, 10, 1D); + } + + @Override + public void actionPerformed(GuiButton button) { + if (button == goBack) { + mc.displayGuiScreen(new DankerGui(1, "")); + } else if (button == nextPage) { + mc.displayGuiScreen(new AlertsGui(page + 1)); + } else if (button == backPage) { + mc.displayGuiScreen(new AlertsGui(page - 1)); + } else if (button == add) { + mc.displayGuiScreen(new AlertAddGui()); + } else if (button == alerts) { + ToggleCommand.alerts = !ToggleCommand.alerts; + ConfigHandler.writeBooleanConfig("toggles", "Alerts", ToggleCommand.alerts); + alerts.displayString = "Alerts: " + Utils.getColouredBoolean(ToggleCommand.alerts); + } else { + mc.displayGuiScreen(new AlertActionGui(button.id)); + } + } + +} diff --git a/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowAddWaypointGui.java b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowAddWaypointGui.java new file mode 100644 index 0000000..df91f04 --- /dev/null +++ b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowAddWaypointGui.java @@ -0,0 +1,118 @@ +package me.Danker.gui.crystalhollowwaypoints; + +import me.Danker.features.CrystalHollowWaypoints; +import me.Danker.handlers.TextRenderer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; + +import java.io.IOException; + +public class CrystalHollowAddWaypointGui extends GuiScreen { + + private GuiButton cancel; + + private GuiTextField name; + private GuiButton curPos; + private GuiTextField x; + private GuiTextField y; + private GuiTextField z; + private GuiButton add; + + @Override + public boolean doesGuiPauseGame() { + return false; + } + + @Override + public void initGui() { + super.initGui(); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int height = sr.getScaledHeight(); + int width = sr.getScaledWidth(); + + cancel = new GuiButton(0, 2, height - 30, 100, 20, "Cancel"); + + name = new GuiTextField(0, this.fontRendererObj, width / 2 - 100, (int) (height * 0.1), 200, 20); + curPos = new GuiButton(0, width / 2 - 50, (int) (height * 0.25), 100, 20, "Current Position"); + x = new GuiTextField(0, this.fontRendererObj, width / 2 - 85, (int) (height * 0.4), 50, 20); + y = new GuiTextField(0, this.fontRendererObj, width / 2 - 25, (int) (height * 0.4), 50, 20); + z = new GuiTextField(0, this.fontRendererObj, width / 2 + 35, (int) (height * 0.4), 50, 20); + add = new GuiButton(0, width / 2 - 25, (int) (height * 0.6), 50, 20, "Add"); + + name.setVisible(true); + name.setEnabled(true); + x.setVisible(true); + x.setEnabled(true); + y.setVisible(true); + y.setEnabled(true); + z.setVisible(true); + z.setEnabled(true); + + this.buttonList.add(cancel); + this.buttonList.add(curPos); + this.buttonList.add(add); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + + name.drawTextBox(); + x.drawTextBox(); + y.drawTextBox(); + z.drawTextBox(); + + new TextRenderer(mc, "X:", width / 2 - 85, (int) (height * 0.35), 1D); + new TextRenderer(mc, "Y:", width / 2 - 25, (int) (height * 0.35), 1D); + new TextRenderer(mc, "Z:", width / 2 + 35, (int) (height * 0.35), 1D); + } + + @Override + public void actionPerformed(GuiButton button) { + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + + if (button == cancel) { + mc.displayGuiScreen(new CrystalHollowWaypointsGui(1)); + } else if (button == curPos) { + x.setText(Integer.toString(player.getPosition().getX())); + y.setText(Integer.toString(player.getPosition().getY())); + z.setText(Integer.toString(player.getPosition().getZ())); + } else if (button == add) { + String loc = name.getText().length() == 0 ? Integer.toString(CrystalHollowWaypoints.waypoints.size()) : name.getText(); + int xPos = x.getText().matches("[-]?\\d+") ? Integer.parseInt(x.getText()) : player.getPosition().getX(); + int yPos = y.getText().matches("[-]?\\d+") ? Integer.parseInt(y.getText()) : player.getPosition().getY(); + int zPos = z.getText().matches("[-]?\\d+") ? Integer.parseInt(z.getText()) : player.getPosition().getZ(); + + BlockPos pos = new BlockPos(xPos, yPos, zPos); + CrystalHollowWaypoints.waypoints.add(new CrystalHollowWaypoints.Waypoint(loc, pos)); + + mc.displayGuiScreen(new CrystalHollowWaypointsGui(1)); + } + } + + @Override + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { + super.mouseClicked(mouseX, mouseY, mouseButton); + name.mouseClicked(mouseX, mouseY, mouseButton); + x.mouseClicked(mouseX, mouseY, mouseButton); + y.mouseClicked(mouseX, mouseY, mouseButton); + z.mouseClicked(mouseX, mouseY, mouseButton); + } + + @Override + protected void keyTyped(char typedChar, int keyCode) throws IOException { + super.keyTyped(typedChar, keyCode); + name.textboxKeyTyped(typedChar, keyCode); + x.textboxKeyTyped(typedChar, keyCode); + y.textboxKeyTyped(typedChar, keyCode); + z.textboxKeyTyped(typedChar, keyCode); + } + +} diff --git a/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointActionGui.java b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointActionGui.java new file mode 100644 index 0000000..f792892 --- /dev/null +++ b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointActionGui.java @@ -0,0 +1,95 @@ +package me.Danker.gui.crystalhollowwaypoints; + +import me.Danker.DankersSkyblockMod; +import me.Danker.features.CrystalHollowWaypoints; +import me.Danker.handlers.TextRenderer; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.util.EnumChatFormatting; + +public class CrystalHollowWaypointActionGui extends GuiScreen { + + private int id; + + private GuiButton goBack; + private GuiButton toggle; + private GuiButton sendNormal; + private GuiButton sendDSM; + private GuiButton sendSBE; + private GuiButton delete; + + public CrystalHollowWaypointActionGui(int id) { + this.id = id; + } + + @Override + public boolean doesGuiPauseGame() { + return false; + } + + @Override + public void initGui() { + super.initGui(); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int height = sr.getScaledHeight(); + int width = sr.getScaledWidth(); + + CrystalHollowWaypoints.Waypoint waypoint = CrystalHollowWaypoints.waypoints.get(id); + + goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); + toggle = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Set Visibility: " + Utils.getColouredBoolean(waypoint.toggled)); + sendNormal = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Send Location And Coordinates"); + sendDSM = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Send DSM Formatted Waypoint"); + sendSBE = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Send SBE Formatted Waypoint"); + delete = new GuiButton(0, width / 2 - 100, (int) (height * 0.8), EnumChatFormatting.RED + "Delete Waypoint"); + + this.buttonList.add(toggle); + this.buttonList.add(sendNormal); + this.buttonList.add(sendDSM); + this.buttonList.add(sendSBE); + this.buttonList.add(delete); + this.buttonList.add(goBack); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + + CrystalHollowWaypoints.Waypoint waypoint = CrystalHollowWaypoints.waypoints.get(id); + + String waypointText = waypoint.location + " @ " + waypoint.getPos(); + int pageWidth = mc.fontRendererObj.getStringWidth(waypointText); + new TextRenderer(mc, waypointText, width / 2 - pageWidth / 2, 10, 1D); + } + + @Override + public void actionPerformed(GuiButton button) { + CrystalHollowWaypoints.Waypoint waypoint = CrystalHollowWaypoints.waypoints.get(id); + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + if (button == goBack) { + mc.displayGuiScreen(new CrystalHollowWaypointsGui(1)); + DankersSkyblockMod.guiToOpen = "crystalwaypoints"; + } else if (button == toggle) { + waypoint.toggle(); + toggle.displayString = "Set Visibility: " + Utils.getColouredBoolean(waypoint.toggled); + } else if (button == sendNormal) { + player.sendChatMessage(waypoint.location + " @ " + waypoint.getPos()); + } else if (button == sendDSM) { + player.sendChatMessage("$DSMCHWP:" + waypoint.getFormattedWaypoint()); + } else if (button == sendSBE) { + player.sendChatMessage("$SBECHWP:" + waypoint.getFormattedWaypoint()); + } else if (button == delete) { + CrystalHollowWaypoints.waypoints.remove(id); + mc.displayGuiScreen(new CrystalHollowWaypointsGui(1)); + return; + } + CrystalHollowWaypoints.waypoints.set(id, waypoint); + } + +} diff --git a/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java new file mode 100644 index 0000000..a3d0452 --- /dev/null +++ b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java @@ -0,0 +1,145 @@ +package me.Danker.gui.crystalhollowwaypoints; + +import me.Danker.DankersSkyblockMod; +import me.Danker.commands.ToggleCommand; +import me.Danker.features.CrystalHollowWaypoints; +import me.Danker.gui.DankerGui; +import me.Danker.gui.buttons.FeatureButton; +import me.Danker.handlers.ConfigHandler; +import me.Danker.handlers.TextRenderer; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; + +import java.util.ArrayList; +import java.util.List; + +public class CrystalHollowWaypointsGui extends GuiScreen { + + private final int page; + private final List allButtons = new ArrayList<>(); + + private GuiButton goBack; + private GuiButton backPage; + private GuiButton nextPage; + private GuiButton sendDSM; + private GuiButton sendSBE; + private GuiButton add; + private FeatureButton crystalHollowWaypoints; + private FeatureButton crystalAutoWaypoints; + + public CrystalHollowWaypointsGui(int page) { + this.page = page; + } + + @Override + public boolean doesGuiPauseGame() { + return false; + } + + @Override + public void initGui() { + super.initGui(); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int height = sr.getScaledHeight(); + int width = sr.getScaledWidth(); + + goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); + backPage = new GuiButton(0, width / 2 - 100, (int) (height * 0.8), 80, 20, "< Back"); + nextPage = new GuiButton(0, width / 2 + 20, (int) (height * 0.8), 80, 20, "Next >"); + sendDSM = new GuiButton(0, 2, 10, 175, 20, "Send DSM Formatted Waypoints"); + sendSBE = new GuiButton(0, 2, 40, 175, 20, "Send SBE Formatted Waypoints"); + add = new GuiButton(0, 0, 0, "Add Waypoint"); + crystalHollowWaypoints = new FeatureButton("Crystal Hollows Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalHollowWaypoints), "Shows waypoints to various places in the Crystal Hollows."); + crystalAutoWaypoints = new FeatureButton("Auto Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalAutoWaypoints), "Automatically creates waypoints when you visit a special place in the Crystal Hollows."); + + allButtons.clear(); + allButtons.add(add); + allButtons.add(crystalHollowWaypoints); + allButtons.add(crystalAutoWaypoints); + for (int i = 0; i < CrystalHollowWaypoints.waypoints.size(); i++) { + CrystalHollowWaypoints.Waypoint waypoint = CrystalHollowWaypoints.waypoints.get(i); + GuiButton button = new GuiButton(i, 0, 0, waypoint.location + " >"); + allButtons.add(button); + } + + reInit(); + } + + public void reInit() { + this.buttonList.clear(); + + for (int i = (page - 1) * 7, iteration = 0; iteration < 7 && i < allButtons.size(); i++, iteration++) { + GuiButton button = allButtons.get(i); + button.xPosition = width / 2 - 100; + button.yPosition = (int) (height * (0.1 * (iteration + 1))); + this.buttonList.add(button); + } + + if (page > 1) this.buttonList.add(backPage); + if (page < Math.ceil(allButtons.size() / 7D)) this.buttonList.add(nextPage); + + this.buttonList.add(goBack); + this.buttonList.add(sendDSM); + this.buttonList.add(sendSBE); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + + String pageText = "Page: " + page + "/" + (int) Math.ceil(allButtons.size() / 7D); + int pageWidth = mc.fontRendererObj.getStringWidth(pageText); + new TextRenderer(mc, pageText, width / 2 - pageWidth / 2, 10, 1D); + } + + @Override + public void actionPerformed(GuiButton button) { + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + if (button == goBack) { + mc.displayGuiScreen(new DankerGui(1, "")); + } else if (button == nextPage) { + mc.displayGuiScreen(new CrystalHollowWaypointsGui(page + 1)); + } else if (button == backPage) { + mc.displayGuiScreen(new CrystalHollowWaypointsGui(page - 1)); + } else if (button == sendDSM) { + if (CrystalHollowWaypoints.waypoints.size() > 0) { + StringBuilder message = new StringBuilder(); + for (CrystalHollowWaypoints.Waypoint waypoint : CrystalHollowWaypoints.waypoints) { + if (message.length() > 0) message.append("\\n"); + message.append(waypoint.getFormattedWaypoint()); + } + message.insert(0, "$DSMCHWP:"); + player.sendChatMessage(message.toString()); + } + } else if (button == sendSBE) { + if (CrystalHollowWaypoints.waypoints.size() > 0) { + StringBuilder message = new StringBuilder(); + for (CrystalHollowWaypoints.Waypoint waypoint : CrystalHollowWaypoints.waypoints) { + if (message.length() > 0) message.append("\\n"); + message.append(waypoint.getFormattedWaypoint()); + } + message.insert(0, "$SBECHWP:"); + player.sendChatMessage(message.toString()); + } + } else if (button == add) { + mc.displayGuiScreen(new CrystalHollowAddWaypointGui()); + } else if (button == crystalHollowWaypoints) { + ToggleCommand.crystalHollowWaypoints = !ToggleCommand.crystalHollowWaypoints; + ConfigHandler.writeBooleanConfig("toggles", "CrystalHollowWaypoints", ToggleCommand.crystalHollowWaypoints); + crystalHollowWaypoints.displayString = "Crystal Hollows Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalHollowWaypoints); + } else if (button == crystalAutoWaypoints) { + ToggleCommand.crystalAutoWaypoints = !ToggleCommand.crystalAutoWaypoints; + ConfigHandler.writeBooleanConfig("toggles", "CrystalAutoWaypoints", ToggleCommand.crystalAutoWaypoints); + crystalAutoWaypoints.displayString = "Auto Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalAutoWaypoints); + } else { + mc.displayGuiScreen(new CrystalHollowWaypointActionGui(button.id)); + } + } + +} diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 2a765ad..28f22fe 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -1,5 +1,8 @@ package me.Danker.handlers; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; import me.Danker.DankersSkyblockMod; import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; @@ -13,7 +16,9 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.config.ConfigCategory; import net.minecraftforge.common.config.Configuration; -import java.io.File; +import java.io.*; +import java.util.ArrayList; +import java.util.Arrays; public class ConfigHandler { public static Configuration config; @@ -220,15 +225,6 @@ public class ConfigHandler { ToggleCommand.crystalAutoWaypoints = initBoolean("toggles", "CrystalAutoWaypoints", true); // enabled by default ToggleCommand.autoAcceptReparty = initBoolean("toggles", "AutoAcceptReparty", false); ToggleCommand.abilityCooldowns = initBoolean("toggles", "AbilityCooldowns", false); - // Chat Messages - ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); - ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); - ToggleCommand.implosionMessages = initBoolean("toggles", "ImplosionMessages", true); - ToggleCommand.healMessages = initBoolean("toggles", "HealMessages", true); - ToggleCommand.cooldownMessages = initBoolean("toggles", "CooldownMessages", true); - ToggleCommand.manaMessages = initBoolean("toggles", "ManaMessages", true); - ToggleCommand.killComboMessages = initBoolean("toggles", "KillComboMessages", true); - // Dungeons ToggleCommand.dungeonTimerToggled = initBoolean("toggles", "DungeonTimer", false); ToggleCommand.lowHealthNotifyToggled = initBoolean("toggles", "LowHealthNotify", false); ToggleCommand.lividSolverToggled = initBoolean("toggles", "LividSolver", false); @@ -239,7 +235,16 @@ public class ConfigHandler { ToggleCommand.bonzoTimerToggled = initBoolean("toggles", "BonzoTimer", false); ToggleCommand.swapToPickBlockToggled = initBoolean("toggles", "PickBlock", false); ToggleCommand.flowerWeaponsToggled = initBoolean("toggles", "FlowerWeapons", false); - ToggleCommand.autoSkillTrackerToggled = initBoolean("toggles", "AutoSkillTracker", false); + ToggleCommand.autoSkillTrackerToggled = initBoolean("toggles", "AutoSkillTracker", false); + ToggleCommand.alerts = initBoolean("toggles", "Alerts", false); + // Chat Messages + ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); + ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); + ToggleCommand.implosionMessages = initBoolean("toggles", "ImplosionMessages", true); + ToggleCommand.healMessages = initBoolean("toggles", "HealMessages", true); + ToggleCommand.cooldownMessages = initBoolean("toggles", "CooldownMessages", true); + ToggleCommand.manaMessages = initBoolean("toggles", "ManaMessages", true); + ToggleCommand.killComboMessages = initBoolean("toggles", "KillComboMessages", true); // Puzzle Solvers ToggleCommand.threeManToggled = initBoolean("toggles", "ThreeManPuzzle", false); ToggleCommand.oruoToggled = initBoolean("toggles", "OruoPuzzle", false); @@ -616,6 +621,21 @@ public class ConfigHandler { // Commands if (!hasKey("commands", "reparty")) writeBooleanConfig("commands", "reparty", false); + + // JSON + Gson gson = new Gson(); + + try { + if (!(new File(Alerts.configFile).exists())) { + FileWriter file = new FileWriter(Alerts.configFile); + file.write(new JsonArray().toString()); + file.close(); + } + Alerts.Alert[] alerts = gson.fromJson(new FileReader(Alerts.configFile), Alerts.Alert[].class); + if (alerts != null) Alerts.alerts = new ArrayList<>(Arrays.asList(alerts)); + } catch (IOException ex) { + ex.printStackTrace(); + } } } -- cgit From 457305a5c1894d776b7c30ecc0f4f0cd8edc1e86 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 25 Nov 2021 16:33:34 -0500 Subject: Fix ability cooldown tracker using full set bonus cooldown --- src/main/java/me/Danker/utils/Utils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 81a32af..682c5af 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -444,7 +444,7 @@ public class Utils { List tooltip = item.getTooltip(player, false); for (String line : tooltip) { - if (line.contains(EnumChatFormatting.GOLD + "Ability: ")) { + if (line.contains(EnumChatFormatting.GOLD + "Ability: ") || line.contains(EnumChatFormatting.GOLD + "Full Set Bonus: ")) { if (line.contains(EnumChatFormatting.GOLD + "Ability: " + ability)) { foundAbility = true; continue; -- cgit From aaba0391a06ac4546d7ec5ce684534c35d9cbc82 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 23 Dec 2021 01:35:10 -0500 Subject: Add dungeon score display --- README.md | 5 +- src/main/java/me/Danker/DankersSkyblockMod.java | 1 + .../java/me/Danker/commands/DankerGuiCommand.java | 70 +------ src/main/java/me/Danker/commands/MoveCommand.java | 13 +- src/main/java/me/Danker/commands/ScaleCommand.java | 10 +- .../java/me/Danker/commands/ToggleCommand.java | 11 +- src/main/java/me/Danker/features/DungeonScore.java | 224 +++++++++++++++++++++ src/main/java/me/Danker/gui/DankerGui.java | 7 + src/main/java/me/Danker/gui/EditLocationsGui.java | 25 +++ .../java/me/Danker/handlers/ConfigHandler.java | 4 + 10 files changed, 293 insertions(+), 77 deletions(-) create mode 100644 src/main/java/me/Danker/features/DungeonScore.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 4f82ca3..4b4802c 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ Discord Server: https://discord.gg/QsEkNQS - Crystal Hollows waypoints (with SkyblockExtras support) - Ability cooldowns display - Custom alerts based on chat +- Predicted dungeon score display ## Commands - /dhelp - Returns this message in-game. @@ -72,8 +73,8 @@ Discord Server: https://discord.gg/QsEkNQS - /loot [winter/festival/spooky/f(1-7)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. - /display [winter/festival/spooky/f(1-7)/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active. - /resetloot - - Resets loot for trackers. /resetloot confirm confirms the reset. -- /move - Moves text display to specified X and Y coordinates. -- /scale - Scales text display to a specified multipler between 0.1x and 10x. +- /move - Moves text display to specified X and Y coordinates. +- /scale - Scales text display to a specified multipler between 0.1x and 10x. - /slayer [player] - Uses API to get slayer xp of a person. If no name is provided, it checks yours. - /skill [player] - Uses API to get skill levels of a person. If no name is provided, it checks yours. - /lobbyskills - Uses API to find the average skills of the lobby, as well the three players with the highest skill average. diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 2ad5141..91f561a 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -121,6 +121,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new CreeperSolver()); MinecraftForge.EVENT_BUS.register(new CrystalHollowWaypoints()); MinecraftForge.EVENT_BUS.register(new CustomMusic()); + MinecraftForge.EVENT_BUS.register(new DungeonScore()); MinecraftForge.EVENT_BUS.register(new DungeonTimer()); MinecraftForge.EVENT_BUS.register(new EndOfFarmAlert()); MinecraftForge.EVENT_BUS.register(new ExpertiseLore()); diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index 0bf82f9..14041d1 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -48,75 +48,6 @@ public class DankerGuiCommand extends CommandBase { if (arg1.length > 0 && arg1[0].equalsIgnoreCase("debug")) { StringBuilder debug = new StringBuilder(); debug.append("```md\n"); - debug.append("# Toggles\n"); - debug.append("[gparty][").append(ToggleCommand.gpartyToggled).append("]\n"); - debug.append("[coords][").append(ToggleCommand.coordsToggled).append("]\n"); - debug.append("[golden][").append(ToggleCommand.goldenToggled).append("]\n"); - debug.append("[slayercount][").append(ToggleCommand.slayerCountTotal).append("]\n"); - debug.append("[rngesusalerts][").append(ToggleCommand.rngesusAlerts).append("]\n"); - debug.append("[splitfishing][").append(ToggleCommand.splitFishing).append("]\n"); - debug.append("[chatmaddox][").append(ToggleCommand.chatMaddoxToggled).append("]\n"); - debug.append("[spiritbearalerts][").append(ToggleCommand.spiritBearAlerts).append("]\n"); - debug.append("[flowerweapons][").append(ToggleCommand.flowerWeaponsToggled).append("]\n"); - debug.append("[sceptremessages][").append(ToggleCommand.sceptreMessages).append("]\n"); - debug.append("[petcolors][").append(ToggleCommand.petColoursToggled).append("]\n"); - debug.append("[dungeontimer][").append(ToggleCommand.dungeonTimerToggled).append("]\n"); - debug.append("[golemalerts][").append(ToggleCommand.golemAlertToggled).append("]\n"); - debug.append("[expertiselore][").append(ToggleCommand.expertiseLoreToggled).append("]\n"); - debug.append("[skill50display][").append(ToggleCommand.skill50DisplayToggled).append("]\n"); - debug.append("[outlinetext][").append(ToggleCommand.outlineTextToggled).append("]\n"); - debug.append("[midasstaffmessages][").append(ToggleCommand.midasStaffMessages).append("]\n"); - debug.append("[implosionmessages][").append(ToggleCommand.implosionMessages).append("]\n"); - debug.append("[healmessages][").append(ToggleCommand.healMessages).append("]\n"); - debug.append("[cooldownmessages][").append(ToggleCommand.cooldownMessages).append("]\n"); - debug.append("[manamessages][").append(ToggleCommand.manaMessages).append("]\n"); - debug.append("[killcombomessages][").append(ToggleCommand.killComboMessages).append("]\n"); - debug.append("[caketimer][").append(ToggleCommand.cakeTimerToggled).append("]\n"); - debug.append("[lowhealthnotify][").append(ToggleCommand.lowHealthNotifyToggled).append("]\n"); - debug.append("[lividsolver][").append(ToggleCommand.lividSolverToggled).append("]\n"); - debug.append("[stopsalvagestarred][").append(ToggleCommand.stopSalvageStarredToggled).append("]\n"); - debug.append("[notifyslayerslain][").append(ToggleCommand.notifySlayerSlainToggled).append("]\n"); - debug.append("[necronnotifications][").append(ToggleCommand.necronNotificationsToggled).append("]\n"); - debug.append("[bonzotimer][").append(ToggleCommand.bonzoTimerToggled).append("]\n"); - debug.append("[autoskilltracker][").append(ToggleCommand.autoSkillTrackerToggled).append("]\n"); - debug.append("[threemanpuzzle][").append(ToggleCommand.threeManToggled).append("]\n"); - debug.append("[oruopuzzle][").append(ToggleCommand.oruoToggled).append("]\n"); - debug.append("[blazepuzzle][").append(ToggleCommand.blazeToggled).append("]\n"); - debug.append("[creeperpuzzle][").append(ToggleCommand.creeperToggled).append("]\n"); - debug.append("[creeperlines][").append(ToggleCommand.creeperLinesToggled).append("]\n"); - debug.append("[waterpuzzle][").append(ToggleCommand.waterToggled).append("]\n"); - debug.append("[tictactoepuzzle][").append(ToggleCommand.ticTacToeToggled).append("]\n"); - debug.append("[boulderpuzzle][").append(ToggleCommand.boulderToggled).append("]\n"); - debug.append("[silverfishpuzzle][").append(ToggleCommand.silverfishToggled).append("]\n"); - debug.append("[icewalkpuzzle][").append(ToggleCommand.iceWalkToggled).append("]\n"); - debug.append("[watchermessage][").append(ToggleCommand.watcherReadyToggled).append("]\n"); - debug.append("[startswithterminal][").append(ToggleCommand.startsWithToggled).append("]\n"); - debug.append("[selectallterminal][").append(ToggleCommand.selectAllToggled).append("]\n"); - debug.append("[clickinorderterminal][").append(ToggleCommand.clickInOrderToggled).append("]\n"); - debug.append("[blockwrongterminalclicks][").append(ToggleCommand.blockWrongTerminalClicksToggled).append("]\n"); - debug.append("[itemframeonsealanterns][").append(ToggleCommand.itemFrameOnSeaLanternsToggled).append("]\n"); - debug.append("[ultrasequencer][").append(ToggleCommand.ultrasequencerToggled).append("]\n"); - debug.append("[chronomatron][").append(ToggleCommand.chronomatronToggled).append("]\n"); - debug.append("[superpairs][").append(ToggleCommand.superpairsToggled).append("]\n"); - debug.append("[hidetooltipsinaddons][").append(ToggleCommand.hideTooltipsInExperimentAddonsToggled).append("]\n"); - debug.append("[pickblock][").append(ToggleCommand.swapToPickBlockToggled).append("]\n"); - debug.append("[melodytooltips][").append(ToggleCommand.melodyTooltips).append("]\n"); - debug.append("[highlightslayers][").append(ToggleCommand.highlightSlayers).append("]\n"); - debug.append("[highlightarachne][").append(ToggleCommand.highlightArachne).append("]\n"); - debug.append("[highlightskeletonmasters][").append(ToggleCommand.highlightSkeletonMasters).append("]\n"); - debug.append("[teammatesinradius][").append(ToggleCommand.teammatesInRadius).append("]\n"); - debug.append("[gianthp][").append(ToggleCommand.giantHP).append("]\n"); - debug.append("[hidepetcandy][").append(ToggleCommand.hidePetCandy).append("]\n"); - debug.append("[customcolourednames][").append(ToggleCommand.customColouredNames).append("]\n"); - debug.append("[endoffarmalert][").append(ToggleCommand.endOfFarmAlert).append("]\n"); - debug.append("[gemstonelore][").append(ToggleCommand.gemstoneLore).append("]\n"); - debug.append("[crystalhollowwaypoints][").append(ToggleCommand.crystalHollowWaypoints).append("]\n"); - debug.append("[crystalautowaypoints][").append(ToggleCommand.crystalAutoWaypoints).append("]\n"); - debug.append("[autoacceptreparty][").append(ToggleCommand.autoAcceptReparty).append("]\n"); - debug.append("[abilitycooldowns][").append(ToggleCommand.abilityCooldowns).append("]\n"); - debug.append("[dungeonbossmusic][").append(ToggleCommand.dungeonBossMusic).append("]\n"); - debug.append("[bloodroommusic][").append(ToggleCommand.bloodRoomMusic).append("]\n"); - debug.append("[dungeonmusic][").append(ToggleCommand.dungeonMusic).append("]\n"); debug.append("# Locations\n"); debug.append("[coords][").append(MoveCommand.coordsXY[0]).append(", ").append(MoveCommand.coordsXY[1]).append("]\n"); debug.append("[display][").append(MoveCommand.displayXY[0]).append(", ").append(MoveCommand.displayXY[1]).append("]\n"); @@ -131,6 +62,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[teammatesinradius][").append(MoveCommand.teammatesInRadiusXY[0]).append(", ").append(MoveCommand.teammatesInRadiusXY[1]).append("]\n"); debug.append("[gianthp][").append(MoveCommand.giantHPXY[0]).append(", ").append(MoveCommand.giantHPXY[1]).append("]\n"); debug.append("[abilitycooldowns][").append(MoveCommand.abilityCooldownsXY[0]).append(", ").append(MoveCommand.abilityCooldownsXY[1]).append("]\n"); + debug.append("[dungeonscore][").append(MoveCommand.dungeonScoreXY[0]).append(", ").append(MoveCommand.dungeonScoreXY[1]).append("]\n"); debug.append("# Other Settings\n"); debug.append("[Current Display][").append(LootDisplay.display).append("]\n"); debug.append("[Auto Display][").append(LootDisplay.auto).append("]\n"); diff --git a/src/main/java/me/Danker/commands/MoveCommand.java b/src/main/java/me/Danker/commands/MoveCommand.java index a43d09b..5a6c6a2 100644 --- a/src/main/java/me/Danker/commands/MoveCommand.java +++ b/src/main/java/me/Danker/commands/MoveCommand.java @@ -26,6 +26,7 @@ public class MoveCommand extends CommandBase { public static int[] teammatesInRadiusXY = {0, 0}; public static int[] giantHPXY = {0, 0}; public static int[] abilityCooldownsXY = {0, 0}; + public static int[] dungeonScoreXY = {0, 0}; @Override public String getCommandName() { @@ -35,7 +36,8 @@ public class MoveCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName() + " "; + "wateranswer/bonzotimer/golemtimer/teammatesinradius/gianthp/" + + "abilitycooldowns/dungeonscore> "; } public static String usage(ICommandSender arg0) { @@ -52,7 +54,7 @@ public class MoveCommand extends CommandBase { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", "skilltracker", "wateranswer", "bonzotimer", "golemtimer", "teammatesinradius", - "gianthp", "abilitycooldowns"); + "gianthp", "abilitycooldowns", "dungeonscore"); } return null; } @@ -158,6 +160,13 @@ public class MoveCommand extends CommandBase { ConfigHandler.writeIntConfig("locations", "abilityCooldownsY", abilityCooldownsXY[1]); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Ability cooldowns has been moved to " + DankersSkyblockMod.SECONDARY_COLOUR + arg1[1] + ", " + arg1[2])); break; + case "dungeonscore": + dungeonScoreXY[0] = Integer.parseInt(arg1[1]); + dungeonScoreXY[1] = Integer.parseInt(arg1[2]); + ConfigHandler.writeIntConfig("locations", "dungeonScoreX", dungeonScoreXY[0]); + ConfigHandler.writeIntConfig("locations", "dungeonScoreY", dungeonScoreXY[1]); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Dungeon score has been moved to " + DankersSkyblockMod.SECONDARY_COLOUR + arg1[1] + ", " + arg1[2])); + break; default: player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); } diff --git a/src/main/java/me/Danker/commands/ScaleCommand.java b/src/main/java/me/Danker/commands/ScaleCommand.java index b38d57e..9bb1f08 100644 --- a/src/main/java/me/Danker/commands/ScaleCommand.java +++ b/src/main/java/me/Danker/commands/ScaleCommand.java @@ -26,6 +26,7 @@ public class ScaleCommand extends CommandBase { public static double teammatesInRadiusScale; public static double giantHPScale; public static double abilityCooldownsScale; + public static double dungeonScoreScale; @Override public String getCommandName() { @@ -35,7 +36,7 @@ public class ScaleCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName() + " "; + "bonzotimer/golemtimer/teammatesinradius/gianthp/abilitycooldown/dungeonscore> "; } public static String usage(ICommandSender arg0) { @@ -52,7 +53,7 @@ public class ScaleCommand extends CommandBase { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", "skilltracker", "wateranswer", "bonzotimer", "golemtimer", "teammatesinradius", - "gianthp", "abilitycooldowns"); + "gianthp", "abilitycooldowns", "dungeonscore"); } return null; } @@ -138,6 +139,11 @@ public class ScaleCommand extends CommandBase { ConfigHandler.writeDoubleConfig("scales", "abilityCooldownsScale", abilityCooldownsScale); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Ability cooldowns has been scaled to " + DankersSkyblockMod.SECONDARY_COLOUR + abilityCooldownsScale + "x")); break; + case "dungeonscore": + dungeonScoreScale = scaleAmount; + ConfigHandler.writeDoubleConfig("scales", "dungeonScoreScale", dungeonScoreScale); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Dungeon score has been scaled to " + DankersSkyblockMod.SECONDARY_COLOUR + dungeonScoreScale + "x")); + break; default: player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); } diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index d9ef9b3..94425c0 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -47,6 +47,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean autoAcceptReparty; public static boolean abilityCooldowns; public static boolean alerts; + public static boolean dungeonScore; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; @@ -145,7 +146,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "gemstonelore", "crystalhollowwaypoints", "crystalautowaypoints", "autoacceptreparty", "itemcooldowns", "hubmusic", "islandmusic", "dungeonhubmusic", "farmingislandsmusic", "goldminemusic", "deepcavernsmusic", "dwarvenminesmusic", "crystalhollowsmusic", "spidersdenmusic", "blazingfortressmusic", - "endmusic", "parkmusic", "alerts", "list"); + "endmusic", "parkmusic", "alerts", "dungeonscore", "list"); } return null; } @@ -592,6 +593,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "Alerts", alerts); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Alerts has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + alerts + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "dungeonscore": + dungeonScore = !dungeonScore; + ConfigHandler.writeBooleanConfig("toggles", "DungeonScore", dungeonScore); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Dungeon score has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + dungeonScore + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "list": player.addChatMessage(new ChatComponentText(DankersSkyblockMod.TYPE_COLOUR + "Guild party notifications: " + DankersSkyblockMod.VALUE_COLOUR + gpartyToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Coord/Angle display: " + DankersSkyblockMod.VALUE_COLOUR + coordsToggled + "\n" + @@ -666,7 +672,8 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Custom blazing fortress music: " + DankersSkyblockMod.VALUE_COLOUR + blazingFortressMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom end music: " + DankersSkyblockMod.VALUE_COLOUR + endMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom park music: " + DankersSkyblockMod.VALUE_COLOUR + parkMusic + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Alerts: " + DankersSkyblockMod.VALUE_COLOUR + alerts + DankersSkyblockMod.TYPE_COLOUR + " Alerts: " + DankersSkyblockMod.VALUE_COLOUR + alerts + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Dungeon score: " + DankersSkyblockMod.VALUE_COLOUR + dungeonScore )); break; default: diff --git a/src/main/java/me/Danker/features/DungeonScore.java b/src/main/java/me/Danker/features/DungeonScore.java new file mode 100644 index 0000000..a2bc6e3 --- /dev/null +++ b/src/main/java/me/Danker/features/DungeonScore.java @@ -0,0 +1,224 @@ +package me.Danker.features; + +import me.Danker.DankersSkyblockMod; +import me.Danker.commands.MoveCommand; +import me.Danker.commands.ScaleCommand; +import me.Danker.commands.ToggleCommand; +import me.Danker.events.RenderOverlayEvent; +import me.Danker.handlers.ConfigHandler; +import me.Danker.handlers.ScoreboardHandler; +import me.Danker.handlers.TextRenderer; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StringUtils; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + +import java.util.Collection; +import java.util.List; + +public class DungeonScore { + + int failedPuzzles; + int skillScore; + String secrets; + int exploreScore; + int timeScore; + int bonusScore; + + @SubscribeEvent(receiveCanceled = true) + public void onChat(ClientChatReceivedEvent event) { + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + + if (!ToggleCommand.dungeonScore || !Utils.inDungeons) return; + + if (message.contains("PUZZLE FAIL! ") || message.contains("chose the wrong answer! I shall never forget this moment")) { + failedPuzzles++; + } + + if (message.contains(":")) return; + + if (message.contains(" and became a ghost.")) { + skillScore = MathHelper.clamp_int(skillScore - 2, 0, 100); + } + } + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + if (event.phase != TickEvent.Phase.START) return; + + if (!ToggleCommand.dungeonScore || !Utils.inDungeons) return; + + if (DankersSkyblockMod.tickAmount % 20 == 0) { + String floor = ""; + List scoreboard = ScoreboardHandler.getSidebarLines(); + for (String s : scoreboard) { + String sCleaned = ScoreboardHandler.cleanSB(s); + if (sCleaned.contains("The Catacombs (")) { + if (sCleaned.contains("F1")) { + floor = "F1"; + } else if (sCleaned.contains("F2")) { + floor = "F2"; + } else if (sCleaned.contains("F3")) { + floor = "F3"; + } else if (sCleaned.contains("F4")) { + floor = "F4"; + } else if (sCleaned.contains("F5")) { + floor = "F5"; + } else if (sCleaned.contains("F6")) { + floor = "F6"; + } else if (sCleaned.contains("F7")) { + floor = "F7"; + } + } + } + + int missingPuzzles = 0; + double openedRooms = 0; + double completedRooms = 0; + double roomScore = 0; + double secretScore = 0; + + Collection players = Minecraft.getMinecraft().getNetHandler().getPlayerInfoMap(); + for (NetworkPlayerInfo player : players) { + if (player == null || player.getDisplayName() == null) continue; + String display = player.getDisplayName().getUnformattedText(); + + if (display.startsWith(" Opened Rooms: ")) { + openedRooms = Double.parseDouble(display.replaceAll("[^\\d]", "")); + } else if (display.startsWith(" Completed Rooms: ")) { + completedRooms = Double.parseDouble(display.replaceAll("[^\\d]", "")); + } else if (display.startsWith(" Secrets Found: ") && display.endsWith("%")) { + secrets = player.getDisplayName().getFormattedText(); + + double secretCount = Double.parseDouble(display.replaceAll("[^\\d.]", "")); + + switch (floor) { + case "F1": + secretScore = secretCount / 30D; + break; + case "F2": + secretScore = secretCount / 40D; + break; + case "F3": + secretScore = secretCount / 50D; + break; + case "F4": + secretScore = secretCount / 60D; + break; + case "F5": + secretScore = secretCount / 70D; + break; + case "F6": + secretScore = secretCount / 85D; + break; + default: + secretScore = secretCount / 100D; + } + } else if (display.startsWith("Time Elapsed: ")) { + String timeText = display.substring(display.indexOf(":") + 2).replaceAll("\\s", ""); + int minutes = Integer.parseInt(timeText.substring(0, timeText.indexOf("m"))); + int seconds = Integer.parseInt(timeText.substring(timeText.indexOf("m") + 1, timeText.indexOf("s"))); + int time = minutes * 60 + seconds; + + if (floor.equals("F2")) time -= 120; + + int base; + switch (floor) { + case "F1": + case "F2": + case "F3": + case "F5": + base = 600; + break; + case "F4": + case "F6": + case "F7": + base = 720; + break; + default: + base = 480; + } + + if (time <= base) { + timeScore = 100; + } else if (time <= base + 100) { + timeScore = (int) Math.ceil(100 - 0.1 * (time - base)); + } else if (time <= base + 500) { + timeScore = (int) Math.ceil(90 - 0.05 * (time - base - 100)); + } else if (time < base + 2600) { + timeScore = (int) Math.ceil(70 - (1/30D) * (time - base - 1100)); + } else { + timeScore = 0; + } + } else if (display.startsWith(" Crypts: ")) { + bonusScore = MathHelper.clamp_int(Integer.parseInt(display.replaceAll("[^\\d]", "")), 0, 5); + } else if (display.contains("[✦]")) { + missingPuzzles++; + } + } + + if (openedRooms != 0) { + roomScore = completedRooms / openedRooms; + } + + skillScore = 100 - 14 * (failedPuzzles + missingPuzzles); + exploreScore = (int) (60 * roomScore + 40 * MathHelper.clamp_double(secretScore, 0, 1)); + } + } + + @SubscribeEvent + public void renderPlayerInfo(RenderOverlayEvent event) { + if (ToggleCommand.dungeonScore && Utils.inDungeons) { + Minecraft mc = Minecraft.getMinecraft(); + + int totalScore = skillScore + exploreScore + timeScore + bonusScore; + String total; + if (totalScore >= 300) { + total = EnumChatFormatting.GOLD + "S+"; + } else if (totalScore >= 270) { + total = EnumChatFormatting.GOLD + "S"; + } else if (totalScore >= 230) { + total = EnumChatFormatting.DARK_PURPLE + "A"; + } else if (totalScore >= 160) { + total = EnumChatFormatting.GREEN + "B"; + } else if (totalScore >= 100) { + total = EnumChatFormatting.BLUE + "C"; + } else { + total = EnumChatFormatting.RED + "D"; + } + + String scoreText = secrets + "\n" + + EnumChatFormatting.GOLD + "Skill:\n" + + EnumChatFormatting.GOLD + "Explore:\n" + + EnumChatFormatting.GOLD + "Speed:\n" + + EnumChatFormatting.GOLD + "Bonus:\n" + + EnumChatFormatting.GOLD + "Total:"; + String score = "\n" + + EnumChatFormatting.GOLD + skillScore + "\n" + + EnumChatFormatting.GOLD + exploreScore + "\n" + + EnumChatFormatting.GOLD + timeScore + "\n" + + EnumChatFormatting.GOLD + bonusScore + "\n" + + EnumChatFormatting.GOLD + totalScore + EnumChatFormatting.GRAY + " (" + total + EnumChatFormatting.GRAY + ")"; + new TextRenderer(mc, scoreText, MoveCommand.dungeonScoreXY[0], MoveCommand.dungeonScoreXY[1], ScaleCommand.dungeonScoreScale); + new TextRenderer(mc, score, MoveCommand.dungeonScoreXY[0] + 80, MoveCommand.dungeonScoreXY[1], ScaleCommand.dungeonScoreScale); + } + } + + @SubscribeEvent + public void onWorldChange(WorldEvent.Load event) { + failedPuzzles = 0; + skillScore = 100; + secrets = ""; + exploreScore = 0; + timeScore = 100; + bonusScore = 0; + } + +} diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 2a081e1..15360f0 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -84,6 +84,7 @@ public class DankerGui extends GuiScreen { private GuiButton flowerWeapons; private GuiButton necronNotifications; private GuiButton bonzoTimer; + private GuiButton dungeonScore; // Chat Messages private GuiButton sceptreMessages; private GuiButton midasStaffMessages; @@ -172,6 +173,7 @@ public class DankerGui extends GuiScreen { gemstoneLore = new FeatureButton("Applied Gemstones in Lore: " + Utils.getColouredBoolean(ToggleCommand.gemstoneLore), "Adds applied gemstones to item tooltip."); autoAcceptReparty = new FeatureButton("Auto Accept Reparty: " + Utils.getColouredBoolean(ToggleCommand.autoAcceptReparty), "Automatically rejoins parties when disbanded and invited."); abilityCooldown = new FeatureButton("Ability Cooldowns: " + Utils.getColouredBoolean(ToggleCommand.abilityCooldowns), "Displays ability cooldowns."); + dungeonScore = new FeatureButton("Dungeon Score Display: " + Utils.getColouredBoolean(ToggleCommand.dungeonScore), "Displays an estimated dungeon score with secrets."); allButtons.clear(); allButtons.add(changeDisplay); @@ -226,6 +228,7 @@ public class DankerGui extends GuiScreen { allButtons.add(gemstoneLore); allButtons.add(autoAcceptReparty); allButtons.add(abilityCooldown); + allButtons.add(dungeonScore); search.setText(initSearchText); search.setVisible(true); @@ -498,6 +501,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.abilityCooldowns = !ToggleCommand.abilityCooldowns; ConfigHandler.writeBooleanConfig("toggles", "AbilityCooldowns", ToggleCommand.abilityCooldowns); abilityCooldown.displayString = "Ability Cooldowns: " + Utils.getColouredBoolean(ToggleCommand.abilityCooldowns); + } else if (button == dungeonScore) { + ToggleCommand.dungeonScore = !ToggleCommand.dungeonScore; + ConfigHandler.writeBooleanConfig("toggles", "DungeonScore", ToggleCommand.dungeonScore); + dungeonScore.displayString = "Dungeon Score Display: " + Utils.getColouredBoolean(ToggleCommand.dungeonScore); } } diff --git a/src/main/java/me/Danker/gui/EditLocationsGui.java b/src/main/java/me/Danker/gui/EditLocationsGui.java index e24de8b..b7f4b02 100644 --- a/src/main/java/me/Danker/gui/EditLocationsGui.java +++ b/src/main/java/me/Danker/gui/EditLocationsGui.java @@ -32,6 +32,7 @@ public class EditLocationsGui extends GuiScreen { private LocationButton teammatesInRadius; private LocationButton giantHP; private LocationButton abilityCooldown; + private LocationButton dungeonScore; @Override public boolean doesGuiPauseGame() { @@ -104,6 +105,19 @@ public class EditLocationsGui extends GuiScreen { EnumChatFormatting.GREEN + "Parley: " + EnumChatFormatting.YELLOW + "2.652s\n" + EnumChatFormatting.GREEN + "Ice Spray: " + EnumChatFormatting.YELLOW + "1.429s"; + String dungeonScoreText = " Secrets Found: " + EnumChatFormatting.GREEN + "100.0%\n" + + EnumChatFormatting.GOLD + "Skill:\n" + + EnumChatFormatting.GOLD + "Explore:\n" + + EnumChatFormatting.GOLD + "Speed:\n" + + EnumChatFormatting.GOLD + "Bonus:\n" + + EnumChatFormatting.GOLD + "Total:"; + String dungeonScoreNums = "\n" + + EnumChatFormatting.GOLD + "100\n" + + EnumChatFormatting.GOLD + "100\n" + + EnumChatFormatting.GOLD + "100\n" + + EnumChatFormatting.GOLD + "5\n" + + EnumChatFormatting.GOLD + "305 " + EnumChatFormatting.GRAY + "(" + EnumChatFormatting.GOLD + "S+" + EnumChatFormatting.GRAY + ")"; + display = new LocationButton(MoveCommand.displayXY[0], MoveCommand.displayXY[1], ScaleCommand.displayScale, displayText, displayNums, 110); dungeonTimer = new LocationButton(MoveCommand.dungeonTimerXY[0], MoveCommand.dungeonTimerXY[1], ScaleCommand.dungeonTimerScale, dungeonTimerText, dungeonTimerNums, 80); coords = new LocationButton(MoveCommand.coordsXY[0], MoveCommand.coordsXY[1], ScaleCommand.coordsScale, NoF3Coords.COORDS_COLOUR + "74 / 14 / -26 (141.1 / 6.7)", null, null); @@ -117,6 +131,7 @@ public class EditLocationsGui extends GuiScreen { teammatesInRadius = new LocationButton(MoveCommand.teammatesInRadiusXY[0], MoveCommand.teammatesInRadiusXY[1], ScaleCommand.teammatesInRadiusScale, teammatesInRadiusText, null, null); giantHP = new LocationButton(MoveCommand.giantHPXY[0], MoveCommand.giantHPXY[1], ScaleCommand.giantHPScale, giantHPText, null, null); abilityCooldown = new LocationButton(MoveCommand.abilityCooldownsXY[0], MoveCommand.abilityCooldownsXY[1], ScaleCommand.abilityCooldownsScale, abilityCooldownText, null, null); + dungeonScore = new LocationButton(MoveCommand.dungeonScoreXY[0], MoveCommand.dungeonScoreXY[1], ScaleCommand.dungeonScoreScale, dungeonScoreText, dungeonScoreNums, 80); this.buttonList.add(coords); this.buttonList.add(dungeonTimer); @@ -131,6 +146,7 @@ public class EditLocationsGui extends GuiScreen { this.buttonList.add(teammatesInRadius); this.buttonList.add(giantHP); this.buttonList.add(abilityCooldown); + this.buttonList.add(dungeonScore); } @Override @@ -246,6 +262,11 @@ public class EditLocationsGui extends GuiScreen { abilityCooldown.xPosition = MoveCommand.abilityCooldownsXY[0]; abilityCooldown.yPosition = MoveCommand.abilityCooldownsXY[1]; break; + case "dungeonScore": + MoveCommand.dungeonScoreXY[0] += xMoved; + MoveCommand.dungeonScoreXY[1] += yMoved; + dungeonScore.xPosition = MoveCommand.dungeonScoreXY[0]; + dungeonScore.yPosition = MoveCommand.dungeonScoreXY[1]; } this.buttonList.clear(); initGui(); @@ -284,6 +305,8 @@ public class EditLocationsGui extends GuiScreen { moving = "giantHP"; } else if (button == abilityCooldown) { moving = "abilityCooldown"; + } else if (button == dungeonScore) { + moving = "dungeonScore"; } } } @@ -318,6 +341,8 @@ public class EditLocationsGui extends GuiScreen { ConfigHandler.writeIntConfig("locations", "giantHPY", MoveCommand.giantHPXY[1]); ConfigHandler.writeIntConfig("locations", "abilityCooldownsX", MoveCommand.abilityCooldownsXY[0]); ConfigHandler.writeIntConfig("locations", "abilityCooldownsY", MoveCommand.abilityCooldownsXY[1]); + ConfigHandler.writeIntConfig("locations", "dungeonScoreX", MoveCommand.dungeonScoreXY[0]); + ConfigHandler.writeIntConfig("locations", "dungeonScoreY", MoveCommand.dungeonScoreXY[1]); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 28f22fe..c785ff1 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -237,6 +237,7 @@ public class ConfigHandler { ToggleCommand.flowerWeaponsToggled = initBoolean("toggles", "FlowerWeapons", false); ToggleCommand.autoSkillTrackerToggled = initBoolean("toggles", "AutoSkillTracker", false); ToggleCommand.alerts = initBoolean("toggles", "Alerts", false); + ToggleCommand.dungeonScore = initBoolean("toggles", "DungeonScore", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); @@ -550,6 +551,8 @@ public class ConfigHandler { MoveCommand.giantHPXY[1] = initInt("locations", "giantHPY", 150); MoveCommand.abilityCooldownsXY[0] = initInt("locations", "abilityCooldownsX", 120); MoveCommand.abilityCooldownsXY[1] = initInt("locations", "abilityCooldownsY", 150); + MoveCommand.dungeonScoreXY[0] = initInt("locations", "dungeonScoreX", 150); + MoveCommand.dungeonScoreXY[1] = initInt("locations", "dungeonScoreY", 150); // Scales ScaleCommand.coordsScale = initDouble("scales", "coordsScale", 1); @@ -565,6 +568,7 @@ public class ConfigHandler { ScaleCommand.teammatesInRadiusScale = initDouble("scales", "teammatesInRadiusScale", 1); ScaleCommand.giantHPScale = initDouble("scales", "giantHPScale", 1); ScaleCommand.abilityCooldownsScale = initDouble("scales", "abilityCooldownsScale", 1); + ScaleCommand.dungeonScoreScale = initDouble("scales", "dungeonScoreScale", 1); // Skills DankersSkyblockMod.farmingLevel = initInt("skills", "farming", -1); -- cgit From de442e9110e8eb1bde9ebc4448d2634dfc4a7b9d Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sun, 26 Dec 2021 20:01:26 -0500 Subject: Fix issues with dungeon score display --- src/main/java/me/Danker/features/DungeonScore.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/DungeonScore.java b/src/main/java/me/Danker/features/DungeonScore.java index a2bc6e3..2b6b287 100644 --- a/src/main/java/me/Danker/features/DungeonScore.java +++ b/src/main/java/me/Danker/features/DungeonScore.java @@ -26,6 +26,7 @@ import java.util.List; public class DungeonScore { int failedPuzzles; + int deaths; int skillScore; String secrets; int exploreScore; @@ -45,7 +46,7 @@ public class DungeonScore { if (message.contains(":")) return; if (message.contains(" and became a ghost.")) { - skillScore = MathHelper.clamp_int(skillScore - 2, 0, 100); + deaths++; } } @@ -85,6 +86,7 @@ public class DungeonScore { double roomScore = 0; double secretScore = 0; + if (Minecraft.getMinecraft().getNetHandler() == null) return; Collection players = Minecraft.getMinecraft().getNetHandler().getPlayerInfoMap(); for (NetworkPlayerInfo player : players) { if (player == null || player.getDisplayName() == null) continue; @@ -168,7 +170,7 @@ public class DungeonScore { roomScore = completedRooms / openedRooms; } - skillScore = 100 - 14 * (failedPuzzles + missingPuzzles); + skillScore = MathHelper.clamp_int(100 - 14 * (failedPuzzles + missingPuzzles) - 2 * deaths, 0, 100); exploreScore = (int) (60 * roomScore + 40 * MathHelper.clamp_double(secretScore, 0, 1)); } } @@ -214,6 +216,7 @@ public class DungeonScore { @SubscribeEvent public void onWorldChange(WorldEvent.Load event) { failedPuzzles = 0; + deaths = 0; skillScore = 100; secrets = ""; exploreScore = 0; -- cgit From dda83961a0922b5753c7d4dd3e239a925d3afa7a Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sun, 26 Dec 2021 21:57:22 -0500 Subject: Add master mode loot tracker --- README.md | 4 +- .../java/me/Danker/commands/DisplayCommand.java | 11 +- src/main/java/me/Danker/commands/LootCommand.java | 37 +++++- src/main/java/me/Danker/features/AutoDisplay.java | 2 + .../me/Danker/features/loot/CatacombsTracker.java | 125 ++++++++++++++++----- .../java/me/Danker/features/loot/LootDisplay.java | 48 ++++++++ src/main/java/me/Danker/gui/DisplayGui.java | 62 +++++----- .../java/me/Danker/handlers/ConfigHandler.java | 10 ++ 8 files changed, 236 insertions(+), 63 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 4b4802c..d613908 100644 --- a/README.md +++ b/README.md @@ -70,8 +70,8 @@ Discord Server: https://discord.gg/QsEkNQS - /toggle - Toggles features. /toggle list returns values of every toggle. - /setkey - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. -- /loot [winter/festival/spooky/f(1-7)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. -- /display [winter/festival/spooky/f(1-7)/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active. +- /loot [winter/festival/spooky/f(1-7)/mm/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. +- /display [winter/festival/spooky/f(1-7)/mm/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active. - /resetloot - - Resets loot for trackers. /resetloot confirm confirms the reset. - /move - Moves text display to specified X and Y coordinates. - /scale - Scales text display to a specified multipler between 0.1x and 10x. diff --git a/src/main/java/me/Danker/commands/DisplayCommand.java b/src/main/java/me/Danker/commands/DisplayCommand.java index e248888..d335a8a 100644 --- a/src/main/java/me/Danker/commands/DisplayCommand.java +++ b/src/main/java/me/Danker/commands/DisplayCommand.java @@ -21,7 +21,7 @@ public class DisplayCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " [winter/festival/spooky/session/f(1-7)]"; + return "/" + getCommandName() + " [winter/festival/spooky/session/f(1-7)/mm]"; } public static String usage(ICommandSender arg0) { @@ -40,7 +40,7 @@ public class DisplayCommand extends CommandBase { } else if (args.length == 2 && args[0].equalsIgnoreCase("fishing")) { return getListOfStringsMatchingLastWord(args, "winter", "festival", "spooky", "session"); } else if (args.length == 2 && args[0].equalsIgnoreCase("catacombs")) { - return getListOfStringsMatchingLastWord(args, "f1", "floor1", "f2", "floor2", "f3", "floor3", "f4", "floor4", "f5", "floor5", "f6", "floor6", "f7", "floor7"); + return getListOfStringsMatchingLastWord(args, "f1", "floor1", "f2", "floor2", "f3", "floor3", "f4", "floor4", "f5", "floor5", "f6", "floor6", "f7", "floor7", "mm", "master"); } else if (args.length > 1) { return getListOfStringsMatchingLastWord(args, "session"); } @@ -198,6 +198,13 @@ public class DisplayCommand extends CommandBase { LootDisplay.display = "catacombs_floor_seven"; } break; + case "mm": + case "master": + if (showSession) { + LootDisplay.display = "catacombs_master_session"; + } else { + LootDisplay.display = "catacombs_master"; + } default: player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: /display catacombs ")); return; diff --git a/src/main/java/me/Danker/commands/LootCommand.java b/src/main/java/me/Danker/commands/LootCommand.java index 617a957..1437b36 100644 --- a/src/main/java/me/Danker/commands/LootCommand.java +++ b/src/main/java/me/Danker/commands/LootCommand.java @@ -24,7 +24,7 @@ public class LootCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " [winter/festival/spooky/f(1-7)/session]"; + return "/" + getCommandName() + " [winter/festival/spooky/f(1-7)/mm/session]"; } public static String usage(ICommandSender arg0) { @@ -43,7 +43,7 @@ public class LootCommand extends CommandBase { } else if (args.length == 2 && args[0].equalsIgnoreCase("fishing")) { return getListOfStringsMatchingLastWord(args, "winter", "festival", "spooky", "session"); } else if (args.length == 2 && args[0].equalsIgnoreCase("catacombs")) { - return getListOfStringsMatchingLastWord(args, "f1", "floor1", "f2", "floor2", "f3", "floor3", "f4", "floor4", "f5", "floor5", "f6", "floor6", "f7", "floor7"); + return getListOfStringsMatchingLastWord(args, "f1", "floor1", "f2", "floor2", "f3", "floor3", "f4", "floor4", "f5", "floor5", "f6", "floor6", "f7", "floor7", "mm", "master"); } else if (args.length > 1) { return getListOfStringsMatchingLastWord(args, "session"); } @@ -803,6 +803,39 @@ public class LootCommand extends CommandBase { EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, CatacombsTracker.f7TimeSpent) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); break; + case "mm": + case "master": + if (showSession) { + player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs MM Summary (Current Session):\n" + + EnumChatFormatting.GOLD + " S Runs:" + nf.format(CatacombsTracker.masterSSession) + "\n" + + EnumChatFormatting.GOLD + " Recombobulators:" + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books:" + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " 1st Master Stars:" + nf.format(CatacombsTracker.firstStarsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " 2nd Master Stars:" + nf.format(CatacombsTracker.secondStarsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " 3rd Master Stars:" + nf.format(CatacombsTracker.thirdStarsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " 4th Master Stars:" + nf.format(CatacombsTracker.fourthStarsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " 5th Master Stars:" + nf.format(CatacombsTracker.fifthStarsSession) + "\n" + + EnumChatFormatting.WHITE + " Rerolls:" + nf.format(CatacombsTracker.masterRerollsSession) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent:" + nf.format(CatacombsTracker.masterCoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + " Time Spent:" + nf.format(CatacombsTracker.masterTimeSpentSession) + "\n" + + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); + return; + } + player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs MM Summary:\n" + + EnumChatFormatting.GOLD + " S Runs:" + nf.format(CatacombsTracker.masterS) + "\n" + + EnumChatFormatting.GOLD + " Recombobulators:" + nf.format(CatacombsTracker.recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books:" + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + + EnumChatFormatting.DARK_PURPLE + " 1st Master Stars:" + nf.format(CatacombsTracker.firstStars) + "\n" + + EnumChatFormatting.DARK_PURPLE + " 2nd Master Stars:" + nf.format(CatacombsTracker.secondStars) + "\n" + + EnumChatFormatting.DARK_PURPLE + " 3rd Master Stars:" + nf.format(CatacombsTracker.thirdStars) + "\n" + + EnumChatFormatting.DARK_PURPLE + " 4th Master Stars:" + nf.format(CatacombsTracker.fourthStars) + "\n" + + EnumChatFormatting.DARK_PURPLE + " 5th Master Stars:" + nf.format(CatacombsTracker.fifthStars) + "\n" + + EnumChatFormatting.WHITE + " Rerolls:" + nf.format(CatacombsTracker.masterRerolls) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent:" + nf.format(CatacombsTracker.masterCoinsSpent) + "\n" + + EnumChatFormatting.AQUA + " Time Spent:" + nf.format(CatacombsTracker.masterTimeSpent) + "\n" + + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); default: player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: /loot catacombs ")); } diff --git a/src/main/java/me/Danker/features/AutoDisplay.java b/src/main/java/me/Danker/features/AutoDisplay.java index 89b1750..8dbe359 100644 --- a/src/main/java/me/Danker/features/AutoDisplay.java +++ b/src/main/java/me/Danker/features/AutoDisplay.java @@ -59,6 +59,8 @@ public class AutoDisplay { LootDisplay.display = "catacombs_floor_six"; } else if (sCleaned.contains("F7")) { LootDisplay.display = "catacombs_floor_seven"; + } else if (sCleaned.contains("(M")) { + LootDisplay.display = "catacombs_master"; } found = true; } diff --git a/src/main/java/me/Danker/features/loot/CatacombsTracker.java b/src/main/java/me/Danker/features/loot/CatacombsTracker.java index ddcb7d5..86770d6 100644 --- a/src/main/java/me/Danker/features/loot/CatacombsTracker.java +++ b/src/main/java/me/Danker/features/loot/CatacombsTracker.java @@ -88,6 +88,16 @@ public class CatacombsTracker { public static int f7Rerolls; public static double f7CoinsSpent; public static double f7TimeSpent; + // MM + public static int masterS; + public static int firstStars; + public static int secondStars; + public static int thirdStars; + public static int fourthStars; + public static int fifthStars; + public static int masterRerolls; + public static double masterCoinsSpent; + public static double masterTimeSpent; // Catacombs Dungeons public static int recombobulatorsSession = 0; @@ -163,6 +173,16 @@ public class CatacombsTracker { public static int f7RerollsSession = 0; public static double f7CoinsSpentSession = 0; public static double f7TimeSpentSession = 0; + // MM + public static int masterSSession = 0; + public static int firstStarsSession = 0; + public static int secondStarsSession = 0; + public static int thirdStarsSession = 0; + public static int fourthStarsSession = 0; + public static int fifthStarsSession = 0; + public static int masterRerollsSession = 0; + public static double masterCoinsSpentSession = 0; + public static double masterTimeSpentSession = 0; @SubscribeEvent public void onChat(ClientChatReceivedEvent event) { @@ -173,37 +193,48 @@ public class CatacombsTracker { if (message.contains(" Team Score: ") && message.contains("(S+)")) { List scoreboard = ScoreboardHandler.getSidebarLines(); - for (String s : scoreboard) { - String sCleaned = ScoreboardHandler.cleanSB(s); - if (sCleaned.contains("The Catacombs (")) { - if (sCleaned.contains("F1")) { - f1SPlus++; - f1SPlusSession++; - ConfigHandler.writeIntConfig("catacombs", "floorOneSPlus", f1SPlus); - } else if (sCleaned.contains("F2")) { - f2SPlus++; - f2SPlusSession++; - ConfigHandler.writeIntConfig("catacombs", "floorTwoSPlus", f2SPlus); - } else if (sCleaned.contains("F3")) { - f3SPlus++; - f3SPlusSession++; - ConfigHandler.writeIntConfig("catacombs", "floorThreeSPlus", f3SPlus); - } else if (sCleaned.contains("F4")) { - f4SPlus++; - f4SPlusSession++; - ConfigHandler.writeIntConfig("catacombs", "floorFourSPlus", f4SPlus); - } else if (sCleaned.contains("F5")) { - f5SPlus++; - f5SPlusSession++; - ConfigHandler.writeIntConfig("catacombs", "floorFiveSPlus", f5SPlus); - } else if (sCleaned.contains("F6")) { - f6SPlus++; - f6SPlusSession++; - ConfigHandler.writeIntConfig("catacombs", "floorSixSPlus", f6SPlus); - } else if (sCleaned.contains("F7")) { - f7SPlus++; - f7SPlusSession++; - ConfigHandler.writeIntConfig("catacombs", "floorSevenSPlus", f7SPlus); + if (message.contains("(S+)")) { + for (String s : scoreboard) { + String sCleaned = ScoreboardHandler.cleanSB(s); + if (sCleaned.contains("The Catacombs (")) { + if (sCleaned.contains("F1")) { + f1SPlus++; + f1SPlusSession++; + ConfigHandler.writeIntConfig("catacombs", "floorOneSPlus", f1SPlus); + } else if (sCleaned.contains("F2")) { + f2SPlus++; + f2SPlusSession++; + ConfigHandler.writeIntConfig("catacombs", "floorTwoSPlus", f2SPlus); + } else if (sCleaned.contains("F3")) { + f3SPlus++; + f3SPlusSession++; + ConfigHandler.writeIntConfig("catacombs", "floorThreeSPlus", f3SPlus); + } else if (sCleaned.contains("F4")) { + f4SPlus++; + f4SPlusSession++; + ConfigHandler.writeIntConfig("catacombs", "floorFourSPlus", f4SPlus); + } else if (sCleaned.contains("F5")) { + f5SPlus++; + f5SPlusSession++; + ConfigHandler.writeIntConfig("catacombs", "floorFiveSPlus", f5SPlus); + } else if (sCleaned.contains("F6")) { + f6SPlus++; + f6SPlusSession++; + ConfigHandler.writeIntConfig("catacombs", "floorSixSPlus", f6SPlus); + } else if (sCleaned.contains("F7")) { + f7SPlus++; + f7SPlusSession++; + ConfigHandler.writeIntConfig("catacombs", "floorSevenSPlus", f7SPlus); + } + } + } + } else if (message.contains("(S)")) { + for (String s : scoreboard) { + String sCleaned = ScoreboardHandler.cleanSB(s); + if (sCleaned.contains("The Catacombs (M")) { + masterS++; + masterSSession++; + ConfigHandler.writeIntConfig("catacombs", "masterS", masterS); } } } @@ -384,6 +415,26 @@ public class CatacombsTracker { witherBoots++; witherBootsSession++; ConfigHandler.writeIntConfig("catacombs", "witherBoot", witherBoots); + } else if (message.contains("First Master Star")) { + firstStars++; + firstStarsSession++; + ConfigHandler.writeIntConfig("catacombs", "firstStar", firstStars); + } else if (message.contains("Second Master Star")) { + secondStars++; + secondStarsSession++; + ConfigHandler.writeIntConfig("catacombs", "secondStar", secondStars); + } else if (message.contains("Third Master Star")) { + thirdStars++; + thirdStarsSession++; + ConfigHandler.writeIntConfig("catacombs", "thirdStar", thirdStars); + } else if (message.contains("Fourth Master Star")) { + fourthStars++; + fourthStarsSession++; + ConfigHandler.writeIntConfig("catacombs", "fourthStar", fourthStars); + } else if (message.contains("Fifth Master Star")) { + fifthStars++; + fifthStarsSession++; + ConfigHandler.writeIntConfig("catacombs", "fifthStar", fifthStars); } } @@ -422,6 +473,10 @@ public class CatacombsTracker { f7TimeSpent = Math.floor(f7TimeSpent + timeToAdd); f7TimeSpentSession = Math.floor(f7TimeSpentSession + timeToAdd); ConfigHandler.writeDoubleConfig("catacombs", "floorSevenTime", f7TimeSpent); + } else if (sCleaned.contains("(M")) { + masterTimeSpent = Math.floor(masterTimeSpent + timeToAdd); + masterTimeSpentSession = Math.floor(masterTimeSpentSession + timeToAdd); + ConfigHandler.writeDoubleConfig("catacombs", "masterTime", masterTimeSpent); } } else if (sCleaned.contains("Time Elapsed:")) { // Get floor time @@ -481,6 +536,10 @@ public class CatacombsTracker { f7CoinsSpent += coinsSpent; f7CoinsSpentSession += coinsSpent; ConfigHandler.writeDoubleConfig("catacombs", "floorSevenCoins", f7CoinsSpent); + } else if (sCleaned.contains("(M")) { + masterCoinsSpent += coinsSpent; + masterCoinsSpentSession += coinsSpent; + ConfigHandler.writeDoubleConfig("catacombs", "masterCoins", masterCoinsSpent); } } break; @@ -500,6 +559,10 @@ public class CatacombsTracker { f7Rerolls++; f7RerollsSession++; ConfigHandler.writeDoubleConfig("catacombs", "floorSevenRerolls", f7Rerolls); + } else if (sCleaned.contains("(M")) { + masterRerolls++; + masterRerollsSession++; + ConfigHandler.writeDoubleConfig("catacombs", "masterRerolls", masterRerolls); } break; } diff --git a/src/main/java/me/Danker/features/loot/LootDisplay.java b/src/main/java/me/Danker/features/loot/LootDisplay.java index d7a5f74..1878b47 100644 --- a/src/main/java/me/Danker/features/loot/LootDisplay.java +++ b/src/main/java/me/Danker/features/loot/LootDisplay.java @@ -1064,6 +1064,54 @@ public class LootDisplay { EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.f7CoinsSpentSession) + "\n" + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f7TimeSpentSession); break; + case "catacombs_master": + dropsText = EnumChatFormatting.GOLD + "S Runs:\n" + + EnumChatFormatting.GOLD + "Recombobulators:\n" + + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + + EnumChatFormatting.DARK_PURPLE + "1st Master Stars:\n" + + EnumChatFormatting.DARK_PURPLE + "2nd Master Stars:\n" + + EnumChatFormatting.DARK_PURPLE + "3rd Master Stars:\n" + + EnumChatFormatting.DARK_PURPLE + "4th Master Stars:\n" + + EnumChatFormatting.DARK_PURPLE + "5th Master Stars:\n" + + EnumChatFormatting.WHITE + "Rerolls:\n" + + EnumChatFormatting.AQUA + "Coins Spent:\n" + + EnumChatFormatting.AQUA + "Time Spent:"; + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.masterS) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.firstStars) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.secondStars) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.thirdStars) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fourthStars) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fifthStars) + "\n" + + EnumChatFormatting.WHITE + nf.format(CatacombsTracker.masterRerolls) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.masterCoinsSpent) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.masterTimeSpent); + break; + case "catacombs_master_session": + dropsText = EnumChatFormatting.GOLD + "S Runs:\n" + + EnumChatFormatting.GOLD + "Recombobulators:\n" + + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + + EnumChatFormatting.DARK_PURPLE + "1st Master Stars:\n" + + EnumChatFormatting.DARK_PURPLE + "2nd Master Stars:\n" + + EnumChatFormatting.DARK_PURPLE + "3rd Master Stars:\n" + + EnumChatFormatting.DARK_PURPLE + "4th Master Stars:\n" + + EnumChatFormatting.DARK_PURPLE + "5th Master Stars:\n" + + EnumChatFormatting.WHITE + "Rerolls:\n" + + EnumChatFormatting.AQUA + "Coins Spent:\n" + + EnumChatFormatting.AQUA + "Time Spent:"; + countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.masterSSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.firstStarsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.secondStarsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.thirdStarsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fourthStarsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fifthStarsSession) + "\n" + + EnumChatFormatting.WHITE + nf.format(CatacombsTracker.masterRerollsSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.masterCoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.masterTimeSpentSession); + break; case "ghost_session": dropsText = EnumChatFormatting.GOLD + "Bags of Cash:\n" + EnumChatFormatting.BLUE + "Sorrows:\n" + diff --git a/src/main/java/me/Danker/gui/DisplayGui.java b/src/main/java/me/Danker/gui/DisplayGui.java index c6b1381..06239b1 100644 --- a/src/main/java/me/Danker/gui/DisplayGui.java +++ b/src/main/java/me/Danker/gui/DisplayGui.java @@ -34,6 +34,7 @@ public class DisplayGui extends GuiScreen { private GuiButton catacombsF5; private GuiButton catacombsF6; private GuiButton catacombsF7; + private GuiButton catacombsMM; private GuiButton ghost; @Override @@ -63,13 +64,14 @@ public class DisplayGui extends GuiScreen { fishingSpooky = new GuiButton(0, width / 2 + 130, (int) (height * 0.4), 100, 20, "Fishing Spooky"); mythological = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), 95, 20, "Mythological"); ghost = new GuiButton(0, width / 2 + 5, (int) (height * 0.5), 95, 20, "Ghost"); - catacombsF1 = new GuiButton(0, width / 2 - 205, (int) (height * 0.65), 50, 20, "F1"); - catacombsF2 = new GuiButton(0, width / 2 - 145, (int) (height * 0.65), 50, 20, "F2"); - catacombsF3 = new GuiButton(0, width / 2 - 85, (int) (height * 0.65), 50, 20, "F3"); - catacombsF4 = new GuiButton(0, width / 2 - 25, (int) (height * 0.65), 50, 20, "F4"); - catacombsF5 = new GuiButton(0, width / 2 + 35, (int) (height * 0.65), 50, 20, "F5"); - catacombsF6 = new GuiButton(0, width / 2 + 95, (int) (height * 0.65), 50, 20, "F6"); - catacombsF7 = new GuiButton(0, width / 2 + 155, (int) (height * 0.65), 50, 20, "F7"); + catacombsF1 = new GuiButton(0, width / 2 - 235, (int) (height * 0.65), 50, 20, "F1"); + catacombsF2 = new GuiButton(0, width / 2 - 175, (int) (height * 0.65), 50, 20, "F2"); + catacombsF3 = new GuiButton(0, width / 2 - 115, (int) (height * 0.65), 50, 20, "F3"); + catacombsF4 = new GuiButton(0, width / 2 - 55, (int) (height * 0.65), 50, 20, "F4"); + catacombsF5 = new GuiButton(0, width / 2 + 5, (int) (height * 0.65), 50, 20, "F5"); + catacombsF6 = new GuiButton(0, width / 2 + 65, (int) (height * 0.65), 50, 20, "F6"); + catacombsF7 = new GuiButton(0, width / 2 + 125, (int) (height * 0.65), 50, 20, "F7"); + catacombsMM = new GuiButton(0, width / 2 + 185, (int) (height * 0.65), 50, 20, "MM"); this.buttonList.add(showSession); this.buttonList.add(off); @@ -90,6 +92,7 @@ public class DisplayGui extends GuiScreen { this.buttonList.add(catacombsF5); this.buttonList.add(catacombsF6); this.buttonList.add(catacombsF7); + this.buttonList.add(catacombsMM); this.buttonList.add(ghost); this.buttonList.add(goBack); } @@ -125,44 +128,47 @@ public class DisplayGui extends GuiScreen { } else if (button == off) { setDisplay("off", true); } else if (button == zombie) { - setDisplay("zombie", false); + setDisplay("zombie"); } else if (button == spider) { - setDisplay("spider", false); + setDisplay("spider"); } else if (button == wolf) { - setDisplay("wolf", false); + setDisplay("wolf"); } else if (button == enderman) { - setDisplay("enderman", false); + setDisplay("enderman"); } else if (button == auto) { LootDisplay.auto = true; ConfigHandler.writeBooleanConfig("misc", "autoDisplay", true); } else if (button == fishing) { - setDisplay("fishing", false); + setDisplay("fishing"); } else if (button == fishingWinter) { - setDisplay("fishing_winter", false); + setDisplay("fishing_winter"); } else if (button == fishingFestival) { - setDisplay("fishing_festival", false); + setDisplay("fishing_festival"); } else if (button == fishingSpooky) { - setDisplay("fishing_spooky", false); + setDisplay("fishing_spooky"); } else if (button == mythological) { - setDisplay("mythological", false); + setDisplay("mythological"); } else if (button == catacombsF1) { - setDisplay("catacombs_floor_one", false); + setDisplay("catacombs_floor_one"); } else if (button == catacombsF2) { - setDisplay("catacombs_floor_two", false); + setDisplay("catacombs_floor_two"); } else if (button == catacombsF3) { - setDisplay("catacombs_floor_three", false); + setDisplay("catacombs_floor_three"); } else if (button == catacombsF4) { - setDisplay("catacombs_floor_four", false); + setDisplay("catacombs_floor_four"); } else if (button == catacombsF5) { - setDisplay("catacombs_floor_five", false); + setDisplay("catacombs_floor_five"); } else if (button == catacombsF6) { - setDisplay("catacombs_floor_six", false); + setDisplay("catacombs_floor_six"); } else if (button == catacombsF7) { - setDisplay("catacombs_floor_seven", false); - } else if (button == ghost) - setDisplay("ghost",false); + setDisplay("catacombs_floor_seven"); + } else if (button == catacombsMM) { + setDisplay("catacombs_master"); + } else if (button == ghost) { + setDisplay("ghost"); + } } - + public void setDisplay(String display, boolean forceNoSession) { if (!forceNoSession && addSession) display += "_session"; LootDisplay.auto = false; @@ -170,5 +176,9 @@ public class DisplayGui extends GuiScreen { ConfigHandler.writeBooleanConfig("misc", "autoDisplay", false); ConfigHandler.writeStringConfig("misc", "display", display); } + + public void setDisplay(String display) { + setDisplay(display, false); + } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index c785ff1..112d86d 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -504,6 +504,16 @@ public class ConfigHandler { CatacombsTracker.f7Rerolls = initInt("catacombs", "floorSevenRerolls", 0); CatacombsTracker.f7CoinsSpent = initDouble("catacombs", "floorSevenCoins", 0); CatacombsTracker.f7TimeSpent = initDouble("catacombs", "floorSevenTime", 0); + // MM + CatacombsTracker.masterS = initInt("catacombs", "masterS", 0); + CatacombsTracker.firstStars = initInt("catacombs", "firstStar", 0); + CatacombsTracker.secondStars = initInt("catacombs", "secondStar", 0); + CatacombsTracker.thirdStars = initInt("catacombs", "thirdStar", 0); + CatacombsTracker.fourthStars = initInt("catacombs", "fourthStar", 0); + CatacombsTracker.fifthStars = initInt("catacombs", "fifthStar", 0); + CatacombsTracker.masterRerolls = initInt("catacombs", "masterRerolls", 0); + CatacombsTracker.masterCoinsSpent = initDouble("catacombs", "masterCoins", 0); + CatacombsTracker.masterTimeSpent = initDouble("catacombs", "masterTime", 0); // Ghost GhostTracker.sorrows = initInt("ghosts", "sorrow", 0); -- cgit From f2cf64f5b1a4894a1e6056efaafff165e41071e2 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 6 Jan 2022 18:35:16 -0500 Subject: Actually fix dungeon coins spent --- src/main/java/me/Danker/DankersSkyblockMod.java | 7 ++----- src/main/java/me/Danker/events/ChestSlotClickedEvent.java | 8 -------- .../java/me/Danker/features/loot/CatacombsTracker.java | 15 ++++++++------- 3 files changed, 10 insertions(+), 20 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 91f561a..d1d2d10 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -486,11 +486,8 @@ public class DankersSkyblockMod { if (slot == null) return; ItemStack item = slot.getStack(); String inventoryName = inventory.getDisplayName().getUnformattedText(); - if (item == null) { - if (MinecraftForge.EVENT_BUS.post(new ChestSlotClickedEvent(chest, inventory, inventoryName, slot))) event.setCanceled(true); - } else { - if (MinecraftForge.EVENT_BUS.post(new ChestSlotClickedEvent(chest, inventory, inventoryName, slot, item))) event.setCanceled(true); - } + + if (MinecraftForge.EVENT_BUS.post(new ChestSlotClickedEvent(chest, inventory, inventoryName, slot, item))) event.setCanceled(true); } } } diff --git a/src/main/java/me/Danker/events/ChestSlotClickedEvent.java b/src/main/java/me/Danker/events/ChestSlotClickedEvent.java index 5e4702c..452979e 100644 --- a/src/main/java/me/Danker/events/ChestSlotClickedEvent.java +++ b/src/main/java/me/Danker/events/ChestSlotClickedEvent.java @@ -23,12 +23,4 @@ public class ChestSlotClickedEvent extends Event { this.item = item; } - public ChestSlotClickedEvent(GuiChest chest, IInventory inventory, String inventoryName, Slot slot) { - this.chest = chest; - this.inventory = inventory; - this.inventoryName = inventoryName; - this.slot = slot; - item = null; - } - } diff --git a/src/main/java/me/Danker/features/loot/CatacombsTracker.java b/src/main/java/me/Danker/features/loot/CatacombsTracker.java index 86770d6..c4b9634 100644 --- a/src/main/java/me/Danker/features/loot/CatacombsTracker.java +++ b/src/main/java/me/Danker/features/loot/CatacombsTracker.java @@ -188,7 +188,7 @@ public class CatacombsTracker { public void onChat(ClientChatReceivedEvent event) { String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); - if (!Utils.inSkyblock) return; + if (!Utils.inDungeons) return; if (event.type == 2) return; if (message.contains(" Team Score: ") && message.contains("(S+)")) { @@ -492,17 +492,17 @@ public class CatacombsTracker { @SubscribeEvent public void onSlotClick(ChestSlotClickedEvent event) { + if (!Utils.inDungeons) return; + ItemStack item = event.item; if (event.inventoryName.endsWith(" Chest") && item != null) { if (item.getDisplayName().contains("Open Reward Chest")) { - List tooltip = item.getTooltip(Minecraft.getMinecraft().thePlayer, Minecraft.getMinecraft().gameSettings.advancedItemTooltips); + List tooltip = item.getTooltip(Minecraft.getMinecraft().thePlayer, false); for (String lineUnclean : tooltip) { String line = StringUtils.stripControlCodes(lineUnclean); - if (line.contains("FREE")) { - continue; - } else if (line.contains(" Coins") && !line.contains("NOTE:")) { - int coinsSpent = Integer.parseInt(line.substring(0, line.indexOf(" ")).replaceAll(",", "")); + if (line.contains(" Coins") && !line.contains("NOTE:")) { + int coinsSpent = Integer.parseInt(line.replaceAll("[^\\d]", "")); List scoreboard = ScoreboardHandler.getSidebarLines(); for (String s : scoreboard) { @@ -541,9 +541,10 @@ public class CatacombsTracker { masterCoinsSpentSession += coinsSpent; ConfigHandler.writeDoubleConfig("catacombs", "masterCoins", masterCoinsSpent); } + break; } - break; } + break; } } } else if (item.getDisplayName().contains("Reroll Chest")) { -- cgit From 836c6a646526649f8bb4e85b4396ff038a5aef9b Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 11 Jan 2022 21:25:50 -0500 Subject: Fix custom colour crash Possibly getting value when data is loading into JsonObject --- src/main/java/me/Danker/features/ColouredNames.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/ColouredNames.java b/src/main/java/me/Danker/features/ColouredNames.java index dfd6d84..f7f4d7a 100644 --- a/src/main/java/me/Danker/features/ColouredNames.java +++ b/src/main/java/me/Danker/features/ColouredNames.java @@ -137,7 +137,11 @@ public class ColouredNames { } public static String getColourFromName(String name) { - return "§" + DankersSkyblockMod.data.get("colourednames").getAsJsonObject().get(name).getAsString(); + try { + return "§" + DankersSkyblockMod.data.get("colourednames").getAsJsonObject().get(name).getAsString(); + } catch (NullPointerException ex) { + return EnumChatFormatting.WHITE.toString(); + } } } -- cgit From 4f89ebe884e37084eb2088087f2bb378ccb84020 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 25 Feb 2022 22:46:55 -0500 Subject: Fix chronomatron solver --- src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java index 52da0ec..7293f51 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java @@ -45,8 +45,10 @@ public class ChronomatronSolver { if (chronomatronPattern.size() > chronomatronMouseClicks && !item.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks))) { if (event.isCancelable() && !Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && !Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)) { event.setCanceled(true); + return; } } + chronomatronMouseClicks++; } else if (inventory.getStackInSlot(49).getDisplayName().startsWith("§aRemember the pattern!")) { if (event.isCancelable()) event.setCanceled(true); } -- cgit From 1bac9cb7a1a481b6574555c82461c555ec18cf46 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 25 Feb 2022 22:47:12 -0500 Subject: Fix slayer trackers not counting if drop is >= 10 --- src/main/java/me/Danker/features/loot/LootTracker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/loot/LootTracker.java b/src/main/java/me/Danker/features/loot/LootTracker.java index 5371ddc..4e5974c 100644 --- a/src/main/java/me/Danker/features/loot/LootTracker.java +++ b/src/main/java/me/Danker/features/loot/LootTracker.java @@ -55,7 +55,7 @@ public class LootTracker { } public static int getAmountfromMessage(String message) { - if (message.charAt(message.indexOf("(") + 2) == 'x') { + if (message.charAt(message.indexOf("(") + 2) == 'x' || message.charAt(message.indexOf("(") + 3) == 'x') { return Integer.parseInt(message.substring(message.indexOf("(") + 1, message.indexOf("x"))); } else { return 1; -- cgit From e660a2872bd5bb278dee6a8f7fbe26336dfd8b1d Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 4 Mar 2022 02:15:35 -0500 Subject: Update F7 notifications --- .../me/Danker/features/NecronNotifications.java | 79 +++++++++++----------- src/main/java/me/Danker/gui/DankerGui.java | 4 +- 2 files changed, 43 insertions(+), 40 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/NecronNotifications.java b/src/main/java/me/Danker/features/NecronNotifications.java index d35996c..323e7f8 100644 --- a/src/main/java/me/Danker/features/NecronNotifications.java +++ b/src/main/java/me/Danker/features/NecronNotifications.java @@ -24,55 +24,58 @@ public class NecronNotifications { if (!Utils.inDungeons) return; - if (ToggleCommand.necronNotificationsToggled && message.contains("[BOSS] Necron:")) { + if (ToggleCommand.necronNotificationsToggled) { Minecraft mc = Minecraft.getMinecraft(); World world = mc.theWorld; - if (message.contains("You tricked me!") || message.contains("That beam, it hurts! IT HURTS!!")) { - Utils.createTitle(EnumChatFormatting.RED + "NECRON STUCK!", 2); - } else if (message.contains("STOP USING MY FACTORY AGAINST ME!") || message.contains("OOF") || message.contains("ANOTHER TRAP!! YOUR TRICKS ARE FUTILE!") || message.contains("SERIOUSLY? AGAIN?!") || message.contains("STOP!!!!!")) { - List necronLabels = world.getEntities(EntityArmorStand.class, (entity -> { - if (!entity.hasCustomName()) return false; - if (!entity.getCustomNameTag().contains("Necron")) return false; - return true; - })); - if (necronLabels.size() == 0) { - Utils.createTitle(EnumChatFormatting.WHITE + "NECRON STUNNED!", 2); - } else { - EntityArmorStand necron = necronLabels.get(0); - double x = necron.posX; - double z = necron.posZ; - BlockPos blockPos = new BlockPos(x, 168, z); + if (message.startsWith("[BOSS] Maxor:")) { + if (message.contains("THAT BEAM! IT HURTS! IT HURTS!!") || message.contains("YOU TRICKED ME!")) { + Utils.createTitle(EnumChatFormatting.RED + "MAXOR STUCK!", 2); + } + } else if (message.startsWith("[BOSS] Storm:")) { + if (message.contains("Ouch, that hurt!") || message.contains("Oof")) { + List stormLabels = world.getEntities(EntityArmorStand.class, (entity -> { + if (!entity.hasCustomName()) return false; + return entity.getCustomNameTag().contains("Storm"); + })); + if (stormLabels.size() == 0) { + Utils.createTitle(EnumChatFormatting.WHITE + "STORM STUNNED!", 2); + } else { + EntityArmorStand storm = stormLabels.get(0); + double x = storm.posX; + double z = storm.posZ; - IBlockState blockState = world.getBlockState(blockPos); - Block block = blockState.getBlock(); + BlockPos blockPos = new BlockPos(x, 168, z); - if (block != Blocks.stained_hardened_clay) { - Utils.createTitle(EnumChatFormatting.WHITE + "NECRON STUNNED!", 2); - } else { - switch (block.getDamageValue(world, blockPos)) { - case 4: - Utils.createTitle(EnumChatFormatting.YELLOW + "YELLOW PILLAR!", 2); - break; - case 5: - Utils.createTitle(EnumChatFormatting.DARK_GREEN + "GREEN PILLAR!", 2); - break; - case 11: - Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "PURPLE PILLAR!", 2); - break; - default: - Utils.createTitle(EnumChatFormatting.WHITE + "NECRON STUNNED!", 2); + IBlockState blockState = world.getBlockState(blockPos); + Block block = blockState.getBlock(); + + if (block != Blocks.stained_hardened_clay) { + Utils.createTitle(EnumChatFormatting.WHITE + "STORM STUNNED!", 2); + } else { + switch (block.getDamageValue(world, blockPos)) { + case 4: + Utils.createTitle(EnumChatFormatting.YELLOW + "YELLOW PILLAR!", 2); + break; + case 5: + Utils.createTitle(EnumChatFormatting.DARK_GREEN + "GREEN PILLAR!", 2); + break; + case 11: + Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "PURPLE PILLAR!", 2); + break; + default: + Utils.createTitle(EnumChatFormatting.WHITE + "STORM STUNNED!", 2); + } } - } + } + } else if (message.contains("I should have known that I stood no chance.")) { + Utils.createTitle(EnumChatFormatting.RED + "RED PILLAR!", 2); } - } else if (message.contains("I'VE HAD ENOUGH! YOU'RE NOT HITTING ME WITH ANY MORE PILLARS!")) { - Utils.createTitle(EnumChatFormatting.RED + "RED PILLAR!", 2); - } else if (message.contains("ARGH!")) { + } else if (message.startsWith("[BOSS] Necron:") && message.contains("ARGH!")) { Utils.createTitle(EnumChatFormatting.RED + "EXPLOSION OVER!", 2); } } - } } diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 15360f0..c7af0da 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -158,7 +158,7 @@ public class DankerGui extends GuiScreen { watcherReadyMessage = new FeatureButton("Display Watcher Ready Message: " + Utils.getColouredBoolean(ToggleCommand.watcherReadyToggled), "Alerts when Watcher finishes spawning mobs."); flowerWeapons = new FeatureButton("Prevent Placing FoT/Spirit Sceptre: " + Utils.getColouredBoolean(ToggleCommand.flowerWeaponsToggled), "Blocks placing Flower of Truth or Spirit Sceptre."); notifySlayerSlain = new FeatureButton("Notify when Slayer Slain: " + Utils.getColouredBoolean(ToggleCommand.notifySlayerSlainToggled), "Alerts when slayer boss has been slain."); - necronNotifications = new FeatureButton("Necron Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled), "Creates alert on different phases of the Necron fight."); + necronNotifications = new FeatureButton("Floor 7 Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled), "Creates alert on different phases of the floor 7 fight."); bonzoTimer = new FeatureButton("Bonzo's Mask Timer: " + Utils.getColouredBoolean(ToggleCommand.bonzoTimerToggled), "Displays cooldown of Bonzo Mask ability."); autoSkillTracker = new FeatureButton("Auto Start/Stop Skill Tracker: " + Utils.getColouredBoolean(ToggleCommand.autoSkillTrackerToggled), "Automatically pauses skill tracker when opening a gui."); melodyTooltips = new FeatureButton("Hide tooltips in Melody's Harp: " + Utils.getColouredBoolean(ToggleCommand.melodyTooltips), "Hides tooltips in Melody's Harp."); @@ -432,7 +432,7 @@ public class DankerGui extends GuiScreen { } else if (button == necronNotifications) { ToggleCommand.necronNotificationsToggled = !ToggleCommand.necronNotificationsToggled; ConfigHandler.writeBooleanConfig("toggles", "NecronNotifications", ToggleCommand.necronNotificationsToggled); - necronNotifications.displayString = "Necron Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled); + necronNotifications.displayString = "Floor 7 Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled); } else if (button == bonzoTimer) { ToggleCommand.bonzoTimerToggled = !ToggleCommand.bonzoTimerToggled; ConfigHandler.writeBooleanConfig("toggles", "BonzoTimer", ToggleCommand.bonzoTimerToggled); -- cgit From c260e3b0bb8eda50ea9e8af4f0214dc08d7f1d91 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 4 Mar 2022 02:55:02 -0500 Subject: Small fixes to chat message triggers Mainly fix crash with three man solver --- src/main/java/me/Danker/features/AutoAcceptReparty.java | 5 ++++- src/main/java/me/Danker/features/BonzoMaskTimer.java | 1 + src/main/java/me/Danker/features/puzzlesolvers/ThreeManSolver.java | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/AutoAcceptReparty.java b/src/main/java/me/Danker/features/AutoAcceptReparty.java index a89b30b..b2e563d 100644 --- a/src/main/java/me/Danker/features/AutoAcceptReparty.java +++ b/src/main/java/me/Danker/features/AutoAcceptReparty.java @@ -13,9 +13,12 @@ public class AutoAcceptReparty { @SubscribeEvent(receiveCanceled = true) public void onChat(ClientChatReceivedEvent event) { - String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); if (ToggleCommand.autoAcceptReparty) { + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + + if (message.contains(":")) return; + String[] split = message.split("\\s"); if (message.contains("has disbanded the party!")) { diff --git a/src/main/java/me/Danker/features/BonzoMaskTimer.java b/src/main/java/me/Danker/features/BonzoMaskTimer.java index e27d0bf..5bec1ba 100644 --- a/src/main/java/me/Danker/features/BonzoMaskTimer.java +++ b/src/main/java/me/Danker/features/BonzoMaskTimer.java @@ -35,6 +35,7 @@ public class BonzoMaskTimer { String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); if (!Utils.inDungeons) return; + if (message.contains(":")) return; if (ToggleCommand.bonzoTimerToggled && message.contains("Bonzo's Mask") && message.contains("saved your life!")) { double usedTime = System.currentTimeMillis() / 1000; diff --git a/src/main/java/me/Danker/features/puzzlesolvers/ThreeManSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/ThreeManSolver.java index b0935c3..d97509c 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/ThreeManSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/ThreeManSolver.java @@ -35,7 +35,7 @@ public class ThreeManSolver { if (!Utils.inDungeons) return; - if (ToggleCommand.threeManToggled && message.contains("[NPC]")) { + if (ToggleCommand.threeManToggled && message.startsWith("[NPC]")) { if (DankersSkyblockMod.data != null && DankersSkyblockMod.data.has("threeman")) { JsonArray riddleSolutions = DankersSkyblockMod.data.get("threeman").getAsJsonArray(); -- cgit From 42b556c49db4d848cddca76b383135dcdaad99fa Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 4 Mar 2022 03:01:48 -0500 Subject: Remove networth command You had a good unreleased run --- README.md | 1 - src/main/java/me/Danker/DankersSkyblockMod.java | 1 - src/main/java/me/Danker/commands/DHelpCommand.java | 1 - .../java/me/Danker/commands/NetworthCommand.java | 171 --------------------- 4 files changed, 174 deletions(-) delete mode 100644 src/main/java/me/Danker/commands/NetworthCommand.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index d613908..8e31daa 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,6 @@ Discord Server: https://discord.gg/QsEkNQS - /reloaddsmrepo - Reloads Danker's Skyblock Mod repository. - /dsmfarmlength - Sets coords to be used for end of farm alert. - /hotmof [player] - Uses API to find total powder and HotM tree of a person. If no name is provided, it checks yours. -- /networth [player] - Uses API to find networth of a person. If no name is provided, it checks yours. ## Keybinds - Open Maddox menu - M by default. diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index d1d2d10..0d7e577 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -215,7 +215,6 @@ public class DankersSkyblockMod { ClientCommandHandler.instance.registerCommand(new LobbySkillsCommand()); ClientCommandHandler.instance.registerCommand(new LootCommand()); ClientCommandHandler.instance.registerCommand(new MoveCommand()); - ClientCommandHandler.instance.registerCommand(new NetworthCommand()); ClientCommandHandler.instance.registerCommand(new PetsCommand()); ClientCommandHandler.instance.registerCommand(new PlayerCommand()); ClientCommandHandler.instance.registerCommand(new ReloadConfigCommand()); diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index d960237..477d43b 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -63,7 +63,6 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + ReloadRepoCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Reloads Danker's Skyblock Mod repository.\n" + EnumChatFormatting.GOLD + FarmLengthCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Sets coords to be used for end of farm alert.\n" + EnumChatFormatting.GOLD + HOTMCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find total powder and HotM tree of a person. If no name is provided, it checks yours.\n" + - EnumChatFormatting.GOLD + NetworthCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find networth of a person. If no name is provided, it checks yours.\n" + EnumChatFormatting.GREEN + " Open Maddox Menu" + EnumChatFormatting.AQUA + " - M by default.\n" + EnumChatFormatting.GREEN + " Start/Stop Skill Tracker" + EnumChatFormatting.AQUA + " - Numpad 5 by default.\n")); } diff --git a/src/main/java/me/Danker/commands/NetworthCommand.java b/src/main/java/me/Danker/commands/NetworthCommand.java deleted file mode 100644 index be35c84..0000000 --- a/src/main/java/me/Danker/commands/NetworthCommand.java +++ /dev/null @@ -1,171 +0,0 @@ -package me.Danker.commands; - -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import me.Danker.DankersSkyblockMod; -import me.Danker.handlers.APIHandler; -import me.Danker.handlers.ConfigHandler; -import me.Danker.utils.Utils; -import net.minecraft.command.CommandBase; -import net.minecraft.command.CommandException; -import net.minecraft.command.ICommandSender; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; - -import java.io.IOException; -import java.text.DecimalFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -public class NetworthCommand extends CommandBase { - - @Override - public String getCommandName() { - return "networth"; - } - - @Override - public List getCommandAliases() { - return Collections.singletonList("nw"); - } - - @Override - public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " [name]"; - } - - public static String usage(ICommandSender arg0) { - return new NetworthCommand().getCommandUsage(arg0); - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { - if (args.length == 1) { - return Utils.getMatchingPlayers(args[0]); - } - return null; - } - - @Override - public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { - // MULTI THREAD DRIFTING - new Thread(() -> { - EntityPlayer player = (EntityPlayer) arg0; - - // Check key - String key = ConfigHandler.getString("api", "APIKey"); - if (key.equals("")) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "API key not set. Use /setkey.")); - return; - } - - // Get UUID for Hypixel API requests - String username; - String uuid; - if (arg1.length == 0) { - username = player.getName(); - uuid = player.getUniqueID().toString().replaceAll("[\\-]", ""); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking networth of " + DankersSkyblockMod.SECONDARY_COLOUR + username)); - } else { - username = arg1[0]; - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking networth of " + DankersSkyblockMod.SECONDARY_COLOUR + username)); - uuid = APIHandler.getUUID(username); - } - - // Find stats of latest profile - String latestProfile = APIHandler.getLatestProfileID(uuid, key); - if (latestProfile == null) return; - - String profileURL = "https://api.hypixel.net/skyblock/profile?profile=" + latestProfile + "&key=" + key; - System.out.println("Fetching profile..."); - JsonObject profileResponse = APIHandler.getResponse(profileURL, true); - if (!profileResponse.get("success").getAsBoolean()) { - String reason = profileResponse.get("cause").getAsString(); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Failed with reason: " + reason)); - return; - } - - try { - System.out.println("Fetching networth..."); - - JsonObject body = new JsonObject(); - body.add("data", profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject()); - body.get("data").getAsJsonObject().add("banking", profileResponse.get("profile").getAsJsonObject().get("banking").getAsJsonObject()); - - JsonObject networth = APIHandler.getResponsePOST("https://nariah-dev.com/api/networth/categories", body, true); - if (networth.has("success") && !networth.get("success").getAsBoolean()) { - String reason = profileResponse.get("cause").getAsString(); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Failed with reason: " + reason)); - return; - } - - JsonObject data = networth.get("data").getAsJsonObject(); - JsonObject categoriesObject = data.get("categories").getAsJsonObject(); - - long total = data.get("networth").getAsLong(); - long purse = data.get("purse").getAsLong(); - long bank = data.get("bank").getAsLong(); - long sacks = data.get("sacks").getAsLong(); - - List categories = categoriesObject.entrySet().stream() - .map(Map.Entry::getKey) - .collect(Collectors.toCollection(ArrayList::new)); - StringBuilder subcategories = new StringBuilder(); - - for (String category : categories) { - JsonObject categoryObject = categoriesObject.get(category).getAsJsonObject(); - subcategories.append("\n").append(DankersSkyblockMod.TYPE_COLOUR).append(Utils.capitalizeString(category)).append(" value - ").append(formatPrice(categoryObject.get("total").getAsLong())).append("\n"); - - JsonArray topItems = categoryObject.get("top_items").getAsJsonArray(); - - for (int i = 0; i < 5 && i < topItems.size(); i++) { - JsonObject item = topItems.get(i).getAsJsonObject(); - - subcategories.append(EnumChatFormatting.AQUA); - if (item.has("count") && item.get("count").getAsInt() > 1) { - subcategories.append(item.get("count").getAsInt()).append("x").append(" "); - } - subcategories.append(item.get("name").getAsString()); - if (item.has("recomb") && item.get("recomb").getAsBoolean()) { - subcategories.append(" ⇑"); - } - subcategories.append(" ➜ ").append(EnumChatFormatting.GOLD).append(formatPrice(item.get("price").getAsLong())).append("\n"); - } - } - - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" + - EnumChatFormatting.AQUA + username + "'s Networth:\n" + - DankersSkyblockMod.TYPE_COLOUR + "Purse: " + EnumChatFormatting.GOLD + formatPrice(purse) + "\n" + - DankersSkyblockMod.TYPE_COLOUR + "Bank: " + EnumChatFormatting.GOLD + formatPrice(bank) + "\n" + - DankersSkyblockMod.TYPE_COLOUR + "Sacks: " + EnumChatFormatting.GOLD + formatPrice(sacks) + "\n" + - subcategories + "\n" + - DankersSkyblockMod.TYPE_COLOUR + "Total: " + EnumChatFormatting.GOLD + formatPrice(total) + "\n" + - DankersSkyblockMod.DELIMITER_COLOUR + EnumChatFormatting.BOLD + "-------------------")); - } catch (IOException ex) { - ex.printStackTrace(); - } - }).start(); - } - - String formatPrice(long price) { - String[] suffixes = {"", "K", "M", "B", "T"}; - double p = price; - int i = 0; - while ((p / 1000) >= 1) { - p /= 1000; - i++; - } - return new DecimalFormat("#.#").format(p) + suffixes[i]; - } - -} -- cgit From 2b57ccad6d21b325c3164117fe14e00e13399a7c Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 4 Mar 2022 13:20:20 -0500 Subject: Add CH fishing tracker Organized change display GUI Add method to make centered text rendering easier --- README.md | 6 +- .../java/me/Danker/commands/DisplayCommand.java | 11 +- .../me/Danker/commands/ImportFishingCommand.java | 116 ++++++++++++++------- src/main/java/me/Danker/commands/LootCommand.java | 28 ++++- .../java/me/Danker/commands/ResetLootCommand.java | 6 ++ .../me/Danker/features/loot/FishingTracker.java | 44 ++++++++ .../java/me/Danker/features/loot/LootDisplay.java | 44 ++++++++ src/main/java/me/Danker/gui/DankerGui.java | 4 +- src/main/java/me/Danker/gui/DisplayGui.java | 51 +++++---- src/main/java/me/Danker/gui/OnlySlayerGui.java | 4 +- src/main/java/me/Danker/gui/SkillTrackerGui.java | 6 +- src/main/java/me/Danker/gui/WarningGui.java | 16 ++- .../java/me/Danker/gui/alerts/AlertActionGui.java | 2 + src/main/java/me/Danker/gui/alerts/AlertsGui.java | 4 +- .../CrystalHollowWaypointActionGui.java | 5 +- .../CrystalHollowWaypointsGui.java | 4 +- .../java/me/Danker/handlers/ConfigHandler.java | 7 ++ src/main/java/me/Danker/utils/RenderUtils.java | 6 ++ 18 files changed, 272 insertions(+), 92 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 8e31daa..4ae2a40 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Discord Server: https://discord.gg/QsEkNQS - Maddox menu keybind - Block starting other slayer quests - Slayer slain alert -- Fishing, jerry fishing, fishing festival, spooky fishing trackers +- Fishing, jerry fishing, fishing festival, spooky fishing, crystal hollows fishing trackers - Expertise kills in fishing rod lore - Gemstones applied in item lore - Catacombs trackers @@ -70,8 +70,8 @@ Discord Server: https://discord.gg/QsEkNQS - /toggle - Toggles features. /toggle list returns values of every toggle. - /setkey - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. -- /loot [winter/festival/spooky/f(1-7)/mm/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. -- /display [winter/festival/spooky/f(1-7)/mm/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active. +- /loot [winter/festival/spooky/ch/f(1-7)/mm/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. +- /display [winter/festival/spooky/ch/f(1-7)/mm/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active. - /resetloot - - Resets loot for trackers. /resetloot confirm confirms the reset. - /move - Moves text display to specified X and Y coordinates. - /scale - Scales text display to a specified multipler between 0.1x and 10x. diff --git a/src/main/java/me/Danker/commands/DisplayCommand.java b/src/main/java/me/Danker/commands/DisplayCommand.java index d335a8a..3db6853 100644 --- a/src/main/java/me/Danker/commands/DisplayCommand.java +++ b/src/main/java/me/Danker/commands/DisplayCommand.java @@ -21,7 +21,7 @@ public class DisplayCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " [winter/festival/spooky/session/f(1-7)/mm]"; + return "/" + getCommandName() + " [winter/festival/spooky/ch/session/f(1-7)/mm]"; } public static String usage(ICommandSender arg0) { @@ -38,7 +38,7 @@ public class DisplayCommand extends CommandBase { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "enderman", "fishing", "catacombs", "mythological", "ghost", "auto", "off"); } else if (args.length == 2 && args[0].equalsIgnoreCase("fishing")) { - return getListOfStringsMatchingLastWord(args, "winter", "festival", "spooky", "session"); + return getListOfStringsMatchingLastWord(args, "winter", "festival", "spooky", "ch", "session"); } else if (args.length == 2 && args[0].equalsIgnoreCase("catacombs")) { return getListOfStringsMatchingLastWord(args, "f1", "floor1", "f2", "floor2", "f3", "floor3", "f4", "floor4", "f5", "floor5", "f6", "floor6", "f7", "floor7", "mm", "master"); } else if (args.length > 1) { @@ -113,6 +113,13 @@ public class DisplayCommand extends CommandBase { LootDisplay.display = "fishing_spooky"; } break; + case "ch": + if (showSession) { + LootDisplay.display = "fishing_ch"; + } else { + LootDisplay.display = "fishing_ch_session"; + } + break; default: if (showSession) { LootDisplay.display = "fishing_session"; diff --git a/src/main/java/me/Danker/commands/ImportFishingCommand.java b/src/main/java/me/Danker/commands/ImportFishingCommand.java index 3ee5ebd..bdd3281 100644 --- a/src/main/java/me/Danker/commands/ImportFishingCommand.java +++ b/src/main/java/me/Danker/commands/ImportFishingCommand.java @@ -37,22 +37,22 @@ public class ImportFishingCommand extends CommandBase { // MULTI THREAD DRIFTING new Thread(() -> { EntityPlayer player = (EntityPlayer) arg0; - + // Check key String key = ConfigHandler.getString("api", "APIKey"); if (key.equals("")) { player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "API key not set. Use /setkey.")); return; } - + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Importing your fishing stats...")); - + // Get UUID for Hypixel API requests String uuid = player.getUniqueID().toString().replaceAll("[\\-]", ""); - + String latestProfile = APIHandler.getLatestProfileID(uuid, key); if (latestProfile == null) return; - + String profileURL = "https://api.hypixel.net/skyblock/profile?profile=" + latestProfile + "&key=" + key; System.out.println("Fetching profile..."); JsonObject profileResponse = APIHandler.getResponse(profileURL, true); @@ -61,10 +61,10 @@ public class ImportFishingCommand extends CommandBase { player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); return; } - + System.out.println("Fetching fishing stats..."); JsonObject statsObject = profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject().get("stats").getAsJsonObject(); - + FishingTracker.greatCatches = 0; FishingTracker.goodCatches = 0; if (statsObject.has("items_fished_treasure")) { @@ -75,44 +75,44 @@ public class ImportFishingCommand extends CommandBase { FishingTracker.goodCatches = statsObject.get("items_fished_treasure").getAsInt(); } } - + FishingTracker.seaCreatures = 0; FishingTracker.squids = 0; if (statsObject.has("kills_pond_squid")) { FishingTracker.squids = statsObject.get("kills_pond_squid").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.squids; - + FishingTracker.seaWalkers = 0; if (statsObject.has("kills_sea_walker")) { FishingTracker.seaWalkers = statsObject.get("kills_sea_walker").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.seaWalkers; - + FishingTracker.nightSquids = 0; if (statsObject.has("kills_night_squid")) { FishingTracker.nightSquids = statsObject.get("kills_night_squid").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.nightSquids; - + FishingTracker.seaGuardians = 0; if (statsObject.has("kills_sea_guardian")) { FishingTracker.seaGuardians = statsObject.get("kills_sea_guardian").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.seaGuardians; - + FishingTracker.seaWitches = 0; if (statsObject.has("kills_sea_witch")) { FishingTracker.seaWitches = statsObject.get("kills_sea_witch").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.seaWitches; - + FishingTracker.seaArchers = 0; if (statsObject.has("kills_sea_archer")) { FishingTracker.seaArchers = statsObject.get("kills_sea_archer").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.seaArchers; - + FishingTracker.monsterOfTheDeeps = 0; if (statsObject.has("kills_zombie_deep")) { if (statsObject.has("kills_chicken_deep")) { @@ -124,44 +124,44 @@ public class ImportFishingCommand extends CommandBase { FishingTracker.monsterOfTheDeeps = statsObject.get("kills_chicken_deep").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.monsterOfTheDeeps; - + FishingTracker.catfishes = 0; if (statsObject.has("kills_catfish")) { FishingTracker.catfishes = statsObject.get("kills_catfish").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.catfishes; - + FishingTracker.carrotKings = 0; if (statsObject.has("kills_carrot_king")) { FishingTracker.carrotKings = statsObject.get("kills_carrot_king").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.carrotKings; - + FishingTracker.seaLeeches = 0; if (statsObject.has("kills_sea_leech")) { FishingTracker.seaLeeches = statsObject.get("kills_sea_leech").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.seaLeeches; - + FishingTracker.guardianDefenders = 0; if (statsObject.has("kills_guardian_defender")) { FishingTracker.guardianDefenders = statsObject.get("kills_guardian_defender").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.guardianDefenders; - + FishingTracker.deepSeaProtectors = 0; if (statsObject.has("kills_deep_sea_protector")) { FishingTracker.deepSeaProtectors = statsObject.get("kills_deep_sea_protector").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.deepSeaProtectors; - + FishingTracker.hydras = 0; if (statsObject.has("kills_water_hydra")) { // Hydra splits FishingTracker.hydras = statsObject.get("kills_water_hydra").getAsInt() / 2; } FishingTracker.seaCreatures += FishingTracker.hydras; - + FishingTracker.seaEmperors = 0; if (statsObject.has("kills_skeleton_emperor")) { if (statsObject.has("kills_guardian_emperor")) { @@ -173,90 +173,126 @@ public class ImportFishingCommand extends CommandBase { FishingTracker.seaEmperors = statsObject.get("kills_guardian_emperor").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.seaEmperors; - + FishingTracker.fishingMilestone = 0; if (statsObject.has("pet_milestone_sea_creatures_killed")) { FishingTracker.fishingMilestone = statsObject.get("pet_milestone_sea_creatures_killed").getAsInt(); } - + FishingTracker.frozenSteves = 0; if (statsObject.has("kills_frozen_steve")) { FishingTracker.frozenSteves = statsObject.get("kills_frozen_steve").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.frozenSteves; - + FishingTracker.frostyTheSnowmans = 0; if (statsObject.has("kills_frosty_the_snowman")) { FishingTracker.frostyTheSnowmans = statsObject.get("kills_frosty_the_snowman").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.frostyTheSnowmans; - + FishingTracker.grinches = 0; if (statsObject.has("kills_grinch")) { FishingTracker.grinches = statsObject.get("kills_grinch").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.grinches; - + FishingTracker.yetis = 0; if (statsObject.has("kills_yeti")) { FishingTracker.yetis = statsObject.get("kills_yeti").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.yetis; - + FishingTracker.nurseSharks = 0; if (statsObject.has("kills_nurse_shark")) { FishingTracker.nurseSharks = statsObject.get("kills_nurse_shark").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.nurseSharks; - + FishingTracker.blueSharks = 0; if (statsObject.has("kills_nurse_shark")) { FishingTracker.blueSharks = statsObject.get("kills_blue_shark").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.blueSharks; - + FishingTracker.tigerSharks = 0; if (statsObject.has("kills_nurse_shark")) { FishingTracker.tigerSharks = statsObject.get("kills_tiger_shark").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.tigerSharks; - + FishingTracker.greatWhiteSharks = 0; if (statsObject.has("kills_nurse_shark")) { FishingTracker.greatWhiteSharks = statsObject.get("kills_great_white_shark").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.greatWhiteSharks; - + FishingTracker.scarecrows = 0; if (statsObject.has("kills_scarecrow")) { FishingTracker.scarecrows = statsObject.get("kills_scarecrow").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.scarecrows; - + FishingTracker.nightmares = 0; if (statsObject.has("kills_nightmare")) { FishingTracker.nightmares = statsObject.get("kills_nightmare").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.nightmares; - + FishingTracker.werewolfs = 0; if (statsObject.has("kills_werewolf")) { FishingTracker.werewolfs = statsObject.get("kills_werewolf").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.werewolfs; - + FishingTracker.phantomFishers = 0; if (statsObject.has("kills_phantom_fisherman")) { FishingTracker.phantomFishers = statsObject.get("kills_phantom_fisherman").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.phantomFishers; - + FishingTracker.grimReapers = 0; if (statsObject.has("kills_grim_reaper")) { FishingTracker.grimReapers = statsObject.get("kills_grim_reaper").getAsInt(); } FishingTracker.seaCreatures += FishingTracker.grimReapers; - + + FishingTracker.waterWorms = 0; + if (statsObject.has("kills_water_worm")) { + FishingTracker.waterWorms = statsObject.get("kills_water_worm").getAsInt(); + } + FishingTracker.seaCreatures += FishingTracker.waterWorms; + + FishingTracker.poisonedWaterWorms = 0; + if (statsObject.has("kills_poisoned_water_worm")) { + FishingTracker.poisonedWaterWorms = statsObject.get("kills_poisoned_water_worm").getAsInt(); + } + FishingTracker.seaCreatures += FishingTracker.poisonedWaterWorms; + + FishingTracker.flamingWorms = 0; + if (statsObject.has("kills_flaming_worm")) { + FishingTracker.flamingWorms = statsObject.get("kills_flaming_worm").getAsInt(); + } + FishingTracker.seaCreatures += FishingTracker.flamingWorms; + + FishingTracker.lavaBlazes = 0; + if (statsObject.has("kills_lava_blaze")) { + FishingTracker.lavaBlazes = statsObject.get("kills_lava_blaze").getAsInt(); + } + FishingTracker.seaCreatures += FishingTracker.lavaBlazes; + + FishingTracker.lavaPigmen = 0; + if (statsObject.has("kills_lava_pigman")) { + FishingTracker.lavaPigmen = statsObject.get("kills_lava_pigman").getAsInt(); + } + FishingTracker.seaCreatures += FishingTracker.lavaPigmen; + + FishingTracker.zombieMiners = 0; + if (statsObject.has("kills_zombie_miner")) { + FishingTracker.zombieMiners = statsObject.get("kills_zombie_miner").getAsInt(); + } + FishingTracker.seaCreatures += FishingTracker.zombieMiners; + System.out.println("Writing to config..."); ConfigHandler.writeIntConfig("fishing", "goodCatch", FishingTracker.goodCatches); ConfigHandler.writeIntConfig("fishing", "greatCatch", FishingTracker.greatCatches); @@ -289,7 +325,13 @@ public class ImportFishingCommand extends CommandBase { ConfigHandler.writeIntConfig("fishing", "werewolf", FishingTracker.werewolfs); ConfigHandler.writeIntConfig("fishing", "phantomFisher", FishingTracker.phantomFishers); ConfigHandler.writeIntConfig("fishing", "grimReaper", FishingTracker.grimReapers); - + ConfigHandler.writeIntConfig("fishing", "waterWorm", FishingTracker.waterWorms); + ConfigHandler.writeIntConfig("fishing", "poisonedWaterWorm", FishingTracker.poisonedWaterWorms); + ConfigHandler.writeIntConfig("fishing", "flamingWorm", FishingTracker.flamingWorms); + ConfigHandler.writeIntConfig("fishing", "lavaBlaze", FishingTracker.lavaBlazes); + ConfigHandler.writeIntConfig("fishing", "lavaPigman", FishingTracker.lavaPigmen); + ConfigHandler.writeIntConfig("fishing", "zombieMiner", FishingTracker.zombieMiners); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Fishing stats imported.")); }).start(); } diff --git a/src/main/java/me/Danker/commands/LootCommand.java b/src/main/java/me/Danker/commands/LootCommand.java index 1437b36..2a647c6 100644 --- a/src/main/java/me/Danker/commands/LootCommand.java +++ b/src/main/java/me/Danker/commands/LootCommand.java @@ -24,7 +24,7 @@ public class LootCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " [winter/festival/spooky/f(1-7)/mm/session]"; + return "/" + getCommandName() + " [winter/festival/spooky/ch/f(1-7)/mm/session]"; } public static String usage(ICommandSender arg0) { @@ -41,7 +41,7 @@ public class LootCommand extends CommandBase { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "enderman", "fishing", "catacombs", "mythological"); } else if (args.length == 2 && args[0].equalsIgnoreCase("fishing")) { - return getListOfStringsMatchingLastWord(args, "winter", "festival", "spooky", "session"); + return getListOfStringsMatchingLastWord(args, "winter", "festival", "spooky", "ch", "session"); } else if (args.length == 2 && args[0].equalsIgnoreCase("catacombs")) { return getListOfStringsMatchingLastWord(args, "f1", "floor1", "f2", "floor2", "f3", "floor3", "f4", "floor4", "f5", "floor5", "f6", "floor6", "f7", "floor7", "mm", "master"); } else if (args.length > 1) { @@ -451,6 +451,30 @@ public class LootCommand extends CommandBase { EnumChatFormatting.GOLD + " Phantom Fishers: " + nf.format(FishingTracker.phantomFishers) + "\n" + EnumChatFormatting.GOLD + " Grim Reapers: " + nf.format(FishingTracker.grimReapers) + "\n" + EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------")); + } else if (arg1[1].equalsIgnoreCase("ch")) { + if (showSession) { + player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.GOLD + EnumChatFormatting.BOLD + " Crystal Hollows Fishing Summary:\n" + + EnumChatFormatting.BLUE + " Water Worms: " + nf.format(FishingTracker.waterWormsSession) + "\n" + + EnumChatFormatting.GREEN + " Poisoned Water Worms: " + nf.format(FishingTracker.poisonedWaterWormsSession) + "\n" + + EnumChatFormatting.RED + " Flaming Worms: " + nf.format(FishingTracker.flamingWormsSession) + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Lava Blazes: " + nf.format(FishingTracker.lavaBlazesSession) + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Lava Pigmen: " + nf.format(FishingTracker.lavaPigmenSession) + "\n" + + EnumChatFormatting.GOLD + " Zombie Miners: " + nf.format(FishingTracker.zombieMinersSession) + "\n" + + EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------")); + + return; + } + + player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.GOLD + EnumChatFormatting.BOLD + " Crystal Hollows Fishing Summary:\n" + + EnumChatFormatting.BLUE + " Water Worms: " + nf.format(FishingTracker.waterWorms) + "\n" + + EnumChatFormatting.GREEN + " Poisoned Water Worms: " + nf.format(FishingTracker.poisonedWaterWorms) + "\n" + + EnumChatFormatting.RED + " Flaming Worms: " + nf.format(FishingTracker.flamingWorms) + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Lava Blazes: " + nf.format(FishingTracker.lavaBlazes) + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Lava Pigmen: " + nf.format(FishingTracker.lavaPigmen) + "\n" + + EnumChatFormatting.GOLD + " Zombie Miners: " + nf.format(FishingTracker.zombieMiners) + "\n" + + EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------")); } } diff --git a/src/main/java/me/Danker/commands/ResetLootCommand.java b/src/main/java/me/Danker/commands/ResetLootCommand.java index 2c5c947..cca7dda 100644 --- a/src/main/java/me/Danker/commands/ResetLootCommand.java +++ b/src/main/java/me/Danker/commands/ResetLootCommand.java @@ -238,6 +238,12 @@ public class ResetLootCommand extends CommandBase { FishingTracker.werewolfsSession = 0; FishingTracker.phantomFishersSession = 0; FishingTracker.grimReapersSession = 0; + FishingTracker.waterWorms = 0; + FishingTracker.poisonedWaterWorms = 0; + FishingTracker.flamingWorms = 0; + FishingTracker.lavaBlazes = 0; + FishingTracker.lavaPigmen = 0; + FishingTracker.zombieMiners = 0; ConfigHandler.deleteCategory("fishing"); ConfigHandler.reloadConfig(); } diff --git a/src/main/java/me/Danker/features/loot/FishingTracker.java b/src/main/java/me/Danker/features/loot/FishingTracker.java index c54f943..cf329aa 100644 --- a/src/main/java/me/Danker/features/loot/FishingTracker.java +++ b/src/main/java/me/Danker/features/loot/FishingTracker.java @@ -47,6 +47,13 @@ public class FishingTracker { public static int werewolfs; public static int phantomFishers; public static int grimReapers; + // CH Fishing + public static int waterWorms; + public static int poisonedWaterWorms; + public static int flamingWorms; + public static int lavaBlazes; + public static int lavaPigmen; + public static int zombieMiners; // Fishing public static int seaCreaturesSession = 0; @@ -87,6 +94,13 @@ public class FishingTracker { public static int werewolfsSession = 0; public static int phantomFishersSession = 0; public static int grimReapersSession = 0; + // CH Fishing + public static int waterWormsSession = 0; + public static int poisonedWaterWormsSession = 0; + public static int flamingWormsSession = 0; + public static int lavaBlazesSession = 0; + public static int lavaPigmenSession = 0; + public static int zombieMinersSession = 0; @SubscribeEvent public void onChat(ClientChatReceivedEvent event) { @@ -252,6 +266,36 @@ public class FishingTracker { grimReapersSession++; ConfigHandler.writeIntConfig("fishing", "grimReaper", grimReapers); increaseSeaCreatures(); + } else if (message.contains("A Water Worm surfaces")) { + waterWorms++; + waterWormsSession++; + ConfigHandler.writeIntConfig("fishing", "waterWorm", waterWorms); + increaseSeaCreatures(); + } else if (message.contains("A Poisoned Water Worm surfaces")) { + poisonedWaterWorms++; + poisonedWaterWormsSession++; + ConfigHandler.writeIntConfig("fishing", "poisonedWaterWorm", poisonedWaterWorms); + increaseSeaCreatures(); + } else if (message.contains("A flaming worm surfaces from the depths")) { + flamingWorms++; + flamingWormsSession++; + ConfigHandler.writeIntConfig("fishing", "flamingWorm", flamingWorms); + increaseSeaCreatures(); + } else if (message.contains("A Lava Blaze has surfaced from the depths")) { + lavaBlazes++; + lavaBlazesSession++; + ConfigHandler.writeIntConfig("fishing", "lavaBlaze", lavaBlazes); + increaseSeaCreatures(); + } else if (message.contains("A Lava Pigman arose from the depths")) { + lavaPigmen++; + lavaPigmenSession++; + ConfigHandler.writeIntConfig("fishing", "lavaPigman", lavaPigmen); + increaseSeaCreatures(); + } else if (message.contains("A Zombie Miner surfaces")) { + zombieMiners++; + zombieMinersSession++; + ConfigHandler.writeIntConfig("fishing", "zombieMiner", zombieMiners); + increaseSeaCreatures(); } } diff --git a/src/main/java/me/Danker/features/loot/LootDisplay.java b/src/main/java/me/Danker/features/loot/LootDisplay.java index 1878b47..812108b 100644 --- a/src/main/java/me/Danker/features/loot/LootDisplay.java +++ b/src/main/java/me/Danker/features/loot/LootDisplay.java @@ -680,6 +680,50 @@ public class LootDisplay { EnumChatFormatting.GOLD + nf.format(FishingTracker.phantomFishersSession) + "\n" + EnumChatFormatting.GOLD + nf.format(FishingTracker.grimReapersSession); break; + case "fishing_ch": + dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + + EnumChatFormatting.AQUA + "Fishing Milestone:\n" + + EnumChatFormatting.GOLD + "Good Catches:\n" + + EnumChatFormatting.DARK_PURPLE + "Great Catches:\n" + + EnumChatFormatting.BLUE + "Water Worms:\n" + + EnumChatFormatting.GREEN + "Poison Water Worms:\n" + + EnumChatFormatting.RED + "Flaming Worms:\n" + + EnumChatFormatting.DARK_PURPLE + "Lava Blazes:\n" + + EnumChatFormatting.DARK_PURPLE + "Lava Pigmen:\n" + + EnumChatFormatting.GOLD + "Zombie Miners:"; + countText = EnumChatFormatting.AQUA + nf.format(FishingTracker.seaCreatures) + "\n" + + EnumChatFormatting.AQUA + nf.format(FishingTracker.fishingMilestone) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.goodCatches) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.greatCatches) + "\n" + + EnumChatFormatting.BLUE + nf.format(FishingTracker.waterWorms) + "\n" + + EnumChatFormatting.GREEN + nf.format(FishingTracker.poisonedWaterWorms) + "\n" + + EnumChatFormatting.RED + nf.format(FishingTracker.flamingWorms) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.lavaBlazes) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.lavaPigmen) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.zombieMiners); + break; + case "fishing_ch_session": + dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + + EnumChatFormatting.AQUA + "Fishing Milestone:\n" + + EnumChatFormatting.GOLD + "Good Catches:\n" + + EnumChatFormatting.DARK_PURPLE + "Great Catches:\n" + + EnumChatFormatting.BLUE + "Water Worms:\n" + + EnumChatFormatting.GREEN + "Poison Water Worms:\n" + + EnumChatFormatting.RED + "Flaming Worms:\n" + + EnumChatFormatting.DARK_PURPLE + "Lava Blazes:\n" + + EnumChatFormatting.DARK_PURPLE + "Lava Pigmen:\n" + + EnumChatFormatting.GOLD + "Zombie Miners:"; + countText = EnumChatFormatting.AQUA + nf.format(FishingTracker.seaCreaturesSession) + "\n" + + EnumChatFormatting.AQUA + nf.format(FishingTracker.fishingMilestoneSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.goodCatchesSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.greatCatchesSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(FishingTracker.waterWormsSession) + "\n" + + EnumChatFormatting.GREEN + nf.format(FishingTracker.poisonedWaterWormsSession) + "\n" + + EnumChatFormatting.RED + nf.format(FishingTracker.flamingWormsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.lavaBlazesSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.lavaPigmenSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.zombieMinersSession); + break; case "mythological": dropsText = EnumChatFormatting.GOLD + "Coins:\n" + EnumChatFormatting.WHITE + "Griffin Feathers:\n" + diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index c7af0da..6edffa9 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -7,6 +7,7 @@ import me.Danker.gui.buttons.FeatureButton; import me.Danker.gui.crystalhollowwaypoints.CrystalHollowWaypointsGui; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.TextRenderer; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; @@ -274,8 +275,7 @@ public class DankerGui extends GuiScreen { super.drawScreen(mouseX, mouseY, partialTicks); String pageText = "Page: " + page + "/" + (int) Math.ceil(foundButtons.size() / 7D); - int pageWidth = mc.fontRendererObj.getStringWidth(pageText); - new TextRenderer(mc, pageText, width / 2 - pageWidth / 2, 10, 1D); + RenderUtils.drawCenteredText(pageText, width, 10, 1D); for (GuiButton button : this.buttonList) { if (button instanceof FeatureButton && button.isMouseOver()) { diff --git a/src/main/java/me/Danker/gui/DisplayGui.java b/src/main/java/me/Danker/gui/DisplayGui.java index 06239b1..4da92c6 100644 --- a/src/main/java/me/Danker/gui/DisplayGui.java +++ b/src/main/java/me/Danker/gui/DisplayGui.java @@ -4,6 +4,7 @@ import me.Danker.DankersSkyblockMod; import me.Danker.features.loot.LootDisplay; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.TextRenderer; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; @@ -26,7 +27,7 @@ public class DisplayGui extends GuiScreen { private GuiButton fishingWinter; private GuiButton fishingFestival; private GuiButton fishingSpooky; - private GuiButton mythological; + private GuiButton fishingCH; private GuiButton catacombsF1; private GuiButton catacombsF2; private GuiButton catacombsF3; @@ -35,6 +36,7 @@ public class DisplayGui extends GuiScreen { private GuiButton catacombsF6; private GuiButton catacombsF7; private GuiButton catacombsMM; + private GuiButton mythological; private GuiButton ghost; @Override @@ -54,16 +56,15 @@ public class DisplayGui extends GuiScreen { showSession = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Current Session Only: " + Utils.getColouredBoolean(addSession)); off = new GuiButton(0, width / 2 - 210, (int) (height * 0.2), "Off"); auto = new GuiButton(0, width / 2 + 10, (int) (height * 0.2), "Auto"); - zombie = new GuiButton(0, width / 2 - 230, (int) (height * 0.3), 100, 20, "Zombie"); - spider = new GuiButton(0, width / 2 - 110, (int) (height * 0.3), 100, 20, "Spider"); - wolf = new GuiButton(0, width / 2 + 10, (int) (height * 0.3), 100, 20, "Wolf"); - enderman = new GuiButton(0, width / 2 + 130, (int) (height * 0.3), 100, 20, "Enderman"); - fishing = new GuiButton(0, width / 2 - 230, (int) (height * 0.4), 100, 20, "Fishing"); - fishingWinter = new GuiButton(0, width / 2 - 110, (int) (height * 0.4), 100, 20, "Fishing Winter"); - fishingFestival = new GuiButton(0, width / 2 + 10, (int) (height * 0.4), 100, 20, "Fishing Festival"); - fishingSpooky = new GuiButton(0, width / 2 + 130, (int) (height * 0.4), 100, 20, "Fishing Spooky"); - mythological = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), 95, 20, "Mythological"); - ghost = new GuiButton(0, width / 2 + 5, (int) (height * 0.5), 95, 20, "Ghost"); + zombie = new GuiButton(0, width / 2 - 230, (int) (height * 0.35), 100, 20, "Zombie"); + spider = new GuiButton(0, width / 2 - 110, (int) (height * 0.35), 100, 20, "Spider"); + wolf = new GuiButton(0, width / 2 + 10, (int) (height * 0.35), 100, 20, "Wolf"); + enderman = new GuiButton(0, width / 2 + 130, (int) (height * 0.35), 100, 20, "Enderman"); + fishing = new GuiButton(0, width / 2 - 270, (int) (height * 0.5), 100, 20, "Fishing"); + fishingWinter = new GuiButton(0, width / 2 - 160, (int) (height * 0.5), 100, 20, "Fishing Winter"); + fishingFestival = new GuiButton(0, width / 2 - 50, (int) (height * 0.5), 100, 20, "Fishing Festival"); + fishingSpooky = new GuiButton(0, width / 2 + 60, (int) (height * 0.5), 100, 20, "Fishing Spooky"); + fishingCH = new GuiButton(0, width / 2 + 170, (int) (height * 0.5), 100, 20, "CH Fishing"); catacombsF1 = new GuiButton(0, width / 2 - 235, (int) (height * 0.65), 50, 20, "F1"); catacombsF2 = new GuiButton(0, width / 2 - 175, (int) (height * 0.65), 50, 20, "F2"); catacombsF3 = new GuiButton(0, width / 2 - 115, (int) (height * 0.65), 50, 20, "F3"); @@ -72,6 +73,8 @@ public class DisplayGui extends GuiScreen { catacombsF6 = new GuiButton(0, width / 2 + 65, (int) (height * 0.65), 50, 20, "F6"); catacombsF7 = new GuiButton(0, width / 2 + 125, (int) (height * 0.65), 50, 20, "F7"); catacombsMM = new GuiButton(0, width / 2 + 185, (int) (height * 0.65), 50, 20, "MM"); + mythological = new GuiButton(0, width / 2 - 100, (int) (height * 0.8), 95, 20, "Mythological"); + ghost = new GuiButton(0, width / 2 + 5, (int) (height * 0.8), 95, 20, "Ghost"); this.buttonList.add(showSession); this.buttonList.add(off); @@ -84,7 +87,7 @@ public class DisplayGui extends GuiScreen { this.buttonList.add(fishingWinter); this.buttonList.add(fishingFestival); this.buttonList.add(fishingSpooky); - this.buttonList.add(mythological); + this.buttonList.add(fishingCH); this.buttonList.add(catacombsF1); this.buttonList.add(catacombsF2); this.buttonList.add(catacombsF3); @@ -93,6 +96,7 @@ public class DisplayGui extends GuiScreen { this.buttonList.add(catacombsF6); this.buttonList.add(catacombsF7); this.buttonList.add(catacombsMM); + this.buttonList.add(mythological); this.buttonList.add(ghost); this.buttonList.add(goBack); } @@ -100,20 +104,13 @@ public class DisplayGui extends GuiScreen { @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); - Minecraft mc = Minecraft.getMinecraft(); - - String displayText; - if (LootDisplay.auto) { - displayText = "Current Display: auto"; - } else { - displayText = "Current Display: " + LootDisplay.display; - } - int displayWidth = mc.fontRendererObj.getStringWidth(displayText); - new TextRenderer(mc, displayText, width / 2 - displayWidth / 2, 10, 1D); - - String catacombsTitleText = "Catacombs Dungeon"; - int catacombsTitleWidth = mc.fontRendererObj.getStringWidth(catacombsTitleText); - new TextRenderer(mc, catacombsTitleText, width / 2 - catacombsTitleWidth / 2, (int) (height * 0.6), 1D); + + String displayText = LootDisplay.auto ? "Current Display: auto" : "Current Display: " + LootDisplay.display; + RenderUtils.drawCenteredText(displayText, width, 10, 1D); + RenderUtils.drawCenteredText("Slayer", width, (int) (height * 0.3), 1D); + RenderUtils.drawCenteredText("Fishing", width, (int) (height * 0.45), 1D); + RenderUtils.drawCenteredText("Catacombs Dungeon", width, (int) (height * 0.6), 1D); + RenderUtils.drawCenteredText("Misc", width, (int) (height * 0.75), 1D); super.drawScreen(mouseX, mouseY, partialTicks); } @@ -146,6 +143,8 @@ public class DisplayGui extends GuiScreen { setDisplay("fishing_festival"); } else if (button == fishingSpooky) { setDisplay("fishing_spooky"); + } else if (button == fishingCH) { + setDisplay("fishing_ch"); } else if (button == mythological) { setDisplay("mythological"); } else if (button == catacombsF1) { diff --git a/src/main/java/me/Danker/gui/OnlySlayerGui.java b/src/main/java/me/Danker/gui/OnlySlayerGui.java index c203b8a..a5674f8 100644 --- a/src/main/java/me/Danker/gui/OnlySlayerGui.java +++ b/src/main/java/me/Danker/gui/OnlySlayerGui.java @@ -5,6 +5,7 @@ import me.Danker.commands.ToggleCommand; import me.Danker.features.BlockWrongSlayer; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.TextRenderer; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; @@ -97,8 +98,7 @@ public class OnlySlayerGui extends GuiScreen { } else { displayText = "Only Allow Slayer: " + BlockWrongSlayer.onlySlayerName + " " + BlockWrongSlayer.onlySlayerNumber; } - int displayWidth = mc.fontRendererObj.getStringWidth(displayText); - new TextRenderer(mc, displayText, width / 2 - displayWidth / 2, 10, 1D); + RenderUtils.drawCenteredText(displayText, width, 10, 1D); super.drawScreen(mouseX, mouseY, partialTicks); } diff --git a/src/main/java/me/Danker/gui/SkillTrackerGui.java b/src/main/java/me/Danker/gui/SkillTrackerGui.java index 290310f..84cc2e3 100644 --- a/src/main/java/me/Danker/gui/SkillTrackerGui.java +++ b/src/main/java/me/Danker/gui/SkillTrackerGui.java @@ -4,6 +4,7 @@ import me.Danker.DankersSkyblockMod; import me.Danker.features.SkillTracker; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.TextRenderer; +import me.Danker.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; @@ -50,6 +51,7 @@ public class SkillTrackerGui extends GuiScreen { @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); + String stateText = ""; if (SkillTracker.skillStopwatch.isStarted() && !SkillTracker.skillStopwatch.isSuspended()) { stateText = "Timer: Running"; @@ -59,8 +61,8 @@ public class SkillTrackerGui extends GuiScreen { if (!SkillTracker.showSkillTracker) { stateText += " (Hidden)"; } - int stateTextWidth = mc.fontRendererObj.getStringWidth(stateText); - new TextRenderer(mc, stateText, width / 2 - stateTextWidth / 2, 10, 1D); + RenderUtils.drawCenteredText(stateText, width, 10, 1D); + super.drawScreen(mouseX, mouseY, partialTicks); } diff --git a/src/main/java/me/Danker/gui/WarningGui.java b/src/main/java/me/Danker/gui/WarningGui.java index db0c21b..bb37b83 100644 --- a/src/main/java/me/Danker/gui/WarningGui.java +++ b/src/main/java/me/Danker/gui/WarningGui.java @@ -1,10 +1,12 @@ package me.Danker.gui; import me.Danker.handlers.TextRenderer; +import me.Danker.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.util.EnumChatFormatting; public class WarningGui extends GuiScreen { private GuiButton close; @@ -34,15 +36,11 @@ public class WarningGui extends GuiScreen { @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); - String text0 = "§cWARNING!§0"; - int text0Width = mc.fontRendererObj.getStringWidth(text0); - new TextRenderer(mc, text0, (int)(width * 0.45) - text0Width / 2, (int) (height * 0.1), 2 ); - String text1 = "You are using SpiderFrog's Old Animations mod."; - int text1Width = mc.fontRendererObj.getStringWidth(text1); - new TextRenderer(mc, text1, width / 2 - text1Width / 2, (int) (height * 0.3), 1D ); - String text2 = "This mod breaks Danker's Skyblock Mod."; - int text2Width = mc.fontRendererObj.getStringWidth(text2); - new TextRenderer(mc, text2, width / 2 - text2Width / 2, (int) (height * 0.4), 1D); + + RenderUtils.drawCenteredText(EnumChatFormatting.RED + "WARNING!", (int) (width * 0.9), (int) (height * 0.1), 2D); + RenderUtils.drawCenteredText("You are using SpiderFrog's Old Animations mod.", width, (int) (height * 0.3), 1D); + RenderUtils.drawCenteredText("This mod breaks Danker's Skyblock Mod.", width, (int) (height * 0.4), 1D); + super.drawScreen(mouseX, mouseY, partialTicks); } diff --git a/src/main/java/me/Danker/gui/alerts/AlertActionGui.java b/src/main/java/me/Danker/gui/alerts/AlertActionGui.java index 06dfd91..034ad79 100644 --- a/src/main/java/me/Danker/gui/alerts/AlertActionGui.java +++ b/src/main/java/me/Danker/gui/alerts/AlertActionGui.java @@ -2,6 +2,7 @@ package me.Danker.gui.alerts; import me.Danker.features.Alerts; import me.Danker.handlers.TextRenderer; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; @@ -55,6 +56,7 @@ public class AlertActionGui extends GuiScreen { Alerts.Alert alert = Alerts.alerts.get(id); + RenderUtils.drawCenteredText(alert.alert, width, 10, 1D); String alertText = alert.alert; int textWidth = mc.fontRendererObj.getStringWidth(alertText); new TextRenderer(mc, alertText, width / 2 - textWidth / 2, 10, 1D); diff --git a/src/main/java/me/Danker/gui/alerts/AlertsGui.java b/src/main/java/me/Danker/gui/alerts/AlertsGui.java index 3ccd869..8eaedca 100644 --- a/src/main/java/me/Danker/gui/alerts/AlertsGui.java +++ b/src/main/java/me/Danker/gui/alerts/AlertsGui.java @@ -6,6 +6,7 @@ import me.Danker.gui.DankerGui; import me.Danker.gui.buttons.FeatureButton; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.TextRenderer; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; @@ -78,8 +79,7 @@ public class AlertsGui extends GuiScreen { super.drawScreen(mouseX, mouseY, partialTicks); String pageText = "Page: " + page + "/" + (int) Math.ceil(allButtons.size() / 7D); - int pageWidth = mc.fontRendererObj.getStringWidth(pageText); - new TextRenderer(mc, pageText, width / 2 - pageWidth / 2, 10, 1D); + RenderUtils.drawCenteredText(pageText, width, 10, 1D); } @Override diff --git a/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointActionGui.java b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointActionGui.java index f792892..30447a0 100644 --- a/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointActionGui.java +++ b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointActionGui.java @@ -3,6 +3,7 @@ package me.Danker.gui.crystalhollowwaypoints; import me.Danker.DankersSkyblockMod; import me.Danker.features.CrystalHollowWaypoints; import me.Danker.handlers.TextRenderer; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; @@ -63,9 +64,7 @@ public class CrystalHollowWaypointActionGui extends GuiScreen { CrystalHollowWaypoints.Waypoint waypoint = CrystalHollowWaypoints.waypoints.get(id); - String waypointText = waypoint.location + " @ " + waypoint.getPos(); - int pageWidth = mc.fontRendererObj.getStringWidth(waypointText); - new TextRenderer(mc, waypointText, width / 2 - pageWidth / 2, 10, 1D); + RenderUtils.drawCenteredText(waypoint.location + " @ " + waypoint.getPos(), width, 10, 1D); } @Override diff --git a/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java index a3d0452..2331ec0 100644 --- a/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java +++ b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java @@ -7,6 +7,7 @@ import me.Danker.gui.DankerGui; import me.Danker.gui.buttons.FeatureButton; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.TextRenderer; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; @@ -94,8 +95,7 @@ public class CrystalHollowWaypointsGui extends GuiScreen { super.drawScreen(mouseX, mouseY, partialTicks); String pageText = "Page: " + page + "/" + (int) Math.ceil(allButtons.size() / 7D); - int pageWidth = mc.fontRendererObj.getStringWidth(pageText); - new TextRenderer(mc, pageText, width / 2 - pageWidth / 2, 10, 1D); + RenderUtils.drawCenteredText(pageText, width, 10, 1D); } @Override diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 112d86d..e5ed372 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -417,6 +417,13 @@ public class ConfigHandler { FishingTracker.werewolfs = initInt("fishing", "werewolf", 0); FishingTracker.phantomFishers = initInt("fishing", "phantomFisher", 0); FishingTracker.grimReapers = initInt("fishing", "grimReaper", 0); + // CH Fishing + FishingTracker.waterWorms = initInt("fishing", "waterWorm", 0); + FishingTracker.poisonedWaterWorms = initInt("fishing", "poisonedWaterWorm", 0); + FishingTracker.flamingWorms = initInt("fishing", "flamingWorm", 0); + FishingTracker.lavaBlazes = initInt("fishing", "lavaBlaze", 0); + FishingTracker.lavaPigmen = initInt("fishing", "lavaPigman", 0); + FishingTracker.zombieMiners = initInt("fishing", "zombieMiner", 0); // Mythological MythologicalTracker.mythCoins = initDouble("mythological", "coins", 0); diff --git a/src/main/java/me/Danker/utils/RenderUtils.java b/src/main/java/me/Danker/utils/RenderUtils.java index f117969..50b9786 100644 --- a/src/main/java/me/Danker/utils/RenderUtils.java +++ b/src/main/java/me/Danker/utils/RenderUtils.java @@ -363,4 +363,10 @@ public class RenderUtils { GlStateManager.disableRescaleNormal(); } + public static void drawCenteredText(String text, int screenWidth, int height, double scale) { + Minecraft mc = Minecraft.getMinecraft(); + int textWidth = mc.fontRendererObj.getStringWidth(text); + new TextRenderer(mc, text, screenWidth / 2 - textWidth / 2, height, scale); + } + } -- cgit From 4a9c72be2c81059569f6cf75e854b9cdefc2891a Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 4 Mar 2022 20:26:29 -0500 Subject: Add custom colours to titles --- src/main/java/me/Danker/DankersSkyblockMod.java | 1 - .../me/Danker/commands/CustomMusicCommand.java | 3 --- .../java/me/Danker/commands/InventoryCommand.java | 1 - .../java/me/Danker/features/AbilityCooldowns.java | 1 - .../java/me/Danker/features/ColouredNames.java | 31 ++++++++++++++++++++++ src/main/java/me/Danker/features/DungeonScore.java | 2 -- src/main/java/me/Danker/gui/CustomMusicGui.java | 1 - src/main/java/me/Danker/gui/DankerGui.java | 2 -- src/main/java/me/Danker/gui/DisplayGui.java | 2 -- src/main/java/me/Danker/gui/ExperimentsGui.java | 1 - src/main/java/me/Danker/gui/OnlySlayerGui.java | 4 --- src/main/java/me/Danker/gui/PuzzleSolversGui.java | 1 - src/main/java/me/Danker/gui/SkillTrackerGui.java | 2 -- src/main/java/me/Danker/gui/WarningGui.java | 1 - .../java/me/Danker/gui/alerts/AlertAddGui.java | 3 --- src/main/java/me/Danker/gui/alerts/AlertsGui.java | 1 - .../CrystalHollowWaypointActionGui.java | 1 - .../CrystalHollowWaypointsGui.java | 2 -- .../java/me/Danker/handlers/ConfigHandler.java | 6 +++-- src/main/java/me/Danker/utils/Utils.java | 1 - 20 files changed, 35 insertions(+), 32 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 0d7e577..ce39152 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -9,7 +9,6 @@ import me.Danker.features.*; import me.Danker.features.loot.*; import me.Danker.features.puzzlesolvers.*; import me.Danker.gui.*; -import me.Danker.gui.crystalhollowwaypoints.CrystalHollowWaypointsGui; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.PacketHandler; import me.Danker.utils.RenderUtils; diff --git a/src/main/java/me/Danker/commands/CustomMusicCommand.java b/src/main/java/me/Danker/commands/CustomMusicCommand.java index d21d08e..283b748 100644 --- a/src/main/java/me/Danker/commands/CustomMusicCommand.java +++ b/src/main/java/me/Danker/commands/CustomMusicCommand.java @@ -10,9 +10,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; -import javax.sound.sampled.LineUnavailableException; -import javax.sound.sampled.UnsupportedAudioFileException; -import java.io.IOException; import java.util.List; public class CustomMusicCommand extends CommandBase { diff --git a/src/main/java/me/Danker/commands/InventoryCommand.java b/src/main/java/me/Danker/commands/InventoryCommand.java index d4b35ae..66a5725 100644 --- a/src/main/java/me/Danker/commands/InventoryCommand.java +++ b/src/main/java/me/Danker/commands/InventoryCommand.java @@ -12,7 +12,6 @@ import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; -import net.minecraft.init.Items; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.InventoryBasic; import net.minecraft.item.ItemStack; diff --git a/src/main/java/me/Danker/features/AbilityCooldowns.java b/src/main/java/me/Danker/features/AbilityCooldowns.java index 397857a..e98660e 100644 --- a/src/main/java/me/Danker/features/AbilityCooldowns.java +++ b/src/main/java/me/Danker/features/AbilityCooldowns.java @@ -12,7 +12,6 @@ import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.inventory.ContainerChest; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StringUtils; import net.minecraftforge.client.event.ClientChatReceivedEvent; diff --git a/src/main/java/me/Danker/features/ColouredNames.java b/src/main/java/me/Danker/features/ColouredNames.java index f7f4d7a..aad1ab1 100644 --- a/src/main/java/me/Danker/features/ColouredNames.java +++ b/src/main/java/me/Danker/features/ColouredNames.java @@ -2,10 +2,12 @@ package me.Danker.features; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; +import me.Danker.events.PacketReadEvent; import me.Danker.utils.Utils; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.network.play.server.S45PacketTitle; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; @@ -16,7 +18,9 @@ import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.ReflectionHelper; +import java.lang.reflect.Field; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -30,6 +34,8 @@ public class ColouredNames { public static Map nametags = new HashMap<>(); public static final EnumChatFormatting[] RAINBOW_COLOURS = new EnumChatFormatting[]{EnumChatFormatting.RED, EnumChatFormatting.GOLD, EnumChatFormatting.YELLOW, EnumChatFormatting.GREEN, EnumChatFormatting.AQUA, EnumChatFormatting.BLUE, EnumChatFormatting.DARK_PURPLE}; + static Field messageField = ReflectionHelper.findField(S45PacketTitle.class, "message", "field_179810_b", "b"); + @SubscribeEvent public void onChat(ClientChatReceivedEvent event) { if (!ToggleCommand.customColouredNames || !Utils.inSkyblock || event.type != 0) return; @@ -90,6 +96,31 @@ public class ColouredNames { } } + @SubscribeEvent + public void onPacketRead(PacketReadEvent event) { + if (!ToggleCommand.customColouredNames || !Utils.inSkyblock) return; + + if (event.packet instanceof S45PacketTitle) { + S45PacketTitle packet = (S45PacketTitle) event.packet; + + if (packet.getMessage() == null) return; + + String message = packet.getMessage().getUnformattedText(); + for (String user : users) { + if (message.contains(user)) { + try { + messageField.setAccessible(true); + messageField.set(packet, replaceChat(packet.getMessage(), user)); + event.packet = packet; + } catch (IllegalAccessException ex) { + ex.printStackTrace(); + } + break; + } + } + } + } + @SubscribeEvent public void onWorldChange(WorldEvent.Load event) { nametags.clear(); diff --git a/src/main/java/me/Danker/features/DungeonScore.java b/src/main/java/me/Danker/features/DungeonScore.java index 2b6b287..706ce62 100644 --- a/src/main/java/me/Danker/features/DungeonScore.java +++ b/src/main/java/me/Danker/features/DungeonScore.java @@ -5,12 +5,10 @@ import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; import me.Danker.commands.ToggleCommand; import me.Danker.events.RenderOverlayEvent; -import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.ScoreboardHandler; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; -import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.network.NetworkPlayerInfo; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.MathHelper; diff --git a/src/main/java/me/Danker/gui/CustomMusicGui.java b/src/main/java/me/Danker/gui/CustomMusicGui.java index 6695b9a..4d5dcc9 100644 --- a/src/main/java/me/Danker/gui/CustomMusicGui.java +++ b/src/main/java/me/Danker/gui/CustomMusicGui.java @@ -1,6 +1,5 @@ package me.Danker.gui; -import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; import me.Danker.features.CustomMusic; import me.Danker.handlers.ConfigHandler; diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 6edffa9..d5e9ee8 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -1,12 +1,10 @@ package me.Danker.gui; -import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; import me.Danker.gui.alerts.AlertsGui; import me.Danker.gui.buttons.FeatureButton; import me.Danker.gui.crystalhollowwaypoints.CrystalHollowWaypointsGui; import me.Danker.handlers.ConfigHandler; -import me.Danker.handlers.TextRenderer; import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; diff --git a/src/main/java/me/Danker/gui/DisplayGui.java b/src/main/java/me/Danker/gui/DisplayGui.java index 4da92c6..17726f8 100644 --- a/src/main/java/me/Danker/gui/DisplayGui.java +++ b/src/main/java/me/Danker/gui/DisplayGui.java @@ -1,9 +1,7 @@ package me.Danker.gui; -import me.Danker.DankersSkyblockMod; import me.Danker.features.loot.LootDisplay; import me.Danker.handlers.ConfigHandler; -import me.Danker.handlers.TextRenderer; import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; diff --git a/src/main/java/me/Danker/gui/ExperimentsGui.java b/src/main/java/me/Danker/gui/ExperimentsGui.java index 3cc4929..53eb118 100644 --- a/src/main/java/me/Danker/gui/ExperimentsGui.java +++ b/src/main/java/me/Danker/gui/ExperimentsGui.java @@ -1,6 +1,5 @@ package me.Danker.gui; -import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; import me.Danker.handlers.ConfigHandler; import me.Danker.utils.Utils; diff --git a/src/main/java/me/Danker/gui/OnlySlayerGui.java b/src/main/java/me/Danker/gui/OnlySlayerGui.java index a5674f8..2a6d844 100644 --- a/src/main/java/me/Danker/gui/OnlySlayerGui.java +++ b/src/main/java/me/Danker/gui/OnlySlayerGui.java @@ -1,12 +1,8 @@ package me.Danker.gui; -import me.Danker.DankersSkyblockMod; -import me.Danker.commands.ToggleCommand; import me.Danker.features.BlockWrongSlayer; import me.Danker.handlers.ConfigHandler; -import me.Danker.handlers.TextRenderer; import me.Danker.utils.RenderUtils; -import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; diff --git a/src/main/java/me/Danker/gui/PuzzleSolversGui.java b/src/main/java/me/Danker/gui/PuzzleSolversGui.java index 3356ead..0cfa72b 100644 --- a/src/main/java/me/Danker/gui/PuzzleSolversGui.java +++ b/src/main/java/me/Danker/gui/PuzzleSolversGui.java @@ -1,6 +1,5 @@ package me.Danker.gui; -import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; import me.Danker.handlers.ConfigHandler; import me.Danker.utils.Utils; diff --git a/src/main/java/me/Danker/gui/SkillTrackerGui.java b/src/main/java/me/Danker/gui/SkillTrackerGui.java index 84cc2e3..e77f785 100644 --- a/src/main/java/me/Danker/gui/SkillTrackerGui.java +++ b/src/main/java/me/Danker/gui/SkillTrackerGui.java @@ -1,9 +1,7 @@ package me.Danker.gui; -import me.Danker.DankersSkyblockMod; import me.Danker.features.SkillTracker; import me.Danker.handlers.ConfigHandler; -import me.Danker.handlers.TextRenderer; import me.Danker.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; diff --git a/src/main/java/me/Danker/gui/WarningGui.java b/src/main/java/me/Danker/gui/WarningGui.java index bb37b83..901b59e 100644 --- a/src/main/java/me/Danker/gui/WarningGui.java +++ b/src/main/java/me/Danker/gui/WarningGui.java @@ -1,6 +1,5 @@ package me.Danker.gui; -import me.Danker.handlers.TextRenderer; import me.Danker.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; diff --git a/src/main/java/me/Danker/gui/alerts/AlertAddGui.java b/src/main/java/me/Danker/gui/alerts/AlertAddGui.java index 9014ea1..efc099c 100644 --- a/src/main/java/me/Danker/gui/alerts/AlertAddGui.java +++ b/src/main/java/me/Danker/gui/alerts/AlertAddGui.java @@ -1,7 +1,5 @@ package me.Danker.gui.alerts; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; import me.Danker.features.Alerts; import me.Danker.handlers.TextRenderer; import net.minecraft.client.Minecraft; @@ -11,7 +9,6 @@ import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.gui.ScaledResolution; import net.minecraftforge.fml.client.config.GuiCheckBox; -import java.io.FileWriter; import java.io.IOException; public class AlertAddGui extends GuiScreen { diff --git a/src/main/java/me/Danker/gui/alerts/AlertsGui.java b/src/main/java/me/Danker/gui/alerts/AlertsGui.java index 8eaedca..d73d56a 100644 --- a/src/main/java/me/Danker/gui/alerts/AlertsGui.java +++ b/src/main/java/me/Danker/gui/alerts/AlertsGui.java @@ -5,7 +5,6 @@ import me.Danker.features.Alerts; import me.Danker.gui.DankerGui; import me.Danker.gui.buttons.FeatureButton; import me.Danker.handlers.ConfigHandler; -import me.Danker.handlers.TextRenderer; import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; diff --git a/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointActionGui.java b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointActionGui.java index 30447a0..8d6fa85 100644 --- a/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointActionGui.java +++ b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointActionGui.java @@ -2,7 +2,6 @@ package me.Danker.gui.crystalhollowwaypoints; import me.Danker.DankersSkyblockMod; import me.Danker.features.CrystalHollowWaypoints; -import me.Danker.handlers.TextRenderer; import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; diff --git a/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java index 2331ec0..fc0f108 100644 --- a/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java +++ b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java @@ -1,12 +1,10 @@ package me.Danker.gui.crystalhollowwaypoints; -import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; import me.Danker.features.CrystalHollowWaypoints; import me.Danker.gui.DankerGui; import me.Danker.gui.buttons.FeatureButton; import me.Danker.handlers.ConfigHandler; -import me.Danker.handlers.TextRenderer; import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index e5ed372..3839766 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -2,7 +2,6 @@ package me.Danker.handlers; import com.google.gson.Gson; import com.google.gson.JsonArray; -import com.google.gson.JsonObject; import me.Danker.DankersSkyblockMod; import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; @@ -16,7 +15,10 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.config.ConfigCategory; import net.minecraftforge.common.config.Configuration; -import java.io.*; +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 682c5af..8c48c54 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -9,7 +9,6 @@ import me.Danker.handlers.ScoreboardHandler; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.network.NetworkPlayerInfo; -import net.minecraft.client.settings.GameSettings; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItemFrame; import net.minecraft.entity.player.EntityPlayer; -- cgit From 16ac896e6bc5b6bc536d4b05bfad8d8ac520c6af Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 4 Mar 2022 20:31:02 -0500 Subject: Fix typo in /lobbybank --- src/main/java/me/Danker/commands/LobbyBankCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/LobbyBankCommand.java b/src/main/java/me/Danker/commands/LobbyBankCommand.java index 165750b..5b9795b 100644 --- a/src/main/java/me/Danker/commands/LobbyBankCommand.java +++ b/src/main/java/me/Danker/commands/LobbyBankCommand.java @@ -55,7 +55,7 @@ public class LobbyBankCommand extends CommandBase { try { // Create deep copy of players to prevent passing reference and ConcurrentModificationException Collection players = new ArrayList<>(Minecraft.getMinecraft().getNetHandler().getPlayerInfoMap()); - playerSP.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking skill average of lobby. Estimated time: " + (int) (players.size() * 1.2 + 1) + " seconds.")); + playerSP.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking bank of lobby. Estimated time: " + (int) (players.size() * 1.2 + 1) + " seconds.")); // Send request every .6 seconds, leaving room for another 20 requests per minute for (final NetworkPlayerInfo player : players) { -- cgit From e1b746ce2ab5207a3c6df39697c94edb0fcd7801 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 5 Mar 2022 22:46:57 -0500 Subject: Update catacombs tracker Add Dark Claymore Track both S and S+ and allow switching Make floor detection easier and use less computing Allow livid detector to work in M5 Stop updating ToggleCommand --- src/main/java/me/Danker/DankersSkyblockMod.java | 1 + src/main/java/me/Danker/commands/LootCommand.java | 32 +- .../java/me/Danker/commands/ToggleCommand.java | 5 +- src/main/java/me/Danker/features/AutoDisplay.java | 50 ++- src/main/java/me/Danker/features/DungeonScore.java | 57 +-- .../me/Danker/features/loot/CatacombsTracker.java | 420 ++++++++++++++------- .../java/me/Danker/features/loot/LootDisplay.java | 78 +++- .../Danker/features/puzzlesolvers/LividSolver.java | 2 +- src/main/java/me/Danker/gui/DankerGui.java | 7 + .../java/me/Danker/handlers/ConfigHandler.java | 17 +- src/main/java/me/Danker/utils/Utils.java | 45 +++ 11 files changed, 508 insertions(+), 206 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index ce39152..02eeff4 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -383,6 +383,7 @@ public class DankersSkyblockMod { if (player != null) { Utils.checkForSkyblock(); Utils.checkForDungeons(); + Utils.checkForDungeonFloor(); Utils.checkTabLocation(); } diff --git a/src/main/java/me/Danker/commands/LootCommand.java b/src/main/java/me/Danker/commands/LootCommand.java index 2a647c6..246d1aa 100644 --- a/src/main/java/me/Danker/commands/LootCommand.java +++ b/src/main/java/me/Danker/commands/LootCommand.java @@ -832,7 +832,20 @@ public class LootCommand extends CommandBase { if (showSession) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs MM Summary (Current Session):\n" + - EnumChatFormatting.GOLD + " S Runs:" + nf.format(CatacombsTracker.masterSSession) + "\n" + + EnumChatFormatting.GOLD + " Master One S Runs:" + nf.format(CatacombsTracker.m1SSession) + "\n" + + EnumChatFormatting.GOLD + " Master One S+ Runs:" + nf.format(CatacombsTracker.m1SPlusSession) + "\n" + + EnumChatFormatting.GOLD + " Master Two S Runs:" + nf.format(CatacombsTracker.m2SSession) + "\n" + + EnumChatFormatting.GOLD + " Master Two S+ Runs:" + nf.format(CatacombsTracker.m2SPlusSession) + "\n" + + EnumChatFormatting.GOLD + " Master Three S Runs:" + nf.format(CatacombsTracker.m3SSession) + "\n" + + EnumChatFormatting.GOLD + " Master Three S+ Runs:" + nf.format(CatacombsTracker.m3SPlusSession) + "\n" + + EnumChatFormatting.GOLD + " Master Four S Runs:" + nf.format(CatacombsTracker.m4SSession) + "\n" + + EnumChatFormatting.GOLD + " Master Four S+ Runs:" + nf.format(CatacombsTracker.m4SPlusSession) + "\n" + + EnumChatFormatting.GOLD + " Master Five S Runs:" + nf.format(CatacombsTracker.m5SSession) + "\n" + + EnumChatFormatting.GOLD + " Master Five S+ Runs:" + nf.format(CatacombsTracker.m5SPlusSession) + "\n" + + EnumChatFormatting.GOLD + " Master Six S Runs:" + nf.format(CatacombsTracker.m6SSession) + "\n" + + EnumChatFormatting.GOLD + " Master Six S+ Runs:" + nf.format(CatacombsTracker.m6SPlusSession) + "\n" + + EnumChatFormatting.GOLD + " Master Seven S Runs:" + nf.format(CatacombsTracker.m7SSession) + "\n" + + EnumChatFormatting.GOLD + " Master Seven S+ Runs:" + nf.format(CatacombsTracker.m7SPlusSession) + "\n" + EnumChatFormatting.GOLD + " Recombobulators:" + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books:" + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " 1st Master Stars:" + nf.format(CatacombsTracker.firstStarsSession) + "\n" + @@ -840,6 +853,7 @@ public class LootCommand extends CommandBase { EnumChatFormatting.DARK_PURPLE + " 3rd Master Stars:" + nf.format(CatacombsTracker.thirdStarsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " 4th Master Stars:" + nf.format(CatacombsTracker.fourthStarsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " 5th Master Stars:" + nf.format(CatacombsTracker.fifthStarsSession) + "\n" + + EnumChatFormatting.GOLD + " Dark Claymores: " + nf.format(CatacombsTracker.darkClaymoresSession) + "\n" + EnumChatFormatting.WHITE + " Rerolls:" + nf.format(CatacombsTracker.masterRerollsSession) + "\n" + EnumChatFormatting.AQUA + " Coins Spent:" + nf.format(CatacombsTracker.masterCoinsSpentSession) + "\n" + EnumChatFormatting.AQUA + " Time Spent:" + nf.format(CatacombsTracker.masterTimeSpentSession) + "\n" + @@ -848,7 +862,20 @@ public class LootCommand extends CommandBase { } player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs MM Summary:\n" + - EnumChatFormatting.GOLD + " S Runs:" + nf.format(CatacombsTracker.masterS) + "\n" + + EnumChatFormatting.GOLD + " Master One S Runs:" + nf.format(CatacombsTracker.m1S) + "\n" + + EnumChatFormatting.GOLD + " Master One S+ Runs:" + nf.format(CatacombsTracker.m1SPlus) + "\n" + + EnumChatFormatting.GOLD + " Master Two S Runs:" + nf.format(CatacombsTracker.m2S) + "\n" + + EnumChatFormatting.GOLD + " Master Two S+ Runs:" + nf.format(CatacombsTracker.m2SPlus) + "\n" + + EnumChatFormatting.GOLD + " Master Three S Runs:" + nf.format(CatacombsTracker.m3S) + "\n" + + EnumChatFormatting.GOLD + " Master Three S+ Runs:" + nf.format(CatacombsTracker.m3SPlus) + "\n" + + EnumChatFormatting.GOLD + " Master Four S Runs:" + nf.format(CatacombsTracker.m4S) + "\n" + + EnumChatFormatting.GOLD + " Master Four S+ Runs:" + nf.format(CatacombsTracker.m4SPlus) + "\n" + + EnumChatFormatting.GOLD + " Master Five S Runs:" + nf.format(CatacombsTracker.m5S) + "\n" + + EnumChatFormatting.GOLD + " Master Five S+ Runs:" + nf.format(CatacombsTracker.m5SPlus) + "\n" + + EnumChatFormatting.GOLD + " Master Six S Runs:" + nf.format(CatacombsTracker.m6S) + "\n" + + EnumChatFormatting.GOLD + " Master Six S+ Runs:" + nf.format(CatacombsTracker.m6SPlus) + "\n" + + EnumChatFormatting.GOLD + " Master Seven S Runs:" + nf.format(CatacombsTracker.m7S) + "\n" + + EnumChatFormatting.GOLD + " Master Seven S+ Runs:" + nf.format(CatacombsTracker.m7SPlus) + "\n" + EnumChatFormatting.GOLD + " Recombobulators:" + nf.format(CatacombsTracker.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books:" + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + EnumChatFormatting.DARK_PURPLE + " 1st Master Stars:" + nf.format(CatacombsTracker.firstStars) + "\n" + @@ -856,6 +883,7 @@ public class LootCommand extends CommandBase { EnumChatFormatting.DARK_PURPLE + " 3rd Master Stars:" + nf.format(CatacombsTracker.thirdStars) + "\n" + EnumChatFormatting.DARK_PURPLE + " 4th Master Stars:" + nf.format(CatacombsTracker.fourthStars) + "\n" + EnumChatFormatting.DARK_PURPLE + " 5th Master Stars:" + nf.format(CatacombsTracker.fifthStars) + "\n" + + EnumChatFormatting.GOLD + " Dark Claymores: " + nf.format(CatacombsTracker.darkClaymores) + "\n" + EnumChatFormatting.WHITE + " Rerolls:" + nf.format(CatacombsTracker.masterRerolls) + "\n" + EnumChatFormatting.AQUA + " Coins Spent:" + nf.format(CatacombsTracker.masterCoinsSpent) + "\n" + EnumChatFormatting.AQUA + " Time Spent:" + nf.format(CatacombsTracker.masterTimeSpent) + "\n" + diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 94425c0..04770aa 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -14,12 +14,12 @@ import net.minecraft.util.ChatComponentText; import java.util.List; public class ToggleCommand extends CommandBase implements ICommand { - // i hate this file so much // Some of these end with toggled and some don't, I don't want to go back and fix them all for consistency public static boolean gpartyToggled; public static boolean coordsToggled; public static boolean goldenToggled; public static boolean slayerCountTotal; + public static boolean masterSPlusDisplay; public static boolean rngesusAlerts; public static boolean ghostDisplay; public static boolean splitFishing; @@ -106,6 +106,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean endMusic; public static boolean parkMusic; + // NO LONGER UPDATED @Override public String getCommandName() { return "toggle"; @@ -150,7 +151,7 @@ public class ToggleCommand extends CommandBase implements ICommand { } return null; } - + @Override public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { final EntityPlayer player = (EntityPlayer)arg0; diff --git a/src/main/java/me/Danker/features/AutoDisplay.java b/src/main/java/me/Danker/features/AutoDisplay.java index 8dbe359..5fc4489 100644 --- a/src/main/java/me/Danker/features/AutoDisplay.java +++ b/src/main/java/me/Danker/features/AutoDisplay.java @@ -4,6 +4,7 @@ import me.Danker.DankersSkyblockMod; import me.Danker.features.loot.LootDisplay; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.ScoreboardHandler; +import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.init.Items; @@ -44,23 +45,38 @@ public class AutoDisplay { } else if (sCleaned.contains("The Mist")){ LootDisplay.display = "ghost"; found = true; - } else if (sCleaned.contains("The Catacombs (")) { - if (sCleaned.contains("F1")) { - LootDisplay.display = "catacombs_floor_one"; - } else if (sCleaned.contains("F2")) { - LootDisplay.display = "catacombs_floor_two"; - } else if (sCleaned.contains("F3")) { - LootDisplay.display = "catacombs_floor_three"; - } else if (sCleaned.contains("F4")) { - LootDisplay.display = "catacombs_floor_four"; - } else if (sCleaned.contains("F5")) { - LootDisplay.display = "catacombs_floor_five"; - } else if (sCleaned.contains("F6")) { - LootDisplay.display = "catacombs_floor_six"; - } else if (sCleaned.contains("F7")) { - LootDisplay.display = "catacombs_floor_seven"; - } else if (sCleaned.contains("(M")) { - LootDisplay.display = "catacombs_master"; + } else if (Utils.inDungeons) { + switch (Utils.currentFloor) { + case F1: + LootDisplay.display = "catacombs_floor_one"; + break; + case F2: + LootDisplay.display = "catacombs_floor_two"; + break; + case F3: + LootDisplay.display = "catacombs_floor_three"; + break; + case F4: + LootDisplay.display = "catacombs_floor_four"; + break; + case F5: + LootDisplay.display = "catacombs_floor_five"; + break; + case F6: + LootDisplay.display = "catacombs_floor_six"; + break; + case F7: + LootDisplay.display = "catacombs_floor_seven"; + break; + case M1: + case M2: + case M3: + case M4: + case M5: + case M6: + case M7: + LootDisplay.display = "catacombs_master"; + break; } found = true; } diff --git a/src/main/java/me/Danker/features/DungeonScore.java b/src/main/java/me/Danker/features/DungeonScore.java index 706ce62..588db8a 100644 --- a/src/main/java/me/Danker/features/DungeonScore.java +++ b/src/main/java/me/Danker/features/DungeonScore.java @@ -5,7 +5,6 @@ import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; import me.Danker.commands.ToggleCommand; import me.Danker.events.RenderOverlayEvent; -import me.Danker.handlers.ScoreboardHandler; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; @@ -19,7 +18,6 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import java.util.Collection; -import java.util.List; public class DungeonScore { @@ -55,29 +53,6 @@ public class DungeonScore { if (!ToggleCommand.dungeonScore || !Utils.inDungeons) return; if (DankersSkyblockMod.tickAmount % 20 == 0) { - String floor = ""; - List scoreboard = ScoreboardHandler.getSidebarLines(); - for (String s : scoreboard) { - String sCleaned = ScoreboardHandler.cleanSB(s); - if (sCleaned.contains("The Catacombs (")) { - if (sCleaned.contains("F1")) { - floor = "F1"; - } else if (sCleaned.contains("F2")) { - floor = "F2"; - } else if (sCleaned.contains("F3")) { - floor = "F3"; - } else if (sCleaned.contains("F4")) { - floor = "F4"; - } else if (sCleaned.contains("F5")) { - floor = "F5"; - } else if (sCleaned.contains("F6")) { - floor = "F6"; - } else if (sCleaned.contains("F7")) { - floor = "F7"; - } - } - } - int missingPuzzles = 0; double openedRooms = 0; double completedRooms = 0; @@ -99,23 +74,23 @@ public class DungeonScore { double secretCount = Double.parseDouble(display.replaceAll("[^\\d.]", "")); - switch (floor) { - case "F1": + switch (Utils.currentFloor) { + case F1: secretScore = secretCount / 30D; break; - case "F2": + case F2: secretScore = secretCount / 40D; break; - case "F3": + case F3: secretScore = secretCount / 50D; break; - case "F4": + case F4: secretScore = secretCount / 60D; break; - case "F5": + case F5: secretScore = secretCount / 70D; break; - case "F6": + case F6: secretScore = secretCount / 85D; break; default: @@ -127,19 +102,19 @@ public class DungeonScore { int seconds = Integer.parseInt(timeText.substring(timeText.indexOf("m") + 1, timeText.indexOf("s"))); int time = minutes * 60 + seconds; - if (floor.equals("F2")) time -= 120; + if (Utils.currentFloor == Utils.DungeonFloor.F2) time -= 120; int base; - switch (floor) { - case "F1": - case "F2": - case "F3": - case "F5": + switch (Utils.currentFloor) { + case F1: + case F2: + case F3: + case F5: base = 600; break; - case "F4": - case "F6": - case "F7": + case F4: + case F6: + case F7: base = 720; break; default: diff --git a/src/main/java/me/Danker/features/loot/CatacombsTracker.java b/src/main/java/me/Danker/features/loot/CatacombsTracker.java index c4b9634..8d50ab3 100644 --- a/src/main/java/me/Danker/features/loot/CatacombsTracker.java +++ b/src/main/java/me/Danker/features/loot/CatacombsTracker.java @@ -89,12 +89,26 @@ public class CatacombsTracker { public static double f7CoinsSpent; public static double f7TimeSpent; // MM - public static int masterS; + public static int m1S; + public static int m1SPlus; + public static int m2S; + public static int m2SPlus; + public static int m3S; + public static int m3SPlus; + public static int m4S; + public static int m4SPlus; + public static int m5S; + public static int m5SPlus; + public static int m6S; + public static int m6SPlus; + public static int m7S; + public static int m7SPlus; public static int firstStars; public static int secondStars; public static int thirdStars; public static int fourthStars; public static int fifthStars; + public static int darkClaymores; public static int masterRerolls; public static double masterCoinsSpent; public static double masterTimeSpent; @@ -174,12 +188,26 @@ public class CatacombsTracker { public static double f7CoinsSpentSession = 0; public static double f7TimeSpentSession = 0; // MM - public static int masterSSession = 0; + public static int m1SSession = 0; + public static int m1SPlusSession = 0; + public static int m2SSession = 0; + public static int m2SPlusSession = 0; + public static int m3SSession = 0; + public static int m3SPlusSession = 0; + public static int m4SSession = 0; + public static int m4SPlusSession = 0; + public static int m5SSession = 0; + public static int m5SPlusSession = 0; + public static int m6SSession = 0; + public static int m6SPlusSession = 0; + public static int m7SSession = 0; + public static int m7SPlusSession = 0; public static int firstStarsSession = 0; public static int secondStarsSession = 0; public static int thirdStarsSession = 0; public static int fourthStarsSession = 0; public static int fifthStarsSession = 0; + public static int darkClaymoresSession = 0; public static int masterRerollsSession = 0; public static double masterCoinsSpentSession = 0; public static double masterTimeSpentSession = 0; @@ -191,51 +219,138 @@ public class CatacombsTracker { if (!Utils.inDungeons) return; if (event.type == 2) return; - if (message.contains(" Team Score: ") && message.contains("(S+)")) { - List scoreboard = ScoreboardHandler.getSidebarLines(); + if (message.contains(" Team Score: ")) { if (message.contains("(S+)")) { - for (String s : scoreboard) { - String sCleaned = ScoreboardHandler.cleanSB(s); - if (sCleaned.contains("The Catacombs (")) { - if (sCleaned.contains("F1")) { - f1SPlus++; - f1SPlusSession++; - ConfigHandler.writeIntConfig("catacombs", "floorOneSPlus", f1SPlus); - } else if (sCleaned.contains("F2")) { - f2SPlus++; - f2SPlusSession++; - ConfigHandler.writeIntConfig("catacombs", "floorTwoSPlus", f2SPlus); - } else if (sCleaned.contains("F3")) { - f3SPlus++; - f3SPlusSession++; - ConfigHandler.writeIntConfig("catacombs", "floorThreeSPlus", f3SPlus); - } else if (sCleaned.contains("F4")) { - f4SPlus++; - f4SPlusSession++; - ConfigHandler.writeIntConfig("catacombs", "floorFourSPlus", f4SPlus); - } else if (sCleaned.contains("F5")) { - f5SPlus++; - f5SPlusSession++; - ConfigHandler.writeIntConfig("catacombs", "floorFiveSPlus", f5SPlus); - } else if (sCleaned.contains("F6")) { - f6SPlus++; - f6SPlusSession++; - ConfigHandler.writeIntConfig("catacombs", "floorSixSPlus", f6SPlus); - } else if (sCleaned.contains("F7")) { - f7SPlus++; - f7SPlusSession++; - ConfigHandler.writeIntConfig("catacombs", "floorSevenSPlus", f7SPlus); - } - } + switch (Utils.currentFloor) { + case F1: + f1SPlus++; + f1SPlusSession++; + ConfigHandler.writeIntConfig("catacombs", "floorOneSPlus", f1SPlus); + break; + case F2: + f2SPlus++; + f2SPlusSession++; + ConfigHandler.writeIntConfig("catacombs", "floorTwoSPlus", f2SPlus); + break; + case F3: + f3SPlus++; + f3SPlusSession++; + ConfigHandler.writeIntConfig("catacombs", "floorThreeSPlus", f3SPlus); + break; + case F4: + f4SPlus++; + f4SPlusSession++; + ConfigHandler.writeIntConfig("catacombs", "floorFourSPlus", f4SPlus); + break; + case F5: + f5SPlus++; + f5SPlusSession++; + ConfigHandler.writeIntConfig("catacombs", "floorFiveSPlus", f5SPlus); + break; + case F6: + f6SPlus++; + f6SPlusSession++; + ConfigHandler.writeIntConfig("catacombs", "floorSixSPlus", f6SPlus); + break; + case F7: + f7SPlus++; + f7SPlusSession++; + ConfigHandler.writeIntConfig("catacombs", "floorSevenSPlus", f7SPlus); + break; + case M1: + m1S++; + m1SPlus++; + m1SSession++; + m1SPlusSession++; + ConfigHandler.writeIntConfig("catacombs", "masterOneS", m1S); + ConfigHandler.writeIntConfig("catacombs", "masterOneSPlus", m1SPlus); + break; + case M2: + m2S++; + m2SPlus++; + m2SSession++; + m2SPlusSession++; + ConfigHandler.writeIntConfig("catacombs", "masterTwoS", m2S); + ConfigHandler.writeIntConfig("catacombs", "masterTwoSPlus", m2SPlus); + break; + case M3: + m3S++; + m3SPlus++; + m3SSession++; + m3SPlusSession++; + ConfigHandler.writeIntConfig("catacombs", "masterThreeS", m3S); + ConfigHandler.writeIntConfig("catacombs", "masterThreeSPlus", m3SPlus); + break; + case M4: + m4S++; + m4SPlus++; + m4SSession++; + m4SPlusSession++; + ConfigHandler.writeIntConfig("catacombs", "masterFourS", m4S); + ConfigHandler.writeIntConfig("catacombs", "masterFourSPlus", m4SPlus); + break; + case M5: + m5S++; + m5SPlus++; + m5SSession++; + m5SPlusSession++; + ConfigHandler.writeIntConfig("catacombs", "masterFiveS", m5S); + ConfigHandler.writeIntConfig("catacombs", "masterFiveSPlus", m5SPlus); + break; + case M6: + m6S++; + m6SPlus++; + m6SSession++; + m6SPlusSession++; + ConfigHandler.writeIntConfig("catacombs", "masterSixS", m6S); + ConfigHandler.writeIntConfig("catacombs", "masterSixSPlus", m6SPlus); + break; + case M7: + m7S++; + m7SPlus++; + m7SSession++; + m7SPlusSession++; + ConfigHandler.writeIntConfig("catacombs", "masterSevenS", m7S); + ConfigHandler.writeIntConfig("catacombs", "masterSevenSPlus", m7SPlus); + break; } } else if (message.contains("(S)")) { - for (String s : scoreboard) { - String sCleaned = ScoreboardHandler.cleanSB(s); - if (sCleaned.contains("The Catacombs (M")) { - masterS++; - masterSSession++; - ConfigHandler.writeIntConfig("catacombs", "masterS", masterS); - } + switch (Utils.currentFloor) { + case M1: + m1S++; + m1SPlus++; + ConfigHandler.writeIntConfig("catacombs", "masterOneS", m1S); + break; + case M2: + m2S++; + m2SPlus++; + ConfigHandler.writeIntConfig("catacombs", "masterTwoS", m2S); + break; + case M3: + m3S++; + m3SPlus++; + ConfigHandler.writeIntConfig("catacombs", "masterThreeS", m3S); + break; + case M4: + m4S++; + m4SPlus++; + ConfigHandler.writeIntConfig("catacombs", "masterFourS", m4S); + break; + case M5: + m5S++; + m5SPlus++; + ConfigHandler.writeIntConfig("catacombs", "masterFiveS", m5S); + break; + case M6: + m6S++; + m6SPlus++; + ConfigHandler.writeIntConfig("catacombs", "masterSixS", m6S); + break; + case M7: + m7S++; + m7SPlus++; + ConfigHandler.writeIntConfig("catacombs", "masterSevenS", m7S); + break; } } } @@ -435,56 +550,74 @@ public class CatacombsTracker { fifthStars++; fifthStarsSession++; ConfigHandler.writeIntConfig("catacombs", "fifthStar", fifthStars); + } else if (message.contains("Dark Claymore")) { + darkClaymores++; + darkClaymoresSession++; + ConfigHandler.writeIntConfig("catacombs", "darkClaymore", darkClaymores); } } if (message.contains("EXTRA STATS ")) { List scoreboard = ScoreboardHandler.getSidebarLines(); - int timeToAdd = 0; for (String s : scoreboard) { String sCleaned = ScoreboardHandler.cleanSB(s); - if (sCleaned.contains("The Catacombs (")) { - // Add time to floor - if (sCleaned.contains("F1")) { - f1TimeSpent = Math.floor(f1TimeSpent + timeToAdd); - f1TimeSpentSession = Math.floor(f1TimeSpentSession + timeToAdd); - ConfigHandler.writeDoubleConfig("catacombs", "floorOneTime", f1TimeSpent); - } else if (sCleaned.contains("F2")) { - f2TimeSpent = Math.floor(f2TimeSpent + timeToAdd); - f2TimeSpentSession = Math.floor(f2TimeSpentSession + timeToAdd); - ConfigHandler.writeDoubleConfig("catacombs", "floorTwoTime", f2TimeSpent); - } else if (sCleaned.contains("F3")) { - f3TimeSpent = Math.floor(f3TimeSpent + timeToAdd); - f3TimeSpentSession = Math.floor(f3TimeSpentSession + timeToAdd); - ConfigHandler.writeDoubleConfig("catacombs", "floorThreeTime", f3TimeSpent); - } else if (sCleaned.contains("F4")) { - f4TimeSpent = Math.floor(f4TimeSpent + timeToAdd); - f4TimeSpentSession = Math.floor(f4TimeSpentSession + timeToAdd); - ConfigHandler.writeDoubleConfig("catacombs", "floorFourTime", f4TimeSpent); - } else if (sCleaned.contains("F5")) { - f5TimeSpent = Math.floor(f5TimeSpent + timeToAdd); - f5TimeSpentSession = Math.floor(f5TimeSpentSession + timeToAdd); - ConfigHandler.writeDoubleConfig("catacombs", "floorFiveTime", f5TimeSpent); - } else if (sCleaned.contains("F6")) { - f6TimeSpent = Math.floor(f6TimeSpent + timeToAdd); - f6TimeSpentSession = Math.floor(f6TimeSpentSession + timeToAdd); - ConfigHandler.writeDoubleConfig("catacombs", "floorSixTime", f6TimeSpent); - } else if (sCleaned.contains("F7")) { - f7TimeSpent = Math.floor(f7TimeSpent + timeToAdd); - f7TimeSpentSession = Math.floor(f7TimeSpentSession + timeToAdd); - ConfigHandler.writeDoubleConfig("catacombs", "floorSevenTime", f7TimeSpent); - } else if (sCleaned.contains("(M")) { - masterTimeSpent = Math.floor(masterTimeSpent + timeToAdd); - masterTimeSpentSession = Math.floor(masterTimeSpentSession + timeToAdd); - ConfigHandler.writeDoubleConfig("catacombs", "masterTime", masterTimeSpent); - } - } else if (sCleaned.contains("Time Elapsed:")) { + if (sCleaned.contains("Time Elapsed:")) { // Get floor time String time = sCleaned.substring(sCleaned.indexOf(":") + 2); time = time.replaceAll("\\s", ""); int minutes = Integer.parseInt(time.substring(0, time.indexOf("m"))); int seconds = Integer.parseInt(time.substring(time.indexOf("m") + 1, time.indexOf("s"))); - timeToAdd = (minutes * 60) + seconds; + int timeToAdd = (minutes * 60) + seconds; + + // Add time to floor + switch (Utils.currentFloor) { + case F1: + f1TimeSpent = Math.floor(f1TimeSpent + timeToAdd); + f1TimeSpentSession = Math.floor(f1TimeSpentSession + timeToAdd); + ConfigHandler.writeDoubleConfig("catacombs", "floorOneTime", f1TimeSpent); + break; + case F2: + f2TimeSpent = Math.floor(f2TimeSpent + timeToAdd); + f2TimeSpentSession = Math.floor(f2TimeSpentSession + timeToAdd); + ConfigHandler.writeDoubleConfig("catacombs", "floorTwoTime", f2TimeSpent); + break; + case F3: + f3TimeSpent = Math.floor(f3TimeSpent + timeToAdd); + f3TimeSpentSession = Math.floor(f3TimeSpentSession + timeToAdd); + ConfigHandler.writeDoubleConfig("catacombs", "floorThreeTime", f3TimeSpent); + break; + case F4: + f4TimeSpent = Math.floor(f4TimeSpent + timeToAdd); + f4TimeSpentSession = Math.floor(f4TimeSpentSession + timeToAdd); + ConfigHandler.writeDoubleConfig("catacombs", "floorFourTime", f4TimeSpent); + break; + case F5: + f5TimeSpent = Math.floor(f5TimeSpent + timeToAdd); + f5TimeSpentSession = Math.floor(f5TimeSpentSession + timeToAdd); + ConfigHandler.writeDoubleConfig("catacombs", "floorFiveTime", f5TimeSpent); + break; + case F6: + f6TimeSpent = Math.floor(f6TimeSpent + timeToAdd); + f6TimeSpentSession = Math.floor(f6TimeSpentSession + timeToAdd); + ConfigHandler.writeDoubleConfig("catacombs", "floorSixTime", f6TimeSpent); + break; + case F7: + f7TimeSpent = Math.floor(f7TimeSpent + timeToAdd); + f7TimeSpentSession = Math.floor(f7TimeSpentSession + timeToAdd); + ConfigHandler.writeDoubleConfig("catacombs", "floorSevenTime", f7TimeSpent); + break; + case M1: + case M2: + case M3: + case M4: + case M5: + case M6: + case M7: + masterTimeSpent = Math.floor(masterTimeSpent + timeToAdd); + masterTimeSpentSession = Math.floor(masterTimeSpentSession + timeToAdd); + ConfigHandler.writeDoubleConfig("catacombs", "masterTime", masterTimeSpent); + break; + } } } } @@ -504,69 +637,80 @@ public class CatacombsTracker { if (line.contains(" Coins") && !line.contains("NOTE:")) { int coinsSpent = Integer.parseInt(line.replaceAll("[^\\d]", "")); - List scoreboard = ScoreboardHandler.getSidebarLines(); - for (String s : scoreboard) { - String sCleaned = ScoreboardHandler.cleanSB(s); - if (sCleaned.contains("The Catacombs (")) { - if (sCleaned.contains("F1")) { - f1CoinsSpent += coinsSpent; - f1CoinsSpentSession += coinsSpent; - ConfigHandler.writeDoubleConfig("catacombs", "floorOneCoins", f1CoinsSpent); - } else if (sCleaned.contains("F2")) { - f2CoinsSpent += coinsSpent; - f2CoinsSpentSession += coinsSpent; - ConfigHandler.writeDoubleConfig("catacombs", "floorTwoCoins", f2CoinsSpent); - } else if (sCleaned.contains("F3")) { - f3CoinsSpent += coinsSpent; - f3CoinsSpentSession += coinsSpent; - ConfigHandler.writeDoubleConfig("catacombs", "floorThreeCoins", f3CoinsSpent); - } else if (sCleaned.contains("F4")) { - f4CoinsSpent += coinsSpent; - f4CoinsSpentSession += coinsSpent; - ConfigHandler.writeDoubleConfig("catacombs", "floorFourCoins", f4CoinsSpent); - } else if (sCleaned.contains("F5")) { - f5CoinsSpent += coinsSpent; - f5CoinsSpentSession += coinsSpent; - ConfigHandler.writeDoubleConfig("catacombs", "floorFiveCoins", f5CoinsSpent); - } else if (sCleaned.contains("F6")) { - f6CoinsSpent += coinsSpent; - f6CoinsSpentSession += coinsSpent; - ConfigHandler.writeDoubleConfig("catacombs", "floorSixCoins", f6CoinsSpent); - } else if (sCleaned.contains("F7")) { - f7CoinsSpent += coinsSpent; - f7CoinsSpentSession += coinsSpent; - ConfigHandler.writeDoubleConfig("catacombs", "floorSevenCoins", f7CoinsSpent); - } else if (sCleaned.contains("(M")) { - masterCoinsSpent += coinsSpent; - masterCoinsSpentSession += coinsSpent; - ConfigHandler.writeDoubleConfig("catacombs", "masterCoins", masterCoinsSpent); - } + switch (Utils.currentFloor) { + case F1: + f1CoinsSpent += coinsSpent; + f1CoinsSpentSession += coinsSpent; + ConfigHandler.writeDoubleConfig("catacombs", "floorOneCoins", f1CoinsSpent); + break; + case F2: + f2CoinsSpent += coinsSpent; + f2CoinsSpentSession += coinsSpent; + ConfigHandler.writeDoubleConfig("catacombs", "floorTwoCoins", f2CoinsSpent); + break; + case F3: + f3CoinsSpent += coinsSpent; + f3CoinsSpentSession += coinsSpent; + ConfigHandler.writeDoubleConfig("catacombs", "floorThreeCoins", f3CoinsSpent); + break; + case F4: + f4CoinsSpent += coinsSpent; + f4CoinsSpentSession += coinsSpent; + ConfigHandler.writeDoubleConfig("catacombs", "floorFourCoins", f4CoinsSpent); + break; + case F5: + f5CoinsSpent += coinsSpent; + f5CoinsSpentSession += coinsSpent; + ConfigHandler.writeDoubleConfig("catacombs", "floorFiveCoins", f5CoinsSpent); + break; + case F6: + f6CoinsSpent += coinsSpent; + f6CoinsSpentSession += coinsSpent; + ConfigHandler.writeDoubleConfig("catacombs", "floorSixCoins", f6CoinsSpent); + break; + case F7: + f7CoinsSpent += coinsSpent; + f7CoinsSpentSession += coinsSpent; + ConfigHandler.writeDoubleConfig("catacombs", "floorSevenCoins", f7CoinsSpent); + break; + case M1: + case M2: + case M3: + case M4: + case M5: + case M6: + case M7: + masterCoinsSpent += coinsSpent; + masterCoinsSpentSession += coinsSpent; + ConfigHandler.writeDoubleConfig("catacombs", "masterCoins", masterCoinsSpent); break; - } } break; } } } else if (item.getDisplayName().contains("Reroll Chest")) { - List scoreboard = ScoreboardHandler.getSidebarLines(); - for (String s : scoreboard) { - String sCleaned = ScoreboardHandler.cleanSB(s); - if (sCleaned.contains("The Catacombs (")) { - if (sCleaned.contains("F6")) { - f6Rerolls++; - f6RerollsSession++; - ConfigHandler.writeDoubleConfig("catacombs", "floorSixRerolls", f6Rerolls); - } else if (sCleaned.contains("F7")) { - f7Rerolls++; - f7RerollsSession++; - ConfigHandler.writeDoubleConfig("catacombs", "floorSevenRerolls", f7Rerolls); - } else if (sCleaned.contains("(M")) { - masterRerolls++; - masterRerollsSession++; - ConfigHandler.writeDoubleConfig("catacombs", "masterRerolls", masterRerolls); - } + switch (Utils.currentFloor) { + case F6: + f6Rerolls++; + f6RerollsSession++; + ConfigHandler.writeDoubleConfig("catacombs", "floorSixRerolls", f6Rerolls); + break; + case F7: + f7Rerolls++; + f7RerollsSession++; + ConfigHandler.writeDoubleConfig("catacombs", "floorSevenRerolls", f7Rerolls); + break; + case M1: + case M2: + case M3: + case M4: + case M5: + case M6: + case M7: + masterRerolls++; + masterRerollsSession++; + ConfigHandler.writeDoubleConfig("catacombs", "masterRerolls", masterRerolls); break; - } } } } diff --git a/src/main/java/me/Danker/features/loot/LootDisplay.java b/src/main/java/me/Danker/features/loot/LootDisplay.java index 812108b..16e64f6 100644 --- a/src/main/java/me/Danker/features/loot/LootDisplay.java +++ b/src/main/java/me/Danker/features/loot/LootDisplay.java @@ -30,6 +30,8 @@ public class LootDisplay { String timeBetween; String bossesBetween; String drop20; + String runs; + String runsCount; double timeNow = System.currentTimeMillis() / 1000; NumberFormat nf = NumberFormat.getIntegerInstance(Locale.US); @@ -1109,7 +1111,39 @@ public class LootDisplay { EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f7TimeSpentSession); break; case "catacombs_master": - dropsText = EnumChatFormatting.GOLD + "S Runs:\n" + + if (ToggleCommand.masterSPlusDisplay) { + runs = EnumChatFormatting.GOLD + "Master One S+:\n" + + EnumChatFormatting.GOLD + "Master Two S+:\n" + + EnumChatFormatting.GOLD + "Master Three S+:\n" + + EnumChatFormatting.GOLD + "Master Four S+:\n" + + EnumChatFormatting.GOLD + "Master Five S+:\n" + + EnumChatFormatting.GOLD + "Master Six S+:\n" + + EnumChatFormatting.GOLD + "Master Seven S+:\n"; + runsCount = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m1SPlus) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m2SPlus) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m3SPlus) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m4SPlus) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m5SPlus) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m6SPlus) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m7SPlus) + "\n"; + } else { + runs = EnumChatFormatting.GOLD + "Master One S:\n" + + EnumChatFormatting.GOLD + "Master Two S:\n" + + EnumChatFormatting.GOLD + "Master Three S:\n" + + EnumChatFormatting.GOLD + "Master Four S:\n" + + EnumChatFormatting.GOLD + "Master Five S:\n" + + EnumChatFormatting.GOLD + "Master Six S:\n" + + EnumChatFormatting.GOLD + "Master Seven S:\n"; + runsCount = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m1S) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m2S) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m3S) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m4S) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m5S) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m6S) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m7S) + "\n"; + } + + dropsText = runs + EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + EnumChatFormatting.DARK_PURPLE + "1st Master Stars:\n" + @@ -1117,10 +1151,11 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + "3rd Master Stars:\n" + EnumChatFormatting.DARK_PURPLE + "4th Master Stars:\n" + EnumChatFormatting.DARK_PURPLE + "5th Master Stars:\n" + + EnumChatFormatting.GOLD + "Dark Claymores:\n" + EnumChatFormatting.WHITE + "Rerolls:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.masterS) + "\n" + + countText = runsCount + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulators) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.firstStars) + "\n" + @@ -1128,12 +1163,45 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.thirdStars) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fourthStars) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fifthStars) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.darkClaymores) + "\n" + EnumChatFormatting.WHITE + nf.format(CatacombsTracker.masterRerolls) + "\n" + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.masterCoinsSpent) + "\n" + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.masterTimeSpent); break; case "catacombs_master_session": - dropsText = EnumChatFormatting.GOLD + "S Runs:\n" + + if (ToggleCommand.masterSPlusDisplay) { + runs = EnumChatFormatting.GOLD + "Master One S+:\n" + + EnumChatFormatting.GOLD + "Master Two S+:\n" + + EnumChatFormatting.GOLD + "Master Three S+:\n" + + EnumChatFormatting.GOLD + "Master Four S+:\n" + + EnumChatFormatting.GOLD + "Master Five S+:\n" + + EnumChatFormatting.GOLD + "Master Six S+:\n" + + EnumChatFormatting.GOLD + "Master Seven S+:\n"; + runsCount = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m1SPlusSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m2SPlusSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m3SPlusSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m4SPlusSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m5SPlusSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m6SPlusSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m7SPlusSession) + "\n"; + } else { + runs = EnumChatFormatting.GOLD + "Master One S:\n" + + EnumChatFormatting.GOLD + "Master Two S:\n" + + EnumChatFormatting.GOLD + "Master Three S:\n" + + EnumChatFormatting.GOLD + "Master Four S:\n" + + EnumChatFormatting.GOLD + "Master Five S:\n" + + EnumChatFormatting.GOLD + "Master Six S:\n" + + EnumChatFormatting.GOLD + "Master Seven S:\n"; + runsCount = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m1SSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m2SSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m3SSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m4SSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m5SSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m6SSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.m7SSession) + "\n"; + } + + dropsText = runs + EnumChatFormatting.GOLD + "Recombobulators:\n" + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + EnumChatFormatting.DARK_PURPLE + "1st Master Stars:\n" + @@ -1141,10 +1209,11 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + "3rd Master Stars:\n" + EnumChatFormatting.DARK_PURPLE + "4th Master Stars:\n" + EnumChatFormatting.DARK_PURPLE + "5th Master Stars:\n" + + EnumChatFormatting.GOLD + "Dark Claymores:\n" + EnumChatFormatting.WHITE + "Rerolls:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + EnumChatFormatting.AQUA + "Time Spent:"; - countText = EnumChatFormatting.GOLD + nf.format(CatacombsTracker.masterSSession) + "\n" + + countText = runsCount + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.firstStarsSession) + "\n" + @@ -1152,6 +1221,7 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.thirdStarsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fourthStarsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fifthStarsSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.darkClaymoresSession) + "\n" + EnumChatFormatting.WHITE + nf.format(CatacombsTracker.masterRerollsSession) + "\n" + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.masterCoinsSpentSession) + "\n" + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.masterTimeSpentSession); diff --git a/src/main/java/me/Danker/features/puzzlesolvers/LividSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/LividSolver.java index 4e9f498..b947cdb 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/LividSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/LividSolver.java @@ -38,7 +38,7 @@ public class LividSolver { World world = Minecraft.getMinecraft().theWorld; if (DankersSkyblockMod.tickAmount % 20 == 0) { if (ToggleCommand.lividSolverToggled && Utils.inDungeons && !foundLivid && world != null) { - if (Utils.isInScoreboard("The Catacombs (F5)")) { + if (Utils.currentFloor == Utils.DungeonFloor.F5 || Utils.currentFloor == Utils.DungeonFloor.M5) { List loadedLivids = new ArrayList<>(); List entities = world.getLoadedEntityList(); for (Entity entity : entities) { diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index d5e9ee8..a6f76b1 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -50,6 +50,7 @@ public class DankerGui extends GuiScreen { private GuiButton coords; private GuiButton goldenEnch; private GuiButton slayerCount; + private GuiButton masterSPlusDisplay; private GuiButton rngesusAlert; private GuiButton splitFishing; private GuiButton chatMaddox; @@ -135,6 +136,7 @@ public class DankerGui extends GuiScreen { cakeTimer = new FeatureButton("Cake Timer: " + Utils.getColouredBoolean(ToggleCommand.cakeTimerToggled), "Displays time until century cake buffs run out."); skill50Display = new FeatureButton("Display Progress To Skill Level 50: " + Utils.getColouredBoolean(ToggleCommand.skill50DisplayToggled), "Display total progress to max skill level."); slayerCount = new FeatureButton("Count Total 20% Drops: " + Utils.getColouredBoolean(ToggleCommand.slayerCountTotal), "Counts times dropped instead of amount dropped.\nE.x. Hamster Wheels: 40 -> Hamster Wheels: 10 times."); + masterSPlusDisplay = new FeatureButton("Display MM S+ Runs: " + Utils.getColouredBoolean(ToggleCommand.masterSPlusDisplay), "Dispay Master Mode S+ runs instead of S runs."); spiritBearAlert = new FeatureButton("Spirit Bear Spawn Alerts: " + Utils.getColouredBoolean(ToggleCommand.spiritBearAlerts), "Alert when Spirit Bear spawns."); sceptreMessages = new FeatureButton("Spirit Sceptre Messages: " + Utils.getColouredBoolean(ToggleCommand.sceptreMessages), "Turn " + EnumChatFormatting.RED + "off" + EnumChatFormatting.RESET + " to hide Spirit Sceptre messages."); midasStaffMessages = new FeatureButton("Midas Staff Messages: " + Utils.getColouredBoolean(ToggleCommand.midasStaffMessages), "Turn " + EnumChatFormatting.RED + "off" + EnumChatFormatting.RESET + " to hide Midas Staff messages."); @@ -190,6 +192,7 @@ public class DankerGui extends GuiScreen { allButtons.add(cakeTimer); allButtons.add(skill50Display); allButtons.add(slayerCount); + allButtons.add(masterSPlusDisplay); allButtons.add(spiritBearAlert); allButtons.add(sceptreMessages); allButtons.add(midasStaffMessages); @@ -503,6 +506,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.dungeonScore = !ToggleCommand.dungeonScore; ConfigHandler.writeBooleanConfig("toggles", "DungeonScore", ToggleCommand.dungeonScore); dungeonScore.displayString = "Dungeon Score Display: " + Utils.getColouredBoolean(ToggleCommand.dungeonScore); + } else if (button == masterSPlusDisplay) { + ToggleCommand.masterSPlusDisplay = !ToggleCommand.masterSPlusDisplay; + ConfigHandler.writeBooleanConfig("toggles", "MasterSPlusDisplay", ToggleCommand.masterSPlusDisplay); + masterSPlusDisplay.displayString = "Display MM S+ Runs: " + Utils.getColouredBoolean(ToggleCommand.masterSPlusDisplay); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 3839766..9365b63 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -201,6 +201,7 @@ public class ConfigHandler { ToggleCommand.coordsToggled = initBoolean("toggles", "Coords", false); ToggleCommand.goldenToggled = initBoolean("toggles", "Golden", false); ToggleCommand.slayerCountTotal = initBoolean("toggles", "SlayerCount", true); + ToggleCommand.masterSPlusDisplay = initBoolean("toggles", "MasterSPlusDisplay", true); ToggleCommand.rngesusAlerts = initBoolean("toggles", "RNGesusAlerts", false); ToggleCommand.ghostDisplay = initBoolean("toggles", "GhostDisplay", true); ToggleCommand.dungeonTimerToggled = initBoolean("toggles", "GhostTimer", false); @@ -514,12 +515,26 @@ public class ConfigHandler { CatacombsTracker.f7CoinsSpent = initDouble("catacombs", "floorSevenCoins", 0); CatacombsTracker.f7TimeSpent = initDouble("catacombs", "floorSevenTime", 0); // MM - CatacombsTracker.masterS = initInt("catacombs", "masterS", 0); + CatacombsTracker.m1S = initInt("catacombs", "masterOneS", 0); + CatacombsTracker.m1SPlus = initInt("catacombs", "masterOneSPlus", 0); + CatacombsTracker.m2S = initInt("catacombs", "masterTwoS", 0); + CatacombsTracker.m2SPlus = initInt("catacombs", "masterTwoSPlus", 0); + CatacombsTracker.m3S = initInt("catacombs", "masterThreeS", 0); + CatacombsTracker.m3SPlus = initInt("catacombs", "masterThreeSPlus", 0); + CatacombsTracker.m4S = initInt("catacombs", "masterFourS", 0); + CatacombsTracker.m4SPlus = initInt("catacombs", "masterFourSPlus", 0); + CatacombsTracker.m5S = initInt("catacombs", "masterFiveS", 0); + CatacombsTracker.m5SPlus = initInt("catacombs", "masterFiveSPlus", 0); + CatacombsTracker.m6S = initInt("catacombs", "masterSixS", 0); + CatacombsTracker.m6SPlus = initInt("catacombs", "masterSixSPlus", 0); + CatacombsTracker.m7S = initInt("catacombs", "masterSevenS", 0); + CatacombsTracker.m7SPlus = initInt("catacombs", "masterSevenSPlus", 0); CatacombsTracker.firstStars = initInt("catacombs", "firstStar", 0); CatacombsTracker.secondStars = initInt("catacombs", "secondStar", 0); CatacombsTracker.thirdStars = initInt("catacombs", "thirdStar", 0); CatacombsTracker.fourthStars = initInt("catacombs", "fourthStar", 0); CatacombsTracker.fifthStars = initInt("catacombs", "fifthStar", 0); + CatacombsTracker.darkClaymores = initInt("catacombs", "darkClaymore", 0); CatacombsTracker.masterRerolls = initInt("catacombs", "masterRerolls", 0); CatacombsTracker.masterCoinsSpent = initDouble("catacombs", "masterCoins", 0); CatacombsTracker.masterTimeSpent = initDouble("catacombs", "masterTime", 0); diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 8c48c54..30e8249 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -28,6 +28,7 @@ public class Utils { public static boolean inSkyblock = false; public static boolean inDungeons = false; + public static DungeonFloor currentFloor = DungeonFloor.NONE; public static String tabLocation = ""; public static int[] skillXPPerLevel = {0, 50, 125, 200, 300, 500, 750, 1000, 1500, 2000, 3500, 5000, 7500, 10000, 15000, 20000, 30000, 50000, 75000, 100000, 200000, 300000, 400000, 500000, 600000, 700000, 800000, 900000, 1000000, 1100000, @@ -135,6 +136,31 @@ public class Utils { inDungeons = false; } + public static void checkForDungeonFloor() { + if (inDungeons) { + List scoreboard = ScoreboardHandler.getSidebarLines(); + + for (String s : scoreboard) { + String sCleaned = ScoreboardHandler.cleanSB(s); + + if (sCleaned.contains("The Catacombs (")) { + String floor = sCleaned.substring(sCleaned.indexOf("(") + 1, sCleaned.indexOf(")")); + + try { + currentFloor = DungeonFloor.valueOf(floor); + } catch (IllegalArgumentException ex) { + currentFloor = DungeonFloor.NONE; + ex.printStackTrace(); + } + + break; + } + } + } else { + currentFloor = DungeonFloor.NONE; + } + } + public static void checkTabLocation() { if (inSkyblock) { Collection players = Minecraft.getMinecraft().getNetHandler().getPlayerInfoMap(); @@ -465,4 +491,23 @@ public class Utils { return (Math.floor(level / 2D) + 25) / 100D; } + public enum DungeonFloor { + NONE, + E0, + F1, + F2, + F3, + F4, + F5, + F6, + F7, + M1, + M2, + M3, + M4, + M5, + M6, + M7 + } + } -- cgit From 301f4be3cda326c7d97aeffee7df3b40568ff362 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 5 Mar 2022 22:48:02 -0500 Subject: Fix /loot fishing giving 2 loot summaries --- src/main/java/me/Danker/commands/LootCommand.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/LootCommand.java b/src/main/java/me/Danker/commands/LootCommand.java index 246d1aa..937207d 100644 --- a/src/main/java/me/Danker/commands/LootCommand.java +++ b/src/main/java/me/Danker/commands/LootCommand.java @@ -476,6 +476,8 @@ public class LootCommand extends CommandBase { EnumChatFormatting.GOLD + " Zombie Miners: " + nf.format(FishingTracker.zombieMiners) + "\n" + EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------")); } + + return; } if (showSession) { -- cgit From bd683b910aaebf830aa02eb5a91b5a0a2c6e5fe5 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Mon, 7 Mar 2022 13:03:44 -0500 Subject: Add cata 99 and class average to /dungeons --- src/main/java/me/Danker/commands/DungeonsCommand.java | 18 ++++++++++++------ src/main/java/me/Danker/utils/Utils.java | 4 ++-- 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/DungeonsCommand.java b/src/main/java/me/Danker/commands/DungeonsCommand.java index 31df680..75f6f46 100644 --- a/src/main/java/me/Danker/commands/DungeonsCommand.java +++ b/src/main/java/me/Danker/commands/DungeonsCommand.java @@ -13,8 +13,11 @@ import net.minecraft.event.HoverEvent; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; +import java.text.NumberFormat; import java.util.List; +import java.util.Locale; public class DungeonsCommand extends CommandBase { @@ -101,12 +104,14 @@ public class DungeonsCommand extends CommandBase { } JsonObject catacombsObject = dungeonsObject.get("dungeon_types").getAsJsonObject().get("catacombs").getAsJsonObject(); + double catacombs = Utils.xpToDungeonsLevel(catacombsObject.get("experience").getAsDouble()); - double healer = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("healer").getAsJsonObject().get("experience").getAsDouble()); - double mage = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("mage").getAsJsonObject().get("experience").getAsDouble()); - double berserk = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("berserk").getAsJsonObject().get("experience").getAsDouble()); - double archer = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("archer").getAsJsonObject().get("experience").getAsDouble()); - double tank = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("tank").getAsJsonObject().get("experience").getAsDouble()); + double healer = MathHelper.clamp_double(Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("healer").getAsJsonObject().get("experience").getAsDouble()), 0D, 50D); + double mage = MathHelper.clamp_double(Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("mage").getAsJsonObject().get("experience").getAsDouble()), 0D, 50D); + double berserk = MathHelper.clamp_double(Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("berserk").getAsJsonObject().get("experience").getAsDouble()), 0D, 50D); + double archer = MathHelper.clamp_double(Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("archer").getAsJsonObject().get("experience").getAsDouble()), 0D, 50D); + double tank = MathHelper.clamp_double(Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("tank").getAsJsonObject().get("experience").getAsDouble()), 0D, 50D); + double classAverage = Math.round((healer + mage + berserk + archer + tank) / 5D * 100D) / 100D; String selectedClass = Utils.capitalizeString(dungeonsObject.get("selected_dungeon_class").getAsString()); int secrets = playerResponse.get("player").getAsJsonObject().get("achievements").getAsJsonObject().get("skyblock_treasure_hunter").getAsInt(); @@ -127,12 +132,13 @@ public class DungeonsCommand extends CommandBase { ChatComponentText classLevels = new ChatComponentText(EnumChatFormatting.GOLD + " Selected Class: " + selectedClass + "\n\n" + EnumChatFormatting.RED + " Catacombs Level: " + catacombs + "\n" + + EnumChatFormatting.RED + " Class Average: " + classAverage + "\n\n" + EnumChatFormatting.YELLOW + " Healer Level: " + healer + "\n" + EnumChatFormatting.LIGHT_PURPLE + " Mage Level: " + mage + "\n" + EnumChatFormatting.RED + " Berserk Level: " + berserk + "\n" + EnumChatFormatting.GREEN + " Archer Level: " + archer + "\n" + EnumChatFormatting.BLUE + " Tank Level: " + tank + "\n\n" + - EnumChatFormatting.WHITE + " Secrets Found: " + secrets + "\n\n"); + EnumChatFormatting.WHITE + " Secrets Found: " + NumberFormat.getIntegerInstance(Locale.US).format(secrets) + "\n\n"); StringBuilder completionsHoverString = new StringBuilder(); for (int i = 0; i <= highestFloor; i++) { diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 30e8249..c9021f7 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -252,10 +252,10 @@ public class Utils { xpAdded += dungeonsXPPerLevel[i]; if (xp < xpAdded) { double level = (i - 1) + (xp - (xpAdded - dungeonsXPPerLevel[i])) / dungeonsXPPerLevel[i]; - return (double) Math.round(level * 100) / 100; + return (double) Math.round(level * 100D) / 100; } } - return 50D; + return 50D + MathHelper.clamp_double(Math.round((xp - 569809640D) / 200000000D * 100D) / 100D, 0D, 49D); } public static int expertiseKillsLeft(int kills) { -- cgit From 036b0cf2f1115c73a49f4b81bfc53ee620a855c0 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Mon, 7 Mar 2022 13:47:42 -0500 Subject: Fix golden drag pet xp and change level 30-39 pet colour Change colour from FFC400 to 113CF2 --- src/main/java/me/Danker/commands/PetsCommand.java | 8 ++++++-- src/main/java/me/Danker/features/PetColours.java | 20 ++++++++++---------- src/main/java/me/Danker/handlers/ConfigHandler.java | 2 +- 3 files changed, 17 insertions(+), 13 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/PetsCommand.java b/src/main/java/me/Danker/commands/PetsCommand.java index e909fab..de3aed9 100644 --- a/src/main/java/me/Danker/commands/PetsCommand.java +++ b/src/main/java/me/Danker/commands/PetsCommand.java @@ -14,6 +14,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; import java.util.ArrayList; import java.util.List; @@ -82,7 +83,7 @@ public class PetsCommand extends CommandBase { } } - class Pet { + static class Pet { public Rarity rarity; public double xp; @@ -103,13 +104,16 @@ public class PetsCommand extends CommandBase { } } this.active = pet.get("active").getAsBoolean(); - this.name = Utils.capitalizeString(pet.get("type").getAsString());; + this.name = Utils.capitalizeString(pet.get("type").getAsString()); this.rarity = rarity; this.xp = pet.get("exp").getAsDouble(); } public String getStringToAdd() { int level = petXpToLevel(this.xp, this.rarity.name()); + if (this.name.equals("Golden Dragon") && this.xp > 25353230D) { + level = 100 + MathHelper.clamp_int((int) ((this.xp - 25353230) / 1886700) + 2, 0, 100); + } String messageToAdd = rarity.getChatColor() + " " + (this.active ? EnumChatFormatting.BOLD + ">>> " : "") + Utils.capitalizeString(this.rarity.name()) + (this.rarityBoosted ? " ⇑" : "") + " " + this.name + " (" + level + ")" + (this.active ? " <<<" : ""); diff --git a/src/main/java/me/Danker/features/PetColours.java b/src/main/java/me/Danker/features/PetColours.java index 0e219db..7192f07 100644 --- a/src/main/java/me/Danker/features/PetColours.java +++ b/src/main/java/me/Danker/features/PetColours.java @@ -37,25 +37,25 @@ public class PetColours { continue; int colour; int petLevel = Integer.parseInt(item.getDisplayName().substring(item.getDisplayName().indexOf(" ") + 1, item.getDisplayName().indexOf("]"))); - if (petLevel == 100) { + if (petLevel == 100 || petLevel == 200) { colour = PET_100; - } else if (petLevel >= 90) { + } else if ((petLevel < 100 && petLevel >= 90) || petLevel >= 190) { colour = PET_90_TO_99; - } else if (petLevel >= 80) { + } else if ((petLevel < 100 && petLevel >= 80) || petLevel >= 180) { colour = PET_80_TO_89; - } else if (petLevel >= 70) { + } else if ((petLevel < 100 && petLevel >= 70) || petLevel >= 170) { colour = PET_70_TO_79; - } else if (petLevel >= 60) { + } else if ((petLevel < 100 && petLevel >= 60) || petLevel >= 160) { colour = PET_60_TO_69; - } else if (petLevel >= 50) { + } else if ((petLevel < 100 && petLevel >= 50) || petLevel >= 150) { colour = PET_50_TO_59; - } else if (petLevel >= 40) { + } else if ((petLevel < 100 && petLevel >= 40) || petLevel >= 140) { colour = PET_40_TO_49; - } else if (petLevel >= 30) { + } else if ((petLevel < 100 && petLevel >= 30) || petLevel >= 130) { colour = PET_30_TO_39; - } else if (petLevel >= 20) { + } else if ((petLevel < 100 && petLevel >= 20) || petLevel >= 120) { colour = PET_20_TO_29; - } else if (petLevel >= 10) { + } else if ((petLevel < 100 && petLevel >= 10) || petLevel >= 110) { colour = PET_10_TO_19; } else { colour = PET_1_TO_9; diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 9365b63..25988a6 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -638,7 +638,7 @@ public class ConfigHandler { PetColours.PET_1_TO_9 = initInt("colors", "pet1To9", 0x999999); // Grey PetColours.PET_10_TO_19 = initInt("colors", "pet10To19", 0xD62440); // Red PetColours.PET_20_TO_29 = initInt("colors", "pet20To29", 0xEF5230); // Orange - PetColours.PET_30_TO_39 = initInt("colors", "pet30To39", 0xFFC400); // Yellow + PetColours.PET_30_TO_39 = initInt("colors", "pet30To39", 0x113CF2); // Dark Blue PetColours.PET_40_TO_49 = initInt("colors", "pet40To49", 0x0EAC35); // Green PetColours.PET_50_TO_59 = initInt("colors", "pet50To59", 0x008AD8); // Light Blue PetColours.PET_60_TO_69 = initInt("colors", "pet60To69", 0x7E4FC6); // Purple -- cgit From 2f07d40afa0403e68cf44745048def632a476dac Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Mon, 7 Mar 2022 13:52:17 -0500 Subject: Fix missing values in /resetloot --- .../java/me/Danker/commands/ResetLootCommand.java | 35 ++++++++++++++++++---- 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/ResetLootCommand.java b/src/main/java/me/Danker/commands/ResetLootCommand.java index cca7dda..f1d2828 100644 --- a/src/main/java/me/Danker/commands/ResetLootCommand.java +++ b/src/main/java/me/Danker/commands/ResetLootCommand.java @@ -238,12 +238,12 @@ public class ResetLootCommand extends CommandBase { FishingTracker.werewolfsSession = 0; FishingTracker.phantomFishersSession = 0; FishingTracker.grimReapersSession = 0; - FishingTracker.waterWorms = 0; - FishingTracker.poisonedWaterWorms = 0; - FishingTracker.flamingWorms = 0; - FishingTracker.lavaBlazes = 0; - FishingTracker.lavaPigmen = 0; - FishingTracker.zombieMiners = 0; + FishingTracker.waterWormsSession = 0; + FishingTracker.poisonedWaterWormsSession = 0; + FishingTracker.flamingWormsSession = 0; + FishingTracker.lavaBlazesSession = 0; + FishingTracker.lavaPigmenSession = 0; + FishingTracker.zombieMinersSession = 0; ConfigHandler.deleteCategory("fishing"); ConfigHandler.reloadConfig(); } @@ -327,6 +327,29 @@ public class ResetLootCommand extends CommandBase { CatacombsTracker.f7RerollsSession = 0; CatacombsTracker.f7CoinsSpentSession = 0; CatacombsTracker.f7TimeSpentSession = 0; + CatacombsTracker.m1SSession = 0; + CatacombsTracker.m1SPlusSession = 0; + CatacombsTracker.m2SSession = 0; + CatacombsTracker.m2SPlusSession = 0; + CatacombsTracker.m3SSession = 0; + CatacombsTracker.m3SPlusSession = 0; + CatacombsTracker.m4SSession = 0; + CatacombsTracker.m4SPlusSession = 0; + CatacombsTracker.m5SSession = 0; + CatacombsTracker.m5SPlusSession = 0; + CatacombsTracker.m6SSession = 0; + CatacombsTracker.m6SPlusSession = 0; + CatacombsTracker.m7SSession = 0; + CatacombsTracker.m7SPlusSession = 0; + CatacombsTracker.firstStarsSession = 0; + CatacombsTracker.secondStarsSession = 0; + CatacombsTracker.thirdStarsSession = 0; + CatacombsTracker.fourthStarsSession = 0; + CatacombsTracker.fifthStarsSession = 0; + CatacombsTracker.darkClaymoresSession = 0; + CatacombsTracker.masterRerollsSession = 0; + CatacombsTracker.masterCoinsSpentSession = 0; + CatacombsTracker.masterTimeSpentSession = 0; ConfigHandler.deleteCategory("catacombs"); ConfigHandler.reloadConfig(); } -- cgit From 590d195f2e08f794133b725b64cd69cd58b31ee7 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Mon, 7 Mar 2022 14:03:28 -0500 Subject: Fix /loot catacombs mm giving error --- src/main/java/me/Danker/commands/LootCommand.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/LootCommand.java b/src/main/java/me/Danker/commands/LootCommand.java index 937207d..bfef29d 100644 --- a/src/main/java/me/Danker/commands/LootCommand.java +++ b/src/main/java/me/Danker/commands/LootCommand.java @@ -890,8 +890,9 @@ public class LootCommand extends CommandBase { EnumChatFormatting.AQUA + " Coins Spent:" + nf.format(CatacombsTracker.masterCoinsSpent) + "\n" + EnumChatFormatting.AQUA + " Time Spent:" + nf.format(CatacombsTracker.masterTimeSpent) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); + break; default: - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: /loot catacombs ")); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: /loot catacombs ")); } break; default: -- cgit From 21ec0b98fff64031c1e42e00487fd31463d5f26d Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 10 Mar 2022 21:01:28 -0500 Subject: Add Necron Dye to MM tracker Also fix /loot catacombs mm issues --- src/main/java/me/Danker/commands/LootCommand.java | 98 +++++++++++----------- .../me/Danker/features/loot/CatacombsTracker.java | 6 ++ .../java/me/Danker/features/loot/LootDisplay.java | 4 + .../java/me/Danker/handlers/ConfigHandler.java | 1 + 4 files changed, 61 insertions(+), 48 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/LootCommand.java b/src/main/java/me/Danker/commands/LootCommand.java index bfef29d..5edc5f4 100644 --- a/src/main/java/me/Danker/commands/LootCommand.java +++ b/src/main/java/me/Danker/commands/LootCommand.java @@ -834,61 +834,63 @@ public class LootCommand extends CommandBase { if (showSession) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs MM Summary (Current Session):\n" + - EnumChatFormatting.GOLD + " Master One S Runs:" + nf.format(CatacombsTracker.m1SSession) + "\n" + - EnumChatFormatting.GOLD + " Master One S+ Runs:" + nf.format(CatacombsTracker.m1SPlusSession) + "\n" + - EnumChatFormatting.GOLD + " Master Two S Runs:" + nf.format(CatacombsTracker.m2SSession) + "\n" + - EnumChatFormatting.GOLD + " Master Two S+ Runs:" + nf.format(CatacombsTracker.m2SPlusSession) + "\n" + - EnumChatFormatting.GOLD + " Master Three S Runs:" + nf.format(CatacombsTracker.m3SSession) + "\n" + - EnumChatFormatting.GOLD + " Master Three S+ Runs:" + nf.format(CatacombsTracker.m3SPlusSession) + "\n" + - EnumChatFormatting.GOLD + " Master Four S Runs:" + nf.format(CatacombsTracker.m4SSession) + "\n" + - EnumChatFormatting.GOLD + " Master Four S+ Runs:" + nf.format(CatacombsTracker.m4SPlusSession) + "\n" + - EnumChatFormatting.GOLD + " Master Five S Runs:" + nf.format(CatacombsTracker.m5SSession) + "\n" + - EnumChatFormatting.GOLD + " Master Five S+ Runs:" + nf.format(CatacombsTracker.m5SPlusSession) + "\n" + - EnumChatFormatting.GOLD + " Master Six S Runs:" + nf.format(CatacombsTracker.m6SSession) + "\n" + - EnumChatFormatting.GOLD + " Master Six S+ Runs:" + nf.format(CatacombsTracker.m6SPlusSession) + "\n" + - EnumChatFormatting.GOLD + " Master Seven S Runs:" + nf.format(CatacombsTracker.m7SSession) + "\n" + - EnumChatFormatting.GOLD + " Master Seven S+ Runs:" + nf.format(CatacombsTracker.m7SPlusSession) + "\n" + - EnumChatFormatting.GOLD + " Recombobulators:" + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books:" + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " 1st Master Stars:" + nf.format(CatacombsTracker.firstStarsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " 2nd Master Stars:" + nf.format(CatacombsTracker.secondStarsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " 3rd Master Stars:" + nf.format(CatacombsTracker.thirdStarsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " 4th Master Stars:" + nf.format(CatacombsTracker.fourthStarsSession) + "\n" + - EnumChatFormatting.DARK_PURPLE + " 5th Master Stars:" + nf.format(CatacombsTracker.fifthStarsSession) + "\n" + + EnumChatFormatting.GOLD + " Master One S Runs: " + nf.format(CatacombsTracker.m1SSession) + "\n" + + EnumChatFormatting.GOLD + " Master One S+ Runs: " + nf.format(CatacombsTracker.m1SPlusSession) + "\n" + + EnumChatFormatting.GOLD + " Master Two S Runs: " + nf.format(CatacombsTracker.m2SSession) + "\n" + + EnumChatFormatting.GOLD + " Master Two S+ Runs: " + nf.format(CatacombsTracker.m2SPlusSession) + "\n" + + EnumChatFormatting.GOLD + " Master Three S Runs: " + nf.format(CatacombsTracker.m3SSession) + "\n" + + EnumChatFormatting.GOLD + " Master Three S+ Runs: " + nf.format(CatacombsTracker.m3SPlusSession) + "\n" + + EnumChatFormatting.GOLD + " Master Four S Runs: " + nf.format(CatacombsTracker.m4SSession) + "\n" + + EnumChatFormatting.GOLD + " Master Four S+ Runs: " + nf.format(CatacombsTracker.m4SPlusSession) + "\n" + + EnumChatFormatting.GOLD + " Master Five S Runs: " + nf.format(CatacombsTracker.m5SSession) + "\n" + + EnumChatFormatting.GOLD + " Master Five S+ Runs: " + nf.format(CatacombsTracker.m5SPlusSession) + "\n" + + EnumChatFormatting.GOLD + " Master Six S Runs: " + nf.format(CatacombsTracker.m6SSession) + "\n" + + EnumChatFormatting.GOLD + " Master Six S+ Runs: " + nf.format(CatacombsTracker.m6SPlusSession) + "\n" + + EnumChatFormatting.GOLD + " Master Seven S Runs: " + nf.format(CatacombsTracker.m7SSession) + "\n" + + EnumChatFormatting.GOLD + " Master Seven S+ Runs: " + nf.format(CatacombsTracker.m7SPlusSession) + "\n" + + EnumChatFormatting.GOLD + " Recombobulators: " + nf.format(CatacombsTracker.recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " 1st Master Stars: " + nf.format(CatacombsTracker.firstStarsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " 2nd Master Stars: " + nf.format(CatacombsTracker.secondStarsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " 3rd Master Stars: " + nf.format(CatacombsTracker.thirdStarsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " 4th Master Stars: " + nf.format(CatacombsTracker.fourthStarsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + " 5th Master Stars: " + nf.format(CatacombsTracker.fifthStarsSession) + "\n" + + EnumChatFormatting.GOLD + " Necron Dyes: " + nf.format(CatacombsTracker.necronDyesSession) + "\n" + EnumChatFormatting.GOLD + " Dark Claymores: " + nf.format(CatacombsTracker.darkClaymoresSession) + "\n" + - EnumChatFormatting.WHITE + " Rerolls:" + nf.format(CatacombsTracker.masterRerollsSession) + "\n" + - EnumChatFormatting.AQUA + " Coins Spent:" + nf.format(CatacombsTracker.masterCoinsSpentSession) + "\n" + - EnumChatFormatting.AQUA + " Time Spent:" + nf.format(CatacombsTracker.masterTimeSpentSession) + "\n" + + EnumChatFormatting.WHITE + " Rerolls: " + nf.format(CatacombsTracker.masterRerollsSession) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(CatacombsTracker.masterCoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, CatacombsTracker.masterTimeSpentSession) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); return; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Catacombs MM Summary:\n" + - EnumChatFormatting.GOLD + " Master One S Runs:" + nf.format(CatacombsTracker.m1S) + "\n" + - EnumChatFormatting.GOLD + " Master One S+ Runs:" + nf.format(CatacombsTracker.m1SPlus) + "\n" + - EnumChatFormatting.GOLD + " Master Two S Runs:" + nf.format(CatacombsTracker.m2S) + "\n" + - EnumChatFormatting.GOLD + " Master Two S+ Runs:" + nf.format(CatacombsTracker.m2SPlus) + "\n" + - EnumChatFormatting.GOLD + " Master Three S Runs:" + nf.format(CatacombsTracker.m3S) + "\n" + - EnumChatFormatting.GOLD + " Master Three S+ Runs:" + nf.format(CatacombsTracker.m3SPlus) + "\n" + - EnumChatFormatting.GOLD + " Master Four S Runs:" + nf.format(CatacombsTracker.m4S) + "\n" + - EnumChatFormatting.GOLD + " Master Four S+ Runs:" + nf.format(CatacombsTracker.m4SPlus) + "\n" + - EnumChatFormatting.GOLD + " Master Five S Runs:" + nf.format(CatacombsTracker.m5S) + "\n" + - EnumChatFormatting.GOLD + " Master Five S+ Runs:" + nf.format(CatacombsTracker.m5SPlus) + "\n" + - EnumChatFormatting.GOLD + " Master Six S Runs:" + nf.format(CatacombsTracker.m6S) + "\n" + - EnumChatFormatting.GOLD + " Master Six S+ Runs:" + nf.format(CatacombsTracker.m6SPlus) + "\n" + - EnumChatFormatting.GOLD + " Master Seven S Runs:" + nf.format(CatacombsTracker.m7S) + "\n" + - EnumChatFormatting.GOLD + " Master Seven S+ Runs:" + nf.format(CatacombsTracker.m7SPlus) + "\n" + - EnumChatFormatting.GOLD + " Recombobulators:" + nf.format(CatacombsTracker.recombobulators) + "\n" + - EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books:" + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + - EnumChatFormatting.DARK_PURPLE + " 1st Master Stars:" + nf.format(CatacombsTracker.firstStars) + "\n" + - EnumChatFormatting.DARK_PURPLE + " 2nd Master Stars:" + nf.format(CatacombsTracker.secondStars) + "\n" + - EnumChatFormatting.DARK_PURPLE + " 3rd Master Stars:" + nf.format(CatacombsTracker.thirdStars) + "\n" + - EnumChatFormatting.DARK_PURPLE + " 4th Master Stars:" + nf.format(CatacombsTracker.fourthStars) + "\n" + - EnumChatFormatting.DARK_PURPLE + " 5th Master Stars:" + nf.format(CatacombsTracker.fifthStars) + "\n" + + EnumChatFormatting.GOLD + " Master One S Runs: " + nf.format(CatacombsTracker.m1S) + "\n" + + EnumChatFormatting.GOLD + " Master One S+ Runs: " + nf.format(CatacombsTracker.m1SPlus) + "\n" + + EnumChatFormatting.GOLD + " Master Two S Runs: " + nf.format(CatacombsTracker.m2S) + "\n" + + EnumChatFormatting.GOLD + " Master Two S+ Runs: " + nf.format(CatacombsTracker.m2SPlus) + "\n" + + EnumChatFormatting.GOLD + " Master Three S Runs: " + nf.format(CatacombsTracker.m3S) + "\n" + + EnumChatFormatting.GOLD + " Master Three S+ Runs: " + nf.format(CatacombsTracker.m3SPlus) + "\n" + + EnumChatFormatting.GOLD + " Master Four S Runs: " + nf.format(CatacombsTracker.m4S) + "\n" + + EnumChatFormatting.GOLD + " Master Four S+ Runs: " + nf.format(CatacombsTracker.m4SPlus) + "\n" + + EnumChatFormatting.GOLD + " Master Five S Runs: " + nf.format(CatacombsTracker.m5S) + "\n" + + EnumChatFormatting.GOLD + " Master Five S+ Runs: " + nf.format(CatacombsTracker.m5SPlus) + "\n" + + EnumChatFormatting.GOLD + " Master Six S Runs: " + nf.format(CatacombsTracker.m6S) + "\n" + + EnumChatFormatting.GOLD + " Master Six S+ Runs: " + nf.format(CatacombsTracker.m6SPlus) + "\n" + + EnumChatFormatting.GOLD + " Master Seven S Runs: " + nf.format(CatacombsTracker.m7S) + "\n" + + EnumChatFormatting.GOLD + " Master Seven S+ Runs: " + nf.format(CatacombsTracker.m7SPlus) + "\n" + + EnumChatFormatting.GOLD + " Recombobulators: " + nf.format(CatacombsTracker.recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + " Fuming Potato Books: " + nf.format(CatacombsTracker.fumingPotatoBooks) + "\n" + + EnumChatFormatting.DARK_PURPLE + " 1st Master Stars: " + nf.format(CatacombsTracker.firstStars) + "\n" + + EnumChatFormatting.DARK_PURPLE + " 2nd Master Stars: " + nf.format(CatacombsTracker.secondStars) + "\n" + + EnumChatFormatting.DARK_PURPLE + " 3rd Master Stars: " + nf.format(CatacombsTracker.thirdStars) + "\n" + + EnumChatFormatting.DARK_PURPLE + " 4th Master Stars: " + nf.format(CatacombsTracker.fourthStars) + "\n" + + EnumChatFormatting.DARK_PURPLE + " 5th Master Stars: " + nf.format(CatacombsTracker.fifthStars) + "\n" + + EnumChatFormatting.GOLD + " Necron Dyes: " + nf.format(CatacombsTracker.necronDyes) + "\n" + EnumChatFormatting.GOLD + " Dark Claymores: " + nf.format(CatacombsTracker.darkClaymores) + "\n" + - EnumChatFormatting.WHITE + " Rerolls:" + nf.format(CatacombsTracker.masterRerolls) + "\n" + - EnumChatFormatting.AQUA + " Coins Spent:" + nf.format(CatacombsTracker.masterCoinsSpent) + "\n" + - EnumChatFormatting.AQUA + " Time Spent:" + nf.format(CatacombsTracker.masterTimeSpent) + "\n" + + EnumChatFormatting.WHITE + " Rerolls: " + nf.format(CatacombsTracker.masterRerolls) + "\n" + + EnumChatFormatting.AQUA + " Coins Spent: " + Utils.getMoneySpent(CatacombsTracker.masterCoinsSpent) + "\n" + + EnumChatFormatting.AQUA + " Time Spent: " + Utils.getTimeBetween(0, CatacombsTracker.masterTimeSpent) + "\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " -------------------")); break; default: diff --git a/src/main/java/me/Danker/features/loot/CatacombsTracker.java b/src/main/java/me/Danker/features/loot/CatacombsTracker.java index 8d50ab3..634c7ad 100644 --- a/src/main/java/me/Danker/features/loot/CatacombsTracker.java +++ b/src/main/java/me/Danker/features/loot/CatacombsTracker.java @@ -108,6 +108,7 @@ public class CatacombsTracker { public static int thirdStars; public static int fourthStars; public static int fifthStars; + public static int necronDyes; public static int darkClaymores; public static int masterRerolls; public static double masterCoinsSpent; @@ -207,6 +208,7 @@ public class CatacombsTracker { public static int thirdStarsSession = 0; public static int fourthStarsSession = 0; public static int fifthStarsSession = 0; + public static int necronDyesSession = 0; public static int darkClaymoresSession = 0; public static int masterRerollsSession = 0; public static double masterCoinsSpentSession = 0; @@ -554,6 +556,10 @@ public class CatacombsTracker { darkClaymores++; darkClaymoresSession++; ConfigHandler.writeIntConfig("catacombs", "darkClaymore", darkClaymores); + } else if (message.contains("Necron Dye")) { + necronDyes++; + necronDyesSession++; + ConfigHandler.writeIntConfig("catacombs", "necronDye", necronDyes); } } diff --git a/src/main/java/me/Danker/features/loot/LootDisplay.java b/src/main/java/me/Danker/features/loot/LootDisplay.java index 16e64f6..aabdbd9 100644 --- a/src/main/java/me/Danker/features/loot/LootDisplay.java +++ b/src/main/java/me/Danker/features/loot/LootDisplay.java @@ -1151,6 +1151,7 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + "3rd Master Stars:\n" + EnumChatFormatting.DARK_PURPLE + "4th Master Stars:\n" + EnumChatFormatting.DARK_PURPLE + "5th Master Stars:\n" + + EnumChatFormatting.GOLD + "Necron Dyes:\n" + EnumChatFormatting.GOLD + "Dark Claymores:\n" + EnumChatFormatting.WHITE + "Rerolls:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + @@ -1163,6 +1164,7 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.thirdStars) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fourthStars) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fifthStars) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.necronDyes) + "\n" + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.darkClaymores) + "\n" + EnumChatFormatting.WHITE + nf.format(CatacombsTracker.masterRerolls) + "\n" + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.masterCoinsSpent) + "\n" + @@ -1209,6 +1211,7 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + "3rd Master Stars:\n" + EnumChatFormatting.DARK_PURPLE + "4th Master Stars:\n" + EnumChatFormatting.DARK_PURPLE + "5th Master Stars:\n" + + EnumChatFormatting.GOLD + "Necron Dyes:\n" + EnumChatFormatting.GOLD + "Dark Claymores:\n" + EnumChatFormatting.WHITE + "Rerolls:\n" + EnumChatFormatting.AQUA + "Coins Spent:\n" + @@ -1221,6 +1224,7 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.thirdStarsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fourthStarsSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(CatacombsTracker.fifthStarsSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.necronDyesSession) + "\n" + EnumChatFormatting.GOLD + nf.format(CatacombsTracker.darkClaymoresSession) + "\n" + EnumChatFormatting.WHITE + nf.format(CatacombsTracker.masterRerollsSession) + "\n" + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.masterCoinsSpentSession) + "\n" + diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 25988a6..dc57e91 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -534,6 +534,7 @@ public class ConfigHandler { CatacombsTracker.thirdStars = initInt("catacombs", "thirdStar", 0); CatacombsTracker.fourthStars = initInt("catacombs", "fourthStar", 0); CatacombsTracker.fifthStars = initInt("catacombs", "fifthStar", 0); + CatacombsTracker.necronDyes = initInt("catacombs", "necronDye", 0); CatacombsTracker.darkClaymores = initInt("catacombs", "darkClaymore", 0); CatacombsTracker.masterRerolls = initInt("catacombs", "masterRerolls", 0); CatacombsTracker.masterCoinsSpent = initDouble("catacombs", "masterCoins", 0); -- cgit From ccd38690657b767d06ccf2771183738b0a35654d Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 10 Mar 2022 21:08:52 -0500 Subject: Prevent crash from playing non .wav music --- src/main/java/me/Danker/features/CustomMusic.java | 25 +++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java index 1f609cc..5153f91 100644 --- a/src/main/java/me/Danker/features/CustomMusic.java +++ b/src/main/java/me/Danker/features/CustomMusic.java @@ -229,14 +229,23 @@ public class CustomMusic { public void start() throws UnsupportedAudioFileException, LineUnavailableException, IOException { - if (music == null) music = AudioSystem.getClip(); - if (!music.isRunning()) { - reset(); - shuffle(); - setVolume(volume); - cancelNotes = true; - music.setMicrosecondPosition(0); - music.start(); + try { + if (music == null) music = AudioSystem.getClip(); + if (!music.isRunning()) { + reset(); + shuffle(); + setVolume(volume); + cancelNotes = true; + music.setMicrosecondPosition(0); + music.start(); + } + } catch (UnsupportedAudioFileException ex) { + ex.printStackTrace(); + + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + if (player != null) { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Attempted to play non .wav file. Please use a .wav converter instead of renaming the file.")); + } } } -- cgit From 5c1ab9451fc3ef7054f2718719fcf0fbe60ada8b Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 15 Mar 2022 16:23:12 -0400 Subject: Fix alerts not saving when editing --- src/main/java/me/Danker/gui/alerts/AlertActionGui.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/gui/alerts/AlertActionGui.java b/src/main/java/me/Danker/gui/alerts/AlertActionGui.java index 034ad79..02ef186 100644 --- a/src/main/java/me/Danker/gui/alerts/AlertActionGui.java +++ b/src/main/java/me/Danker/gui/alerts/AlertActionGui.java @@ -79,6 +79,7 @@ public class AlertActionGui extends GuiScreen { return; } Alerts.alerts.set(id, alert); + Alerts.saveToFile(); } } -- cgit From 165844ad2624dcdff4517b94f300329cf3a3bf70 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 17 Mar 2022 23:42:19 -0400 Subject: Fix NPE with chat waypoints --- src/main/java/me/Danker/features/CrystalHollowWaypoints.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/CrystalHollowWaypoints.java b/src/main/java/me/Danker/features/CrystalHollowWaypoints.java index 5b8d665..1ce4150 100644 --- a/src/main/java/me/Danker/features/CrystalHollowWaypoints.java +++ b/src/main/java/me/Danker/features/CrystalHollowWaypoints.java @@ -115,6 +115,8 @@ public class CrystalHollowWaypoints { String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); EntityPlayer player = Minecraft.getMinecraft().thePlayer; + if (player == null) return; + /* examples $SBECHWP:Mines of Divan@-673,117,426 $SBECHWP:Khazad-dûm@-292,63,281\nFairy Grotto@-216,110,400\njungle temple@-525,110,395\nJungle Temple@-493,101,425\nMines of Divan@-673,117,426 -- cgit From 71f48e9cf2f250a2ddf5444ccce5d0ebd6487e4a Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sun, 20 Mar 2022 22:42:22 -0400 Subject: Add hiding player armour --- README.md | 2 + src/main/java/me/Danker/DankersSkyblockMod.java | 1 + .../java/me/Danker/commands/ToggleCommand.java | 1 + .../java/me/Danker/features/HidePlayerArmour.java | 51 ++++++++++++++++++++++ src/main/java/me/Danker/gui/DankerGui.java | 8 ++++ .../java/me/Danker/handlers/ConfigHandler.java | 1 + 6 files changed, 64 insertions(+) create mode 100644 src/main/java/me/Danker/features/HidePlayerArmour.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 4ae2a40..a04bd50 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,7 @@ Discord Server: https://discord.gg/QsEkNQS - Ability cooldowns display - Custom alerts based on chat - Predicted dungeon score display +- Hide player armour ## Commands - /dhelp - Returns this message in-game. @@ -148,3 +149,4 @@ Software | License [HyChat](https://github.com/Moulberry/Hychat) | [Creative Commons Public License](https://github.com/Moulberry/Hychat/blob/master/LICENSE) [SkyblockCatia](https://github.com/SteveKunG/SkyBlockcatia) | [MIT License](https://github.com/SteveKunG/SkyBlockcatia/blob/1.8.9/LICENSE.md) [MatterOverdrive (Legacy Edition)](https://bitbucket.org/hrznstudio/mo-legacy-edition/) | [GNU General Public License](https://bitbucket.org/hrznstudio/mo-legacy-edition/src/1.12.2/LICENSE.md) +[Hide Armour](https://github.com/Furgl/Hide-Armor/tree/1.15.2) | No License diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 02eeff4..353247d 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -131,6 +131,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new GolemSpawningAlert()); MinecraftForge.EVENT_BUS.register(new GpartyNotifications()); MinecraftForge.EVENT_BUS.register(new HidePetCandy()); + MinecraftForge.EVENT_BUS.register(new HidePlayerArmour()); MinecraftForge.EVENT_BUS.register(new HideTooltipsInExperiments()); MinecraftForge.EVENT_BUS.register(new HighlightSkeletonMasters()); MinecraftForge.EVENT_BUS.register(new IceWalkSolver()); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 04770aa..2281a0a 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -48,6 +48,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean abilityCooldowns; public static boolean alerts; public static boolean dungeonScore; + public static boolean hideArmour; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; diff --git a/src/main/java/me/Danker/features/HidePlayerArmour.java b/src/main/java/me/Danker/features/HidePlayerArmour.java new file mode 100644 index 0000000..8cc47d0 --- /dev/null +++ b/src/main/java/me/Danker/features/HidePlayerArmour.java @@ -0,0 +1,51 @@ +package me.Danker.features; + +import me.Danker.commands.ToggleCommand; +import me.Danker.utils.Utils; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.client.event.RenderLivingEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.util.ArrayList; +import java.util.List; + +public class HidePlayerArmour { + + List armour = new ArrayList<>(); + + @SubscribeEvent + public void onRenderLivingPre(RenderLivingEvent.Pre event) { + if (ToggleCommand.hideArmour && Utils.inSkyblock) { + if (event.entity instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) event.entity; + + for (int i = 0; i < player.inventory.armorInventory.length; i++) { + if (player.inventory.armorInventory[i] != null) { + armour.add(player.inventory.armorInventory[i].copy()); + player.inventory.armorInventory[i] = null; + } else { + armour.add(null); + } + } + } + } + } + + @SubscribeEvent + public void onRenderLivingPost(RenderLivingEvent.Post event) { + if (ToggleCommand.hideArmour && Utils.inSkyblock) { + if (event.entity instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) event.entity; + + for (int i = 0; i < player.inventory.armorInventory.length; i++) { + player.inventory.armorInventory[i] = armour.get(i); + } + + armour.clear(); + } + } + } + +} diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index a6f76b1..fb84b0a 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -1,5 +1,6 @@ package me.Danker.gui; +import jdk.nashorn.internal.runtime.regexp.joni.Config; import me.Danker.commands.ToggleCommand; import me.Danker.gui.alerts.AlertsGui; import me.Danker.gui.buttons.FeatureButton; @@ -85,6 +86,7 @@ public class DankerGui extends GuiScreen { private GuiButton necronNotifications; private GuiButton bonzoTimer; private GuiButton dungeonScore; + private GuiButton hideArmour; // Chat Messages private GuiButton sceptreMessages; private GuiButton midasStaffMessages; @@ -175,6 +177,7 @@ public class DankerGui extends GuiScreen { autoAcceptReparty = new FeatureButton("Auto Accept Reparty: " + Utils.getColouredBoolean(ToggleCommand.autoAcceptReparty), "Automatically rejoins parties when disbanded and invited."); abilityCooldown = new FeatureButton("Ability Cooldowns: " + Utils.getColouredBoolean(ToggleCommand.abilityCooldowns), "Displays ability cooldowns."); dungeonScore = new FeatureButton("Dungeon Score Display: " + Utils.getColouredBoolean(ToggleCommand.dungeonScore), "Displays an estimated dungeon score with secrets."); + hideArmour = new FeatureButton("Hide Player Armour: " + Utils.getColouredBoolean(ToggleCommand.hideArmour), "Makes player armour invisible, showing their skin."); allButtons.clear(); allButtons.add(changeDisplay); @@ -231,6 +234,7 @@ public class DankerGui extends GuiScreen { allButtons.add(autoAcceptReparty); allButtons.add(abilityCooldown); allButtons.add(dungeonScore); + allButtons.add(hideArmour); search.setText(initSearchText); search.setVisible(true); @@ -510,6 +514,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.masterSPlusDisplay = !ToggleCommand.masterSPlusDisplay; ConfigHandler.writeBooleanConfig("toggles", "MasterSPlusDisplay", ToggleCommand.masterSPlusDisplay); masterSPlusDisplay.displayString = "Display MM S+ Runs: " + Utils.getColouredBoolean(ToggleCommand.masterSPlusDisplay); + } else if (button == hideArmour) { + ToggleCommand.hideArmour = !ToggleCommand.hideArmour; + ConfigHandler.writeBooleanConfig("toggles", "HideArmour", ToggleCommand.hideArmour); + hideArmour.displayString = "Hide Player Armour: " + Utils.getColouredBoolean(ToggleCommand.hideArmour); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index dc57e91..ed28704 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -241,6 +241,7 @@ public class ConfigHandler { ToggleCommand.autoSkillTrackerToggled = initBoolean("toggles", "AutoSkillTracker", false); ToggleCommand.alerts = initBoolean("toggles", "Alerts", false); ToggleCommand.dungeonScore = initBoolean("toggles", "DungeonScore", false); + ToggleCommand.hideArmour = initBoolean("toggles", "HideArmour", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); -- cgit From dce1af627f2f9f10bb21f83b976c2b6008975fdf Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 22 Mar 2022 19:59:22 -0400 Subject: Add new f7 terminals Also remove maze terminal --- src/main/java/me/Danker/DankersSkyblockMod.java | 1 + .../java/me/Danker/commands/ToggleCommand.java | 1 + .../me/Danker/features/AutoSwapToPickBlock.java | 25 ++-- .../puzzlesolvers/BlockWrongTerminalClicks.java | 57 +++----- .../features/puzzlesolvers/SameColourSolver.java | 152 +++++++++++++++++++++ src/main/java/me/Danker/gui/PuzzleSolversGui.java | 13 +- .../java/me/Danker/handlers/ConfigHandler.java | 1 + src/main/java/me/Danker/utils/RenderUtils.java | 16 +++ 8 files changed, 213 insertions(+), 53 deletions(-) create mode 100644 src/main/java/me/Danker/features/puzzlesolvers/SameColourSolver.java (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 353247d..39653ca 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -142,6 +142,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new NotifySlayerSlain()); MinecraftForge.EVENT_BUS.register(new PetColours()); MinecraftForge.EVENT_BUS.register(new Reparty()); + MinecraftForge.EVENT_BUS.register(new SameColourSolver()); MinecraftForge.EVENT_BUS.register(new SelectAllColourSolver()); MinecraftForge.EVENT_BUS.register(new SilverfishSolver()); MinecraftForge.EVENT_BUS.register(new Skill50Display()); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 2281a0a..8bce0b3 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -82,6 +82,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean startsWithToggled; public static boolean selectAllToggled; public static boolean clickInOrderToggled; + public static boolean sameColourToggled; public static boolean blockWrongTerminalClicksToggled; public static boolean itemFrameOnSeaLanternsToggled; // Experiments diff --git a/src/main/java/me/Danker/features/AutoSwapToPickBlock.java b/src/main/java/me/Danker/features/AutoSwapToPickBlock.java index ccabbce..9a4c839 100644 --- a/src/main/java/me/Danker/features/AutoSwapToPickBlock.java +++ b/src/main/java/me/Danker/features/AutoSwapToPickBlock.java @@ -1,6 +1,7 @@ package me.Danker.features; import me.Danker.commands.ToggleCommand; +import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.client.settings.GameSettings; @@ -17,6 +18,8 @@ public class AutoSwapToPickBlock { @SubscribeEvent public void onGuiOpen(GuiOpenEvent event) { + if (!ToggleCommand.swapToPickBlockToggled || !Utils.inSkyblock) return; + Minecraft mc = Minecraft.getMinecraft(); GameSettings gameSettings = mc.gameSettings; if (event.gui instanceof GuiChest) { @@ -25,18 +28,16 @@ public class AutoSwapToPickBlock { IInventory inventory = ((ContainerChest) containerChest).getLowerChestInventory(); String inventoryName = inventory.getDisplayName().getUnformattedText(); - if (ToggleCommand.swapToPickBlockToggled) { - if (inventoryName.startsWith("Chronomatron (") || inventoryName.startsWith("Superpairs (") || inventoryName.startsWith("Ultrasequencer (") || inventoryName.startsWith("What starts with:") || inventoryName.startsWith("Select all the") || inventoryName.startsWith("Navigate the maze!") || inventoryName.startsWith("Correct all the panes!") || inventoryName.startsWith("Click in order!") || inventoryName.startsWith("Harp -")) { - if (!pickBlockBindSwapped) { - pickBlockBind = gameSettings.keyBindPickBlock.getKeyCode(); - gameSettings.keyBindPickBlock.setKeyCode(-100); - pickBlockBindSwapped = true; - } - } else { - if (pickBlockBindSwapped) { - gameSettings.keyBindPickBlock.setKeyCode(pickBlockBind); - pickBlockBindSwapped = false; - } + if (inventoryName.startsWith("Chronomatron (") || inventoryName.startsWith("Superpairs (") || inventoryName.startsWith("Ultrasequencer (") || inventoryName.startsWith("What starts with:") || inventoryName.startsWith("Select all the") || inventoryName.startsWith("Change all to same color!") || inventoryName.startsWith("Correct all the panes!") || inventoryName.startsWith("Click in order!") || inventoryName.startsWith("Click the button on time!") || inventoryName.startsWith("Harp -")) { + if (!pickBlockBindSwapped) { + pickBlockBind = gameSettings.keyBindPickBlock.getKeyCode(); + gameSettings.keyBindPickBlock.setKeyCode(-100); + pickBlockBindSwapped = true; + } + } else { + if (pickBlockBindSwapped) { + gameSettings.keyBindPickBlock.setKeyCode(pickBlockBind); + pickBlockBindSwapped = false; } } } diff --git a/src/main/java/me/Danker/features/puzzlesolvers/BlockWrongTerminalClicks.java b/src/main/java/me/Danker/features/puzzlesolvers/BlockWrongTerminalClicks.java index 5176e8b..7f76059 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/BlockWrongTerminalClicks.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/BlockWrongTerminalClicks.java @@ -30,44 +30,6 @@ public class BlockWrongTerminalClicks { switch (inventoryName) { case "Correct all the panes!": shouldCancel = !StringUtils.stripControlCodes(item.getDisplayName()).startsWith("Off"); - break; - case "Navigate the maze!": - if (item.getItem() != Item.getItemFromBlock(Blocks.stained_glass_pane)) { - shouldCancel = true; - break; - } - - if (item.getItemDamage() != 0) { - shouldCancel = true; - break; - } - - boolean isValid = false; - - int slotIndex = slot.getSlotIndex(); - - if (slotIndex % 9 != 8 && slotIndex != 53) { - ItemStack itemStack = inventory.getStackInSlot(slotIndex + 1); - if (itemStack != null && itemStack.getItemDamage() == 5) isValid = true; - } - - if (!isValid && slotIndex % 9 != 0 && slotIndex != 0) { - ItemStack itemStack = inventory.getStackInSlot(slotIndex - 1); - if (itemStack != null && itemStack.getItemDamage() == 5) isValid = true; - } - - if (!isValid && slotIndex <= 44) { - ItemStack itemStack = inventory.getStackInSlot(slotIndex + 9); - if (itemStack != null && itemStack.getItemDamage() == 5) isValid = true; - } - - if (!isValid && slotIndex >= 9) { - ItemStack itemStack = inventory.getStackInSlot(slotIndex - 9); - if (itemStack != null && itemStack.getItemDamage() == 5) isValid = true; - } - - shouldCancel = !isValid; - break; case "Click in order!": @@ -87,6 +49,25 @@ public class BlockWrongTerminalClicks { if (needed == 0) break; shouldCancel = needed != -1 && item.stackSize != needed; break; + case "Change all to same color!": + if (SameColourSolver.foundColour) { + shouldCancel = SameColourSolver.getDistance(item.getItemDamage(), SameColourSolver.correctColour) == 0; + } + break; + case "Click the button on time!": + int correctPos = -1; + for (int i = 0; i <= 50; i++) { + ItemStack stack = inventory.getStackInSlot(i); + if (stack == null || stack.getItem() != Item.getItemFromBlock(Blocks.stained_glass_pane)) continue; + + if (stack.getItemDamage() == 10) { + correctPos = i % 9; + } else if (stack.getItemDamage() == 5 && correctPos != -1) { + shouldCancel = i % 9 != correctPos; + break; + } + } + break; } if (!shouldCancel) { diff --git a/src/main/java/me/Danker/features/puzzlesolvers/SameColourSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/SameColourSolver.java new file mode 100644 index 0000000..9b0066b --- /dev/null +++ b/src/main/java/me/Danker/features/puzzlesolvers/SameColourSolver.java @@ -0,0 +1,152 @@ +package me.Danker.features.puzzlesolvers; + +import me.Danker.commands.ToggleCommand; +import me.Danker.events.GuiChestBackgroundDrawnEvent; +import me.Danker.utils.RenderUtils; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.inventory.GuiChest; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.ContainerChest; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.client.event.GuiOpenEvent; +import net.minecraftforge.event.entity.player.ItemTooltipEvent; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import org.apache.commons.lang3.math.NumberUtils; + +import java.util.Arrays; +import java.util.List; + +public class SameColourSolver { + + public static boolean foundColour = false; + public static int correctColour = 0; + static List colourLoop = Arrays.asList(14, 1, 4, 13, 11); + + @SubscribeEvent(priority = EventPriority.LOW) + public void onTooltipLow(ItemTooltipEvent event) { + if (!ToggleCommand.sameColourToggled || !Utils.inDungeons) return; + if (event.toolTip == null) return; + + Minecraft mc = Minecraft.getMinecraft(); + EntityPlayerSP player = mc.thePlayer; + + if (mc.currentScreen instanceof GuiChest) { + ContainerChest chest = (ContainerChest) player.openContainer; + IInventory inv = chest.getLowerChestInventory(); + String chestName = inv.getDisplayName().getUnformattedText(); + + if (chestName.equals("Change all to same color!")) { + event.toolTip.clear(); + } + } + } + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + if (!ToggleCommand.sameColourToggled || foundColour || !Utils.inDungeons) return; + if (event.phase != TickEvent.Phase.START) return; + + Minecraft mc = Minecraft.getMinecraft(); + EntityPlayerSP player = mc.thePlayer; + if (mc.currentScreen instanceof GuiChest) { + if (player == null) return; + ContainerChest chest = (ContainerChest) player.openContainer; + List invSlots = ((GuiChest) mc.currentScreen).inventorySlots.inventorySlots; + String chestName = chest.getLowerChestInventory().getDisplayName().getUnformattedText().trim(); + + if (chestName.equals("Change all to same color!")) { + int red = 0; + int orange = 0; + int yellow = 0; + int green = 0; + int blue = 0; + + for (int i = 12; i <= 32; i++) { + ItemStack stack = invSlots.get(i).getStack(); + if (stack == null || stack.getItem() != Item.getItemFromBlock(Blocks.stained_glass_pane)) continue; + if (stack.getItemDamage() == 7) continue; + + switch (stack.getItemDamage()) { + case 1: + orange++; + break; + case 4: + yellow++; + break; + case 11: + blue++; + break; + case 13: + green++; + break; + case 14: + red++; + break; + } + } + + int max = NumberUtils.max(new int[]{red, orange, yellow, green, blue}); + if (max == red) { + correctColour = 14; + } else if (max == orange) { + correctColour = 1; + } else if (max == yellow) { + correctColour = 4; + } else if (max == green) { + correctColour = 13; + } else { + correctColour = 11; + } + foundColour = true; + } + } + } + + @SubscribeEvent + public void onGuiRender(GuiChestBackgroundDrawnEvent event) { + if (!ToggleCommand.sameColourToggled || !foundColour || !Utils.inDungeons) return; + + if (event.displayName.equals("Change all to same color!")) { + int chestSize = event.chestSize; + List invSlots = event.slots; + + for (int i = 12; i <= 32; i++) { + Slot slot = invSlots.get(i); + ItemStack stack = slot.getStack(); + if (stack == null || stack.getItem() != Item.getItemFromBlock(Blocks.stained_glass_pane)) continue; + if (stack.getItemDamage() == 7) continue; + + int distance = getDistance(stack.getItemDamage(), correctColour); + if (distance == 0) continue; + + RenderUtils.drawTextOnSlot(chestSize, slot.xDisplayPosition, slot.yDisplayPosition, "" + distance); + } + } + } + + @SubscribeEvent + public void onGuiOpen(GuiOpenEvent event) { + foundColour = false; + correctColour = 0; + } + + public static int getDistance(int colour, int endColour) { + int index = colourLoop.indexOf(colour); + int finalIndex = colourLoop.indexOf(endColour); + if (index == -1 || finalIndex == -1) return 0; + + if (finalIndex < index) { + return finalIndex - index + 5; + } + return finalIndex - index; + } + +} diff --git a/src/main/java/me/Danker/gui/PuzzleSolversGui.java b/src/main/java/me/Danker/gui/PuzzleSolversGui.java index 0cfa72b..2f87630 100644 --- a/src/main/java/me/Danker/gui/PuzzleSolversGui.java +++ b/src/main/java/me/Danker/gui/PuzzleSolversGui.java @@ -28,6 +28,7 @@ public class PuzzleSolversGui extends GuiScreen { private GuiButton startsWith; private GuiButton selectAll; private GuiButton clickOrder; + private GuiButton sameColour; private GuiButton blockClicks; private GuiButton itemFrameOnSeaLanterns; @@ -67,9 +68,10 @@ public class PuzzleSolversGui extends GuiScreen { startsWith = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Starts With Letter Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.startsWithToggled)); selectAll = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Select All Color Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.selectAllToggled)); clickOrder = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Click in Order Terminal Helper: " + Utils.getColouredBoolean(ToggleCommand.clickInOrderToggled)); - blockClicks = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Block Wrong Clicks on Terminals: " + Utils.getColouredBoolean(ToggleCommand.blockWrongTerminalClicksToggled)); + sameColour = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Same Colour Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.sameColourToggled)); // Page 3 - itemFrameOnSeaLanterns = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Ignore Arrows On Sea Lanterns: " + Utils.getColouredBoolean(ToggleCommand.itemFrameOnSeaLanternsToggled)); + blockClicks = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Block Wrong Clicks on Terminals: " + Utils.getColouredBoolean(ToggleCommand.blockWrongTerminalClicksToggled)); + itemFrameOnSeaLanterns = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Ignore Arrows On Sea Lanterns: " + Utils.getColouredBoolean(ToggleCommand.itemFrameOnSeaLanternsToggled)); switch (page) { case 1: @@ -89,11 +91,12 @@ public class PuzzleSolversGui extends GuiScreen { this.buttonList.add(startsWith); this.buttonList.add(selectAll); this.buttonList.add(clickOrder); - this.buttonList.add(blockClicks); + this.buttonList.add(sameColour); this.buttonList.add(nextPage); this.buttonList.add(backPage); break; case 3: + this.buttonList.add(blockClicks); this.buttonList.add(itemFrameOnSeaLanterns); this.buttonList.add(backPage); } @@ -174,6 +177,10 @@ public class PuzzleSolversGui extends GuiScreen { ToggleCommand.itemFrameOnSeaLanternsToggled = !ToggleCommand.itemFrameOnSeaLanternsToggled; ConfigHandler.writeBooleanConfig("toggles", "IgnoreItemFrameOnSeaLanterns", ToggleCommand.itemFrameOnSeaLanternsToggled); itemFrameOnSeaLanterns.displayString = "Ignore Arrows On Sea Lanterns: " + Utils.getColouredBoolean(ToggleCommand.itemFrameOnSeaLanternsToggled); + } else if (button == sameColour) { + ToggleCommand.sameColourToggled = !ToggleCommand.sameColourToggled; + ConfigHandler.writeBooleanConfig("toggles", "SameColourTerminal", ToggleCommand.sameColourToggled); + sameColour.displayString = "Same Colour Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.sameColourToggled); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index ed28704..14386e4 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -264,6 +264,7 @@ public class ConfigHandler { ToggleCommand.startsWithToggled = initBoolean("toggles", "StartsWithTerminal", false); ToggleCommand.selectAllToggled = initBoolean("toggles", "SelectAllTerminal", false); ToggleCommand.clickInOrderToggled = initBoolean("toggles", "ClickInOrderTerminal", false); + ToggleCommand.sameColourToggled = initBoolean("toggles", "SameColourTerminal", false); ToggleCommand.blockWrongTerminalClicksToggled = initBoolean("toggles", "BlockWrongTerminalClicks", false); ToggleCommand.itemFrameOnSeaLanternsToggled = initBoolean("toggles", "IgnoreItemFrameOnSeaLanterns", false); // Experiment Solvers diff --git a/src/main/java/me/Danker/utils/RenderUtils.java b/src/main/java/me/Danker/utils/RenderUtils.java index 50b9786..b5ede19 100644 --- a/src/main/java/me/Danker/utils/RenderUtils.java +++ b/src/main/java/me/Danker/utils/RenderUtils.java @@ -59,6 +59,22 @@ public class RenderUtils { GL11.glTranslated(0, 0, -1); } + public static void drawTextOnSlot(int size, int xSlotPos, int ySlotPos, String text) { + Minecraft mc = Minecraft.getMinecraft(); + ScaledResolution sr = new ScaledResolution(mc); + int guiLeft = (sr.getScaledWidth() - 176) / 2; + int guiTop = (sr.getScaledHeight() - 222) / 2; + int x = guiLeft + xSlotPos; + int y = guiTop + ySlotPos; + // Move down when chest isn't 6 rows + if (size != 90) y += (6 - (size - 36) / 9) * 9; + + int width = mc.fontRendererObj.getStringWidth(text); + GL11.glTranslated(0, 0, 1); + mc.fontRendererObj.drawString(text, x + 8 - width / 2, y + 5, 0xFFFFFF, true); + GL11.glTranslated(0, 0, -1); + } + public static void draw3DLine(Vec3 pos1, Vec3 pos2, int colourInt, int lineWidth, boolean depth, float partialTicks) { Entity render = Minecraft.getMinecraft().getRenderViewEntity(); WorldRenderer worldRenderer = Tessellator.getInstance().getWorldRenderer(); -- cgit From d80e4d76971b99daeccde6b45876ea68ebcb6458 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 5 Apr 2022 03:12:38 -0400 Subject: Fix same colour solver resetting correct colour --- .../java/me/Danker/features/puzzlesolvers/SameColourSolver.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/puzzlesolvers/SameColourSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/SameColourSolver.java index 9b0066b..986e138 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/SameColourSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/SameColourSolver.java @@ -134,8 +134,10 @@ public class SameColourSolver { @SubscribeEvent public void onGuiOpen(GuiOpenEvent event) { - foundColour = false; - correctColour = 0; + if (!(event.gui instanceof GuiChest)) { + foundColour = false; + correctColour = 0; + } } public static int getDistance(int colour, int endColour) { -- cgit From 6c8469687c9dcad10e5291e1ac581ebafba91f26 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 5 Apr 2022 03:19:04 -0400 Subject: Fix estimated time in lobby commands --- src/main/java/me/Danker/commands/LobbyBankCommand.java | 3 ++- src/main/java/me/Danker/commands/LobbySkillsCommand.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/LobbyBankCommand.java b/src/main/java/me/Danker/commands/LobbyBankCommand.java index 5b9795b..fc63d89 100644 --- a/src/main/java/me/Danker/commands/LobbyBankCommand.java +++ b/src/main/java/me/Danker/commands/LobbyBankCommand.java @@ -5,6 +5,7 @@ import com.google.gson.JsonObject; import me.Danker.DankersSkyblockMod; import me.Danker.handlers.APIHandler; import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.network.NetworkPlayerInfo; import net.minecraft.command.CommandBase; @@ -55,7 +56,7 @@ public class LobbyBankCommand extends CommandBase { try { // Create deep copy of players to prevent passing reference and ConcurrentModificationException Collection players = new ArrayList<>(Minecraft.getMinecraft().getNetHandler().getPlayerInfoMap()); - playerSP.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking bank of lobby. Estimated time: " + (int) (players.size() * 1.2 + 1) + " seconds.")); + playerSP.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking bank of lobby. Estimated time: " + (int) (Utils.getMatchingPlayers("").size() * 1.2 + 1) + " seconds.")); // Send request every .6 seconds, leaving room for another 20 requests per minute for (final NetworkPlayerInfo player : players) { diff --git a/src/main/java/me/Danker/commands/LobbySkillsCommand.java b/src/main/java/me/Danker/commands/LobbySkillsCommand.java index dd5c249..f9f1271 100644 --- a/src/main/java/me/Danker/commands/LobbySkillsCommand.java +++ b/src/main/java/me/Danker/commands/LobbySkillsCommand.java @@ -58,7 +58,7 @@ public class LobbySkillsCommand extends CommandBase { try { // Create deep copy of players to prevent passing reference and ConcurrentModificationException Collection players = new ArrayList<>(Minecraft.getMinecraft().getNetHandler().getPlayerInfoMap()); - playerSP.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking skill average of lobby. Estimated time: " + (int) (players.size() * 1.2 + 1) + " seconds.")); + playerSP.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Checking skill average of lobby. Estimated time: " + (int) (Utils.getMatchingPlayers("").size() * 1.2 + 1) + " seconds.")); // Send request every .6 seconds, leaving room for another 20 requests per minute for (final NetworkPlayerInfo player : players) { -- cgit From 54b86ffd4ed5927513ad3ec9e1fe337b041366e0 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 5 Apr 2022 03:19:54 -0400 Subject: Fix pickobulus ability crashing /hotmof --- src/main/java/me/Danker/commands/HOTMCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/HOTMCommand.java b/src/main/java/me/Danker/commands/HOTMCommand.java index 35c0b28..7a8adb5 100644 --- a/src/main/java/me/Danker/commands/HOTMCommand.java +++ b/src/main/java/me/Danker/commands/HOTMCommand.java @@ -122,9 +122,9 @@ public class HOTMCommand extends CommandBase { enum Node { mining_speed_boost("Mining Speed Boost"), - pickobulus("*Pickobulus"), + pickaxe_toss("Pickobulus"), vein_seeker("Vein Seeker"), - maniac_miner("*Maniac Miner"); + maniac_miner("Maniac Miner"); public String name; -- cgit From 33da58bc40a76e7ac8d93a880effdefda0dcd060 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 5 Apr 2022 03:21:18 -0400 Subject: Fix MM tracker adding S+ runs when doing S runs --- .../java/me/Danker/features/loot/CatacombsTracker.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/loot/CatacombsTracker.java b/src/main/java/me/Danker/features/loot/CatacombsTracker.java index 634c7ad..772b65c 100644 --- a/src/main/java/me/Danker/features/loot/CatacombsTracker.java +++ b/src/main/java/me/Danker/features/loot/CatacombsTracker.java @@ -320,37 +320,37 @@ public class CatacombsTracker { switch (Utils.currentFloor) { case M1: m1S++; - m1SPlus++; + m1SSession++; ConfigHandler.writeIntConfig("catacombs", "masterOneS", m1S); break; case M2: m2S++; - m2SPlus++; + m2SSession++; ConfigHandler.writeIntConfig("catacombs", "masterTwoS", m2S); break; case M3: m3S++; - m3SPlus++; + m3SSession++; ConfigHandler.writeIntConfig("catacombs", "masterThreeS", m3S); break; case M4: m4S++; - m4SPlus++; + m4SSession++; ConfigHandler.writeIntConfig("catacombs", "masterFourS", m4S); break; case M5: m5S++; - m5SPlus++; + m5SSession++; ConfigHandler.writeIntConfig("catacombs", "masterFiveS", m5S); break; case M6: m6S++; - m6SPlus++; + m6SSession++; ConfigHandler.writeIntConfig("catacombs", "masterSixS", m6S); break; case M7: m7S++; - m7SPlus++; + m7SSession++; ConfigHandler.writeIntConfig("catacombs", "masterSevenS", m7S); break; } -- cgit From 1e2036e6ca3b10595ba27691ab4ee0a87d31f052 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 16 Apr 2022 19:05:53 -0400 Subject: Add automatically joining skyblock --- README.md | 1 + src/main/java/me/Danker/DankersSkyblockMod.java | 1 + .../java/me/Danker/commands/ToggleCommand.java | 1 + .../java/me/Danker/features/AutoJoinSkyblock.java | 41 ++++++++++++++++++++++ src/main/java/me/Danker/gui/DankerGui.java | 7 ++++ .../java/me/Danker/handlers/ConfigHandler.java | 1 + 6 files changed, 52 insertions(+) create mode 100644 src/main/java/me/Danker/features/AutoJoinSkyblock.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index a04bd50..12d2700 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ Discord Server: https://discord.gg/QsEkNQS - Custom alerts based on chat - Predicted dungeon score display - Hide player armour +- Automatically join skyblock ## Commands - /dhelp - Returns this message in-game. diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 39653ca..07ba904 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -106,6 +106,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new ArrowTerminalSolver()); MinecraftForge.EVENT_BUS.register(new AutoAcceptReparty()); MinecraftForge.EVENT_BUS.register(new AutoDisplay()); + MinecraftForge.EVENT_BUS.register(new AutoJoinSkyblock()); MinecraftForge.EVENT_BUS.register(new AutoSwapToPickBlock()); MinecraftForge.EVENT_BUS.register(new BlazeSolver()); MinecraftForge.EVENT_BUS.register(new BlockPlacingFlowers()); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 8bce0b3..9c56958 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -49,6 +49,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean alerts; public static boolean dungeonScore; public static boolean hideArmour; + public static boolean autoJoinSkyblock; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; diff --git a/src/main/java/me/Danker/features/AutoJoinSkyblock.java b/src/main/java/me/Danker/features/AutoJoinSkyblock.java new file mode 100644 index 0000000..91d6039 --- /dev/null +++ b/src/main/java/me/Danker/features/AutoJoinSkyblock.java @@ -0,0 +1,41 @@ +package me.Danker.features; + +import me.Danker.commands.ToggleCommand; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.network.FMLNetworkEvent; + +public class AutoJoinSkyblock { + + static boolean joinedServer = false; + + @SubscribeEvent + public void onConnect(FMLNetworkEvent.ClientConnectedToServerEvent event) { + if (ToggleCommand.autoJoinSkyblock && !joinedServer) { + joinedServer = true; + new Thread(() -> { + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + + try { + while (player == null) { + Thread.sleep(100); + player = Minecraft.getMinecraft().thePlayer; + } + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + + if (Utils.isOnHypixel()) player.sendChatMessage("/play sb"); + }).start(); + } + } + + @SubscribeEvent + public void onDisconnect(FMLNetworkEvent.ClientDisconnectionFromServerEvent event) { + joinedServer = false; + } + +} diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index fb84b0a..2900489 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -87,6 +87,7 @@ public class DankerGui extends GuiScreen { private GuiButton bonzoTimer; private GuiButton dungeonScore; private GuiButton hideArmour; + private GuiButton autoJoinSkyblock; // Chat Messages private GuiButton sceptreMessages; private GuiButton midasStaffMessages; @@ -178,6 +179,7 @@ public class DankerGui extends GuiScreen { abilityCooldown = new FeatureButton("Ability Cooldowns: " + Utils.getColouredBoolean(ToggleCommand.abilityCooldowns), "Displays ability cooldowns."); dungeonScore = new FeatureButton("Dungeon Score Display: " + Utils.getColouredBoolean(ToggleCommand.dungeonScore), "Displays an estimated dungeon score with secrets."); hideArmour = new FeatureButton("Hide Player Armour: " + Utils.getColouredBoolean(ToggleCommand.hideArmour), "Makes player armour invisible, showing their skin."); + autoJoinSkyblock = new FeatureButton("Automatically Join Skyblock: " + Utils.getColouredBoolean(ToggleCommand.autoJoinSkyblock), "Automatically join Skyblock when you join Hypixel.\nYou have an addiction."); allButtons.clear(); allButtons.add(changeDisplay); @@ -235,6 +237,7 @@ public class DankerGui extends GuiScreen { allButtons.add(abilityCooldown); allButtons.add(dungeonScore); allButtons.add(hideArmour); + allButtons.add(autoJoinSkyblock); search.setText(initSearchText); search.setVisible(true); @@ -518,6 +521,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.hideArmour = !ToggleCommand.hideArmour; ConfigHandler.writeBooleanConfig("toggles", "HideArmour", ToggleCommand.hideArmour); hideArmour.displayString = "Hide Player Armour: " + Utils.getColouredBoolean(ToggleCommand.hideArmour); + } else if (button == autoJoinSkyblock) { + ToggleCommand.autoJoinSkyblock = !ToggleCommand.autoJoinSkyblock; + ConfigHandler.writeBooleanConfig("toggles", "AutoJoinSkyblock", ToggleCommand.autoJoinSkyblock); + autoJoinSkyblock.displayString = "Automatically Join Skyblock: " + Utils.getColouredBoolean(ToggleCommand.autoJoinSkyblock); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 14386e4..21fa57f 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -242,6 +242,7 @@ public class ConfigHandler { ToggleCommand.alerts = initBoolean("toggles", "Alerts", false); ToggleCommand.dungeonScore = initBoolean("toggles", "DungeonScore", false); ToggleCommand.hideArmour = initBoolean("toggles", "HideArmour", false); + ToggleCommand.autoJoinSkyblock = initBoolean("toggles", "AutoJoinSkyblock", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); -- cgit From 7af45a9bee936d6da43e8b9ee6473a8ecbcb3d7f Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 16 Apr 2022 20:22:32 -0400 Subject: Add location and desktop notification for alerts Options of everywhere, in skyblock and in dungeons --- src/main/java/me/Danker/features/Alerts.java | 42 +++++++++++++++++++- .../java/me/Danker/gui/alerts/AlertActionGui.java | 8 +++- .../java/me/Danker/gui/alerts/AlertAddGui.java | 45 +++++++++++++++++----- 3 files changed, 83 insertions(+), 12 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/Alerts.java b/src/main/java/me/Danker/features/Alerts.java index 2a00fef..aab99b3 100644 --- a/src/main/java/me/Danker/features/Alerts.java +++ b/src/main/java/me/Danker/features/Alerts.java @@ -8,6 +8,7 @@ import net.minecraft.util.StringUtils; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import java.awt.*; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; @@ -20,13 +21,26 @@ public class Alerts { @SubscribeEvent public void onChat(ClientChatReceivedEvent event) { - if (!ToggleCommand.alerts || !Utils.inSkyblock || event.type == 2) return; + if (!ToggleCommand.alerts || event.type == 2) return; String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); for (Alert alert : alerts) { if (!alert.toggled) continue; + boolean location; + switch (alert.location) { + case "Skyblock": + location = Utils.inSkyblock; + break; + case "Dungeons": + location = Utils.inDungeons; + break; + default: + location = true; + } + if (!location) continue; + boolean trigger; switch (alert.mode) { case "Starts With": @@ -44,6 +58,22 @@ public class Alerts { if (trigger) { Utils.createTitle(EnumChatFormatting.RED + alert.alert.replace("&", "§"), 2); + + if (alert.desktop) { + try { + final SystemTray tray = SystemTray.getSystemTray(); + final Image image = Toolkit.getDefaultToolkit().createImage("icon.png"); + final TrayIcon trayIcon = new TrayIcon(image, "Alert"); + trayIcon.setImageAutoSize(true); + trayIcon.setToolTip("Alert"); + tray.add(trayIcon); + trayIcon.displayMessage(StringUtils.stripControlCodes(alert.alert), message, TrayIcon.MessageType.INFO); + tray.remove(trayIcon); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + return; } } @@ -61,14 +91,18 @@ public class Alerts { public static class Alert { public String mode; + public String location; public String message; public String alert; + public boolean desktop; public boolean toggled; - public Alert(String mode, String message, String alert, boolean toggled) { + public Alert(String mode, String location, String message, String alert, boolean desktop, boolean toggled) { this.mode = mode; + this.location = location; this.message = message; this.alert = alert; + this.desktop = desktop; this.toggled = toggled; } @@ -76,6 +110,10 @@ public class Alerts { toggled = !toggled; } + public void toggleDesktop() { + desktop = !desktop; + } + } } diff --git a/src/main/java/me/Danker/gui/alerts/AlertActionGui.java b/src/main/java/me/Danker/gui/alerts/AlertActionGui.java index 02ef186..7a73f5a 100644 --- a/src/main/java/me/Danker/gui/alerts/AlertActionGui.java +++ b/src/main/java/me/Danker/gui/alerts/AlertActionGui.java @@ -16,6 +16,7 @@ public class AlertActionGui extends GuiScreen { private GuiButton goBack; private GuiButton toggle; + private GuiButton toggleDesktop; private GuiButton edit; private GuiButton delete; @@ -40,10 +41,12 @@ public class AlertActionGui extends GuiScreen { goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); toggle = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Enabled: " + Utils.getColouredBoolean(alert.toggled)); - edit = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Edit >"); + toggleDesktop = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Desktop Notification: " + Utils.getColouredBoolean(alert.desktop)); + edit = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Edit >"); delete = new GuiButton(0, width / 2 - 100, (int) (height * 0.8), EnumChatFormatting.RED + "Delete Alert"); this.buttonList.add(toggle); + this.buttonList.add(toggleDesktop); this.buttonList.add(edit); this.buttonList.add(delete); this.buttonList.add(goBack); @@ -70,6 +73,9 @@ public class AlertActionGui extends GuiScreen { } else if (button == toggle) { alert.toggle(); toggle.displayString = "Enabled: " + Utils.getColouredBoolean(alert.toggled); + } else if (button == toggleDesktop) { + alert.toggleDesktop(); + toggleDesktop.displayString = "Desktop Notification: " + Utils.getColouredBoolean(alert.desktop); } else if (button == edit) { mc.displayGuiScreen(new AlertAddGui(alert, id)); } else if (button == delete) { diff --git a/src/main/java/me/Danker/gui/alerts/AlertAddGui.java b/src/main/java/me/Danker/gui/alerts/AlertAddGui.java index efc099c..5f01d6d 100644 --- a/src/main/java/me/Danker/gui/alerts/AlertAddGui.java +++ b/src/main/java/me/Danker/gui/alerts/AlertAddGui.java @@ -2,6 +2,7 @@ package me.Danker.gui.alerts; import me.Danker.features.Alerts; import me.Danker.handlers.TextRenderer; +import me.Danker.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; @@ -20,11 +21,16 @@ public class AlertAddGui extends GuiScreen { private GuiButton cancel; private String mode = "Contains"; + private String location = "Skyblock"; private GuiButton startsWith; private GuiButton contains; private GuiButton endsWith; + private GuiButton everywhere; + private GuiButton skyblock; + private GuiButton dungeons; private GuiTextField message; private GuiTextField alert; + private GuiCheckBox desktop; private GuiCheckBox toggled; private GuiButton add; @@ -54,15 +60,21 @@ public class AlertAddGui extends GuiScreen { startsWith = new GuiButton(0, width / 2 - 200, (int) (height * 0.2), 120, 20, "Starts With"); contains = new GuiButton(0, width / 2 - 60, (int) (height * 0.2), 120, 20, "Contains"); endsWith = new GuiButton(0, width / 2 + 80, (int) (height * 0.2), 120, 20, "Ends With"); - message = new GuiTextField(0, this.fontRendererObj, width / 2 - 100, (int) (height * 0.3), 200, 20); - alert = new GuiTextField(0, this.fontRendererObj, width / 2 - 100, (int) (height * 0.4), 200, 20); - toggled = new GuiCheckBox(0, width / 2 - 26, (int) (height * 0.5), "Toggled", true); - add = new GuiButton(0, width / 2 - 25, (int) (height * 0.7), 50, 20, "Add"); + everywhere = new GuiButton(0, width / 2 - 200, (int) (height * 0.3), 120, 20, "Everywhere"); + skyblock = new GuiButton(0, width / 2 - 60, (int) (height * 0.3), 120, 20, "Skyblock"); + dungeons = new GuiButton(0, width / 2 + 80, (int) (height * 0.3), 120, 20, "Dungeons"); + message = new GuiTextField(0, this.fontRendererObj, width / 2 - 100, (int) (height * 0.4), 200, 20); + alert = new GuiTextField(0, this.fontRendererObj, width / 2 - 100, (int) (height * 0.5), 200, 20); + desktop = new GuiCheckBox(0, width / 2 - 58, (int) (height * 0.6), "Desktop Notification", false); + toggled = new GuiCheckBox(0, width / 2 - 26, (int) (height * 0.65), "Toggled", true); + add = new GuiButton(0, width / 2 - 25, (int) (height * 0.8), 50, 20, "Add"); if (editing) { mode = base.mode; + location = base.location; message.setText(base.message); alert.setText(base.alert); + desktop.setIsChecked(base.desktop); toggled.setIsChecked(base.toggled); } @@ -75,6 +87,10 @@ public class AlertAddGui extends GuiScreen { this.buttonList.add(startsWith); this.buttonList.add(contains); this.buttonList.add(endsWith); + this.buttonList.add(everywhere); + this.buttonList.add(skyblock); + this.buttonList.add(dungeons); + this.buttonList.add(desktop); this.buttonList.add(toggled); this.buttonList.add(add); } @@ -87,9 +103,10 @@ public class AlertAddGui extends GuiScreen { message.drawTextBox(); alert.drawTextBox(); - new TextRenderer(mc, "Mode: " + mode, width / 2 - 35, (int) (height * 0.15), 1D); - new TextRenderer(mc, "Trigger:", width / 2 - 145, (int) (height * 0.32), 1D); - new TextRenderer(mc, "Alert Text:", width / 2 - 158, (int) (height * 0.42), 1D); + RenderUtils.drawCenteredText("Mode: " + mode, width, (int) (height * 0.1), 1D); + RenderUtils.drawCenteredText("Location: " + location, width, (int) (height * 0.15), 1D); + new TextRenderer(mc, "Trigger:", width / 2 - 145, (int) (height * 0.42), 1D); + new TextRenderer(mc, "Alert Text:", width / 2 - 158, (int) (height * 0.52), 1D); } @Override @@ -102,9 +119,19 @@ public class AlertAddGui extends GuiScreen { mode = "Contains"; } else if (button == endsWith) { mode = "Ends With"; + } else if (button == everywhere) { + location = "Everywhere"; + } else if (button == skyblock) { + location = "Skyblock"; + } else if (button == dungeons) { + location = "Dungeons"; } else if (button == add) { - Alerts.alerts.add(new Alerts.Alert(mode, message.getText(), alert.getText(), toggled.isChecked())); - if (editing) Alerts.alerts.remove(id); + Alerts.Alert newAlert = new Alerts.Alert(mode, location, message.getText(), alert.getText(), desktop.isChecked(), toggled.isChecked()); + if (editing) { + Alerts.alerts.set(id, newAlert); + } else { + Alerts.alerts.add(newAlert); + } Alerts.saveToFile(); mc.displayGuiScreen(new AlertsGui(1)); } -- cgit From 637d39e2dad83b29503a1b12fc8e2f7f9e1489fa Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 16 Apr 2022 20:52:59 -0400 Subject: Add auto add player waypoints --- .../commands/CrystalHollowWaypointCommand.java | 20 +++++++++++++++++--- src/main/java/me/Danker/commands/ToggleCommand.java | 1 + .../me/Danker/features/CrystalHollowWaypoints.java | 12 ++++++++++-- .../CrystalHollowWaypointsGui.java | 8 ++++++++ src/main/java/me/Danker/handlers/ConfigHandler.java | 3 ++- 5 files changed, 38 insertions(+), 6 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/CrystalHollowWaypointCommand.java b/src/main/java/me/Danker/commands/CrystalHollowWaypointCommand.java index 1aacf50..f5dea9b 100644 --- a/src/main/java/me/Danker/commands/CrystalHollowWaypointCommand.java +++ b/src/main/java/me/Danker/commands/CrystalHollowWaypointCommand.java @@ -2,6 +2,7 @@ package me.Danker.commands; import me.Danker.DankersSkyblockMod; import me.Danker.features.CrystalHollowWaypoints; +import net.minecraft.client.Minecraft; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; @@ -28,11 +29,13 @@ public class CrystalHollowWaypointCommand extends CommandBase { @Override public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { - EntityPlayer player = (EntityPlayer) arg0; - if (arg1.length == 0) return; + addWaypoints(String.join(" ", arg1), false); + } - String[] waypoints = String.join(" ", arg1).split("\\\\n"); + public static void addWaypoints(String list, boolean auto) { + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + String[] waypoints = list.split("\\\\n"); for (String waypoint : waypoints) { String[] parts = waypoint.split("@-"); @@ -42,6 +45,17 @@ public class CrystalHollowWaypointCommand extends CommandBase { BlockPos pos = new BlockPos(Integer.parseInt(coords[0]), Integer.parseInt(coords[1]), Integer.parseInt(coords[2])); CrystalHollowWaypoints.Waypoint newWaypoint = new CrystalHollowWaypoints.Waypoint(location, pos); + if (auto) { + boolean contains = false; + for (CrystalHollowWaypoints.Waypoint existing : CrystalHollowWaypoints.waypoints) { + if (existing.location.equals(location)) { + contains = true; + break; + } + } + if (contains) continue; + } + CrystalHollowWaypoints.waypoints.add(newWaypoint); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Added " + newWaypoint.location + " @ " + newWaypoint.getPos())); } diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 9c56958..c8f37d6 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -44,6 +44,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean gemstoneLore; public static boolean crystalHollowWaypoints; public static boolean crystalAutoWaypoints; + public static boolean crystalAutoPlayerWaypoints; public static boolean autoAcceptReparty; public static boolean abilityCooldowns; public static boolean alerts; diff --git a/src/main/java/me/Danker/features/CrystalHollowWaypoints.java b/src/main/java/me/Danker/features/CrystalHollowWaypoints.java index 1ce4150..f367877 100644 --- a/src/main/java/me/Danker/features/CrystalHollowWaypoints.java +++ b/src/main/java/me/Danker/features/CrystalHollowWaypoints.java @@ -1,6 +1,7 @@ package me.Danker.features; import me.Danker.DankersSkyblockMod; +import me.Danker.commands.CrystalHollowWaypointCommand; import me.Danker.commands.ToggleCommand; import me.Danker.handlers.ScoreboardHandler; import me.Danker.utils.RenderUtils; @@ -88,7 +89,7 @@ public class CrystalHollowWaypoints { if (!king && entity.getCustomNameTag().endsWith("King Yolkar")) { king = found = true; waypoints.add(new Waypoint("King Yolkar", entity.getPosition())); - } else if (!corleone && entity.getCustomNameTag().endsWith("Boss Corleone")) { + } else if (!corleone && entity.getCustomNameTag().contains("Boss Corleone")) { corleone = found = true; waypoints.add(new Waypoint("Boss Corleone", entity.getPosition())); } else if (!guardian && entity.getCustomNameTag().contains("Key Guardian")) { @@ -123,8 +124,15 @@ public class CrystalHollowWaypoints { */ if (ToggleCommand.crystalHollowWaypoints && Utils.tabLocation.equals("Crystal Hollows")) { if (!message.contains(player.getName()) && (message.contains(": $DSMCHWP:") || message.contains(": $SBECHWP:"))) { + String waypoints = message.substring(message.lastIndexOf(":") + 1); + + if (ToggleCommand.crystalAutoPlayerWaypoints) { + CrystalHollowWaypointCommand.addWaypoints(waypoints, true); + return; + } + ChatComponentText add = new ChatComponentText(EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + " [ADD]\n"); - add.setChatStyle(add.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/dsmaddcrystalhollowwaypoints " + message.substring(message.lastIndexOf(":") + 1)))); + add.setChatStyle(add.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/dsmaddcrystalhollowwaypoints " + waypoints))); new Thread(() -> { try { diff --git a/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java index fc0f108..7c54c98 100644 --- a/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java +++ b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java @@ -1,5 +1,6 @@ package me.Danker.gui.crystalhollowwaypoints; +import javafx.scene.control.Toggle; import me.Danker.commands.ToggleCommand; import me.Danker.features.CrystalHollowWaypoints; import me.Danker.gui.DankerGui; @@ -29,6 +30,7 @@ public class CrystalHollowWaypointsGui extends GuiScreen { private GuiButton add; private FeatureButton crystalHollowWaypoints; private FeatureButton crystalAutoWaypoints; + private FeatureButton crystalAutoPlayerWaypoints; public CrystalHollowWaypointsGui(int page) { this.page = page; @@ -55,11 +57,13 @@ public class CrystalHollowWaypointsGui extends GuiScreen { add = new GuiButton(0, 0, 0, "Add Waypoint"); crystalHollowWaypoints = new FeatureButton("Crystal Hollows Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalHollowWaypoints), "Shows waypoints to various places in the Crystal Hollows."); crystalAutoWaypoints = new FeatureButton("Auto Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalAutoWaypoints), "Automatically creates waypoints when you visit a special place in the Crystal Hollows."); + crystalAutoPlayerWaypoints = new FeatureButton("Auto Add Player Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalAutoPlayerWaypoints), "Automatically adds waypoints sent from players."); allButtons.clear(); allButtons.add(add); allButtons.add(crystalHollowWaypoints); allButtons.add(crystalAutoWaypoints); + allButtons.add(crystalAutoPlayerWaypoints); for (int i = 0; i < CrystalHollowWaypoints.waypoints.size(); i++) { CrystalHollowWaypoints.Waypoint waypoint = CrystalHollowWaypoints.waypoints.get(i); GuiButton button = new GuiButton(i, 0, 0, waypoint.location + " >"); @@ -135,6 +139,10 @@ public class CrystalHollowWaypointsGui extends GuiScreen { ToggleCommand.crystalAutoWaypoints = !ToggleCommand.crystalAutoWaypoints; ConfigHandler.writeBooleanConfig("toggles", "CrystalAutoWaypoints", ToggleCommand.crystalAutoWaypoints); crystalAutoWaypoints.displayString = "Auto Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalAutoWaypoints); + } else if (button == crystalAutoPlayerWaypoints) { + ToggleCommand.crystalAutoPlayerWaypoints = !ToggleCommand.crystalAutoPlayerWaypoints; + ConfigHandler.writeBooleanConfig("toggles", "CrystalAutoPlayerWaypoints", ToggleCommand.crystalAutoPlayerWaypoints); + crystalAutoPlayerWaypoints.displayString = "Auto Add Player Waypoints: " + Utils.getColouredBoolean(ToggleCommand.crystalAutoPlayerWaypoints); } else { mc.displayGuiScreen(new CrystalHollowWaypointActionGui(button.id)); } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 21fa57f..b042177 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -221,11 +221,12 @@ public class ConfigHandler { ToggleCommand.teammatesInRadius = initBoolean("toggles", "TeammatesInRadius", false); ToggleCommand.giantHP = initBoolean("toggles", "GiantHP", false); ToggleCommand.hidePetCandy = initBoolean("toggles", "HidePetCandy", false); - ToggleCommand.customColouredNames = initBoolean("toggles", "CustomColouredNames", true); + ToggleCommand.customColouredNames = initBoolean("toggles", "CustomColouredNames", true); // enabled by default ToggleCommand.endOfFarmAlert = initBoolean("toggles", "EndOfFarmAlert", false); ToggleCommand.gemstoneLore = initBoolean("toggles", "GemstoneLore", false); ToggleCommand.crystalHollowWaypoints = initBoolean("toggles", "CrystalHollowWaypoints", false); ToggleCommand.crystalAutoWaypoints = initBoolean("toggles", "CrystalAutoWaypoints", true); // enabled by default + ToggleCommand.crystalAutoPlayerWaypoints = initBoolean("toggles", "CrystalAutoPlayerWaypoints", false); ToggleCommand.autoAcceptReparty = initBoolean("toggles", "AutoAcceptReparty", false); ToggleCommand.abilityCooldowns = initBoolean("toggles", "AbilityCooldowns", false); ToggleCommand.dungeonTimerToggled = initBoolean("toggles", "DungeonTimer", false); -- cgit From 9b65362e8e85a8fc783fdb2a1c94f6df51f9450f Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Mon, 18 Apr 2022 19:13:55 -0400 Subject: Add farming weight to /weight Also add /we alias --- README.md | 3 +- .../java/me/Danker/commands/WeightCommand.java | 131 ++++++++++++++++++++- .../features/puzzlesolvers/SameColourSolver.java | 1 - src/main/java/me/Danker/gui/DankerGui.java | 1 - .../CrystalHollowWaypointsGui.java | 1 - 5 files changed, 130 insertions(+), 7 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 12d2700..4a77ae4 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ Discord Server: https://discord.gg/QsEkNQS - /bank [player] - Uses API to get bank and purse coins of a person. If no name is provided, it checks yours. - /armor [player] - Uses API to get armour of a person. If no name is provided, it checks yours. - /dungeons [player] - Uses API to get dungeon levels of a person. If no name is provided, it checks yours. -- /weight [player] [lily] - Uses API to get weight of a person. If no name is provided, it checks yours. Adding lily uses lily's weight instead of Senither's. +- /weight [player] [lily/farming] - Uses API to get weight of a person. If no name is provided, it checks yours. Adding lily uses lily's weight. Adding farming uses Kaeso's farming weight. - /importfishing - Imports your fishing stats from your latest profile to your fishing tracker using the API. - /sbplayers - Uses API to find how many players are on each Skyblock island. - /onlyslayer <1/2/3/4/5> @@ -151,3 +151,4 @@ Software | License [SkyblockCatia](https://github.com/SteveKunG/SkyBlockcatia) | [MIT License](https://github.com/SteveKunG/SkyBlockcatia/blob/1.8.9/LICENSE.md) [MatterOverdrive (Legacy Edition)](https://bitbucket.org/hrznstudio/mo-legacy-edition/) | [GNU General Public License](https://bitbucket.org/hrznstudio/mo-legacy-edition/src/1.12.2/LICENSE.md) [Hide Armour](https://github.com/Furgl/Hide-Armor/tree/1.15.2) | No License +[Elite Discord Bot](https://github.com/ptlthg/EliteDiscordBot) | [MIT License](https://github.com/ptlthg/EliteDiscordBot/blob/master/LICENSE) diff --git a/src/main/java/me/Danker/commands/WeightCommand.java b/src/main/java/me/Danker/commands/WeightCommand.java index 7593f65..b00d881 100644 --- a/src/main/java/me/Danker/commands/WeightCommand.java +++ b/src/main/java/me/Danker/commands/WeightCommand.java @@ -1,5 +1,7 @@ package me.Danker.commands; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; import com.google.gson.JsonObject; import me.Danker.DankersSkyblockMod; import me.Danker.handlers.APIHandler; @@ -12,21 +14,40 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; import java.text.NumberFormat; -import java.util.List; -import java.util.Locale; +import java.util.*; +import java.util.stream.Collectors; public class WeightCommand extends CommandBase { + ArrayList t12Minions = new ArrayList<>(Arrays.asList( + "WHEAT_12", + "CARROT_12", + "POTATO_12", + "PUMPKIN_12", + "MELON_12", + "MUSHROOM_12", + "COCOA_12", + "CACTUS_12", + "SUGAR_CANE_12", + "NETHER_WARTS_12" + )); + @Override public String getCommandName() { return "weight"; } + @Override + public List getCommandAliases() { + return Collections.singletonList("we"); + } + @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " [name] [lily]"; + return "/" + getCommandName() + " [name] [lily/farming]"; } public static String usage(ICommandSender arg0) { @@ -129,6 +150,110 @@ public class WeightCommand extends CommandBase { DankersSkyblockMod.TYPE_COLOUR + " Catacombs Completion Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(catacombsBaseWeight) + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Catacombs Master Completion Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(catacombsMasterWeight) + "\n" + DankersSkyblockMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------")); + } else if (arg1[1].equalsIgnoreCase("farming")) { + String latestProfile = APIHandler.getLatestProfileID(uuid, key); + if (latestProfile == null) return; + + String profileURL = "https://api.hypixel.net/skyblock/profile?profile=" + latestProfile + "&key=" + key; + System.out.println("Fetching profile..."); + JsonObject profileResponse = APIHandler.getResponse(profileURL, true); + if (!profileResponse.get("success").getAsBoolean()) { + String reason = profileResponse.get("cause").getAsString(); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); + return; + } + + JsonObject userObject = profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject(); + + if (!userObject.has("collection")) { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + username + " does not have collection API on.")); + return; + } + + JsonObject multipliers = DankersSkyblockMod.data.get("farmingWeight").getAsJsonObject(); + JsonObject collections = userObject.get("collection").getAsJsonObject(); + JsonObject jacob = userObject.has("jacob2") ? userObject.get("jacob2").getAsJsonObject() : null; + JsonArray minions = userObject.get("crafted_generators").getAsJsonArray(); + + // main weight + long wheatColl = collections.has("WHEAT") ? collections.get("WHEAT").getAsLong() < 0 ? collections.get("WHEAT").getAsLong() + 4294967294L : collections.get("WHEAT").getAsLong() : 0; + long carrotColl = collections.has("CARROT_ITEM") ? collections.get("CARROT_ITEM").getAsLong() < 0 ? collections.get("CARROT_ITEM").getAsLong() + 4294967294L : collections.get("CARROT_ITEM").getAsLong() : 0; + long potatoColl = collections.has("POTATO_ITEM") ? collections.get("POTATO_ITEM").getAsLong() < 0 ? collections.get("POTATO_ITEM").getAsLong() + 4294967294L : collections.get("POTATO_ITEM").getAsLong() : 0; + long pumpkinColl = collections.has("PUMPKIN") ? collections.get("PUMPKIN").getAsLong() < 0 ? collections.get("PUMPKIN").getAsLong() + 4294967294L : collections.get("PUMPKIN").getAsLong() : 0; + long melonColl = collections.has("MELON") ? collections.get("MELON").getAsLong() < 0 ? collections.get("MELON").getAsLong() + 4294967294L : collections.get("MELON").getAsLong() : 0; + long mushroomColl = collections.has("MUSHROOM_COLLECTION") ? collections.get("MUSHROOM_COLLECTION").getAsLong() < 0 ? collections.get("MUSHROOM_COLLECTION").getAsLong() + 4294967294L : collections.get("MUSHROOM_COLLECTION").getAsLong() : 0; + long cocoaColl = collections.has("INK_SACK:3") ? collections.get("INK_SACK:3").getAsLong() < 0 ? collections.get("INK_SACK:3").getAsLong() + 4294967294L : collections.get("INK_SACK:3").getAsLong() : 0; + long cactusColl = collections.has("CACTUS") ? collections.get("CACTUS").getAsLong() < 0 ? collections.get("CACTUS").getAsLong() + 4294967294L : collections.get("CACTUS").getAsLong() : 0; + long caneColl = collections.has("SUGAR_CANE") ? collections.get("SUGAR_CANE").getAsLong() < 0 ? collections.get("SUGAR_CANE").getAsLong() + 4294967294L : collections.get("SUGAR_CANE").getAsLong() : 0; + long wartColl = collections.has("NETHER_STALK") ? collections.get("NETHER_STALK").getAsLong() < 0 ? collections.get("NETHER_STALK").getAsLong() + 4294967294L : collections.get("NETHER_STALK").getAsLong() : 0; + + double wheatWeight = Math.round(wheatColl / multipliers.get("wheat").getAsDouble()) / 100D; + double carrotWeight = Math.round(carrotColl / multipliers.get("carrot").getAsDouble()) / 100D; + double potatoWeight = Math.round(potatoColl / multipliers.get("potato").getAsDouble()) / 100D; + double pumpkinWeight = Math.round(pumpkinColl / multipliers.get("pumpkin").getAsDouble()) / 100D; + double melonWeight = Math.round(melonColl / multipliers.get("melon").getAsDouble()) / 100D; + double mushroomWeight = Math.round(mushroomColl / multipliers.get("mushroom").getAsDouble()) / 100D; + double cocoaWeight = Math.round(cocoaColl / multipliers.get("cocoa").getAsDouble()) / 100D; + double cactusWeight = Math.round(cactusColl / multipliers.get("cactus").getAsDouble()) / 100D; + double caneWeight = Math.round(caneColl / multipliers.get("cane").getAsDouble()) / 100D; + double wartWeight = Math.round(wartColl / multipliers.get("wart").getAsDouble()) / 100D; + + // bonus weight + double farmingBonus = 0; + double anitaBonus = 0; + double medalBonus = 0; + double minionBonus = 0; + if (jacob != null) { + // farming cap + double farmingXP = userObject.get("experience_skill_farming").getAsDouble(); + int cap = jacob.get("perks").getAsJsonObject().has("farming_level_cap") ? jacob.get("perks").getAsJsonObject().get("farming_level_cap").getAsInt() : 0; + if (farmingXP > 111672425D && cap == 10) { + farmingBonus = 250D; + } else if (farmingXP > 55172425) { + farmingBonus = 100D; + } + + // anita bonus + anitaBonus = jacob.get("perks").getAsJsonObject().has("double_drops") ? jacob.get("perks").getAsJsonObject().get("double_drops").getAsInt() * 2D : 0; + + // gold medals + int totalGolds = 0; + List contests = jacob.get("contests").getAsJsonObject().entrySet().stream() + .map(Map.Entry::getKey) + .collect(Collectors.toCollection(ArrayList::new)); + + // get total golds + for (String contest : contests) { + JsonObject contestData = jacob.get("contests").getAsJsonObject().get(contest).getAsJsonObject(); + if (contestData.has("claimed_position")) { + if (contestData.get("claimed_position").getAsInt() <= contestData.get("claimed_participants").getAsInt() * 0.05 + 1) totalGolds++; + } + } + + medalBonus = Math.floor(totalGolds / 50D) * 50D / 2D; + medalBonus = MathHelper.clamp_double(medalBonus, 0D, 500D); + } + + // t12 minions + for (JsonElement minion : minions) { + String minionName = minion.getAsString(); + if (t12Minions.contains(minionName)) minionBonus += 5; + } + + double mainWeight = Math.floor((wheatWeight + carrotWeight + potatoWeight + pumpkinWeight + melonWeight + mushroomWeight + cocoaWeight + cactusWeight + caneWeight + wartWeight) * 100D) / 100D; + double bonusWeight = farmingBonus + anitaBonus + medalBonus + minionBonus; + + NumberFormat nf = NumberFormat.getNumberInstance(Locale.US); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.AQUA + username + "'s Weight (Farming):\n" + + DankersSkyblockMod.TYPE_COLOUR + "Total Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(mainWeight + bonusWeight) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + "Collection Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(mainWeight) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + "Bonus Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(bonusWeight) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + "Farming XP Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(farmingBonus) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + "Anita Bonus Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(anitaBonus) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + "Gold Medal Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(medalBonus) + "\n" + + DankersSkyblockMod.TYPE_COLOUR + "Minion Weight: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(minionBonus) + "\n" + + DankersSkyblockMod.DELIMITER_COLOUR + EnumChatFormatting.BOLD + "-------------------")); } else { player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); } diff --git a/src/main/java/me/Danker/features/puzzlesolvers/SameColourSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/SameColourSolver.java index 986e138..a3c1bc1 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/SameColourSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/SameColourSolver.java @@ -8,7 +8,6 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.init.Blocks; -import net.minecraft.init.Items; import net.minecraft.inventory.ContainerChest; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 2900489..4285d16 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -1,6 +1,5 @@ package me.Danker.gui; -import jdk.nashorn.internal.runtime.regexp.joni.Config; import me.Danker.commands.ToggleCommand; import me.Danker.gui.alerts.AlertsGui; import me.Danker.gui.buttons.FeatureButton; diff --git a/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java index 7c54c98..6780542 100644 --- a/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java +++ b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowWaypointsGui.java @@ -1,6 +1,5 @@ package me.Danker.gui.crystalhollowwaypoints; -import javafx.scene.control.Toggle; import me.Danker.commands.ToggleCommand; import me.Danker.features.CrystalHollowWaypoints; import me.Danker.gui.DankerGui; -- cgit From f214832fb6f315d59d876267f71e9e9f0a6082fd Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Wed, 20 Apr 2022 22:52:26 -0400 Subject: Add blaze slayer support + tracker --- README.md | 8 +- src/main/java/me/Danker/DankersSkyblockMod.java | 1 + .../me/Danker/commands/BlockSlayerCommand.java | 10 +- .../java/me/Danker/commands/DisplayCommand.java | 13 +- src/main/java/me/Danker/commands/LootCommand.java | 89 +++++++++- .../java/me/Danker/commands/ResetLootCommand.java | 39 ++++- .../me/Danker/commands/SkyblockPlayersCommand.java | 19 +-- .../java/me/Danker/commands/SlayerCommand.java | 10 +- .../java/me/Danker/commands/WeightCommand.java | 2 + src/main/java/me/Danker/features/AutoDisplay.java | 3 + .../java/me/Danker/features/loot/BlazeTracker.java | 184 +++++++++++++++++++++ .../java/me/Danker/features/loot/LootDisplay.java | 122 ++++++++++++++ .../java/me/Danker/features/loot/LootTracker.java | 6 +- src/main/java/me/Danker/gui/DisplayGui.java | 13 +- src/main/java/me/Danker/gui/OnlySlayerGui.java | 14 +- .../java/me/Danker/handlers/ConfigHandler.java | 27 ++- 16 files changed, 519 insertions(+), 41 deletions(-) create mode 100644 src/main/java/me/Danker/features/loot/BlazeTracker.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 4a77ae4..2a740c7 100644 --- a/README.md +++ b/README.md @@ -72,9 +72,9 @@ Discord Server: https://discord.gg/QsEkNQS - /toggle - Toggles features. /toggle list returns values of every toggle. - /setkey - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. -- /loot [winter/festival/spooky/ch/f(1-7)/mm/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. -- /display [winter/festival/spooky/ch/f(1-7)/mm/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active. -- /resetloot - - Resets loot for trackers. /resetloot confirm confirms the reset. +- /loot [winter/festival/spooky/ch/f(1-7)/mm/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. +- /display [winter/festival/spooky/ch/f(1-7)/mm/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active. +- /resetloot - - Resets loot for trackers. /resetloot confirm confirms the reset. - /move - Moves text display to specified X and Y coordinates. - /scale - Scales text display to a specified multipler between 0.1x and 10x. - /slayer [player] - Uses API to get slayer xp of a person. If no name is provided, it checks yours. @@ -88,7 +88,7 @@ Discord Server: https://discord.gg/QsEkNQS - /weight [player] [lily/farming] - Uses API to get weight of a person. If no name is provided, it checks yours. Adding lily uses lily's weight. Adding farming uses Kaeso's farming weight. - /importfishing - Imports your fishing stats from your latest profile to your fishing tracker using the API. - /sbplayers - Uses API to find how many players are on each Skyblock island. -- /onlyslayer <1/2/3/4/5> +- /onlyslayer <1/2/3/4/5> - /skilltracker - Text display for skill xp/hour. - /reparty - Disbands and reparties all members in the party - /fairysouls - Check the fairysouls of a player diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 07ba904..fb98068 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -166,6 +166,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new LootDisplay()); MinecraftForge.EVENT_BUS.register(new LootTracker()); + MinecraftForge.EVENT_BUS.register(new BlazeTracker()); MinecraftForge.EVENT_BUS.register(new CatacombsTracker()); MinecraftForge.EVENT_BUS.register(new EndermanTracker()); MinecraftForge.EVENT_BUS.register(new FishingTracker()); diff --git a/src/main/java/me/Danker/commands/BlockSlayerCommand.java b/src/main/java/me/Danker/commands/BlockSlayerCommand.java index 9f51be6..37047c9 100644 --- a/src/main/java/me/Danker/commands/BlockSlayerCommand.java +++ b/src/main/java/me/Danker/commands/BlockSlayerCommand.java @@ -21,7 +21,7 @@ public class BlockSlayerCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " <1/2/3/4/5>"; + return "/" + getCommandName() + " <1/2/3/4/5>"; } public static String usage(ICommandSender arg0) { @@ -36,7 +36,7 @@ public class BlockSlayerCommand extends CommandBase { @Override public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "zombie", "spider", "wolf", "enderman"); + return getListOfStringsMatchingLastWord(args, "zombie", "spider", "wolf", "enderman", "blaze"); } else if (args.length == 2) { return getListOfStringsMatchingLastWord(args, "1", "2", "3", "4", "5"); } @@ -62,6 +62,12 @@ public class BlockSlayerCommand extends CommandBase { case "wolf": BlockWrongSlayer.onlySlayerName = "Sven Packmaster"; break; + case "enderman": + BlockWrongSlayer.onlySlayerName = "Voidgloom Seraph"; + break; + case "blaze": + BlockWrongSlayer.onlySlayerName = "Inferno Demonlord"; + break; case "off": BlockWrongSlayer.onlySlayerName = ""; BlockWrongSlayer.onlySlayerNumber = ""; diff --git a/src/main/java/me/Danker/commands/DisplayCommand.java b/src/main/java/me/Danker/commands/DisplayCommand.java index 3db6853..174258d 100644 --- a/src/main/java/me/Danker/commands/DisplayCommand.java +++ b/src/main/java/me/Danker/commands/DisplayCommand.java @@ -21,7 +21,7 @@ public class DisplayCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " [winter/festival/spooky/ch/session/f(1-7)/mm]"; + return "/" + getCommandName() + " [winter/festival/spooky/ch/session/f(1-7)/mm]"; } public static String usage(ICommandSender arg0) { @@ -36,7 +36,7 @@ public class DisplayCommand extends CommandBase { @Override public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "enderman", "fishing", "catacombs", "mythological", "ghost", "auto", "off"); + return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "enderman", "blaze", "fishing", "catacombs", "mythological", "ghost", "auto", "off"); } else if (args.length == 2 && args[0].equalsIgnoreCase("fishing")) { return getListOfStringsMatchingLastWord(args, "winter", "festival", "spooky", "ch", "session"); } else if (args.length == 2 && args[0].equalsIgnoreCase("catacombs")) { @@ -89,6 +89,13 @@ public class DisplayCommand extends CommandBase { LootDisplay.display = "enderman"; } break; + case "blaze": + if (showSession) { + LootDisplay.display = "blaze_session"; + } else { + LootDisplay.display = "blaze"; + } + break; case "fishing": if (arg1.length > 1) { switch (arg1[1].toLowerCase()) { @@ -213,7 +220,7 @@ public class DisplayCommand extends CommandBase { LootDisplay.display = "catacombs_master"; } default: - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: /display catacombs ")); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: /display catacombs ")); return; } break; diff --git a/src/main/java/me/Danker/commands/LootCommand.java b/src/main/java/me/Danker/commands/LootCommand.java index 5edc5f4..5d91573 100644 --- a/src/main/java/me/Danker/commands/LootCommand.java +++ b/src/main/java/me/Danker/commands/LootCommand.java @@ -24,7 +24,7 @@ public class LootCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " [winter/festival/spooky/ch/f(1-7)/mm/session]"; + return "/" + getCommandName() + " [winter/festival/spooky/ch/f(1-7)/mm/session]"; } public static String usage(ICommandSender arg0) { @@ -39,7 +39,7 @@ public class LootCommand extends CommandBase { @Override public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "enderman", "fishing", "catacombs", "mythological"); + return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "enderman", "blaze", "fishing", "catacombs", "mythological"); } else if (args.length == 2 && args[0].equalsIgnoreCase("fishing")) { return getListOfStringsMatchingLastWord(args, "winter", "festival", "spooky", "ch", "session"); } else if (args.length == 2 && args[0].equalsIgnoreCase("catacombs")) { @@ -64,9 +64,8 @@ public class LootCommand extends CommandBase { String bossesBetween; String drop20; NumberFormat nf = NumberFormat.getIntegerInstance(Locale.US); - boolean showSession = false; - if (arg1[arg1.length - 1].equalsIgnoreCase("session")) showSession = true; + boolean showSession = arg1[arg1.length - 1].equalsIgnoreCase("session"); switch (arg1[0].toLowerCase()) { case "wolf": @@ -363,6 +362,88 @@ public class LootCommand extends CommandBase { EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + EnumChatFormatting.DARK_PURPLE + EnumChatFormatting.BOLD + " -------------------")); break; + case "blaze": + if (showSession) { + if (BlazeTracker.timeSession == -1) { + timeBetween = "Never"; + } else { + timeBetween = Utils.getTimeBetween(BlazeTracker.timeSession, timeNow); + } + if (BlazeTracker.bossesSession == -1) { + bossesBetween = "Never"; + } else { + bossesBetween = nf.format(BlazeTracker.bossesSession); + } + + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " Blaze Loot Summary (Current Session):\n" + + EnumChatFormatting.GOLD + " Demonlords Killed: " + nf.format(BlazeTracker.demonlordsSession) + "\n" + + EnumChatFormatting.GRAY + " Derelict Ashes: " + nf.format(BlazeTracker.derelictAshesSession) + "\n" + + EnumChatFormatting.RED + " Lavatear Runes: " + nf.format(BlazeTracker.lavatearRunesSession) + "\n" + + EnumChatFormatting.AQUA + " Splash Potions: " + nf.format(BlazeTracker.splashPotionsSession) + "\n" + + EnumChatFormatting.DARK_RED + " Magma Arrows: " + nf.format(BlazeTracker.magmaArrowsSession) + "\n" + + EnumChatFormatting.DARK_AQUA + " Mana Disintegrators: " + nf.format(BlazeTracker.manaDisintegratorsSession) + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Scorched Books: " + nf.format(BlazeTracker.scorchedBooksSession) + "\n" + + EnumChatFormatting.WHITE + " Kelvin Inverters: " + nf.format(BlazeTracker.kelvinInvertersSession) + "\n" + + EnumChatFormatting.BLUE + " Blaze Rod Distillates: " + nf.format(BlazeTracker.blazeRodDistillatesSession) + "\n" + + EnumChatFormatting.BLUE + " Glowstone Distillates: " + nf.format(BlazeTracker.glowstoneDistillatesSession) + "\n" + + EnumChatFormatting.BLUE + " Magma Cream Distillates: " + nf.format(BlazeTracker.magmaCreamDistillatesSession) + "\n" + + EnumChatFormatting.BLUE + " Nether Wart Distillates: " + nf.format(BlazeTracker.netherWartDistillatesSession) + "\n" + + EnumChatFormatting.BLUE + " Gabagool Distillates: " + nf.format(BlazeTracker.gabagoolDistillatesSession) + "\n" + + EnumChatFormatting.RED + " Scorched Power Crystals: " + nf.format(BlazeTracker.scorchedPowerCrystalsSession) + "\n" + + EnumChatFormatting.RED + " Fire Aspect Books: " + nf.format(BlazeTracker.fireAspectBooksSession) + "\n" + + EnumChatFormatting.GOLD + " Fiery Burst Runes: " + nf.format(BlazeTracker.fieryBurstRunesSession) + "\n" + + EnumChatFormatting.WHITE + " Opal Gems: " + nf.format(BlazeTracker.opalGemsSession) + "\n" + + EnumChatFormatting.RED + " Archfiend Dice: " + nf.format(BlazeTracker.archfiendDiceSession) + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Duplex Books: " + nf.format(BlazeTracker.duplexBooksSession) + "\n" + + EnumChatFormatting.GOLD + " High Class Archfiend Dice: " + nf.format(BlazeTracker.highClassArchfiendDiceSession) + "\n" + + EnumChatFormatting.GOLD + " Engineering Plans: " + nf.format(BlazeTracker.engineeringPlansSession) + "\n" + + EnumChatFormatting.GOLD + " Subzero Inverters: " + nf.format(BlazeTracker.subzeroInvertersSession) + "\n" + + EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + + EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " -------------------")); + return; + } + + if (BlazeTracker.time == -1) { + timeBetween = "Never"; + } else { + timeBetween = Utils.getTimeBetween(BlazeTracker.time, timeNow); + } + if (BlazeTracker.bosses == -1) { + bossesBetween = "Never"; + } else { + bossesBetween = nf.format(BlazeTracker.bosses); + } + + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " Blaze Loot Summary:\n" + + EnumChatFormatting.GOLD + " Demonlords Killed: " + nf.format(BlazeTracker.demonlords) + "\n" + + EnumChatFormatting.GRAY + " Derelict Ashes: " + nf.format(BlazeTracker.derelictAshes) + "\n" + + EnumChatFormatting.RED + " Lavatear Runes: " + nf.format(BlazeTracker.lavatearRunes) + "\n" + + EnumChatFormatting.AQUA + " Splash Potions: " + nf.format(BlazeTracker.splashPotions) + "\n" + + EnumChatFormatting.DARK_RED + " Magma Arrows: " + nf.format(BlazeTracker.magmaArrows) + "\n" + + EnumChatFormatting.DARK_AQUA + " Mana Disintegrators: " + nf.format(BlazeTracker.manaDisintegrators) + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Scorched Books: " + nf.format(BlazeTracker.scorchedBooks) + "\n" + + EnumChatFormatting.WHITE + " Kelvin Inverters: " + nf.format(BlazeTracker.kelvinInverters) + "\n" + + EnumChatFormatting.BLUE + " Blaze Rod Distillates: " + nf.format(BlazeTracker.blazeRodDistillates) + "\n" + + EnumChatFormatting.BLUE + " Glowstone Distillates: " + nf.format(BlazeTracker.glowstoneDistillates) + "\n" + + EnumChatFormatting.BLUE + " Magma Cream Distillates: " + nf.format(BlazeTracker.magmaCreamDistillates) + "\n" + + EnumChatFormatting.BLUE + " Nether Wart Distillates: " + nf.format(BlazeTracker.netherWartDistillates) + "\n" + + EnumChatFormatting.BLUE + " Gabagool Distillates: " + nf.format(BlazeTracker.gabagoolDistillates) + "\n" + + EnumChatFormatting.RED + " Scorched Power Crystals: " + nf.format(BlazeTracker.scorchedPowerCrystals) + "\n" + + EnumChatFormatting.RED + " Fire Aspect Books: " + nf.format(BlazeTracker.fireAspectBooks) + "\n" + + EnumChatFormatting.GOLD + " Fiery Burst Runes: " + nf.format(BlazeTracker.fieryBurstRunes) + "\n" + + EnumChatFormatting.WHITE + " Opal Gems: " + nf.format(BlazeTracker.opalGems) + "\n" + + EnumChatFormatting.RED + " Archfiend Dice: " + nf.format(BlazeTracker.archfiendDice) + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Duplex Books: " + nf.format(BlazeTracker.duplexBooks) + "\n" + + EnumChatFormatting.GOLD + " High Class Archfiend Dice: " + nf.format(BlazeTracker.highClassArchfiendDice) + "\n" + + EnumChatFormatting.GOLD + " Engineering Plans: " + nf.format(BlazeTracker.engineeringPlans) + "\n" + + EnumChatFormatting.GOLD + " Subzero Inverters: " + nf.format(BlazeTracker.subzeroInverters) + "\n" + + EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + + EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " -------------------")); + break; case "fishing": if (arg1.length > 1) { if (arg1[1].equalsIgnoreCase("winter")) { diff --git a/src/main/java/me/Danker/commands/ResetLootCommand.java b/src/main/java/me/Danker/commands/ResetLootCommand.java index f1d2828..d3294b2 100644 --- a/src/main/java/me/Danker/commands/ResetLootCommand.java +++ b/src/main/java/me/Danker/commands/ResetLootCommand.java @@ -25,7 +25,7 @@ public class ResetLootCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + ""; + return "/" + getCommandName() + ""; } public static String usage(ICommandSender arg0) { @@ -44,7 +44,7 @@ public class ResetLootCommand extends CommandBase { if (confirmReset) { return getListOfStringsMatchingLastWord(args, "confirm", "cancel"); } else { - return getListOfStringsMatchingLastWord(args, "zombie", "spider", "wolf", "enderman", "fishing", "mythological", "catacombs"); + return getListOfStringsMatchingLastWord(args, "zombie", "spider", "wolf", "enderman", "blaze", "fishing", "mythological", "catacombs"); } } @@ -53,7 +53,7 @@ public class ResetLootCommand extends CommandBase { final EntityPlayer player = (EntityPlayer) arg0; if (arg1.length == 0) { - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: /resetloot ")); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: /resetloot ")); return; } @@ -75,6 +75,9 @@ public class ResetLootCommand extends CommandBase { case "enderman": resetEnderman(); break; + case "blaze": + resetBlaze(); + break; case "fishing": resetFishing(); break; @@ -102,6 +105,7 @@ public class ResetLootCommand extends CommandBase { case "spider": case "wolf": case "enderman": + case "blaze": case "fishing": case "mythological": case "catacombs": @@ -201,6 +205,35 @@ public class ResetLootCommand extends CommandBase { ConfigHandler.deleteCategory("enderman"); ConfigHandler.reloadConfig(); } + + static void resetBlaze() { + BlazeTracker.demonlordsSession = 0; + BlazeTracker.derelictAshesSession = 0; + BlazeTracker.lavatearRunesSession = 0; + BlazeTracker.splashPotionsSession = 0; + BlazeTracker.magmaArrowsSession = 0; + BlazeTracker.manaDisintegratorsSession = 0; + BlazeTracker.scorchedBooksSession = 0; + BlazeTracker.kelvinInvertersSession = 0; + BlazeTracker.blazeRodDistillatesSession = 0; + BlazeTracker.glowstoneDistillatesSession = 0; + BlazeTracker.magmaCreamDistillatesSession = 0; + BlazeTracker.netherWartDistillatesSession = 0; + BlazeTracker.gabagoolDistillatesSession = 0; + BlazeTracker.scorchedPowerCrystalsSession = 0; + BlazeTracker.fireAspectBooksSession = 0; + BlazeTracker.fieryBurstRunesSession = 0; + BlazeTracker.opalGemsSession = 0; + BlazeTracker.archfiendDiceSession = 0; + BlazeTracker.duplexBooksSession = 0; + BlazeTracker.highClassArchfiendDiceSession = 0; + BlazeTracker.engineeringPlansSession = 0; + BlazeTracker.subzeroInvertersSession = 0; + BlazeTracker.timeSession = 0; + BlazeTracker.bossesSession = 0; + ConfigHandler.deleteCategory("blaze"); + ConfigHandler.reloadConfig(); + } static void resetFishing() { FishingTracker.seaCreaturesSession = 0; diff --git a/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java b/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java index 0923b57..37e89c5 100644 --- a/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java +++ b/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java @@ -70,15 +70,14 @@ public class SkyblockPlayersCommand extends CommandBase { int skyblockTotalPlayers = 0; // players int privateIsland = 0; // dynamic int hub = 0; // hub - int barn = 0; // farming_1 - int mushroomDesert = 0; // farming_2 + int farmingIslands = 0; // farming_1 int park = 0; // foraging_1 int goldMine = 0; // mining_1 int deepCaverns = 0; // mining_2 int dwarvenMines = 0; // mining_3 int crystalHollows = 0; // crystal_hollows int spidersDen = 0; // combat_1 - int blazingFortress = 0; // combat_2 + int crimsonIsle = 0; // crimson_isle int end = 0; // combat_3 int dungeonsHub = 0; // dungeon_hub int dungeons = 0; // dungeon @@ -94,10 +93,7 @@ public class SkyblockPlayersCommand extends CommandBase { hub = skyblockPlayers.get("hub").getAsInt(); } if (skyblockPlayers.has("farming_1")) { - barn = skyblockPlayers.get("farming_1").getAsInt(); - } - if (skyblockPlayers.has("farming_2")) { - mushroomDesert = skyblockPlayers.get("farming_2").getAsInt(); + farmingIslands = skyblockPlayers.get("farming_1").getAsInt(); } if (skyblockPlayers.has("foraging_1")) { park = skyblockPlayers.get("foraging_1").getAsInt(); @@ -117,8 +113,8 @@ public class SkyblockPlayersCommand extends CommandBase { if (skyblockPlayers.has("combat_1")) { spidersDen = skyblockPlayers.get("combat_1").getAsInt(); } - if (skyblockPlayers.has("combat_2")) { - blazingFortress = skyblockPlayers.get("combat_2").getAsInt(); + if (skyblockPlayers.has("crimson_isle")) { + crimsonIsle = skyblockPlayers.get("crimson_isle").getAsInt(); } if (skyblockPlayers.has("combat_3")) { end = skyblockPlayers.get("combat_3").getAsInt(); @@ -143,15 +139,14 @@ public class SkyblockPlayersCommand extends CommandBase { DankersSkyblockMod.TYPE_COLOUR + " Skyblock: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(skyblockTotalPlayers) + " / " + Utils.getPercentage(skyblockTotalPlayers, totalPlayers) + "%\n" + DankersSkyblockMod.TYPE_COLOUR + " Private Island: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(privateIsland) + " / " + Utils.getPercentage(privateIsland, skyblockTotalPlayers) + "%\n" + DankersSkyblockMod.TYPE_COLOUR + " Hub: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(hub) + " / " + Utils.getPercentage(hub, skyblockTotalPlayers) + "%\n" + - DankersSkyblockMod.TYPE_COLOUR + " Barn: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(barn) + " / " + Utils.getPercentage(barn, skyblockTotalPlayers) + "%\n" + - DankersSkyblockMod.TYPE_COLOUR + " Mushroom Desert: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(mushroomDesert) + " / " + Utils.getPercentage(mushroomDesert, skyblockTotalPlayers) + "%\n" + + DankersSkyblockMod.TYPE_COLOUR + " Farming Islands: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(farmingIslands) + " / " + Utils.getPercentage(farmingIslands, skyblockTotalPlayers) + "%\n" + DankersSkyblockMod.TYPE_COLOUR + " Park: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(park) + " / " + Utils.getPercentage(park, skyblockTotalPlayers) + "%\n" + DankersSkyblockMod.TYPE_COLOUR + " Gold Mine: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(goldMine) + " / " + Utils.getPercentage(goldMine, skyblockTotalPlayers) + "%\n" + DankersSkyblockMod.TYPE_COLOUR + " Deep Caverns: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(deepCaverns) + " / " + Utils.getPercentage(deepCaverns, skyblockTotalPlayers) + "%\n" + DankersSkyblockMod.TYPE_COLOUR + " Dwarven Mines: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(dwarvenMines) + " / " + Utils.getPercentage(dwarvenMines, skyblockTotalPlayers) + "%\n" + DankersSkyblockMod.TYPE_COLOUR + " Crystal Hollows: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(crystalHollows) + " / " + Utils.getPercentage(crystalHollows, skyblockTotalPlayers) + "%\n" + DankersSkyblockMod.TYPE_COLOUR + " Spider's Den: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(spidersDen) + " / " + Utils.getPercentage(spidersDen, skyblockTotalPlayers) + "%\n" + - DankersSkyblockMod.TYPE_COLOUR + " Blazing Fortress: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(blazingFortress) + " / " + Utils.getPercentage(blazingFortress, skyblockTotalPlayers) + "%\n" + + DankersSkyblockMod.TYPE_COLOUR + " Crimson Isle: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(crimsonIsle) + " / " + Utils.getPercentage(crimsonIsle, skyblockTotalPlayers) + "%\n" + DankersSkyblockMod.TYPE_COLOUR + " The End: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(end) + " / " + Utils.getPercentage(end, skyblockTotalPlayers) + "%\n" + DankersSkyblockMod.TYPE_COLOUR + " Dungeons Hub: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(dungeonsHub) + " / " + Utils.getPercentage(dungeonsHub, skyblockTotalPlayers) + "%\n" + DankersSkyblockMod.TYPE_COLOUR + " Dungeons: " + DankersSkyblockMod.VALUE_COLOUR + nf.format(dungeons) + " / " + Utils.getPercentage(dungeons, skyblockTotalPlayers) + "%\n" + diff --git a/src/main/java/me/Danker/commands/SlayerCommand.java b/src/main/java/me/Danker/commands/SlayerCommand.java index 5444754..8ad87ae 100644 --- a/src/main/java/me/Danker/commands/SlayerCommand.java +++ b/src/main/java/me/Danker/commands/SlayerCommand.java @@ -113,15 +113,21 @@ public class SlayerCommand extends CommandBase { if (slayersObject.get("enderman").getAsJsonObject().has("xp")) { endermanXP = slayersObject.get("enderman").getAsJsonObject().get("xp").getAsInt(); } + // Blaze + int blazeXP = 0; + if (slayersObject.get("blaze").getAsJsonObject().has("xp")) { + blazeXP = slayersObject.get("blaze").getAsJsonObject().get("xp").getAsInt(); + } NumberFormat nf = NumberFormat.getIntegerInstance(Locale.US); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" + - EnumChatFormatting.AQUA + " " + username + "'s Total XP: " + EnumChatFormatting.GOLD + EnumChatFormatting.BOLD + nf.format(zombieXP + spiderXP + wolfXP + endermanXP) + "\n" + + EnumChatFormatting.AQUA + " " + username + "'s Total XP: " + EnumChatFormatting.GOLD + EnumChatFormatting.BOLD + nf.format(zombieXP + spiderXP + wolfXP + endermanXP + blazeXP) + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Zombie XP: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(zombieXP) + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Spider XP: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(spiderXP) + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Wolf XP: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(wolfXP) + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Enderman XP: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(endermanXP) + "\n" + - DankersSkyblockMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------")); + DankersSkyblockMod.TYPE_COLOUR + " Blaze XP: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(blazeXP) + "\n" + + DankersSkyblockMod.DELIMITER_COLOUR + EnumChatFormatting.BOLD + "-------------------")); }).start(); } diff --git a/src/main/java/me/Danker/commands/WeightCommand.java b/src/main/java/me/Danker/commands/WeightCommand.java index b00d881..ade909d 100644 --- a/src/main/java/me/Danker/commands/WeightCommand.java +++ b/src/main/java/me/Danker/commands/WeightCommand.java @@ -63,6 +63,8 @@ public class WeightCommand extends CommandBase { public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { return Utils.getMatchingPlayers(args[0]); + } else if (args.length == 2) { + return getListOfStringsMatchingLastWord(args, "lily", "farming"); } return null; } diff --git a/src/main/java/me/Danker/features/AutoDisplay.java b/src/main/java/me/Danker/features/AutoDisplay.java index 5fc4489..63b66d5 100644 --- a/src/main/java/me/Danker/features/AutoDisplay.java +++ b/src/main/java/me/Danker/features/AutoDisplay.java @@ -42,6 +42,9 @@ public class AutoDisplay { } else if (sCleaned.contains("Voidgloom Seraph")) { LootDisplay.display = "enderman"; found = true; + } else if (sCleaned.contains("Inferno Demonlord")) { + LootDisplay.display = "blaze"; + found = true; } else if (sCleaned.contains("The Mist")){ LootDisplay.display = "ghost"; found = true; diff --git a/src/main/java/me/Danker/features/loot/BlazeTracker.java b/src/main/java/me/Danker/features/loot/BlazeTracker.java new file mode 100644 index 0000000..896f65f --- /dev/null +++ b/src/main/java/me/Danker/features/loot/BlazeTracker.java @@ -0,0 +1,184 @@ +package me.Danker.features.loot; + +import me.Danker.commands.ToggleCommand; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.Utils; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StringUtils; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class BlazeTracker { + + public static int demonlords; + public static int derelictAshes; + public static int lavatearRunes; + public static int splashPotions; + public static int magmaArrows; + public static int manaDisintegrators; + public static int scorchedBooks; + public static int kelvinInverters; + public static int blazeRodDistillates; + public static int glowstoneDistillates; + public static int magmaCreamDistillates; + public static int netherWartDistillates; + public static int gabagoolDistillates; + public static int scorchedPowerCrystals; + public static int fireAspectBooks; + public static int fieryBurstRunes; + public static int opalGems; + public static int archfiendDice; + public static int duplexBooks; + public static int highClassArchfiendDice; + public static int engineeringPlans; + public static int subzeroInverters; + public static double time; + public static int bosses; + + public static int demonlordsSession = 0; + public static int derelictAshesSession = 0; + public static int lavatearRunesSession = 0; + public static int splashPotionsSession = 0; + public static int magmaArrowsSession = 0; + public static int manaDisintegratorsSession = 0; + public static int scorchedBooksSession = 0; + public static int kelvinInvertersSession = 0; + public static int blazeRodDistillatesSession = 0; + public static int glowstoneDistillatesSession = 0; + public static int magmaCreamDistillatesSession = 0; + public static int netherWartDistillatesSession = 0; + public static int gabagoolDistillatesSession = 0; + public static int scorchedPowerCrystalsSession = 0; + public static int fireAspectBooksSession = 0; + public static int fieryBurstRunesSession = 0; + public static int opalGemsSession = 0; + public static int archfiendDiceSession = 0; + public static int duplexBooksSession = 0; + public static int highClassArchfiendDiceSession = 0; + public static int engineeringPlansSession = 0; + public static int subzeroInvertersSession = 0; + public static double timeSession = 0; + public static int bossesSession = 0; + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent event) { + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + + if (!Utils.inSkyblock) return; + if (event.type == 2) return; + if (message.contains(":")) return; + + boolean rng = false; + + if (message.contains(" Blaze Slayer LVL ")) { + demonlords++; + demonlordsSession++; + if (bosses != -1) { + bosses++; + } + if (bossesSession != -1) { + bossesSession++; + } + ConfigHandler.writeIntConfig("blaze", "demonlords", demonlords); + ConfigHandler.writeIntConfig("blaze", "bossRNG", bosses); + } else if (message.contains("VERY RARE DROP! (") && message.contains(" Lavatears Rune I)")) { + lavatearRunes++; + lavatearRunesSession++; + ConfigHandler.writeIntConfig("blaze", "lavatearRunes", lavatearRunes); + } else if (message.contains("VERY RARE DROP! (Wisp's Ice-Flavored Water I Splash Potion)")) { + splashPotions++; + splashPotionsSession++; + ConfigHandler.writeIntConfig("blaze", "splashPotions", splashPotions); + } else if (message.contains("RARE DROP! (Bundle of Magma Arrows)")) { + magmaArrows++; + magmaArrowsSession++; + ConfigHandler.writeIntConfig("blaze", "magmaArrows", magmaArrows); + } else if (message.contains("VERY RARE DROP! (Mana Disintegrator)")) { + manaDisintegrators++; + manaDisintegratorsSession++; + ConfigHandler.writeIntConfig("blaze", "manaDisintegrators", manaDisintegrators); + } else if (message.contains("VERY RARE DROP! (Scorched Books)")) { + scorchedBooks++; + scorchedBooksSession++; + ConfigHandler.writeIntConfig("blaze", "scorchedBooks", scorchedBooks); + } else if (message.contains("VERY RARE DROP! (Kelvin Inverter)")) { + kelvinInverters++; + kelvinInvertersSession++; + ConfigHandler.writeIntConfig("blaze", "kelvinInverters", kelvinInverters); + } else if (message.contains("VERY RARE DROP! (Blaze Rod Distillate)")) { + blazeRodDistillates++; + blazeRodDistillatesSession++; + ConfigHandler.writeIntConfig("blaze", "blazeRodDistillates", blazeRodDistillates); + } else if (message.contains("VERY RARE DROP! (Glowstone Distillate)")) { + glowstoneDistillates++; + glowstoneDistillatesSession++; + ConfigHandler.writeIntConfig("blaze", "glowstoneDistillates", glowstoneDistillates); + } else if (message.contains("VERY RARE DROP! (Magma Cream Distillate)")) { + magmaCreamDistillates++; + magmaCreamDistillatesSession++; + ConfigHandler.writeIntConfig("blaze", "magmaCreamDistillates", magmaCreamDistillates); + } else if (message.contains("VERY RARE DROP! (Nether Wart Distillate)")) { + netherWartDistillates++; + netherWartDistillatesSession++; + ConfigHandler.writeIntConfig("blaze", "netherWartDistillates", netherWartDistillates); + } else if (message.contains("VERY RARE DROP! (Gabagool Distillate)")) { + gabagoolDistillates++; + gabagoolDistillatesSession++; + ConfigHandler.writeIntConfig("blaze", "gabagoolDistillates", gabagoolDistillates); + } else if (message.contains("VERY RARE DROP! (Scorched Power Crystal)")) { + scorchedPowerCrystals++; + scorchedPowerCrystalsSession++; + ConfigHandler.writeIntConfig("blaze", "scorchedPowerCrystals", scorchedPowerCrystals); + } else if (message.contains("VERY RARE DROP! (Fire Aspect III)")) { + fireAspectBooks++; + fireAspectBooksSession++; + ConfigHandler.writeIntConfig("blaze", "fireAspectBooks", fireAspectBooks); + } else if (message.contains("CRAZY RARE DROP! (") && message.contains(" Fiery Burst Rune I)")) { + rng = true; + fieryBurstRunes++; + fieryBurstRunesSession++; + ConfigHandler.writeIntConfig("blaze", "fieryBurstRunes", fieryBurstRunes); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.RED + "FIERY BURST RUNE!", 5); + } else if (message.contains("VERY RARE DROP! (") && message.contains(" Flawed Opal Gemstone)")) { + opalGems++; + opalGemsSession++; + ConfigHandler.writeIntConfig("blaze", "opalGems", opalGems); + } else if (message.contains("VERY RARE DROP! (Archfiend Dice)")) { + archfiendDice++; + archfiendDiceSession++; + ConfigHandler.writeIntConfig("blaze", "archfiendDice", archfiendDice); + } else if (message.contains("VERY RARE DROP! (Duplex I)")) { + duplexBooks++; + duplexBooksSession++; + ConfigHandler.writeIntConfig("blaze", "duplexBooks", duplexBooks); + } else if (message.contains("CRAZY RARE DROP! (High Class Archfiend Dice)")) { + rng = true; + highClassArchfiendDice++; + highClassArchfiendDiceSession++; + ConfigHandler.writeIntConfig("blaze", "highClassArchfiendDice", highClassArchfiendDice); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GOLD + "HIGH CLASS ARCHFIEND DICE!", 5); + } else if (message.contains("CRAZY RARE DROP! (Wilson's Engineering Plans)")) { + rng = true; + engineeringPlans++; + engineeringPlansSession++; + ConfigHandler.writeIntConfig("blaze", "engineeringPlans", engineeringPlans); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GOLD + "ENGINEERING PLANS!", 5); + } else if (message.contains("CRAZY RARE DROP! (Subzero Inverter)")) { + rng = true; + subzeroInverters++; + subzeroInvertersSession++; + ConfigHandler.writeIntConfig("blaze", "subzeroInverters", subzeroInverters); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GOLD + "SUBZERO INVERTER!", 5); + } + + if (rng) { + time = System.currentTimeMillis() / 1000; + bosses = 0; + timeSession = System.currentTimeMillis() / 1000; + bossesSession = 0; + ConfigHandler.writeDoubleConfig("blaze", "timeRNG", time); + ConfigHandler.writeIntConfig("blaze", "bossRNG", 0); + } + } + +} diff --git a/src/main/java/me/Danker/features/loot/LootDisplay.java b/src/main/java/me/Danker/features/loot/LootDisplay.java index aabdbd9..9d3f466 100644 --- a/src/main/java/me/Danker/features/loot/LootDisplay.java +++ b/src/main/java/me/Danker/features/loot/LootDisplay.java @@ -416,6 +416,128 @@ public class LootDisplay { EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; break; + case "blaze": + if (BlazeTracker.time == -1) { + timeBetween = "Never"; + } else { + timeBetween = Utils.getTimeBetween(BlazeTracker.time, timeNow); + } + if (BlazeTracker.bosses == -1) { + bossesBetween = "Never"; + } else { + bossesBetween = nf.format(BlazeTracker.bosses); + } + + dropsText = EnumChatFormatting.GOLD + "Demonlords Killed:\n" + + EnumChatFormatting.GRAY + "Derelict Ashes:\n" + + EnumChatFormatting.RED + "Lavatear Runes:\n" + + EnumChatFormatting.AQUA + "Splash Potions:\n" + + EnumChatFormatting.DARK_RED + "Magma Arrows:\n" + + EnumChatFormatting.DARK_AQUA + "Mana Disintegrators:\n" + + EnumChatFormatting.LIGHT_PURPLE + "Scorched Books:\n" + + EnumChatFormatting.WHITE + "Kelvin Inverters:\n" + + EnumChatFormatting.BLUE + "Blaze Rod Distillates:\n" + + EnumChatFormatting.BLUE + "Glowstone Distillates:\n" + + EnumChatFormatting.BLUE + "Magma Cream Distillates:\n" + + EnumChatFormatting.BLUE + "Nether Wart Distillates:\n" + + EnumChatFormatting.BLUE + "Gabagool Distillates:\n" + + EnumChatFormatting.RED + "Scorched Power Crystals:\n" + + EnumChatFormatting.RED + "Fire Aspect Books:\n" + + EnumChatFormatting.GOLD + "Fiery Burst Runes:\n" + + EnumChatFormatting.WHITE + "Opal Gems:\n" + + EnumChatFormatting.RED + "Archfiend Dice:\n" + + EnumChatFormatting.LIGHT_PURPLE + "Duplex Books:\n" + + EnumChatFormatting.GOLD + "High Class Archfiend Dice:\n" + + EnumChatFormatting.GOLD + "Engineering Plans:\n" + + EnumChatFormatting.GOLD + "Subzero Inverters:\n" + + EnumChatFormatting.AQUA + "Time Since RNG:\n" + + EnumChatFormatting.AQUA + "Bosses Since RNG:"; + countText = EnumChatFormatting.GOLD + nf.format(BlazeTracker.demonlords) + "\n" + + EnumChatFormatting.GRAY + nf.format(BlazeTracker.derelictAshes) + "\n" + + EnumChatFormatting.RED + nf.format(BlazeTracker.lavatearRunes) + "\n" + + EnumChatFormatting.AQUA + nf.format(BlazeTracker.splashPotions) + "\n" + + EnumChatFormatting.DARK_RED + nf.format(BlazeTracker.magmaArrows) + "\n" + + EnumChatFormatting.DARK_AQUA + nf.format(BlazeTracker.manaDisintegrators) + "\n" + + EnumChatFormatting.LIGHT_PURPLE + nf.format(BlazeTracker.scorchedBooks) + "\n" + + EnumChatFormatting.WHITE + nf.format(BlazeTracker.kelvinInverters) + "\n" + + EnumChatFormatting.BLUE + nf.format(BlazeTracker.blazeRodDistillates) + "\n" + + EnumChatFormatting.BLUE + nf.format(BlazeTracker.glowstoneDistillates) + "\n" + + EnumChatFormatting.BLUE + nf.format(BlazeTracker.magmaCreamDistillates) + "\n" + + EnumChatFormatting.BLUE + nf.format(BlazeTracker.netherWartDistillates) + "\n" + + EnumChatFormatting.BLUE + nf.format(BlazeTracker.gabagoolDistillates) + "\n" + + EnumChatFormatting.RED + nf.format(BlazeTracker.scorchedPowerCrystals) + "\n" + + EnumChatFormatting.RED + nf.format(BlazeTracker.fireAspectBooks) + "\n" + + EnumChatFormatting.GOLD + nf.format(BlazeTracker.fieryBurstRunes) + "\n" + + EnumChatFormatting.WHITE + nf.format(BlazeTracker.opalGems) + "\n" + + EnumChatFormatting.RED + nf.format(BlazeTracker.archfiendDice) + "\n" + + EnumChatFormatting.LIGHT_PURPLE + nf.format(BlazeTracker.duplexBooks) + "\n" + + EnumChatFormatting.GOLD + nf.format(BlazeTracker.highClassArchfiendDice) + "\n" + + EnumChatFormatting.GOLD + nf.format(BlazeTracker.engineeringPlans) + "\n" + + EnumChatFormatting.GOLD + nf.format(BlazeTracker.subzeroInverters) + "\n" + + EnumChatFormatting.AQUA + timeBetween + "\n" + + EnumChatFormatting.AQUA + bossesBetween; + break; + case "blaze_session": + if (BlazeTracker.timeSession == -1) { + timeBetween = "Never"; + } else { + timeBetween = Utils.getTimeBetween(BlazeTracker.timeSession, timeNow); + } + if (BlazeTracker.bossesSession == -1) { + bossesBetween = "Never"; + } else { + bossesBetween = nf.format(BlazeTracker.bossesSession); + } + + dropsText = EnumChatFormatting.GOLD + "Demonlords Killed:\n" + + EnumChatFormatting.GRAY + "Derelict Ashes:\n" + + EnumChatFormatting.RED + "Lavatear Runes:\n" + + EnumChatFormatting.AQUA + "Splash Potions:\n" + + EnumChatFormatting.DARK_RED + "Magma Arrows:\n" + + EnumChatFormatting.DARK_AQUA + "Mana Disintegrators:\n" + + EnumChatFormatting.LIGHT_PURPLE + "Scorched Books:\n" + + EnumChatFormatting.WHITE + "Kelvin Inverters:\n" + + EnumChatFormatting.BLUE + "Blaze Rod Distillates:\n" + + EnumChatFormatting.BLUE + "Glowstone Distillates:\n" + + EnumChatFormatting.BLUE + "Magma Cream Distillates:\n" + + EnumChatFormatting.BLUE + "Nether Wart Distillates:\n" + + EnumChatFormatting.BLUE + "Gabagool Distillates:\n" + + EnumChatFormatting.RED + "Scorched Power Crystals:\n" + + EnumChatFormatting.RED + "Fire Aspect Books:\n" + + EnumChatFormatting.GOLD + "Fiery Burst Runes:\n" + + EnumChatFormatting.WHITE + "Opal Gems:\n" + + EnumChatFormatting.RED + "Archfiend Dice:\n" + + EnumChatFormatting.LIGHT_PURPLE + "Duplex Books:\n" + + EnumChatFormatting.GOLD + "High Class Archfiend Dice:\n" + + EnumChatFormatting.GOLD + "Engineering Plans:\n" + + EnumChatFormatting.GOLD + "Subzero Inverters:\n" + + EnumChatFormatting.AQUA + "Time Since RNG:\n" + + EnumChatFormatting.AQUA + "Bosses Since RNG:"; + countText = EnumChatFormatting.GOLD + nf.format(BlazeTracker.demonlordsSession) + "\n" + + EnumChatFormatting.GRAY + nf.format(BlazeTracker.derelictAshesSession) + "\n" + + EnumChatFormatting.RED + nf.format(BlazeTracker.lavatearRunesSession) + "\n" + + EnumChatFormatting.AQUA + nf.format(BlazeTracker.splashPotionsSession) + "\n" + + EnumChatFormatting.DARK_RED + nf.format(BlazeTracker.magmaArrowsSession) + "\n" + + EnumChatFormatting.DARK_AQUA + nf.format(BlazeTracker.manaDisintegratorsSession) + "\n" + + EnumChatFormatting.LIGHT_PURPLE + nf.format(BlazeTracker.scorchedBooksSession) + "\n" + + EnumChatFormatting.WHITE + nf.format(BlazeTracker.kelvinInvertersSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(BlazeTracker.blazeRodDistillatesSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(BlazeTracker.glowstoneDistillatesSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(BlazeTracker.magmaCreamDistillatesSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(BlazeTracker.netherWartDistillatesSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(BlazeTracker.gabagoolDistillatesSession) + "\n" + + EnumChatFormatting.RED + nf.format(BlazeTracker.scorchedPowerCrystalsSession) + "\n" + + EnumChatFormatting.RED + nf.format(BlazeTracker.fireAspectBooksSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(BlazeTracker.fieryBurstRunesSession) + "\n" + + EnumChatFormatting.WHITE + nf.format(BlazeTracker.opalGemsSession) + "\n" + + EnumChatFormatting.RED + nf.format(BlazeTracker.archfiendDiceSession) + "\n" + + EnumChatFormatting.LIGHT_PURPLE + nf.format(BlazeTracker.duplexBooksSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(BlazeTracker.highClassArchfiendDiceSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(BlazeTracker.engineeringPlansSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(BlazeTracker.subzeroInvertersSession) + "\n" + + EnumChatFormatting.AQUA + timeBetween + "\n" + + EnumChatFormatting.AQUA + bossesBetween; + break; case "fishing": if (FishingTracker.empTime == -1) { timeBetween = "Never"; diff --git a/src/main/java/me/Danker/features/loot/LootTracker.java b/src/main/java/me/Danker/features/loot/LootTracker.java index 4e5974c..27f0779 100644 --- a/src/main/java/me/Danker/features/loot/LootTracker.java +++ b/src/main/java/me/Danker/features/loot/LootTracker.java @@ -31,23 +31,27 @@ public class LootTracker { int itemWebs = Utils.getItems("Tarantula Web"); int itemRev = Utils.getItems("Revenant Flesh"); int itemNullSphere = Utils.getItems("Null Sphere"); + int itemDerelictAshe = Utils.getItems("Derelict Ashe"); // If no items, are detected, allow check again. Should fix items not being found - if (itemTeeth + itemWebs + itemRev + itemNullSphere > 0) { + if (itemTeeth + itemWebs + itemRev + itemNullSphere + itemDerelictAshe > 0) { itemsChecked = System.currentTimeMillis() / 1000; WolfTracker.wolfTeeth += itemTeeth; SpiderTracker.spiderWebs += itemWebs; ZombieTracker.zombieRevFlesh += itemRev; EndermanTracker.endermanNullSpheres += itemNullSphere; + BlazeTracker.derelictAshes += itemDerelictAshe; WolfTracker.wolfTeethSession += itemTeeth; SpiderTracker.spiderWebsSession += itemWebs; ZombieTracker.zombieRevFleshSession += itemRev; EndermanTracker.endermanNullSpheresSession += itemNullSphere; + BlazeTracker.derelictAshesSession += itemDerelictAshe; ConfigHandler.writeIntConfig("wolf", "teeth", WolfTracker.wolfTeeth); ConfigHandler.writeIntConfig("spider", "web", SpiderTracker.spiderWebs); ConfigHandler.writeIntConfig("zombie", "revFlesh", ZombieTracker.zombieRevFlesh); ConfigHandler.writeIntConfig("enderman", "nullSpheres", EndermanTracker.endermanNullSpheres); + ConfigHandler.writeIntConfig("blaze", "derelictAshe", BlazeTracker.derelictAshes); } } } diff --git a/src/main/java/me/Danker/gui/DisplayGui.java b/src/main/java/me/Danker/gui/DisplayGui.java index 17726f8..073b161 100644 --- a/src/main/java/me/Danker/gui/DisplayGui.java +++ b/src/main/java/me/Danker/gui/DisplayGui.java @@ -20,6 +20,7 @@ public class DisplayGui extends GuiScreen { private GuiButton spider; private GuiButton wolf; private GuiButton enderman; + private GuiButton blaze; private GuiButton auto; private GuiButton fishing; private GuiButton fishingWinter; @@ -54,10 +55,11 @@ public class DisplayGui extends GuiScreen { showSession = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Current Session Only: " + Utils.getColouredBoolean(addSession)); off = new GuiButton(0, width / 2 - 210, (int) (height * 0.2), "Off"); auto = new GuiButton(0, width / 2 + 10, (int) (height * 0.2), "Auto"); - zombie = new GuiButton(0, width / 2 - 230, (int) (height * 0.35), 100, 20, "Zombie"); - spider = new GuiButton(0, width / 2 - 110, (int) (height * 0.35), 100, 20, "Spider"); - wolf = new GuiButton(0, width / 2 + 10, (int) (height * 0.35), 100, 20, "Wolf"); - enderman = new GuiButton(0, width / 2 + 130, (int) (height * 0.35), 100, 20, "Enderman"); + zombie = new GuiButton(0, width / 2 - 270, (int) (height * 0.35), 100, 20, "Zombie"); + spider = new GuiButton(0, width / 2 - 160, (int) (height * 0.35), 100, 20, "Spider"); + wolf = new GuiButton(0, width / 2 - 50, (int) (height * 0.35), 100, 20, "Wolf"); + enderman = new GuiButton(0, width / 2 + 60, (int) (height * 0.35), 100, 20, "Enderman"); + blaze = new GuiButton(0, width / 2 + 170, (int) (height * 0.35), 100, 20, "Blaze"); fishing = new GuiButton(0, width / 2 - 270, (int) (height * 0.5), 100, 20, "Fishing"); fishingWinter = new GuiButton(0, width / 2 - 160, (int) (height * 0.5), 100, 20, "Fishing Winter"); fishingFestival = new GuiButton(0, width / 2 - 50, (int) (height * 0.5), 100, 20, "Fishing Festival"); @@ -81,6 +83,7 @@ public class DisplayGui extends GuiScreen { this.buttonList.add(spider); this.buttonList.add(wolf); this.buttonList.add(enderman); + this.buttonList.add(blaze); this.buttonList.add(fishing); this.buttonList.add(fishingWinter); this.buttonList.add(fishingFestival); @@ -130,6 +133,8 @@ public class DisplayGui extends GuiScreen { setDisplay("wolf"); } else if (button == enderman) { setDisplay("enderman"); + } else if (button == blaze) { + setDisplay("blaze"); } else if (button == auto) { LootDisplay.auto = true; ConfigHandler.writeBooleanConfig("misc", "autoDisplay", true); diff --git a/src/main/java/me/Danker/gui/OnlySlayerGui.java b/src/main/java/me/Danker/gui/OnlySlayerGui.java index 2a6d844..c637ff9 100644 --- a/src/main/java/me/Danker/gui/OnlySlayerGui.java +++ b/src/main/java/me/Danker/gui/OnlySlayerGui.java @@ -19,6 +19,7 @@ public class OnlySlayerGui extends GuiScreen { private GuiButton spider; private GuiButton wolf; private GuiButton enderman; + private GuiButton blaze; private GuiButton one; private GuiButton two; private GuiButton three; @@ -60,10 +61,11 @@ public class OnlySlayerGui extends GuiScreen { goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); off = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Off"); - zombie = new GuiButton(0, width / 2 - 230, (int) (height * 0.4), 100, 20, "Zombie"); - spider = new GuiButton(0, width / 2 - 110, (int) (height * 0.4), 100, 20, "Spider"); - wolf = new GuiButton(0, width / 2 + 10, (int) (height * 0.4), 100, 20, "Wolf"); - enderman = new GuiButton(0, width / 2 + 130, (int) (height * 0.4), 100, 20, "Enderman"); + zombie = new GuiButton(0, width / 2 - 270, (int) (height * 0.4), 100, 20, "Zombie"); + spider = new GuiButton(0, width / 2 - 160, (int) (height * 0.4), 100, 20, "Spider"); + wolf = new GuiButton(0, width / 2 - 50, (int) (height * 0.4), 100, 20, "Wolf"); + enderman = new GuiButton(0, width / 2 + 60, (int) (height * 0.4), 100, 20, "Enderman"); + blaze = new GuiButton(0, width / 2 + 170, (int) (height * 0.4), 100, 20, "Blaze"); one = new GuiButton(0, width / 2 - 190, (int) (height * 0.6), 60, 20, "I"); two = new GuiButton(0, width / 2 - 110, (int) (height * 0.6), 60, 20, "II"); three = new GuiButton(0, width / 2 - 30, (int) (height * 0.6), 60, 20, "III"); @@ -75,6 +77,7 @@ public class OnlySlayerGui extends GuiScreen { this.buttonList.add(spider); this.buttonList.add(wolf); this.buttonList.add(enderman); + this.buttonList.add(blaze); this.buttonList.add(one); this.buttonList.add(two); this.buttonList.add(three); @@ -86,7 +89,6 @@ public class OnlySlayerGui extends GuiScreen { @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); - Minecraft mc = Minecraft.getMinecraft(); String displayText; if (BlockWrongSlayer.onlySlayerName.equals("")) { @@ -117,6 +119,8 @@ public class OnlySlayerGui extends GuiScreen { onlyName = "Sven Packmaster"; } else if (button == enderman) { onlyName = "Voidgloom Seraph"; + } else if (button == blaze) { + onlyName = "Inferno Demonlord"; } else if (button == one) { onlyNumberInt = 1; } else if (button == two) { diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index b042177..4298c2a 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -384,7 +384,32 @@ public class ConfigHandler { EndermanTracker.endermanEnderBooks = initInt("enderman", "enderBooks", 0); EndermanTracker.endermanTime = initDouble("enderman", "timeRNG", -1); EndermanTracker.endermanBosses = initInt("enderman", "bossRNG", -1); - + // Blaze + BlazeTracker.demonlords = initInt("blaze", "demonlords", 0); + BlazeTracker.derelictAshes = initInt("blaze", "derelictAshes", 0); + BlazeTracker.lavatearRunes = initInt("blaze", "lavatearRunes", 0); + BlazeTracker.splashPotions = initInt("blaze", "splashPotions", 0); + BlazeTracker.magmaArrows = initInt("blaze", "magmaArrows", 0); + BlazeTracker.manaDisintegrators = initInt("blaze", "manaDisintegrators", 0); + BlazeTracker.scorchedBooks = initInt("blaze", "scorchedBooks", 0); + BlazeTracker.kelvinInverters = initInt("blaze", "kelvinInverters", 0); + BlazeTracker.blazeRodDistillates = initInt("blaze", "blazeRodDistillates", 0); + BlazeTracker.glowstoneDistillates = initInt("blaze", "glowstoneDistillates", 0); + BlazeTracker.magmaCreamDistillates = initInt("blaze", "magmaCreamDistillates", 0); + BlazeTracker.netherWartDistillates = initInt("blaze", "netherWartDistillates", 0); + BlazeTracker.gabagoolDistillates = initInt("blaze", "gabagoolDistillates", 0); + BlazeTracker.scorchedPowerCrystals = initInt("blaze", "scorchedPowerCrystals", 0); + BlazeTracker.fireAspectBooks = initInt("blaze", "fireAspectBooks", 0); + BlazeTracker.fieryBurstRunes = initInt("blaze", "fieryBurstRunes", 0); + BlazeTracker.opalGems = initInt("blaze", "opalGems", 0); + BlazeTracker.archfiendDice = initInt("blaze", "archfiendDice", 0); + BlazeTracker.duplexBooks = initInt("blaze", "duplexBooks", 0); + BlazeTracker.highClassArchfiendDice = initInt("blaze", "highClassArchfiendDice", 0); + BlazeTracker.engineeringPlans = initInt("blaze", "engineeringPlans", 0); + BlazeTracker.subzeroInverters = initInt("blaze", "subzeroInverters", 0); + BlazeTracker.time = initDouble("blaze", "timeRNG", -1); + BlazeTracker.bossesSession = initInt("blaze", "bossRNG", -1); + // Fishing FishingTracker.seaCreatures = initInt("fishing", "seaCreature", 0); FishingTracker.goodCatches = initInt("fishing", "goodCatch", 0); -- cgit From a731568267903caf47a857bc3780de85daa63739 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Wed, 20 Apr 2022 23:42:22 -0400 Subject: Fix crimson isle custom music --- README.md | 4 ++-- src/main/java/me/Danker/commands/CustomMusicCommand.java | 12 ++++++------ src/main/java/me/Danker/commands/ToggleCommand.java | 12 ++++++------ src/main/java/me/Danker/features/CustomMusic.java | 12 ++++++------ src/main/java/me/Danker/gui/CustomMusicGui.java | 16 ++++++++-------- src/main/java/me/Danker/handlers/ConfigHandler.java | 4 ++-- 6 files changed, 30 insertions(+), 30 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 2a740c7..e3b7ee8 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ Discord Server: https://discord.gg/QsEkNQS - /reparty - Disbands and reparties all members in the party - /fairysouls - Check the fairysouls of a player - /lobbybank - Uses API to find the average bank total of the lobby, as well the three players with the highest total money in the bank (and purse). -- /dsmmusic [dungeonboss/bloodroom/dungeon/hub/island/dungeonhub/farmingislands/goldmine/deepcaverns/dwarvenmines/crystalhollows/spidersden/blazingfortress/end/park] [1-100] - Stops, reloads or changes the volume of custom music. +- /dsmmusic [dungeonboss/bloodroom/dungeon/hub/island/dungeonhub/farmingislands/goldmine/deepcaverns/dwarvenmines/crystalhollows/spidersden/crimsonisle/end/park] [1-100] - Stops, reloads or changes the volume of custom music. - /player [player] - Uses API to find skills, slayers, coins and weight of a player. - /reloadconfig - Reloads Danker's Skyblock Mod config. - /reloaddsmrepo - Reloads Danker's Skyblock Mod repository. @@ -119,7 +119,7 @@ Discord Server: https://discord.gg/QsEkNQS - Dwarven Mines: `dwarvenmines.wav` - Crystal Hollows: `crystalhollows.wav` - Spider's Den: `spidersden.wav` - - Blazing Fortress: `blazingfortress.wav` + - Crimson Isle: `crimsonisle.wav` - The End: `end.wav` - The Park: `park.wav` 2. Either run `/dsmmusic reload` or restart your game. diff --git a/src/main/java/me/Danker/commands/CustomMusicCommand.java b/src/main/java/me/Danker/commands/CustomMusicCommand.java index 283b748..f0634fc 100644 --- a/src/main/java/me/Danker/commands/CustomMusicCommand.java +++ b/src/main/java/me/Danker/commands/CustomMusicCommand.java @@ -22,7 +22,7 @@ public class CustomMusicCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName() + " [dungeonboss/bloodroom/dungeon/hub/island/dungeonhub/farmingislands/" + - "goldmine/deepcaverns/dwarvenmines/crystalhollows/spidersden/blazingfortress/end/park] [1-100]"; + "goldmine/deepcaverns/dwarvenmines/crystalhollows/spidersden/crimsonisle/end/park] [1-100]"; } public static String usage(ICommandSender arg0) { @@ -40,7 +40,7 @@ public class CustomMusicCommand extends CommandBase { return getListOfStringsMatchingLastWord(args, "stop", "reload", "volume"); } else if (args.length == 2) { return getListOfStringsMatchingLastWord(args, "dungeonboss", "bloodroom", "dungeon", "hub", "island", "dungeonhub", "farmingislands", "goldmine", - "deepcaverns", "dwarvenmines", "crystalhollows", "spidersden", "blazingfortress", "end", "park"); + "deepcaverns", "dwarvenmines", "crystalhollows", "spidersden", "crimsonisle", "end", "park"); } return null; } @@ -144,11 +144,11 @@ public class CustomMusicCommand extends CommandBase { CustomMusic.spidersDenVolume = volume; ConfigHandler.writeIntConfig("music", "SpidersDenVolume", volume); break; - case "blazingfortress": - if (!CustomMusic.blazingFortress.setVolume(volume)) return; + case "crimsonisle": + if (!CustomMusic.crimsonIsle.setVolume(volume)) return; - CustomMusic.blazingFortressVolume = volume; - ConfigHandler.writeIntConfig("music", "BlazingFortressVolume", volume); + CustomMusic.crimsonIsleVolume = volume; + ConfigHandler.writeIntConfig("music", "CrimsonIsleVolume", volume); break; case "end": if (!CustomMusic.end.setVolume(volume)) return; diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index c8f37d6..3536bd7 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -106,7 +106,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean dwarvenMinesMusic; public static boolean crystalHollowsMusic; public static boolean spidersDenMusic; - public static boolean blazingFortressMusic; + public static boolean crimsonIsleMusic; public static boolean endMusic; public static boolean parkMusic; @@ -576,10 +576,10 @@ public class ToggleCommand extends CommandBase implements ICommand { player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom spider's den music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + spidersDenMusic + DankersSkyblockMod.MAIN_COLOUR + ".")); break; case "blazingfortressmusic": - blazingFortressMusic = !blazingFortressMusic; - CustomMusic.blazingFortress.stop(); - ConfigHandler.writeBooleanConfig("toggles", "BlazingFortressMusic", blazingFortressMusic); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom blazing fortress music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + blazingFortressMusic + DankersSkyblockMod.MAIN_COLOUR + ".")); + crimsonIsleMusic = !crimsonIsleMusic; + CustomMusic.crimsonIsle.stop(); + ConfigHandler.writeBooleanConfig("toggles", "CrimsonIsleMusic", crimsonIsleMusic); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom crimson isle music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + crimsonIsleMusic + DankersSkyblockMod.MAIN_COLOUR + ".")); break; case "endmusic": endMusic = !endMusic; @@ -674,7 +674,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Custom dwarven mines music: " + DankersSkyblockMod.VALUE_COLOUR + dwarvenMinesMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom crystal hollows music: " + DankersSkyblockMod.VALUE_COLOUR + crystalHollowsMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom spider's den music: " + DankersSkyblockMod.VALUE_COLOUR + spidersDenMusic + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Custom blazing fortress music: " + DankersSkyblockMod.VALUE_COLOUR + blazingFortressMusic + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Custom blazing fortress music: " + DankersSkyblockMod.VALUE_COLOUR + crimsonIsleMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom end music: " + DankersSkyblockMod.VALUE_COLOUR + endMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom park music: " + DankersSkyblockMod.VALUE_COLOUR + parkMusic + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Alerts: " + DankersSkyblockMod.VALUE_COLOUR + alerts + "\n" + diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java index 5153f91..a31e40a 100644 --- a/src/main/java/me/Danker/features/CustomMusic.java +++ b/src/main/java/me/Danker/features/CustomMusic.java @@ -51,8 +51,8 @@ public class CustomMusic { public static int crystalHollowsVolume; public static Song spidersDen; public static int spidersDenVolume; - public static Song blazingFortress; - public static int blazingFortressVolume; + public static Song crimsonIsle; + public static int crimsonIsleVolume; public static Song end; public static int endVolume; public static Song park; @@ -119,8 +119,8 @@ public class CustomMusic { case "Spider's Den": if (ToggleCommand.spidersDenMusic) spidersDen.start(); break; - case "Blazing Fortress": - if (ToggleCommand.blazingFortressMusic) blazingFortress.start(); + case "Crimson Isle": + if (ToggleCommand.crimsonIsleMusic) crimsonIsle.start(); break; case "The End": if (ToggleCommand.endMusic) end.start(); @@ -184,7 +184,7 @@ public class CustomMusic { dwarvenMines = new Song(directory, "dwarvenmines", dwarvenMinesVolume); crystalHollows = new Song(directory, "crystalhollows", crystalHollowsVolume); spidersDen = new Song(directory, "spidersden", spidersDenVolume); - blazingFortress = new Song(directory, "blazingfortress", blazingFortressVolume); + crimsonIsle = new Song(directory, "crimsonisle", crimsonIsleVolume); end = new Song(directory, "end", endVolume); park = new Song(directory, "park", parkVolume); } @@ -202,7 +202,7 @@ public class CustomMusic { if (dwarvenMines != null) dwarvenMines.stop(); if (crystalHollows != null) crystalHollows.stop(); if (spidersDen != null) spidersDen.stop(); - if (blazingFortress != null) blazingFortress.stop(); + if (crimsonIsle != null) crimsonIsle.stop(); if (end != null) end.stop(); if (park != null) park.stop(); } diff --git a/src/main/java/me/Danker/gui/CustomMusicGui.java b/src/main/java/me/Danker/gui/CustomMusicGui.java index 4d5dcc9..98210f5 100644 --- a/src/main/java/me/Danker/gui/CustomMusicGui.java +++ b/src/main/java/me/Danker/gui/CustomMusicGui.java @@ -29,7 +29,7 @@ public class CustomMusicGui extends GuiScreen { private GuiButton dwarvenMinesMusic; private GuiButton crystalHollowsMusic; private GuiButton spidersDenMusic; - private GuiButton blazingFortressMusic; + private GuiButton crimsonIsleMusic; private GuiButton endMusic; private GuiButton parkMusic; @@ -66,7 +66,7 @@ public class CustomMusicGui extends GuiScreen { dwarvenMinesMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Custom Dwarven Mines Music: " + Utils.getColouredBoolean(ToggleCommand.dwarvenMinesMusic)); crystalHollowsMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Custom Crystal Hollows Music: " + Utils.getColouredBoolean(ToggleCommand.crystalHollowsMusic)); spidersDenMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Custom Spider's Den Music: " + Utils.getColouredBoolean(ToggleCommand.spidersDenMusic)); - blazingFortressMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Custom Blazing Fortress Music: " + Utils.getColouredBoolean(ToggleCommand.blazingFortressMusic)); + crimsonIsleMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Custom Crimson Isle Music: " + Utils.getColouredBoolean(ToggleCommand.crimsonIsleMusic)); endMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Custom End Music: " + Utils.getColouredBoolean(ToggleCommand.endMusic)); parkMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Custom Park Music: " + Utils.getColouredBoolean(ToggleCommand.parkMusic)); @@ -87,7 +87,7 @@ public class CustomMusicGui extends GuiScreen { this.buttonList.add(dwarvenMinesMusic); this.buttonList.add(crystalHollowsMusic); this.buttonList.add(spidersDenMusic); - this.buttonList.add(blazingFortressMusic); + this.buttonList.add(crimsonIsleMusic); this.buttonList.add(endMusic); this.buttonList.add(nextPage); this.buttonList.add(backPage); @@ -175,11 +175,11 @@ public class CustomMusicGui extends GuiScreen { CustomMusic.spidersDen.stop(); ConfigHandler.writeBooleanConfig("toggles", "SpidersDenMusic", ToggleCommand.spidersDenMusic); spidersDenMusic.displayString = "Custom Spider's Den Music: " + Utils.getColouredBoolean(ToggleCommand.spidersDenMusic); - } else if (button == blazingFortressMusic) { - ToggleCommand.blazingFortressMusic = !ToggleCommand.blazingFortressMusic; - CustomMusic.blazingFortress.stop(); - ConfigHandler.writeBooleanConfig("toggles", "BlazingFortressMusic", ToggleCommand.blazingFortressMusic); - blazingFortressMusic.displayString = "Custom Blazing Fortress Music: " + Utils.getColouredBoolean(ToggleCommand.blazingFortressMusic); + } else if (button == crimsonIsleMusic) { + ToggleCommand.crimsonIsleMusic = !ToggleCommand.crimsonIsleMusic; + CustomMusic.crimsonIsle.stop(); + ConfigHandler.writeBooleanConfig("toggles", "BlazingFortressMusic", ToggleCommand.crimsonIsleMusic); + crimsonIsleMusic.displayString = "Custom Crimson Isle Music: " + Utils.getColouredBoolean(ToggleCommand.crimsonIsleMusic); } else if (button == endMusic) { ToggleCommand.endMusic = !ToggleCommand.endMusic; CustomMusic.end.stop(); diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 4298c2a..3ecb2cc 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -287,7 +287,7 @@ public class ConfigHandler { ToggleCommand.dwarvenMinesMusic = initBoolean("toggles", "DwarvenMinesMusic", false); ToggleCommand.crystalHollowsMusic = initBoolean("toggles", "CrystalHollowsMusic", false); ToggleCommand.spidersDenMusic = initBoolean("toggles", "SpidersDenMusic", false); - ToggleCommand.blazingFortressMusic = initBoolean("toggles", "BlazingFortressMusic", false); + ToggleCommand.crimsonIsleMusic = initBoolean("toggles", "CrimsonIsleMusic", false); ToggleCommand.endMusic = initBoolean("toggles", "Music", false); ToggleCommand.parkMusic = initBoolean("toggles", "Music", false); // Music Volume @@ -303,7 +303,7 @@ public class ConfigHandler { CustomMusic.dwarvenMinesVolume = initInt("music", "DwarvenMinesVolume", 50); CustomMusic.crystalHollowsVolume = initInt("music", "CrystalHollowsVolume", 50); CustomMusic.spidersDenVolume = initInt("music", "SpidersDenVolume", 50); - CustomMusic.blazingFortressVolume = initInt("music", "BlazingFortressVolume", 50); + CustomMusic.crimsonIsleVolume = initInt("music", "CrimsonIsleVolume", 50); CustomMusic.endVolume = initInt("music", "EndVolume", 50); CustomMusic.parkVolume = initInt("music", "ParkVolume", 50); -- cgit From 3ea4a9b5d7d686a9f4eb1d699b2c8c6f6432e60f Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 21 Apr 2022 01:32:56 -0400 Subject: Fix text for blaze display --- src/main/java/me/Danker/features/loot/LootDisplay.java | 16 ++++++++-------- src/main/java/me/Danker/handlers/ConfigHandler.java | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/loot/LootDisplay.java b/src/main/java/me/Danker/features/loot/LootDisplay.java index 9d3f466..9436ec6 100644 --- a/src/main/java/me/Danker/features/loot/LootDisplay.java +++ b/src/main/java/me/Danker/features/loot/LootDisplay.java @@ -438,16 +438,16 @@ public class LootDisplay { EnumChatFormatting.WHITE + "Kelvin Inverters:\n" + EnumChatFormatting.BLUE + "Blaze Rod Distillates:\n" + EnumChatFormatting.BLUE + "Glowstone Distillates:\n" + - EnumChatFormatting.BLUE + "Magma Cream Distillates:\n" + - EnumChatFormatting.BLUE + "Nether Wart Distillates:\n" + + EnumChatFormatting.BLUE + "Magma Distillates:\n" + + EnumChatFormatting.BLUE + "Wart Distillates:\n" + EnumChatFormatting.BLUE + "Gabagool Distillates:\n" + - EnumChatFormatting.RED + "Scorched Power Crystals:\n" + + EnumChatFormatting.RED + "Power Crystals:\n" + EnumChatFormatting.RED + "Fire Aspect Books:\n" + EnumChatFormatting.GOLD + "Fiery Burst Runes:\n" + EnumChatFormatting.WHITE + "Opal Gems:\n" + EnumChatFormatting.RED + "Archfiend Dice:\n" + EnumChatFormatting.LIGHT_PURPLE + "Duplex Books:\n" + - EnumChatFormatting.GOLD + "High Class Archfiend Dice:\n" + + EnumChatFormatting.GOLD + "High Class Dice:\n" + EnumChatFormatting.GOLD + "Engineering Plans:\n" + EnumChatFormatting.GOLD + "Subzero Inverters:\n" + EnumChatFormatting.AQUA + "Time Since RNG:\n" + @@ -499,16 +499,16 @@ public class LootDisplay { EnumChatFormatting.WHITE + "Kelvin Inverters:\n" + EnumChatFormatting.BLUE + "Blaze Rod Distillates:\n" + EnumChatFormatting.BLUE + "Glowstone Distillates:\n" + - EnumChatFormatting.BLUE + "Magma Cream Distillates:\n" + - EnumChatFormatting.BLUE + "Nether Wart Distillates:\n" + + EnumChatFormatting.BLUE + "Magma Distillates:\n" + + EnumChatFormatting.BLUE + "Wart Distillates:\n" + EnumChatFormatting.BLUE + "Gabagool Distillates:\n" + - EnumChatFormatting.RED + "Scorched Power Crystals:\n" + + EnumChatFormatting.RED + "Power Crystals:\n" + EnumChatFormatting.RED + "Fire Aspect Books:\n" + EnumChatFormatting.GOLD + "Fiery Burst Runes:\n" + EnumChatFormatting.WHITE + "Opal Gems:\n" + EnumChatFormatting.RED + "Archfiend Dice:\n" + EnumChatFormatting.LIGHT_PURPLE + "Duplex Books:\n" + - EnumChatFormatting.GOLD + "High Class Archfiend Dice:\n" + + EnumChatFormatting.GOLD + "High Class Dice:\n" + EnumChatFormatting.GOLD + "Engineering Plans:\n" + EnumChatFormatting.GOLD + "Subzero Inverters:\n" + EnumChatFormatting.AQUA + "Time Since RNG:\n" + diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 3ecb2cc..a4d7ca9 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -408,7 +408,7 @@ public class ConfigHandler { BlazeTracker.engineeringPlans = initInt("blaze", "engineeringPlans", 0); BlazeTracker.subzeroInverters = initInt("blaze", "subzeroInverters", 0); BlazeTracker.time = initDouble("blaze", "timeRNG", -1); - BlazeTracker.bossesSession = initInt("blaze", "bossRNG", -1); + BlazeTracker.bosses = initInt("blaze", "bossRNG", -1); // Fishing FishingTracker.seaCreatures = initInt("fishing", "seaCreature", 0); -- cgit From 0aef9021be5143adb5be5e624675d79868aa9738 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 22 Apr 2022 00:32:25 -0400 Subject: Add lava fishing tracker --- README.md | 6 +- .../java/me/Danker/commands/DisplayCommand.java | 21 +- .../me/Danker/commands/ImportFishingCommand.java | 273 +++++---------------- src/main/java/me/Danker/commands/LootCommand.java | 65 ++++- .../java/me/Danker/commands/ResetLootCommand.java | 11 + src/main/java/me/Danker/features/AutoDisplay.java | 6 +- .../me/Danker/features/loot/FishingTracker.java | 96 +++++++- .../java/me/Danker/features/loot/LootDisplay.java | 86 +++++++ src/main/java/me/Danker/gui/DisplayGui.java | 15 +- .../java/me/Danker/handlers/ConfigHandler.java | 12 + 10 files changed, 350 insertions(+), 241 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index e3b7ee8..ea32b5d 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Discord Server: https://discord.gg/QsEkNQS - Maddox menu keybind - Block starting other slayer quests - Slayer slain alert -- Fishing, jerry fishing, fishing festival, spooky fishing, crystal hollows fishing trackers +- Fishing, jerry fishing, fishing festival, spooky fishing, crystal hollows fishing, lava fishing trackers - Expertise kills in fishing rod lore - Gemstones applied in item lore - Catacombs trackers @@ -72,8 +72,8 @@ Discord Server: https://discord.gg/QsEkNQS - /toggle - Toggles features. /toggle list returns values of every toggle. - /setkey - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. -- /loot [winter/festival/spooky/ch/f(1-7)/mm/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. -- /display [winter/festival/spooky/ch/f(1-7)/mm/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active. +- /loot [winter/festival/spooky/ch/lava/f(1-7)/mm/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. +- /display [winter/festival/spooky/ch/lava/f(1-7)/mm/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active. - /resetloot - - Resets loot for trackers. /resetloot confirm confirms the reset. - /move - Moves text display to specified X and Y coordinates. - /scale - Scales text display to a specified multipler between 0.1x and 10x. diff --git a/src/main/java/me/Danker/commands/DisplayCommand.java b/src/main/java/me/Danker/commands/DisplayCommand.java index 174258d..21ada93 100644 --- a/src/main/java/me/Danker/commands/DisplayCommand.java +++ b/src/main/java/me/Danker/commands/DisplayCommand.java @@ -21,7 +21,7 @@ public class DisplayCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " [winter/festival/spooky/ch/session/f(1-7)/mm]"; + return "/" + getCommandName() + " [winter/festival/spooky/ch/lava/session/f(1-7)/mm]"; } public static String usage(ICommandSender arg0) { @@ -38,7 +38,7 @@ public class DisplayCommand extends CommandBase { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "enderman", "blaze", "fishing", "catacombs", "mythological", "ghost", "auto", "off"); } else if (args.length == 2 && args[0].equalsIgnoreCase("fishing")) { - return getListOfStringsMatchingLastWord(args, "winter", "festival", "spooky", "ch", "session"); + return getListOfStringsMatchingLastWord(args, "winter", "festival", "spooky", "ch", "lava", "session"); } else if (args.length == 2 && args[0].equalsIgnoreCase("catacombs")) { return getListOfStringsMatchingLastWord(args, "f1", "floor1", "f2", "floor2", "f3", "floor3", "f4", "floor4", "f5", "floor5", "f6", "floor6", "f7", "floor7", "mm", "master"); } else if (args.length > 1) { @@ -56,10 +56,8 @@ public class DisplayCommand extends CommandBase { return; } - boolean showSession = false; - - if (arg1[arg1.length - 1].equalsIgnoreCase("session")) showSession = true; - + boolean showSession = arg1[arg1.length - 1].equalsIgnoreCase("session"); + switch (arg1[0].toLowerCase()) { case "wolf": if (showSession) { @@ -122,9 +120,16 @@ public class DisplayCommand extends CommandBase { break; case "ch": if (showSession) { + LootDisplay.display = "fishing_ch_session"; + } else { LootDisplay.display = "fishing_ch"; + } + break; + case "lava": + if (showSession) { + LootDisplay.display = "fishing_lava_session"; } else { - LootDisplay.display = "fishing_ch_session"; + LootDisplay.display = "fishing_lava"; } break; default: @@ -230,7 +235,7 @@ public class DisplayCommand extends CommandBase { } else { LootDisplay.display = "ghost"; } - + break; case "auto": LootDisplay.auto = true; player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Display set to " + DankersSkyblockMod.SECONDARY_COLOUR + "auto" + DankersSkyblockMod.MAIN_COLOUR + ".")); diff --git a/src/main/java/me/Danker/commands/ImportFishingCommand.java b/src/main/java/me/Danker/commands/ImportFishingCommand.java index bdd3281..f51e01f 100644 --- a/src/main/java/me/Danker/commands/ImportFishingCommand.java +++ b/src/main/java/me/Danker/commands/ImportFishingCommand.java @@ -77,221 +77,50 @@ public class ImportFishingCommand extends CommandBase { } FishingTracker.seaCreatures = 0; - FishingTracker.squids = 0; - if (statsObject.has("kills_pond_squid")) { - FishingTracker.squids = statsObject.get("kills_pond_squid").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.squids; - - FishingTracker.seaWalkers = 0; - if (statsObject.has("kills_sea_walker")) { - FishingTracker.seaWalkers = statsObject.get("kills_sea_walker").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.seaWalkers; - - FishingTracker.nightSquids = 0; - if (statsObject.has("kills_night_squid")) { - FishingTracker.nightSquids = statsObject.get("kills_night_squid").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.nightSquids; - - FishingTracker.seaGuardians = 0; - if (statsObject.has("kills_sea_guardian")) { - FishingTracker.seaGuardians = statsObject.get("kills_sea_guardian").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.seaGuardians; - - FishingTracker.seaWitches = 0; - if (statsObject.has("kills_sea_witch")) { - FishingTracker.seaWitches = statsObject.get("kills_sea_witch").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.seaWitches; - - FishingTracker.seaArchers = 0; - if (statsObject.has("kills_sea_archer")) { - FishingTracker.seaArchers = statsObject.get("kills_sea_archer").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.seaArchers; - - FishingTracker.monsterOfTheDeeps = 0; - if (statsObject.has("kills_zombie_deep")) { - if (statsObject.has("kills_chicken_deep")) { - FishingTracker.monsterOfTheDeeps = statsObject.get("kills_zombie_deep").getAsInt() + statsObject.get("kills_chicken_deep").getAsInt(); - } else { - FishingTracker.monsterOfTheDeeps = statsObject.get("kills_zombie_deep").getAsInt(); - } - } else if (statsObject.has("kills_chicken_deep")) { - FishingTracker.monsterOfTheDeeps = statsObject.get("kills_chicken_deep").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.monsterOfTheDeeps; - - FishingTracker.catfishes = 0; - if (statsObject.has("kills_catfish")) { - FishingTracker.catfishes = statsObject.get("kills_catfish").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.catfishes; - - FishingTracker.carrotKings = 0; - if (statsObject.has("kills_carrot_king")) { - FishingTracker.carrotKings = statsObject.get("kills_carrot_king").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.carrotKings; - - FishingTracker.seaLeeches = 0; - if (statsObject.has("kills_sea_leech")) { - FishingTracker.seaLeeches = statsObject.get("kills_sea_leech").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.seaLeeches; - - FishingTracker.guardianDefenders = 0; - if (statsObject.has("kills_guardian_defender")) { - FishingTracker.guardianDefenders = statsObject.get("kills_guardian_defender").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.guardianDefenders; - - FishingTracker.deepSeaProtectors = 0; - if (statsObject.has("kills_deep_sea_protector")) { - FishingTracker.deepSeaProtectors = statsObject.get("kills_deep_sea_protector").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.deepSeaProtectors; - - FishingTracker.hydras = 0; - if (statsObject.has("kills_water_hydra")) { - // Hydra splits - FishingTracker.hydras = statsObject.get("kills_water_hydra").getAsInt() / 2; - } - FishingTracker.seaCreatures += FishingTracker.hydras; - - FishingTracker.seaEmperors = 0; - if (statsObject.has("kills_skeleton_emperor")) { - if (statsObject.has("kills_guardian_emperor")) { - FishingTracker.seaEmperors = statsObject.get("kills_skeleton_emperor").getAsInt() + statsObject.get("kills_guardian_emperor").getAsInt(); - } else { - FishingTracker.seaEmperors = statsObject.get("kills_skeleton_emperor").getAsInt(); - } - } else if (statsObject.has("kills_guardian_emperor")) { - FishingTracker.seaEmperors = statsObject.get("kills_guardian_emperor").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.seaEmperors; - - FishingTracker.fishingMilestone = 0; - if (statsObject.has("pet_milestone_sea_creatures_killed")) { - FishingTracker.fishingMilestone = statsObject.get("pet_milestone_sea_creatures_killed").getAsInt(); - } - - FishingTracker.frozenSteves = 0; - if (statsObject.has("kills_frozen_steve")) { - FishingTracker.frozenSteves = statsObject.get("kills_frozen_steve").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.frozenSteves; - - FishingTracker.frostyTheSnowmans = 0; - if (statsObject.has("kills_frosty_the_snowman")) { - FishingTracker.frostyTheSnowmans = statsObject.get("kills_frosty_the_snowman").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.frostyTheSnowmans; - - FishingTracker.grinches = 0; - if (statsObject.has("kills_grinch")) { - FishingTracker.grinches = statsObject.get("kills_grinch").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.grinches; - - FishingTracker.yetis = 0; - if (statsObject.has("kills_yeti")) { - FishingTracker.yetis = statsObject.get("kills_yeti").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.yetis; - - FishingTracker.nurseSharks = 0; - if (statsObject.has("kills_nurse_shark")) { - FishingTracker.nurseSharks = statsObject.get("kills_nurse_shark").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.nurseSharks; - - FishingTracker.blueSharks = 0; - if (statsObject.has("kills_nurse_shark")) { - FishingTracker.blueSharks = statsObject.get("kills_blue_shark").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.blueSharks; - - FishingTracker.tigerSharks = 0; - if (statsObject.has("kills_nurse_shark")) { - FishingTracker.tigerSharks = statsObject.get("kills_tiger_shark").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.tigerSharks; - - FishingTracker.greatWhiteSharks = 0; - if (statsObject.has("kills_nurse_shark")) { - FishingTracker.greatWhiteSharks = statsObject.get("kills_great_white_shark").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.greatWhiteSharks; - - FishingTracker.scarecrows = 0; - if (statsObject.has("kills_scarecrow")) { - FishingTracker.scarecrows = statsObject.get("kills_scarecrow").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.scarecrows; - - FishingTracker.nightmares = 0; - if (statsObject.has("kills_nightmare")) { - FishingTracker.nightmares = statsObject.get("kills_nightmare").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.nightmares; - - FishingTracker.werewolfs = 0; - if (statsObject.has("kills_werewolf")) { - FishingTracker.werewolfs = statsObject.get("kills_werewolf").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.werewolfs; - - FishingTracker.phantomFishers = 0; - if (statsObject.has("kills_phantom_fisherman")) { - FishingTracker.phantomFishers = statsObject.get("kills_phantom_fisherman").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.phantomFishers; - - FishingTracker.grimReapers = 0; - if (statsObject.has("kills_grim_reaper")) { - FishingTracker.grimReapers = statsObject.get("kills_grim_reaper").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.grimReapers; - - FishingTracker.waterWorms = 0; - if (statsObject.has("kills_water_worm")) { - FishingTracker.waterWorms = statsObject.get("kills_water_worm").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.waterWorms; - - FishingTracker.poisonedWaterWorms = 0; - if (statsObject.has("kills_poisoned_water_worm")) { - FishingTracker.poisonedWaterWorms = statsObject.get("kills_poisoned_water_worm").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.poisonedWaterWorms; - FishingTracker.flamingWorms = 0; - if (statsObject.has("kills_flaming_worm")) { - FishingTracker.flamingWorms = statsObject.get("kills_flaming_worm").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.flamingWorms; - - FishingTracker.lavaBlazes = 0; - if (statsObject.has("kills_lava_blaze")) { - FishingTracker.lavaBlazes = statsObject.get("kills_lava_blaze").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.lavaBlazes; - - FishingTracker.lavaPigmen = 0; - if (statsObject.has("kills_lava_pigman")) { - FishingTracker.lavaPigmen = statsObject.get("kills_lava_pigman").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.lavaPigmen; - - FishingTracker.zombieMiners = 0; - if (statsObject.has("kills_zombie_miner")) { - FishingTracker.zombieMiners = statsObject.get("kills_zombie_miner").getAsInt(); - } - FishingTracker.seaCreatures += FishingTracker.zombieMiners; + FishingTracker.squids = getSCFromApi(statsObject, "kills_pond_squid"); + FishingTracker.seaWalkers = getSCFromApi(statsObject, "kills_sea_walker"); + FishingTracker.nightSquids = getSCFromApi(statsObject, "kills_night_squid"); + FishingTracker.seaGuardians = getSCFromApi(statsObject, "kills_sea_guardian"); + FishingTracker.seaWitches = getSCFromApi(statsObject, "kills_sea_witch"); + FishingTracker.seaArchers = getSCFromApi(statsObject, "kills_sea_archer"); + FishingTracker.monsterOfTheDeeps = getSCFromApi(statsObject, "kills_zombie_deep") + getSCFromApi(statsObject, "kills_chicken_deep"); + FishingTracker.catfishes = getSCFromApi(statsObject, "kills_catfish"); + FishingTracker.carrotKings = getSCFromApi(statsObject, "kills_carrot_king"); + FishingTracker.seaLeeches = getSCFromApi(statsObject, "kills_sea_leech"); + FishingTracker.guardianDefenders = getSCFromApi(statsObject, "kills_guardian_defender"); + FishingTracker.deepSeaProtectors = getSCFromApi(statsObject, "kills_deep_sea_protector"); + FishingTracker.hydras = getSCFromApi(statsObject, "kills_water_hydra") / 2; + FishingTracker.seaEmperors = getSCFromApi(statsObject, "kills_skeleton_emperor") + getSCFromApi(statsObject, "kills_guardian_emperor"); + FishingTracker.fishingMilestone = getSCFromApi(statsObject, "pet_milestone_sea_creatures_killed"); + FishingTracker.frozenSteves = getSCFromApi(statsObject, "kills_frozen_steve"); + FishingTracker.frostyTheSnowmans = getSCFromApi(statsObject, "kills_frosty_the_snowman"); + FishingTracker.grinches = getSCFromApi(statsObject, "kills_grinch"); + FishingTracker.yetis = getSCFromApi(statsObject, "kills_yeti"); + FishingTracker.nurseSharks = getSCFromApi(statsObject, "kills_nurse_shark"); + FishingTracker.blueSharks = getSCFromApi(statsObject, "kills_blue_shark"); + FishingTracker.tigerSharks = getSCFromApi(statsObject, "kills_tiger_shark"); + FishingTracker.greatWhiteSharks = getSCFromApi(statsObject, "kills_great_white_shark"); + FishingTracker.scarecrows = getSCFromApi(statsObject, "kills_scarecrow"); + FishingTracker.nightmares = getSCFromApi(statsObject, "kills_nightmare"); + FishingTracker.werewolfs = getSCFromApi(statsObject, "kills_werewolf"); + FishingTracker.phantomFishers = getSCFromApi(statsObject, "kills_phantom_fisherman"); + FishingTracker.grimReapers = getSCFromApi(statsObject, "kills_grim_reaper"); + FishingTracker.waterWorms = getSCFromApi(statsObject, "kills_water_worm"); + FishingTracker.poisonedWaterWorms = getSCFromApi(statsObject, "kills_poisoned_water_worm"); + FishingTracker.flamingWorms = getSCFromApi(statsObject, "kills_flaming_worm"); + FishingTracker.lavaBlazes = getSCFromApi(statsObject, "kills_lava_blaze"); + FishingTracker.lavaPigmen = getSCFromApi(statsObject, "kills_lava_pigman"); + FishingTracker.zombieMiners = getSCFromApi(statsObject, "kills_zombie_miner"); + FishingTracker.magmaSlugs = getSCFromApi(statsObject, "kills_magma_slug"); + FishingTracker.moogmas = getSCFromApi(statsObject, "kills_moogma"); + FishingTracker.lavaLeeches = getSCFromApi(statsObject, "kills_lava_leech"); + FishingTracker.pyroclasticWorms = getSCFromApi(statsObject, "kills_pyroclastic_worm"); + FishingTracker.lavaFlames = getSCFromApi(statsObject, "kills_lava_flame"); + FishingTracker.fireEels = getSCFromApi(statsObject, "kills_fire_eel"); + FishingTracker.tauruses = getSCFromApi(statsObject, "kills_taurus"); + FishingTracker.thunders = getSCFromApi(statsObject, "kills_thunder"); + FishingTracker.lordJawbuses = getSCFromApi(statsObject, "kills_lord_jawbus"); System.out.println("Writing to config..."); ConfigHandler.writeIntConfig("fishing", "goodCatch", FishingTracker.goodCatches); @@ -331,9 +160,25 @@ public class ImportFishingCommand extends CommandBase { ConfigHandler.writeIntConfig("fishing", "lavaBlaze", FishingTracker.lavaBlazes); ConfigHandler.writeIntConfig("fishing", "lavaPigman", FishingTracker.lavaPigmen); ConfigHandler.writeIntConfig("fishing", "zombieMiner", FishingTracker.zombieMiners); + ConfigHandler.writeIntConfig("fishing", "magmaSlug", FishingTracker.magmaSlugs); + ConfigHandler.writeIntConfig("fishing", "moogma", FishingTracker.moogmas); + ConfigHandler.writeIntConfig("fishing", "lavaLeech", FishingTracker.lavaLeeches); + ConfigHandler.writeIntConfig("fishing", "pyroclasticWorm", FishingTracker.pyroclasticWorms); + ConfigHandler.writeIntConfig("fishing", "lavaFlame", FishingTracker.lavaFlames); + ConfigHandler.writeIntConfig("fishing", "fireEel", FishingTracker.fireEels); + ConfigHandler.writeIntConfig("fishing", "taurus", FishingTracker.tauruses); + ConfigHandler.writeIntConfig("fishing", "thunder", FishingTracker.thunders); + ConfigHandler.writeIntConfig("fishing", "lordJawbus", FishingTracker.lordJawbuses); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Fishing stats imported.")); }).start(); } + static int getSCFromApi(JsonObject obj, String key) { + int sc = 0; + if (obj.has(key)) sc = obj.get(key).getAsInt(); + FishingTracker.seaCreatures += sc; + return sc; + } + } diff --git a/src/main/java/me/Danker/commands/LootCommand.java b/src/main/java/me/Danker/commands/LootCommand.java index 5d91573..3be46a4 100644 --- a/src/main/java/me/Danker/commands/LootCommand.java +++ b/src/main/java/me/Danker/commands/LootCommand.java @@ -24,7 +24,7 @@ public class LootCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " [winter/festival/spooky/ch/f(1-7)/mm/session]"; + return "/" + getCommandName() + " [winter/festival/spooky/ch/lava/f(1-7)/mm/session]"; } public static String usage(ICommandSender arg0) { @@ -41,7 +41,7 @@ public class LootCommand extends CommandBase { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "enderman", "blaze", "fishing", "catacombs", "mythological"); } else if (args.length == 2 && args[0].equalsIgnoreCase("fishing")) { - return getListOfStringsMatchingLastWord(args, "winter", "festival", "spooky", "ch", "session"); + return getListOfStringsMatchingLastWord(args, "winter", "festival", "spooky", "ch", "lava", "session"); } else if (args.length == 2 && args[0].equalsIgnoreCase("catacombs")) { return getListOfStringsMatchingLastWord(args, "f1", "floor1", "f2", "floor2", "f3", "floor3", "f4", "floor4", "f5", "floor5", "f6", "floor6", "f7", "floor7", "mm", "master"); } else if (args.length > 1) { @@ -511,6 +511,7 @@ public class LootCommand extends CommandBase { EnumChatFormatting.GOLD + " Tiger Sharks: " + nf.format(FishingTracker.tigerSharks) + "\n" + EnumChatFormatting.WHITE + " Great White Sharks: " + nf.format(FishingTracker.greatWhiteSharks) + "\n" + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " -------------------")); + return; } else if (arg1[1].equalsIgnoreCase("spooky")) { if (showSession) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + @@ -532,6 +533,7 @@ public class LootCommand extends CommandBase { EnumChatFormatting.GOLD + " Phantom Fishers: " + nf.format(FishingTracker.phantomFishers) + "\n" + EnumChatFormatting.GOLD + " Grim Reapers: " + nf.format(FishingTracker.grimReapers) + "\n" + EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------")); + return; } else if (arg1[1].equalsIgnoreCase("ch")) { if (showSession) { player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + @@ -556,9 +558,64 @@ public class LootCommand extends CommandBase { EnumChatFormatting.LIGHT_PURPLE + " Lava Pigmen: " + nf.format(FishingTracker.lavaPigmen) + "\n" + EnumChatFormatting.GOLD + " Zombie Miners: " + nf.format(FishingTracker.zombieMiners) + "\n" + EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------")); - } + return; + } else if (arg1[1].equalsIgnoreCase("lava")) { + if (showSession) { + if (FishingTracker.jawbusTimeSession == -1) { + timeBetween = "Never"; + } else { + timeBetween = Utils.getTimeBetween(FishingTracker.jawbusTimeSession, timeNow); + } + if (FishingTracker.jawbusSCsSession == -1) { + bossesBetween = "Never"; + } else { + bossesBetween = nf.format(FishingTracker.jawbusSCsSession); + } - return; + player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Lava Fishing Summary (Current Session):\n" + + EnumChatFormatting.DARK_RED + " Magma Slugs: " + nf.format(FishingTracker.magmaSlugsSession) + "\n" + + EnumChatFormatting.RED + " Moogmas: " + nf.format(FishingTracker.moogmasSession) + "\n" + + EnumChatFormatting.RED + " Lava Leeches: " + nf.format(FishingTracker.lavaLeechesSession) + "\n" + + EnumChatFormatting.RED + " Pyroclastic Worms: " + nf.format(FishingTracker.pyroclasticWormsSession) + "\n" + + EnumChatFormatting.DARK_RED + " Lava Flames: " + nf.format(FishingTracker.lavaFlamesSession) + "\n" + + EnumChatFormatting.RED + " Fire Eels: " + nf.format(FishingTracker.fireEelsSession) + "\n" + + EnumChatFormatting.GOLD + " Tauruses: " + nf.format(FishingTracker.taurusesSession) + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Thunders: " + nf.format(FishingTracker.thundersSession) + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Lord Jawbuses: " + nf.format(FishingTracker.lordJawbusesSession) + "\n" + + EnumChatFormatting.AQUA + " Time Since Lord Jawbus: " + timeBetween + "\n" + + EnumChatFormatting.AQUA + " Creatures Since Lord Jawbus: " + bossesBetween + "\n" + + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " -------------------")); + return; + } + + if (FishingTracker.jawbusTime == -1) { + timeBetween = "Never"; + } else { + timeBetween = Utils.getTimeBetween(FishingTracker.jawbusTime, timeNow); + } + if (FishingTracker.jawbusSCs == -1) { + bossesBetween = "Never"; + } else { + bossesBetween = nf.format(FishingTracker.jawbusSCs); + } + + player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Lava Fishing Summary:\n" + + EnumChatFormatting.DARK_RED + " Magma Slugs: " + nf.format(FishingTracker.magmaSlugs) + "\n" + + EnumChatFormatting.RED + " Moogmas: " + nf.format(FishingTracker.moogmas) + "\n" + + EnumChatFormatting.RED + " Lava Leeches: " + nf.format(FishingTracker.lavaLeeches) + "\n" + + EnumChatFormatting.RED + " Pyroclastic Worms: " + nf.format(FishingTracker.pyroclasticWorms) + "\n" + + EnumChatFormatting.DARK_RED + " Lava Flames: " + nf.format(FishingTracker.lavaFlames) + "\n" + + EnumChatFormatting.RED + " Fire Eels: " + nf.format(FishingTracker.fireEels) + "\n" + + EnumChatFormatting.GOLD + " Tauruses: " + nf.format(FishingTracker.tauruses) + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Thunders: " + nf.format(FishingTracker.thunders) + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Lord Jawbuses: " + nf.format(FishingTracker.lordJawbuses) + "\n" + + EnumChatFormatting.AQUA + " Time Since Lord Jawbus: " + timeBetween + "\n" + + EnumChatFormatting.AQUA + " Creatures Since Lord Jawbus: " + bossesBetween + "\n" + + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " -------------------")); + return; + } } if (showSession) { diff --git a/src/main/java/me/Danker/commands/ResetLootCommand.java b/src/main/java/me/Danker/commands/ResetLootCommand.java index d3294b2..c17c2ae 100644 --- a/src/main/java/me/Danker/commands/ResetLootCommand.java +++ b/src/main/java/me/Danker/commands/ResetLootCommand.java @@ -277,6 +277,17 @@ public class ResetLootCommand extends CommandBase { FishingTracker.lavaBlazesSession = 0; FishingTracker.lavaPigmenSession = 0; FishingTracker.zombieMinersSession = 0; + FishingTracker.magmaSlugsSession = 0; + FishingTracker.moogmasSession = 0; + FishingTracker.lavaLeechesSession = 0; + FishingTracker.pyroclasticWormsSession = 0; + FishingTracker.lavaFlamesSession = 0; + FishingTracker.fireEelsSession = 0; + FishingTracker.taurusesSession = 0; + FishingTracker.thundersSession = 0; + FishingTracker.lordJawbusesSession = 0; + FishingTracker.jawbusTimeSession = 0; + FishingTracker.jawbusSCsSession = 0; ConfigHandler.deleteCategory("fishing"); ConfigHandler.reloadConfig(); } diff --git a/src/main/java/me/Danker/features/AutoDisplay.java b/src/main/java/me/Danker/features/AutoDisplay.java index 63b66d5..7f86035 100644 --- a/src/main/java/me/Danker/features/AutoDisplay.java +++ b/src/main/java/me/Danker/features/AutoDisplay.java @@ -95,7 +95,11 @@ public class AutoDisplay { List lore = hotbarItem.getTooltip(player, mc.gameSettings.advancedItemTooltips); for (int j = lore.size() - 1; j >= 0; j--) { // reverse if (lore.get(j).contains("FISHING ROD")) { - LootDisplay.display = "fishing"; + if (Utils.tabLocation.equals("Crimson Isle")) { + LootDisplay.display = "fishing_lava"; + } else { + LootDisplay.display = "fishing"; + } found = true; break; } diff --git a/src/main/java/me/Danker/features/loot/FishingTracker.java b/src/main/java/me/Danker/features/loot/FishingTracker.java index cf329aa..95a9040 100644 --- a/src/main/java/me/Danker/features/loot/FishingTracker.java +++ b/src/main/java/me/Danker/features/loot/FishingTracker.java @@ -54,6 +54,18 @@ public class FishingTracker { public static int lavaBlazes; public static int lavaPigmen; public static int zombieMiners; + // Lava fishing + public static int magmaSlugs; + public static int moogmas; + public static int lavaLeeches; + public static int pyroclasticWorms; + public static int lavaFlames; + public static int fireEels; + public static int tauruses; + public static int thunders; + public static int lordJawbuses; + public static double jawbusTime; + public static int jawbusSCs; // Fishing public static int seaCreaturesSession = 0; @@ -101,6 +113,18 @@ public class FishingTracker { public static int lavaBlazesSession = 0; public static int lavaPigmenSession = 0; public static int zombieMinersSession = 0; + // Lava fishing + public static int magmaSlugsSession = 0; + public static int moogmasSession = 0; + public static int lavaLeechesSession = 0; + public static int pyroclasticWormsSession = 0; + public static int lavaFlamesSession = 0; + public static int fireEelsSession = 0; + public static int taurusesSession = 0; + public static int thundersSession = 0; + public static int lordJawbusesSession = 0; + public static double jawbusTimeSession = 0; + public static int jawbusSCsSession = 0; @SubscribeEvent public void onChat(ClientChatReceivedEvent event) { @@ -296,16 +320,61 @@ public class FishingTracker { zombieMinersSession++; ConfigHandler.writeIntConfig("fishing", "zombieMiner", zombieMiners); increaseSeaCreatures(); + } else if (message.contains("From Beneath the lava appears a Magma Slug")) { + magmaSlugs++; + magmaSlugsSession++; + ConfigHandler.writeIntConfig("fishing", "magmaSlug", magmaSlugs); + increaseSeaCreatures(); + } else if (message.contains("You hear a faint Moo from the lava... A Moogma appears")) { + moogmas++; + moogmasSession++; + ConfigHandler.writeIntConfig("fishing", "moogma", moogmas); + increaseSeaCreatures(); + } else if (message.contains("A small but fearsome Lava Leech emerges")) { + lavaLeeches++; + lavaLeechesSession++; + ConfigHandler.writeIntConfig("fishing", "lavaLeech", lavaLeeches); + increaseSeaCreatures(); + } else if (message.contains("You feel the heat radiating as a Pyroclastic Worm surfaces")) { + pyroclasticWorms++; + pyroclasticWormsSession++; + ConfigHandler.writeIntConfig("fishing", "pyroclasticWorm", pyroclasticWorms); + increaseSeaCreatures(); + } else if (message.contains("A Lava Flame flies out from beneath the lava")) { + lavaFlames++; + lavaFlamesSession++; + ConfigHandler.writeIntConfig("fishing", "lavaFlame", lavaFlames); + increaseSeaCreatures(); + } else if (message.contains("A Fire Eel slithers out from the depths")) { + fireEels++; + fireEelsSession++; + ConfigHandler.writeIntConfig("fishing", "fireEel", fireEels); + increaseSeaCreatures(); + } else if (message.contains("Taurus and his steed emerge")) { + tauruses++; + taurusesSession++; + ConfigHandler.writeIntConfig("fishing", "taurus", tauruses); + increaseSeaCreatures(); + } else if (message.contains("You hear a massive rumble as Thunder emerges")) { + thunders++; + thundersSession++; + ConfigHandler.writeIntConfig("fishing", "thunder", thunders); + increaseSeaCreatures(); + } else if (message.contains("You have angered a legendary creature... Lord Jawbus has arrived")) { + lordJawbuses++; + jawbusTime = System.currentTimeMillis() / 1000; + jawbusSCs = 0; + lordJawbusesSession++; + jawbusTimeSession = System.currentTimeMillis() / 1000; + jawbusSCsSession = 0; + ConfigHandler.writeIntConfig("fishing", "lordJawbus", lordJawbuses); + ConfigHandler.writeDoubleConfig("fishing", "jawbusTime", jawbusTime); + ConfigHandler.writeIntConfig("fishing", "jawbusSC", jawbusSCs); + increaseSeaCreatures(); } } public void increaseSeaCreatures() { - if (empSCs != -1) { - empSCs++; - } - if (empSCsSession != -1) { - empSCsSession++; - } // Only increment Yetis when in Jerry's Workshop if (Utils.isInScoreboard("Jerry's Workshop") || Utils.isInScoreboard("Jerry Pond")) { if (yetiSCs != -1) { @@ -314,6 +383,20 @@ public class FishingTracker { if (yetiSCsSession != -1) { yetiSCsSession++; } + } else if (Utils.tabLocation.equals("Crimson Isle")) { + if (jawbusSCs != -1) { + jawbusSCs++; + } + if (jawbusSCsSession != -1) { + jawbusSCsSession++; + } + } else { + if (empSCs != -1) { + empSCs++; + } + if (empSCsSession != -1) { + empSCsSession++; + } } seaCreatures++; @@ -324,6 +407,7 @@ public class FishingTracker { ConfigHandler.writeIntConfig("fishing", "milestone", fishingMilestone); ConfigHandler.writeIntConfig("fishing", "empSC", empSCs); ConfigHandler.writeIntConfig("fishing", "yetiSC", yetiSCs); + ConfigHandler.writeIntConfig("fishing", "jawbusSC", jawbusSCs); } } diff --git a/src/main/java/me/Danker/features/loot/LootDisplay.java b/src/main/java/me/Danker/features/loot/LootDisplay.java index 9436ec6..e1ddcb0 100644 --- a/src/main/java/me/Danker/features/loot/LootDisplay.java +++ b/src/main/java/me/Danker/features/loot/LootDisplay.java @@ -848,6 +848,92 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.lavaPigmenSession) + "\n" + EnumChatFormatting.GOLD + nf.format(FishingTracker.zombieMinersSession); break; + case "fishing_lava": + if (FishingTracker.jawbusTime == -1) { + timeBetween = "Never"; + } else { + timeBetween = Utils.getTimeBetween(FishingTracker.jawbusTime, timeNow); + } + if (FishingTracker.jawbusSCs == -1) { + bossesBetween = "Never"; + } else { + bossesBetween = nf.format(FishingTracker.jawbusSCs); + } + + dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + + EnumChatFormatting.AQUA + "Fishing Milestone:\n" + + EnumChatFormatting.GOLD + "Good Catches:\n" + + EnumChatFormatting.DARK_PURPLE + "Great Catches:\n" + + EnumChatFormatting.DARK_RED + "Magma Slugs:\n" + + EnumChatFormatting.RED + "Moogmas:\n" + + EnumChatFormatting.RED + "Lava Leeches:\n" + + EnumChatFormatting.RED + "Pyroclastic Worms:\n" + + EnumChatFormatting.DARK_RED + "Lava Flames:\n" + + EnumChatFormatting.RED + "Fire Eels:\n" + + EnumChatFormatting.GOLD + "Tauruses:\n" + + EnumChatFormatting.LIGHT_PURPLE + "Thunders:\n" + + EnumChatFormatting.LIGHT_PURPLE + "Lord Jawbuses:\n" + + EnumChatFormatting.AQUA + "Time Since Jawbus:\n" + + EnumChatFormatting.AQUA + "SC Since Jawbus:"; + countText = EnumChatFormatting.AQUA + nf.format(FishingTracker.seaCreatures) + "\n" + + EnumChatFormatting.AQUA + nf.format(FishingTracker.fishingMilestone) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.goodCatches) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.greatCatches) + "\n" + + EnumChatFormatting.DARK_RED + nf.format(FishingTracker.magmaSlugs) + "\n" + + EnumChatFormatting.RED + nf.format(FishingTracker.moogmas) + "\n" + + EnumChatFormatting.RED + nf.format(FishingTracker.lavaLeeches) + "\n" + + EnumChatFormatting.RED + nf.format(FishingTracker.pyroclasticWorms) + "\n" + + EnumChatFormatting.DARK_RED + nf.format(FishingTracker.lavaFlames) + "\n" + + EnumChatFormatting.RED + nf.format(FishingTracker.fireEels) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.tauruses) + "\n" + + EnumChatFormatting.LIGHT_PURPLE + nf.format(FishingTracker.thunders) + "\n" + + EnumChatFormatting.LIGHT_PURPLE + nf.format(FishingTracker.lordJawbuses) + "\n" + + EnumChatFormatting.AQUA + timeBetween + "\n" + + EnumChatFormatting.AQUA + bossesBetween; + break; + case "fishing_lava_session": + if (FishingTracker.jawbusTimeSession == -1) { + timeBetween = "Never"; + } else { + timeBetween = Utils.getTimeBetween(FishingTracker.jawbusTimeSession, timeNow); + } + if (FishingTracker.jawbusSCsSession == -1) { + bossesBetween = "Never"; + } else { + bossesBetween = nf.format(FishingTracker.jawbusSCsSession); + } + + dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + + EnumChatFormatting.AQUA + "Fishing Milestone:\n" + + EnumChatFormatting.GOLD + "Good Catches:\n" + + EnumChatFormatting.DARK_PURPLE + "Great Catches:\n" + + EnumChatFormatting.DARK_RED + "Magma Slugs:\n" + + EnumChatFormatting.RED + "Moogmas:\n" + + EnumChatFormatting.RED + "Lava Leeches:\n" + + EnumChatFormatting.RED + "Pyroclastic Worms:\n" + + EnumChatFormatting.DARK_RED + "Lava Flames:\n" + + EnumChatFormatting.RED + "Fire Eels:\n" + + EnumChatFormatting.GOLD + "Tauruses:\n" + + EnumChatFormatting.LIGHT_PURPLE + "Thunders:\n" + + EnumChatFormatting.LIGHT_PURPLE + "Lord Jawbuses:\n" + + EnumChatFormatting.AQUA + "Time Since Jawbus:\n" + + EnumChatFormatting.AQUA + "SC Since Jawbus:"; + countText = EnumChatFormatting.AQUA + nf.format(FishingTracker.seaCreaturesSession) + "\n" + + EnumChatFormatting.AQUA + nf.format(FishingTracker.fishingMilestoneSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.goodCatchesSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.greatCatchesSession) + "\n" + + EnumChatFormatting.DARK_RED + nf.format(FishingTracker.magmaSlugsSession) + "\n" + + EnumChatFormatting.RED + nf.format(FishingTracker.moogmasSession) + "\n" + + EnumChatFormatting.RED + nf.format(FishingTracker.lavaLeechesSession) + "\n" + + EnumChatFormatting.RED + nf.format(FishingTracker.pyroclasticWormsSession) + "\n" + + EnumChatFormatting.DARK_RED + nf.format(FishingTracker.lavaFlamesSession) + "\n" + + EnumChatFormatting.RED + nf.format(FishingTracker.fireEelsSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(FishingTracker.taurusesSession) + "\n" + + EnumChatFormatting.LIGHT_PURPLE + nf.format(FishingTracker.thundersSession) + "\n" + + EnumChatFormatting.LIGHT_PURPLE + nf.format(FishingTracker.lordJawbusesSession) + "\n" + + EnumChatFormatting.AQUA + timeBetween + "\n" + + EnumChatFormatting.AQUA + bossesBetween; + break; case "mythological": dropsText = EnumChatFormatting.GOLD + "Coins:\n" + EnumChatFormatting.WHITE + "Griffin Feathers:\n" + diff --git a/src/main/java/me/Danker/gui/DisplayGui.java b/src/main/java/me/Danker/gui/DisplayGui.java index 073b161..b8be3d6 100644 --- a/src/main/java/me/Danker/gui/DisplayGui.java +++ b/src/main/java/me/Danker/gui/DisplayGui.java @@ -27,6 +27,7 @@ public class DisplayGui extends GuiScreen { private GuiButton fishingFestival; private GuiButton fishingSpooky; private GuiButton fishingCH; + private GuiButton fishingLava; private GuiButton catacombsF1; private GuiButton catacombsF2; private GuiButton catacombsF3; @@ -60,11 +61,12 @@ public class DisplayGui extends GuiScreen { wolf = new GuiButton(0, width / 2 - 50, (int) (height * 0.35), 100, 20, "Wolf"); enderman = new GuiButton(0, width / 2 + 60, (int) (height * 0.35), 100, 20, "Enderman"); blaze = new GuiButton(0, width / 2 + 170, (int) (height * 0.35), 100, 20, "Blaze"); - fishing = new GuiButton(0, width / 2 - 270, (int) (height * 0.5), 100, 20, "Fishing"); - fishingWinter = new GuiButton(0, width / 2 - 160, (int) (height * 0.5), 100, 20, "Fishing Winter"); - fishingFestival = new GuiButton(0, width / 2 - 50, (int) (height * 0.5), 100, 20, "Fishing Festival"); - fishingSpooky = new GuiButton(0, width / 2 + 60, (int) (height * 0.5), 100, 20, "Fishing Spooky"); - fishingCH = new GuiButton(0, width / 2 + 170, (int) (height * 0.5), 100, 20, "CH Fishing"); + fishing = new GuiButton(0, width / 2 - 295, (int) (height * 0.5), 90, 20, "Fishing"); + fishingWinter = new GuiButton(0, width / 2 - 195, (int) (height * 0.5), 90, 20, "Fishing Winter"); + fishingFestival = new GuiButton(0, width / 2 - 95, (int) (height * 0.5), 90, 20, "Fishing Festival"); + fishingSpooky = new GuiButton(0, width / 2 + 5, (int) (height * 0.5), 90, 20, "Fishing Spooky"); + fishingCH = new GuiButton(0, width / 2 + 105, (int) (height * 0.5), 90, 20, "CH Fishing"); + fishingLava = new GuiButton(0, width / 2 + 205, (int) (height * 0.5), 90, 20, "Lava Fishing"); catacombsF1 = new GuiButton(0, width / 2 - 235, (int) (height * 0.65), 50, 20, "F1"); catacombsF2 = new GuiButton(0, width / 2 - 175, (int) (height * 0.65), 50, 20, "F2"); catacombsF3 = new GuiButton(0, width / 2 - 115, (int) (height * 0.65), 50, 20, "F3"); @@ -89,6 +91,7 @@ public class DisplayGui extends GuiScreen { this.buttonList.add(fishingFestival); this.buttonList.add(fishingSpooky); this.buttonList.add(fishingCH); + this.buttonList.add(fishingLava); this.buttonList.add(catacombsF1); this.buttonList.add(catacombsF2); this.buttonList.add(catacombsF3); @@ -148,6 +151,8 @@ public class DisplayGui extends GuiScreen { setDisplay("fishing_spooky"); } else if (button == fishingCH) { setDisplay("fishing_ch"); + } else if (button == fishingLava) { + setDisplay("fishing_lava"); } else if (button == mythological) { setDisplay("mythological"); } else if (button == catacombsF1) { diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index a4d7ca9..1267b9b 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -456,6 +456,18 @@ public class ConfigHandler { FishingTracker.lavaBlazes = initInt("fishing", "lavaBlaze", 0); FishingTracker.lavaPigmen = initInt("fishing", "lavaPigman", 0); FishingTracker.zombieMiners = initInt("fishing", "zombieMiner", 0); + // Lava Fishing + FishingTracker.magmaSlugs = initInt("fishing", "magmaSlug", 0); + FishingTracker.moogmas = initInt("fishing", "moogma", 0); + FishingTracker.lavaLeeches = initInt("fishing", "lavaLeech", 0); + FishingTracker.pyroclasticWorms = initInt("fishing", "pyroclasticWorm", 0); + FishingTracker.lavaFlames = initInt("fishing", "lavaFlame", 0); + FishingTracker.fireEels = initInt("fishing", "fireEel", 0); + FishingTracker.tauruses = initInt("fishing", "taurus", 0); + FishingTracker.thunders = initInt("fishing", "thunder", 0); + FishingTracker.lordJawbuses = initInt("fishing", "lordJawbus", 0); + FishingTracker.jawbusTime = initDouble("fishing", "jawbusTime", -1); + FishingTracker.jawbusSCs = initInt("fishing", "jawbusSC", -1); // Mythological MythologicalTracker.mythCoins = initDouble("mythological", "coins", 0); -- cgit From c9c0ea6a3e3382fd236345b89bd0991c8b8cbb17 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 22 Apr 2022 01:41:18 -0400 Subject: Fix of inquistor not counted in tracker Manually added from #118 --- .../me/Danker/features/loot/MythologicalTracker.java | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/loot/MythologicalTracker.java b/src/main/java/me/Danker/features/loot/MythologicalTracker.java index 1784b41..9a98466 100644 --- a/src/main/java/me/Danker/features/loot/MythologicalTracker.java +++ b/src/main/java/me/Danker/features/loot/MythologicalTracker.java @@ -2,10 +2,14 @@ package me.Danker.features.loot; import me.Danker.handlers.ConfigHandler; import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; import net.minecraft.util.StringUtils; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import java.util.List; + public class MythologicalTracker { public static double mythCoins; @@ -73,9 +77,19 @@ public class MythologicalTracker { gaiaConstructsSession++; ConfigHandler.writeIntConfig("mythological", "gaiaConstruct", gaiaConstructs); } else if (message.contains("a Minos Champion!")) { - minosChampions++; - minosChampionsSession++; - ConfigHandler.writeIntConfig("mythological", "minosChampion", minosChampions); + Minecraft mc = Minecraft.getMinecraft(); + List listWorldEntity = mc.theWorld.getLoadedEntityList(); + for (Entity entity : listWorldEntity) { + if (entity.getName().contains("Minos Champion")) { + minosChampions++; + minosChampionsSession++; + ConfigHandler.writeIntConfig("mythological", "minosChampion", minosChampions); + } else if (entity.getName().contains("Minos Inquisitor")) { + minosInquisitors++; + minosInquisitorsSession++; + ConfigHandler.writeIntConfig("mythological", "minosInquisitor", minosInquisitors); + } + } } else if (message.contains("a Minos Inquisitor!")) { minosInquisitors++; minosInquisitorsSession++; -- cgit From eb034080964b408ad6140c6782075500fd8397e9 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Fri, 22 Apr 2022 22:28:21 +0200 Subject: removed old warp commands --- src/main/java/me/Danker/commands/DHelpCommand.java | 8 ---- src/main/java/me/Danker/commands/warp/Crypt.java | 43 --------------------- .../java/me/Danker/commands/warp/DarkAuction.java | 44 ---------------------- src/main/java/me/Danker/commands/warp/Dragon.java | 44 ---------------------- .../java/me/Danker/commands/warp/DungeonHub.java | 44 ---------------------- .../java/me/Danker/commands/warp/HowlingCave.java | 43 --------------------- src/main/java/me/Danker/commands/warp/Magma.java | 43 --------------------- .../java/me/Danker/commands/warp/SpidersNest.java | 43 --------------------- 8 files changed, 312 deletions(-) delete mode 100644 src/main/java/me/Danker/commands/warp/Crypt.java delete mode 100644 src/main/java/me/Danker/commands/warp/DarkAuction.java delete mode 100644 src/main/java/me/Danker/commands/warp/Dragon.java delete mode 100644 src/main/java/me/Danker/commands/warp/DungeonHub.java delete mode 100644 src/main/java/me/Danker/commands/warp/HowlingCave.java delete mode 100644 src/main/java/me/Danker/commands/warp/Magma.java delete mode 100644 src/main/java/me/Danker/commands/warp/SpidersNest.java (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index db474c7..477d43b 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -1,7 +1,6 @@ package me.Danker.commands; import me.Danker.DankersSkyblockMod; -import me.Danker.commands.warp.*; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; @@ -60,13 +59,6 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + RepartyCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Disbands and reparties all members in the party.\n" + EnumChatFormatting.GOLD + CustomMusicCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Stops or reloads the custom music.\n" + EnumChatFormatting.GOLD + PlayerCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find skills, slayers, coins and weight of a player.\n" + - EnumChatFormatting.GOLD + Crypt.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Crypt in the Hub. \n" + - EnumChatFormatting.GOLD + DarkAuction.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Dark Auction in the Hub. \n" + - EnumChatFormatting.GOLD + Dragon.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Dragons Nest in the End. \n" + - EnumChatFormatting.GOLD + DungeonHub.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Dungeon Hub. \n" + - EnumChatFormatting.GOLD + HowlingCave.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Howling Cave in the Park. \n" + - EnumChatFormatting.GOLD + Magma.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Magma Fields in the Blazing Fortress. \n" + - EnumChatFormatting.GOLD + SpidersNest.usage(arg0) + EnumChatFormatting.AQUA + " - Warps you to the Top of the Spider's Nest in the Spider's Den. \n" + EnumChatFormatting.GOLD + ReloadConfigCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Reloads Danker's Skyblock Mod config.\n" + EnumChatFormatting.GOLD + ReloadRepoCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Reloads Danker's Skyblock Mod repository.\n" + EnumChatFormatting.GOLD + FarmLengthCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Sets coords to be used for end of farm alert.\n" + diff --git a/src/main/java/me/Danker/commands/warp/Crypt.java b/src/main/java/me/Danker/commands/warp/Crypt.java deleted file mode 100644 index fd91790..0000000 --- a/src/main/java/me/Danker/commands/warp/Crypt.java +++ /dev/null @@ -1,43 +0,0 @@ -package me.Danker.commands.warp; - -import me.Danker.utils.Utils; -import net.minecraft.client.Minecraft; -import net.minecraft.command.CommandBase; -import net.minecraft.command.CommandException; -import net.minecraft.command.ICommandSender; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; - -import java.util.List; - -public class Crypt extends CommandBase { - @Override - public String getCommandName() { - return "crypt"; - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "/" + getCommandName(); - } - - public static String usage(ICommandSender arg0) { - return new me.Danker.commands.warp.Crypt().getCommandUsage(arg0); - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { - return null; - } - - @Override - public void processCommand(ICommandSender sender, String[] args) throws CommandException { - if (!Utils.inSkyblock) return; - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp crypt"); - } -} diff --git a/src/main/java/me/Danker/commands/warp/DarkAuction.java b/src/main/java/me/Danker/commands/warp/DarkAuction.java deleted file mode 100644 index d2cffe9..0000000 --- a/src/main/java/me/Danker/commands/warp/DarkAuction.java +++ /dev/null @@ -1,44 +0,0 @@ -package me.Danker.commands.warp; - -import me.Danker.DankersSkyblockMod; -import me.Danker.utils.Utils; -import net.minecraft.client.Minecraft; -import net.minecraft.command.CommandBase; -import net.minecraft.command.CommandException; -import net.minecraft.command.ICommandSender; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; - -import java.util.List; - -public class DarkAuction extends CommandBase { - @Override - public String getCommandName() { - return "da"; - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "/" + getCommandName(); - } - - public static String usage(ICommandSender arg0) { - return new me.Danker.commands.warp.DarkAuction().getCommandUsage(arg0); - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { - return null; - } - - @Override - public void processCommand(ICommandSender sender, String[] args) throws CommandException { - if (!Utils.inSkyblock) return; - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp da"); - } -} diff --git a/src/main/java/me/Danker/commands/warp/Dragon.java b/src/main/java/me/Danker/commands/warp/Dragon.java deleted file mode 100644 index a0cf9ab..0000000 --- a/src/main/java/me/Danker/commands/warp/Dragon.java +++ /dev/null @@ -1,44 +0,0 @@ -package me.Danker.commands.warp; - -import me.Danker.DankersSkyblockMod; -import me.Danker.utils.Utils; -import net.minecraft.client.Minecraft; -import net.minecraft.command.CommandBase; -import net.minecraft.command.CommandException; -import net.minecraft.command.ICommandSender; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; - -import java.util.List; - -public class Dragon extends CommandBase { - @Override - public String getCommandName() { - return "drag"; - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "/" + getCommandName(); - } - - public static String usage(ICommandSender arg0) { - return new me.Danker.commands.warp.DarkAuction().getCommandUsage(arg0); - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { - return null; - } - - @Override - public void processCommand(ICommandSender sender, String[] args) throws CommandException { - if (!Utils.inSkyblock) return; - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp drag"); - } -} diff --git a/src/main/java/me/Danker/commands/warp/DungeonHub.java b/src/main/java/me/Danker/commands/warp/DungeonHub.java deleted file mode 100644 index 3031fec..0000000 --- a/src/main/java/me/Danker/commands/warp/DungeonHub.java +++ /dev/null @@ -1,44 +0,0 @@ -package me.Danker.commands.warp; - -import me.Danker.DankersSkyblockMod; -import me.Danker.utils.Utils; -import net.minecraft.client.Minecraft; -import net.minecraft.command.CommandBase; -import net.minecraft.command.CommandException; -import net.minecraft.command.ICommandSender; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; - -import java.util.List; - -public class DungeonHub extends CommandBase { - @Override - public String getCommandName() { - return "dun"; - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "/" + getCommandName(); - } - - public static String usage(ICommandSender arg0) { - return new me.Danker.commands.warp.DungeonHub().getCommandUsage(arg0); - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { - return null; - } - - @Override - public void processCommand(ICommandSender sender, String[] args) throws CommandException { - if (!Utils.inSkyblock) return; - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp dungeon_hub"); - } -} diff --git a/src/main/java/me/Danker/commands/warp/HowlingCave.java b/src/main/java/me/Danker/commands/warp/HowlingCave.java deleted file mode 100644 index 1d45ada..0000000 --- a/src/main/java/me/Danker/commands/warp/HowlingCave.java +++ /dev/null @@ -1,43 +0,0 @@ -package me.Danker.commands.warp; - -import me.Danker.utils.Utils; -import net.minecraft.client.Minecraft; -import net.minecraft.command.CommandBase; -import net.minecraft.command.CommandException; -import net.minecraft.command.ICommandSender; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; - -import java.util.List; - -public class HowlingCave extends CommandBase { - @Override - public String getCommandName() { - return "howl"; - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "/" + getCommandName(); - } - - public static String usage(ICommandSender arg0) { - return new me.Danker.commands.warp.HowlingCave().getCommandUsage(arg0); - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { - return null; - } - - @Override - public void processCommand(ICommandSender sender, String[] args) throws CommandException { - if (!Utils.inSkyblock) return; - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp howl"); - } -} diff --git a/src/main/java/me/Danker/commands/warp/Magma.java b/src/main/java/me/Danker/commands/warp/Magma.java deleted file mode 100644 index 4f7459d..0000000 --- a/src/main/java/me/Danker/commands/warp/Magma.java +++ /dev/null @@ -1,43 +0,0 @@ -package me.Danker.commands.warp; - -import me.Danker.utils.Utils; -import net.minecraft.client.Minecraft; -import net.minecraft.command.CommandBase; -import net.minecraft.command.CommandException; -import net.minecraft.command.ICommandSender; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; - -import java.util.List; - -public class Magma extends CommandBase { - @Override - public String getCommandName() { - return "magma"; - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "/" + getCommandName(); - } - - public static String usage(ICommandSender arg0) { - return new me.Danker.commands.warp.Magma().getCommandUsage(arg0); - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { - return null; - } - - @Override - public void processCommand(ICommandSender sender, String[] args) throws CommandException { - if (!Utils.inSkyblock) return; - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp magma"); - } -} diff --git a/src/main/java/me/Danker/commands/warp/SpidersNest.java b/src/main/java/me/Danker/commands/warp/SpidersNest.java deleted file mode 100644 index ecea275..0000000 --- a/src/main/java/me/Danker/commands/warp/SpidersNest.java +++ /dev/null @@ -1,43 +0,0 @@ -package me.Danker.commands.warp; - -import me.Danker.utils.Utils; -import net.minecraft.client.Minecraft; -import net.minecraft.command.CommandBase; -import net.minecraft.command.CommandException; -import net.minecraft.command.ICommandSender; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; - -import java.util.List; - -public class SpidersNest extends CommandBase { - @Override - public String getCommandName() { - return "nest"; - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "/" + getCommandName(); - } - - public static String usage(ICommandSender arg0) { - return new me.Danker.commands.warp.SpidersNest().getCommandUsage(arg0); - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { - return null; - } - - @Override - public void processCommand(ICommandSender sender, String[] args) throws CommandException { - if (!Utils.inSkyblock) return; - Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp nest"); - } -} -- cgit From 4b49b2c392d3acec1d2503edb29b510dd2a214cc Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Fri, 22 Apr 2022 22:28:44 +0200 Subject: added new way of registering WarpCommands --- README.md | 36 ++++++--- src/main/java/me/Danker/DankersSkyblockMod.java | 11 +-- .../java/me/Danker/commands/warp/WarpCommand.java | 79 ++++++++++++++++++ .../Danker/commands/warp/WarpCommandHandler.java | 94 ++++++++++++++++++++++ 4 files changed, 203 insertions(+), 17 deletions(-) create mode 100644 src/main/java/me/Danker/commands/warp/WarpCommand.java create mode 100644 src/main/java/me/Danker/commands/warp/WarpCommandHandler.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 6cd98e3..e46f75d 100644 --- a/README.md +++ b/README.md @@ -101,16 +101,34 @@ Discord Server: https://discord.gg/QsEkNQS - /dsmfarmlength - Sets coords to be used for end of farm alert. - /hotmof [player] - Uses API to find total powder and HotM tree of a person. If no name is provided, it checks yours. -##Warps -Commands for to warp to the MVP+ exclusive warps -- /crypt - Warps you to the Crypt in the Hub. -- /da - Warps you to the Dark Auction in the Hub. -- /drag - Warps you to the Dragons Nest in the End. -- /dun - Warps you to the Dungeon Hub. -- /howl - Warps you to the Howling Cave in the Park. -- /magma - Warps you to the Magma Fields in the Blazing Fortress. -- /nest - Warps you to the Top of the Spider's Nest in the Spider's Den. +
+ Warps +### Warps +Shortcut commands that save you the time of typing the whole warp command. + - /deep - Warps you to the Deep Caverns. + - /nether - Warps you to the Crimson Isle. + - /isle - Warps you to the Crimson Isle. + - /crimson - Warps you to the Crimson Isle. + - /mines - Warps you to the Dwarven Mines. + - /forge - Warps you to the Dwarven Forge. + - /crystals - Warps you to the Crystal Hollows. + - /gold - Warps you to the Gold Mine. + - /desert - Warps you to the Desert. + - /spider - Warps you to the Spiders Den. + - /barn - Warps you to the Barn. + - /end - Warps you to the End. + - /park - Warps you to the Park. + - /castle - Warps you to the Hub Castle. + - /da - Warps you to the Dark Auction. + - /crypt - Warps you to the Crypt in the Hub. + - /nest - Warps you to the top of the Spider's Den. + - /void - Warps you to the Void Sepulture in the End. + - /drag - Warps you to the Dragons Nest in the End. + - /jungle - Warps you to the Jungle. + - /howl - Warps you to the Howling Cave in the Park. + - /dun - Warps you to the Dungeon Hub. +
## Keybinds - Open Maddox menu - M by default. diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 6fa1995..16c73c8 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -2,7 +2,7 @@ package me.Danker; import com.google.gson.JsonObject; import me.Danker.commands.*; -import me.Danker.commands.warp.*; +import me.Danker.commands.warp.WarpCommandHandler; import me.Danker.events.ChestSlotClickedEvent; import me.Danker.events.GuiChestBackgroundDrawnEvent; import me.Danker.events.RenderOverlayEvent; @@ -79,6 +79,7 @@ public class DankersSkyblockMod { public static boolean firstLaunch = false; public static String configDirectory; public static JsonObject data = null; + public static WarpCommandHandler warpCommandHandler; public static int farmingLevel; public static int miningLevel; @@ -232,13 +233,7 @@ public class DankersSkyblockMod { ClientCommandHandler.instance.registerCommand(new ToggleCommand()); ClientCommandHandler.instance.registerCommand(new WeightCommand()); - ClientCommandHandler.instance.registerCommand(new Crypt()); - ClientCommandHandler.instance.registerCommand(new DarkAuction()); - ClientCommandHandler.instance.registerCommand(new Dragon()); - ClientCommandHandler.instance.registerCommand(new DungeonHub()); - ClientCommandHandler.instance.registerCommand(new HowlingCave()); - ClientCommandHandler.instance.registerCommand(new Magma()); - ClientCommandHandler.instance.registerCommand(new SpidersNest()); + warpCommandHandler = new WarpCommandHandler(); configDirectory = event.getModConfigurationDirectory().toString(); } diff --git a/src/main/java/me/Danker/commands/warp/WarpCommand.java b/src/main/java/me/Danker/commands/warp/WarpCommand.java new file mode 100644 index 0000000..730e7cd --- /dev/null +++ b/src/main/java/me/Danker/commands/warp/WarpCommand.java @@ -0,0 +1,79 @@ +package me.Danker.commands.warp; + +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; + +public class WarpCommand extends CommandBase { + + + private boolean custom_command = false; + public String name; + public String destination; + + /** + * A Command blueprint extending CommandBase that uses the name and sends the destination as "/warp {@link #destination}" + * @param name the name that the command is called as + * @param destination the location name that is sent + */ + public WarpCommand(String name, String destination) { + this.name = name; + this.destination = destination; + } + + /** + * A Command blueprint extending CommandBase that uses the name and sends the destination as "/warp {@link #destination}" + * @param name the name that the command is called as + * @param destination the location name that is sent + * @param custom_command is the custom command should use the /warp format or send a custom command. + * Adds the "/" to the destination. + */ + public WarpCommand(String name, String destination, boolean custom_command) { + this.name = name; + this.destination = destination; + this.custom_command = custom_command; + } + + /** + * Returns the commands name that is set in the constructor + */ + @Override + public String getCommandName() { + return name; + } + + /** + * Returns the command usage for the builtin help + * @param sender the command sender + * @return "/" + the command name + */ + @Override + public String getCommandUsage(ICommandSender sender) { + return "/" + getCommandName(); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + /** + * The logic that is called when the command is executed + * Sends a message as the player containing "/warp {@link #destination}" + * @param sender the command sender + * @param args what is written after the command + */ + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + if (!Utils.inSkyblock) return; + if (custom_command) { + Minecraft.getMinecraft().thePlayer.sendChatMessage("/" + this.destination); + return; + } + Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp " + this.destination); + + } + +} diff --git a/src/main/java/me/Danker/commands/warp/WarpCommandHandler.java b/src/main/java/me/Danker/commands/warp/WarpCommandHandler.java new file mode 100644 index 0000000..6cdf840 --- /dev/null +++ b/src/main/java/me/Danker/commands/warp/WarpCommandHandler.java @@ -0,0 +1,94 @@ +package me.Danker.commands.warp; + +import net.minecraftforge.client.ClientCommandHandler; + +import java.util.ArrayList; +import java.util.List; + +public class WarpCommandHandler { + + private List commands; + + /** + * Constructor of the WarpCommandHandler, it will register all commands when it is created + */ + public WarpCommandHandler() { + this.commands = new ArrayList(); + registerCommands(); + } + + + /** + * @return List of all registered commands + */ + public List getCommands() { + return this.commands; + } + + /** + * Registers a command to the handler + * @param warpCommand WarpCommand to register + */ + public void registerCommand(WarpCommand warpCommand) { + this.commands.add(warpCommand); + ClientCommandHandler.instance.registerCommand(warpCommand); + } + + /** + * Get a command by its name + * @param name Name of the command + * @return WarpCommand with the given name + */ + public WarpCommand getCommand(String name) { + for (WarpCommand command : this.commands) { + if (command.getCommandName().equalsIgnoreCase(name)) { + return command; + } + } + return null; + } + + /** + * Get a command by the class it extends from + * @param clazz Class to get the command from + * @return WarpCommand with the given class + */ + public WarpCommand getCommand(Class clazz) { + for (WarpCommand command : this.commands) { + if (command.getClass() == clazz) { + return command; + } + } + return null; + } + + /** + * Register all commands + */ + private void registerCommands() { + registerCommand(new WarpCommand("deep", "deep")); + registerCommand(new WarpCommand("nether", "nether")); + registerCommand(new WarpCommand("isle", "isle")); + registerCommand(new WarpCommand("crimson", "crimson")); + registerCommand(new WarpCommand("mines", "mines")); + registerCommand(new WarpCommand("forge", "forge")); + registerCommand(new WarpCommand("crystals", "crystals")); + registerCommand(new WarpCommand("gold", "gold")); + registerCommand(new WarpCommand("desert", "desert")); + registerCommand(new WarpCommand("spider", "spider")); + registerCommand(new WarpCommand("barn", "barn")); + registerCommand(new WarpCommand("end", "end")); + registerCommand(new WarpCommand("park", "park")); + registerCommand(new WarpCommand("castle", "castle")); + registerCommand(new WarpCommand("museum", "museum")); + registerCommand(new WarpCommand("da", "da")); + registerCommand(new WarpCommand("crypt", "crypt")); + registerCommand(new WarpCommand("nest", "nest")); + registerCommand(new WarpCommand("void", "void")); + registerCommand(new WarpCommand("drag", "dragon")); + registerCommand(new WarpCommand("jungle", "jungle")); + registerCommand(new WarpCommand("howl", "howl")); + registerCommand(new WarpCommand("dun", "dungeon_hub")); + } + +} -- cgit From 5f6ce80319b21d53abbec15886f4e2fbd765f748 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Fri, 22 Apr 2022 22:28:55 +0200 Subject: fixed HighlightCommissions --- src/main/java/me/Danker/utils/Utils.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index c9021f7..0fa2d0a 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -8,6 +8,8 @@ import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.ScoreboardHandler; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.network.NetworkPlayerInfo; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItemFrame; @@ -18,6 +20,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.scoreboard.ScoreObjective; import net.minecraft.util.*; +import org.lwjgl.opengl.GL11; import java.util.*; import java.util.regex.Matcher; @@ -491,6 +494,20 @@ public class Utils { return (Math.floor(level / 2D) + 25) / 100D; } + public static void drawOnSlot(int size, int xSlotPos, int ySlotPos, int colour) { + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int guiLeft = (sr.getScaledWidth() - 176) / 2; + int guiTop = (sr.getScaledHeight() - 222) / 2; + int x = guiLeft + xSlotPos; + int y = guiTop + ySlotPos; + // Move down when chest isn't 6 rows + if (size != 90) y += (6 - (size - 36) / 9) * 9; + + GL11.glTranslated(0, 0, 1); + Gui.drawRect(x, y, x + 16, y + 16, colour); + GL11.glTranslated(0, 0, -1); + } + public enum DungeonFloor { NONE, E0, -- cgit From 125632e4771993e5ac55dcb7e8371c18f938bad6 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 23 Apr 2022 03:48:13 -0400 Subject: Fix typo in fishing tracker --- src/main/java/me/Danker/features/loot/FishingTracker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/loot/FishingTracker.java b/src/main/java/me/Danker/features/loot/FishingTracker.java index 95a9040..bb7daba 100644 --- a/src/main/java/me/Danker/features/loot/FishingTracker.java +++ b/src/main/java/me/Danker/features/loot/FishingTracker.java @@ -320,7 +320,7 @@ public class FishingTracker { zombieMinersSession++; ConfigHandler.writeIntConfig("fishing", "zombieMiner", zombieMiners); increaseSeaCreatures(); - } else if (message.contains("From Beneath the lava appears a Magma Slug")) { + } else if (message.contains("From beneath the lava appears a Magma Slug")) { magmaSlugs++; magmaSlugsSession++; ConfigHandler.writeIntConfig("fishing", "magmaSlug", magmaSlugs); -- cgit From 9d676f89051d2845566b7253c0b91f3abe32673d Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 23 Apr 2022 22:46:40 -0400 Subject: Add fire pillar display --- README.md | 5 ++- src/main/java/me/Danker/DankersSkyblockMod.java | 1 + .../java/me/Danker/commands/DankerGuiCommand.java | 1 + src/main/java/me/Danker/commands/MoveCommand.java | 12 ++++- src/main/java/me/Danker/commands/ScaleCommand.java | 10 ++++- .../java/me/Danker/commands/ToggleCommand.java | 21 ++++----- .../java/me/Danker/features/FirePillarDisplay.java | 51 ++++++++++++++++++++++ src/main/java/me/Danker/gui/DankerGui.java | 7 +++ src/main/java/me/Danker/gui/EditLocationsGui.java | 35 ++++++++++----- .../java/me/Danker/gui/buttons/LocationButton.java | 4 ++ .../java/me/Danker/handlers/ConfigHandler.java | 4 ++ 11 files changed, 124 insertions(+), 27 deletions(-) create mode 100644 src/main/java/me/Danker/features/FirePillarDisplay.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index ea32b5d..30fec71 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ Discord Server: https://discord.gg/QsEkNQS - Predicted dungeon score display - Hide player armour - Automatically join skyblock +- Fire pillar display ## Commands - /dhelp - Returns this message in-game. @@ -75,8 +76,8 @@ Discord Server: https://discord.gg/QsEkNQS - /loot [winter/festival/spooky/ch/lava/f(1-7)/mm/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. - /display [winter/festival/spooky/ch/lava/f(1-7)/mm/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active. - /resetloot - - Resets loot for trackers. /resetloot confirm confirms the reset. -- /move - Moves text display to specified X and Y coordinates. -- /scale - Scales text display to a specified multipler between 0.1x and 10x. +- /move - Moves text display to specified X and Y coordinates. +- /scale - Scales text display to a specified multipler between 0.1x and 10x. - /slayer [player] - Uses API to get slayer xp of a person. If no name is provided, it checks yours. - /skill [player] - Uses API to get skill levels of a person. If no name is provided, it checks yours. - /lobbyskills - Uses API to find the average skills of the lobby, as well the three players with the highest skill average. diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index fb98068..cc96448 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -126,6 +126,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new EndOfFarmAlert()); MinecraftForge.EVENT_BUS.register(new ExpertiseLore()); MinecraftForge.EVENT_BUS.register(new FasterMaddoxCalling()); + MinecraftForge.EVENT_BUS.register(new FirePillarDisplay()); MinecraftForge.EVENT_BUS.register(new GemstonesLore()); MinecraftForge.EVENT_BUS.register(new GiantHPDisplay()); MinecraftForge.EVENT_BUS.register(new GoldenEnchants()); diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index 14041d1..1c5ea53 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -63,6 +63,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[gianthp][").append(MoveCommand.giantHPXY[0]).append(", ").append(MoveCommand.giantHPXY[1]).append("]\n"); debug.append("[abilitycooldowns][").append(MoveCommand.abilityCooldownsXY[0]).append(", ").append(MoveCommand.abilityCooldownsXY[1]).append("]\n"); debug.append("[dungeonscore][").append(MoveCommand.dungeonScoreXY[0]).append(", ").append(MoveCommand.dungeonScoreXY[1]).append("]\n"); + debug.append("[firepillar][").append(MoveCommand.firePillarXY[0]).append(", ").append(MoveCommand.firePillarXY[1]).append("]\n"); debug.append("# Other Settings\n"); debug.append("[Current Display][").append(LootDisplay.display).append("]\n"); debug.append("[Auto Display][").append(LootDisplay.auto).append("]\n"); diff --git a/src/main/java/me/Danker/commands/MoveCommand.java b/src/main/java/me/Danker/commands/MoveCommand.java index 5a6c6a2..106e603 100644 --- a/src/main/java/me/Danker/commands/MoveCommand.java +++ b/src/main/java/me/Danker/commands/MoveCommand.java @@ -27,6 +27,7 @@ public class MoveCommand extends CommandBase { public static int[] giantHPXY = {0, 0}; public static int[] abilityCooldownsXY = {0, 0}; public static int[] dungeonScoreXY = {0, 0}; + public static int[] firePillarXY = {0, 0}; @Override public String getCommandName() { @@ -37,7 +38,7 @@ public class MoveCommand extends CommandBase { public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName() + " "; + "abilitycooldowns/dungeonscore/firepillar> "; } public static String usage(ICommandSender arg0) { @@ -54,7 +55,7 @@ public class MoveCommand extends CommandBase { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", "skilltracker", "wateranswer", "bonzotimer", "golemtimer", "teammatesinradius", - "gianthp", "abilitycooldowns", "dungeonscore"); + "gianthp", "abilitycooldowns", "dungeonscore", "firepillar"); } return null; } @@ -167,6 +168,13 @@ public class MoveCommand extends CommandBase { ConfigHandler.writeIntConfig("locations", "dungeonScoreY", dungeonScoreXY[1]); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Dungeon score has been moved to " + DankersSkyblockMod.SECONDARY_COLOUR + arg1[1] + ", " + arg1[2])); break; + case "firepillar": + firePillarXY[0] = Integer.parseInt(arg1[1]); + firePillarXY[1] = Integer.parseInt(arg1[2]); + ConfigHandler.writeIntConfig("locations", "firePillarX", firePillarXY[0]); + ConfigHandler.writeIntConfig("locations", "firePillarY", firePillarXY[1]); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Fire pillar has been moved to " + DankersSkyblockMod.SECONDARY_COLOUR + arg1[1] + ", " + arg1[2])); + break; default: player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); } diff --git a/src/main/java/me/Danker/commands/ScaleCommand.java b/src/main/java/me/Danker/commands/ScaleCommand.java index 9bb1f08..a19642b 100644 --- a/src/main/java/me/Danker/commands/ScaleCommand.java +++ b/src/main/java/me/Danker/commands/ScaleCommand.java @@ -27,6 +27,7 @@ public class ScaleCommand extends CommandBase { public static double giantHPScale; public static double abilityCooldownsScale; public static double dungeonScoreScale; + public static double firePillarScale; @Override public String getCommandName() { @@ -36,7 +37,7 @@ public class ScaleCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName() + " "; + "bonzotimer/golemtimer/teammatesinradius/gianthp/abilitycooldown/dungeonscore/firepillar> "; } public static String usage(ICommandSender arg0) { @@ -53,7 +54,7 @@ public class ScaleCommand extends CommandBase { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", "skilltracker", "wateranswer", "bonzotimer", "golemtimer", "teammatesinradius", - "gianthp", "abilitycooldowns", "dungeonscore"); + "gianthp", "abilitycooldowns", "dungeonscore", "firepillar"); } return null; } @@ -144,6 +145,11 @@ public class ScaleCommand extends CommandBase { ConfigHandler.writeDoubleConfig("scales", "dungeonScoreScale", dungeonScoreScale); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Dungeon score has been scaled to " + DankersSkyblockMod.SECONDARY_COLOUR + dungeonScoreScale + "x")); break; + case "firepillar": + firePillarScale = scaleAmount; + ConfigHandler.writeDoubleConfig("scales", "firePillarScale", firePillarScale); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Fire pillar has been scaled to " + DankersSkyblockMod.SECONDARY_COLOUR + firePillarScale + "x")); + break; default: player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); } diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 3536bd7..7207565 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -32,6 +32,15 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean expertiseLoreToggled; public static boolean skill50DisplayToggled; public static boolean outlineTextToggled; + public static boolean lowHealthNotifyToggled; + public static boolean stopSalvageStarredToggled; + public static boolean watcherReadyToggled; + public static boolean swapToPickBlockToggled; + public static boolean flowerWeaponsToggled; + public static boolean notifySlayerSlainToggled; + public static boolean necronNotificationsToggled; + public static boolean bonzoTimerToggled; + public static boolean autoSkillTrackerToggled; public static boolean cakeTimerToggled; public static boolean highlightSlayers; public static boolean highlightArachne; @@ -51,6 +60,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean dungeonScore; public static boolean hideArmour; public static boolean autoJoinSkyblock; + public static boolean firePillar; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; @@ -59,16 +69,6 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean cooldownMessages; public static boolean manaMessages; public static boolean killComboMessages; - public static boolean lowHealthNotifyToggled; - public static boolean lividSolverToggled; - public static boolean stopSalvageStarredToggled; - public static boolean watcherReadyToggled; - public static boolean swapToPickBlockToggled; - public static boolean flowerWeaponsToggled; - public static boolean notifySlayerSlainToggled; - public static boolean necronNotificationsToggled; - public static boolean bonzoTimerToggled; - public static boolean autoSkillTrackerToggled; // Puzzle Solvers public static boolean threeManToggled; public static boolean oruoToggled; @@ -80,6 +80,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean boulderToggled; public static boolean silverfishToggled; public static boolean iceWalkToggled; + public static boolean lividSolverToggled; // Terminal Helpers public static boolean startsWithToggled; public static boolean selectAllToggled; diff --git a/src/main/java/me/Danker/features/FirePillarDisplay.java b/src/main/java/me/Danker/features/FirePillarDisplay.java new file mode 100644 index 0000000..34b2288 --- /dev/null +++ b/src/main/java/me/Danker/features/FirePillarDisplay.java @@ -0,0 +1,51 @@ +package me.Danker.features; + +import me.Danker.DankersSkyblockMod; +import me.Danker.commands.MoveCommand; +import me.Danker.commands.ScaleCommand; +import me.Danker.commands.ToggleCommand; +import me.Danker.events.RenderOverlayEvent; +import me.Danker.handlers.TextRenderer; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.util.StringUtils; +import net.minecraft.world.World; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + +import java.util.List; + +public class FirePillarDisplay { + + static Entity pillar = null; + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + if (event.phase != TickEvent.Phase.START) return; + + World world = Minecraft.getMinecraft().theWorld; + if (DankersSkyblockMod.tickAmount % 20 == 0) { + pillar = null; + if (ToggleCommand.firePillar && world != null && Utils.tabLocation.equals("Crimson Isle") && Utils.isInScoreboard("Slay the boss!")) { + List entities = world.getLoadedEntityList(); + + for (Entity entity : entities) { + String name = StringUtils.stripControlCodes(entity.getName()); + if (name.endsWith(" hits") && name.charAt(1) == 's') { + pillar = entity; + break; + } + } + } + } + } + + @SubscribeEvent + public void renderPlayerInfo(RenderOverlayEvent event) { + if (ToggleCommand.firePillar && pillar != null) { + new TextRenderer(Minecraft.getMinecraft(), Utils.removeBold(pillar.getName()), MoveCommand.firePillarXY[0], MoveCommand.firePillarXY[1], ScaleCommand.firePillarScale); + } + } + +} diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 4285d16..156a3a9 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -87,6 +87,7 @@ public class DankerGui extends GuiScreen { private GuiButton dungeonScore; private GuiButton hideArmour; private GuiButton autoJoinSkyblock; + private GuiButton firePillar; // Chat Messages private GuiButton sceptreMessages; private GuiButton midasStaffMessages; @@ -179,6 +180,7 @@ public class DankerGui extends GuiScreen { dungeonScore = new FeatureButton("Dungeon Score Display: " + Utils.getColouredBoolean(ToggleCommand.dungeonScore), "Displays an estimated dungeon score with secrets."); hideArmour = new FeatureButton("Hide Player Armour: " + Utils.getColouredBoolean(ToggleCommand.hideArmour), "Makes player armour invisible, showing their skin."); autoJoinSkyblock = new FeatureButton("Automatically Join Skyblock: " + Utils.getColouredBoolean(ToggleCommand.autoJoinSkyblock), "Automatically join Skyblock when you join Hypixel.\nYou have an addiction."); + firePillar = new FeatureButton("Fire Pillar Display: " + Utils.getColouredBoolean(ToggleCommand.firePillar), "Displays blaze fire pillar text on screen"); allButtons.clear(); allButtons.add(changeDisplay); @@ -237,6 +239,7 @@ public class DankerGui extends GuiScreen { allButtons.add(dungeonScore); allButtons.add(hideArmour); allButtons.add(autoJoinSkyblock); + allButtons.add(firePillar); search.setText(initSearchText); search.setVisible(true); @@ -524,6 +527,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.autoJoinSkyblock = !ToggleCommand.autoJoinSkyblock; ConfigHandler.writeBooleanConfig("toggles", "AutoJoinSkyblock", ToggleCommand.autoJoinSkyblock); autoJoinSkyblock.displayString = "Automatically Join Skyblock: " + Utils.getColouredBoolean(ToggleCommand.autoJoinSkyblock); + } else if (button == firePillar) { + ToggleCommand.firePillar = !ToggleCommand.firePillar; + ConfigHandler.writeBooleanConfig("toggles", "FirePillar", ToggleCommand.firePillar); + firePillar.displayString = "Fire Pillar Display: " + Utils.getColouredBoolean(ToggleCommand.firePillar); } } diff --git a/src/main/java/me/Danker/gui/EditLocationsGui.java b/src/main/java/me/Danker/gui/EditLocationsGui.java index b7f4b02..24f0908 100644 --- a/src/main/java/me/Danker/gui/EditLocationsGui.java +++ b/src/main/java/me/Danker/gui/EditLocationsGui.java @@ -33,6 +33,7 @@ public class EditLocationsGui extends GuiScreen { private LocationButton giantHP; private LocationButton abilityCooldown; private LocationButton dungeonScore; + private LocationButton firePillar; @Override public boolean doesGuiPauseGame() { @@ -120,18 +121,19 @@ public class EditLocationsGui extends GuiScreen { display = new LocationButton(MoveCommand.displayXY[0], MoveCommand.displayXY[1], ScaleCommand.displayScale, displayText, displayNums, 110); dungeonTimer = new LocationButton(MoveCommand.dungeonTimerXY[0], MoveCommand.dungeonTimerXY[1], ScaleCommand.dungeonTimerScale, dungeonTimerText, dungeonTimerNums, 80); - coords = new LocationButton(MoveCommand.coordsXY[0], MoveCommand.coordsXY[1], ScaleCommand.coordsScale, NoF3Coords.COORDS_COLOUR + "74 / 14 / -26 (141.1 / 6.7)", null, null); - skill50 = new LocationButton(MoveCommand.skill50XY[0], MoveCommand.skill50XY[1], ScaleCommand.skill50Scale, Skill50Display.SKILL_50_COLOUR + "+3.5 Farming (28,882,117.7/55,172,425) 52.34%", null, null); - lividHP = new LocationButton(MoveCommand.lividHpXY[0], MoveCommand.lividHpXY[1], ScaleCommand.lividHpScale, EnumChatFormatting.WHITE + "﴾ Livid " + EnumChatFormatting.YELLOW + "6.9M" + EnumChatFormatting.RED + "❤ " + EnumChatFormatting.WHITE + "﴿", null, null); - cakeTimer = new LocationButton(MoveCommand.cakeTimerXY[0], MoveCommand.cakeTimerXY[1] + 5, ScaleCommand.cakeTimerScale, CakeTimer.CAKE_COLOUR + " 11h16m", null, null); - skillTracker = new LocationButton(MoveCommand.skillTrackerXY[0], MoveCommand.skillTrackerXY[1], ScaleCommand.skillTrackerScale, skillTrackerText, null, null); - waterAnswer = new LocationButton(MoveCommand.waterAnswerXY[0], MoveCommand.waterAnswerXY[1], ScaleCommand.waterAnswerScale, waterAnswerText, null, null); - bonzoTimer = new LocationButton(MoveCommand.bonzoTimerXY[0], MoveCommand.bonzoTimerXY[1] + 5, ScaleCommand.bonzoTimerScale, BonzoMaskTimer.BONZO_COLOR + " 3m30s", null, null); - golemTimer = new LocationButton(MoveCommand.golemTimerXY[0], MoveCommand.golemTimerXY[1] + 5, ScaleCommand.golemTimerScale, GolemSpawningAlert.GOLEM_COLOUR + " 20s", null, null); - teammatesInRadius = new LocationButton(MoveCommand.teammatesInRadiusXY[0], MoveCommand.teammatesInRadiusXY[1], ScaleCommand.teammatesInRadiusScale, teammatesInRadiusText, null, null); - giantHP = new LocationButton(MoveCommand.giantHPXY[0], MoveCommand.giantHPXY[1], ScaleCommand.giantHPScale, giantHPText, null, null); - abilityCooldown = new LocationButton(MoveCommand.abilityCooldownsXY[0], MoveCommand.abilityCooldownsXY[1], ScaleCommand.abilityCooldownsScale, abilityCooldownText, null, null); + coords = new LocationButton(MoveCommand.coordsXY[0], MoveCommand.coordsXY[1], ScaleCommand.coordsScale, NoF3Coords.COORDS_COLOUR + "74 / 14 / -26 (141.1 / 6.7)"); + skill50 = new LocationButton(MoveCommand.skill50XY[0], MoveCommand.skill50XY[1], ScaleCommand.skill50Scale, Skill50Display.SKILL_50_COLOUR + "+3.5 Farming (28,882,117.7/55,172,425) 52.34%"); + lividHP = new LocationButton(MoveCommand.lividHpXY[0], MoveCommand.lividHpXY[1], ScaleCommand.lividHpScale, EnumChatFormatting.WHITE + "﴾ Livid " + EnumChatFormatting.YELLOW + "6.9M" + EnumChatFormatting.RED + "❤ " + EnumChatFormatting.WHITE + "﴿"); + cakeTimer = new LocationButton(MoveCommand.cakeTimerXY[0], MoveCommand.cakeTimerXY[1] + 5, ScaleCommand.cakeTimerScale, CakeTimer.CAKE_COLOUR + " 11h16m"); + skillTracker = new LocationButton(MoveCommand.skillTrackerXY[0], MoveCommand.skillTrackerXY[1], ScaleCommand.skillTrackerScale, skillTrackerText); + waterAnswer = new LocationButton(MoveCommand.waterAnswerXY[0], MoveCommand.waterAnswerXY[1], ScaleCommand.waterAnswerScale, waterAnswerText); + bonzoTimer = new LocationButton(MoveCommand.bonzoTimerXY[0], MoveCommand.bonzoTimerXY[1] + 5, ScaleCommand.bonzoTimerScale, BonzoMaskTimer.BONZO_COLOR + " 3m30s"); + golemTimer = new LocationButton(MoveCommand.golemTimerXY[0], MoveCommand.golemTimerXY[1] + 5, ScaleCommand.golemTimerScale, GolemSpawningAlert.GOLEM_COLOUR + " 20s"); + teammatesInRadius = new LocationButton(MoveCommand.teammatesInRadiusXY[0], MoveCommand.teammatesInRadiusXY[1], ScaleCommand.teammatesInRadiusScale, teammatesInRadiusText); + giantHP = new LocationButton(MoveCommand.giantHPXY[0], MoveCommand.giantHPXY[1], ScaleCommand.giantHPScale, giantHPText); + abilityCooldown = new LocationButton(MoveCommand.abilityCooldownsXY[0], MoveCommand.abilityCooldownsXY[1], ScaleCommand.abilityCooldownsScale, abilityCooldownText); dungeonScore = new LocationButton(MoveCommand.dungeonScoreXY[0], MoveCommand.dungeonScoreXY[1], ScaleCommand.dungeonScoreScale, dungeonScoreText, dungeonScoreNums, 80); + firePillar = new LocationButton(MoveCommand.firePillarXY[0], MoveCommand.firePillarXY[1], ScaleCommand.firePillarScale, EnumChatFormatting.GOLD + "3s " + EnumChatFormatting.RED + "8 hits"); this.buttonList.add(coords); this.buttonList.add(dungeonTimer); @@ -147,6 +149,7 @@ public class EditLocationsGui extends GuiScreen { this.buttonList.add(giantHP); this.buttonList.add(abilityCooldown); this.buttonList.add(dungeonScore); + this.buttonList.add(firePillar); } @Override @@ -267,6 +270,12 @@ public class EditLocationsGui extends GuiScreen { MoveCommand.dungeonScoreXY[1] += yMoved; dungeonScore.xPosition = MoveCommand.dungeonScoreXY[0]; dungeonScore.yPosition = MoveCommand.dungeonScoreXY[1]; + break; + case "firePillar": + MoveCommand.firePillarXY[0] += xMoved; + MoveCommand.firePillarXY[1] += yMoved; + firePillar.xPosition = MoveCommand.firePillarXY[0]; + firePillar.yPosition = MoveCommand.firePillarXY[1]; } this.buttonList.clear(); initGui(); @@ -307,6 +316,8 @@ public class EditLocationsGui extends GuiScreen { moving = "abilityCooldown"; } else if (button == dungeonScore) { moving = "dungeonScore"; + } else if (button == firePillar) { + moving = "firePillar"; } } } @@ -343,6 +354,8 @@ public class EditLocationsGui extends GuiScreen { ConfigHandler.writeIntConfig("locations", "abilityCooldownsY", MoveCommand.abilityCooldownsXY[1]); ConfigHandler.writeIntConfig("locations", "dungeonScoreX", MoveCommand.dungeonScoreXY[0]); ConfigHandler.writeIntConfig("locations", "dungeonScoreY", MoveCommand.dungeonScoreXY[1]); + ConfigHandler.writeIntConfig("locations", "firePillarX", MoveCommand.firePillarXY[0]); + ConfigHandler.writeIntConfig("locations", "firePillarY", MoveCommand.firePillarXY[1]); } } diff --git a/src/main/java/me/Danker/gui/buttons/LocationButton.java b/src/main/java/me/Danker/gui/buttons/LocationButton.java index 8da1ab9..533bf83 100644 --- a/src/main/java/me/Danker/gui/buttons/LocationButton.java +++ b/src/main/java/me/Danker/gui/buttons/LocationButton.java @@ -44,6 +44,10 @@ public class LocationButton extends GuiButton { this.height = (int) ((splitText.length * 9 + 3) * scale); this.width = (int) ((this.longestText + offset + 3) * scale); } + + public LocationButton(int x, int y, double scale, String text) { + this(x, y, scale, text, null, null); + } @Override public void drawButton(Minecraft mc, int mouseX, int mouseY) { diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 1267b9b..5db8a17 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -244,6 +244,7 @@ public class ConfigHandler { ToggleCommand.dungeonScore = initBoolean("toggles", "DungeonScore", false); ToggleCommand.hideArmour = initBoolean("toggles", "HideArmour", false); ToggleCommand.autoJoinSkyblock = initBoolean("toggles", "AutoJoinSkyblock", false); + ToggleCommand.firePillar = initBoolean("toggles", "FirePillar", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); @@ -629,6 +630,8 @@ public class ConfigHandler { MoveCommand.abilityCooldownsXY[1] = initInt("locations", "abilityCooldownsY", 150); MoveCommand.dungeonScoreXY[0] = initInt("locations", "dungeonScoreX", 150); MoveCommand.dungeonScoreXY[1] = initInt("locations", "dungeonScoreY", 150); + MoveCommand.firePillarXY[0] = initInt("locations", "firePillarX", 200); + MoveCommand.firePillarXY[1] = initInt("locations", "firePillarY", 200); // Scales ScaleCommand.coordsScale = initDouble("scales", "coordsScale", 1); @@ -645,6 +648,7 @@ public class ConfigHandler { ScaleCommand.giantHPScale = initDouble("scales", "giantHPScale", 1); ScaleCommand.abilityCooldownsScale = initDouble("scales", "abilityCooldownsScale", 1); ScaleCommand.dungeonScoreScale = initDouble("scales", "dungeonScoreScale", 1); + ScaleCommand.firePillarScale = initDouble("scales", "firePillarScale", 1); // Skills DankersSkyblockMod.farmingLevel = initInt("skills", "farming", -1); -- cgit From 6281b9fe15b3d807cd2e2fdba2b7649544f17658 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 23 Apr 2022 23:24:13 -0400 Subject: Fix some drops not counting in blaze tracker Also make multidrops work with any amount of digits --- .../java/me/Danker/features/loot/BlazeTracker.java | 42 ++++++++++++---------- .../java/me/Danker/features/loot/LootTracker.java | 11 +++--- 2 files changed, 31 insertions(+), 22 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/loot/BlazeTracker.java b/src/main/java/me/Danker/features/loot/BlazeTracker.java index 896f65f..955f83c 100644 --- a/src/main/java/me/Danker/features/loot/BlazeTracker.java +++ b/src/main/java/me/Danker/features/loot/BlazeTracker.java @@ -89,7 +89,7 @@ public class BlazeTracker { splashPotions++; splashPotionsSession++; ConfigHandler.writeIntConfig("blaze", "splashPotions", splashPotions); - } else if (message.contains("RARE DROP! (Bundle of Magma Arrows)")) { + } else if (message.contains("RARE DROP! (Bundle of Magma Arrows)")) { magmaArrows++; magmaArrowsSession++; ConfigHandler.writeIntConfig("blaze", "magmaArrows", magmaArrows); @@ -105,25 +105,30 @@ public class BlazeTracker { kelvinInverters++; kelvinInvertersSession++; ConfigHandler.writeIntConfig("blaze", "kelvinInverters", kelvinInverters); - } else if (message.contains("VERY RARE DROP! (Blaze Rod Distillate)")) { - blazeRodDistillates++; - blazeRodDistillatesSession++; + } else if (message.contains("VERY RARE DROP! (") && message.contains("Blaze Rod Distillate)")) { + int amount = LootTracker.getAmountfromMessage(message); + blazeRodDistillates += amount; + blazeRodDistillatesSession += amount; ConfigHandler.writeIntConfig("blaze", "blazeRodDistillates", blazeRodDistillates); - } else if (message.contains("VERY RARE DROP! (Glowstone Distillate)")) { - glowstoneDistillates++; - glowstoneDistillatesSession++; + } else if (message.contains("VERY RARE DROP! (") && message.contains("Glowstone Distillate)")) { + int amount = LootTracker.getAmountfromMessage(message); + glowstoneDistillates += amount; + glowstoneDistillatesSession += amount; ConfigHandler.writeIntConfig("blaze", "glowstoneDistillates", glowstoneDistillates); - } else if (message.contains("VERY RARE DROP! (Magma Cream Distillate)")) { - magmaCreamDistillates++; - magmaCreamDistillatesSession++; + } else if (message.contains("VERY RARE DROP! (") && message.contains("Magma Cream Distillate)")) { + int amount = LootTracker.getAmountfromMessage(message); + magmaCreamDistillates += amount; + magmaCreamDistillatesSession += amount; ConfigHandler.writeIntConfig("blaze", "magmaCreamDistillates", magmaCreamDistillates); - } else if (message.contains("VERY RARE DROP! (Nether Wart Distillate)")) { - netherWartDistillates++; - netherWartDistillatesSession++; + } else if (message.contains("VERY RARE DROP! (") && message.contains("Nether Wart Distillate)")) { + int amount = LootTracker.getAmountfromMessage(message); + netherWartDistillates += amount; + netherWartDistillatesSession += amount; ConfigHandler.writeIntConfig("blaze", "netherWartDistillates", netherWartDistillates); - } else if (message.contains("VERY RARE DROP! (Gabagool Distillate)")) { - gabagoolDistillates++; - gabagoolDistillatesSession++; + } else if (message.contains("VERY RARE DROP! (") && message.contains("Gabagool Distillate)")) { + int amount = LootTracker.getAmountfromMessage(message); + gabagoolDistillates += amount; + gabagoolDistillatesSession += amount; ConfigHandler.writeIntConfig("blaze", "gabagoolDistillates", gabagoolDistillates); } else if (message.contains("VERY RARE DROP! (Scorched Power Crystal)")) { scorchedPowerCrystals++; @@ -140,8 +145,9 @@ public class BlazeTracker { ConfigHandler.writeIntConfig("blaze", "fieryBurstRunes", fieryBurstRunes); if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.RED + "FIERY BURST RUNE!", 5); } else if (message.contains("VERY RARE DROP! (") && message.contains(" Flawed Opal Gemstone)")) { - opalGems++; - opalGemsSession++; + int amount = LootTracker.getAmountfromMessage(message); + opalGems += amount; + opalGemsSession += amount; ConfigHandler.writeIntConfig("blaze", "opalGems", opalGems); } else if (message.contains("VERY RARE DROP! (Archfiend Dice)")) { archfiendDice++; diff --git a/src/main/java/me/Danker/features/loot/LootTracker.java b/src/main/java/me/Danker/features/loot/LootTracker.java index 27f0779..d654109 100644 --- a/src/main/java/me/Danker/features/loot/LootTracker.java +++ b/src/main/java/me/Danker/features/loot/LootTracker.java @@ -8,10 +8,13 @@ import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; public class LootTracker { public static long itemsChecked = 0; + static Pattern dropPattern = Pattern.compile(".*? \\((?\\d+)x .*\\).*"); @SubscribeEvent(priority = EventPriority.HIGHEST) public void onSound(PlaySoundEvent event) { @@ -59,11 +62,11 @@ public class LootTracker { } public static int getAmountfromMessage(String message) { - if (message.charAt(message.indexOf("(") + 2) == 'x' || message.charAt(message.indexOf("(") + 3) == 'x') { - return Integer.parseInt(message.substring(message.indexOf("(") + 1, message.indexOf("x"))); - } else { - return 1; + Matcher matcher = dropPattern.matcher(message); + if (matcher.find()) { + return Integer.parseInt(matcher.group("amount")); } + return 1; } } -- cgit From 0f7bb4b43fcbb50a33077e2532a53eaf6300e30d Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 28 Apr 2022 00:08:37 -0400 Subject: Fix importing taurus from API --- src/main/java/me/Danker/commands/ImportFishingCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/ImportFishingCommand.java b/src/main/java/me/Danker/commands/ImportFishingCommand.java index f51e01f..16fecf5 100644 --- a/src/main/java/me/Danker/commands/ImportFishingCommand.java +++ b/src/main/java/me/Danker/commands/ImportFishingCommand.java @@ -118,7 +118,7 @@ public class ImportFishingCommand extends CommandBase { FishingTracker.pyroclasticWorms = getSCFromApi(statsObject, "kills_pyroclastic_worm"); FishingTracker.lavaFlames = getSCFromApi(statsObject, "kills_lava_flame"); FishingTracker.fireEels = getSCFromApi(statsObject, "kills_fire_eel"); - FishingTracker.tauruses = getSCFromApi(statsObject, "kills_taurus"); + FishingTracker.tauruses = getSCFromApi(statsObject, "kills_pig_rider"); FishingTracker.thunders = getSCFromApi(statsObject, "kills_thunder"); FishingTracker.lordJawbuses = getSCFromApi(statsObject, "kills_lord_jawbus"); -- cgit From b3cb573fcfb7afbb0206d29b71432ab68c82a876 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 28 Apr 2022 00:11:03 -0400 Subject: Add alert sound to config Default to random.orb --- src/main/java/me/Danker/handlers/ConfigHandler.java | 2 ++ src/main/java/me/Danker/utils/Utils.java | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 5db8a17..bf20d3c 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -9,6 +9,7 @@ import me.Danker.commands.ToggleCommand; import me.Danker.features.*; import me.Danker.features.loot.*; import me.Danker.features.puzzlesolvers.*; +import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.util.EnumChatFormatting; @@ -598,6 +599,7 @@ public class ConfigHandler { DankersSkyblockMod.firstLaunch = initBoolean("misc", "firstLaunch", true); EndOfFarmAlert.min = initDouble("misc", "farmMin", -78.5); EndOfFarmAlert.max = initDouble("misc", "farmMax", 79.5); + Utils.TITLE_SOUND = initString("misc", "titleSound", "random.orb"); // Locations ScaledResolution scaled = new ScaledResolution(Minecraft.getMinecraft()); diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index c9021f7..2229d65 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -50,6 +50,7 @@ public class Utils { put('D', 500); put('M', 1000); }}; + public static String TITLE_SOUND; public static int getItems(String item) { Minecraft mc = Minecraft.getMinecraft(); @@ -97,7 +98,7 @@ public class Utils { } public static void createTitle(String text, int seconds) { - Minecraft.getMinecraft().thePlayer.playSound("random.orb", 1, (float) 0.5); + Minecraft.getMinecraft().thePlayer.playSound(TITLE_SOUND, 1, (float) 0.5); DankersSkyblockMod.titleTimer = seconds * 20; DankersSkyblockMod.showTitle = true; DankersSkyblockMod.titleText = text; -- cgit From 852777345060b09ab34945cff65a095aa8cb1aa9 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 28 Apr 2022 01:17:00 -0400 Subject: Add Skytils waypoint support --- build.gradle | 2 +- src/main/java/me/Danker/DankersSkyblockMod.java | 2 +- .../commands/CrystalHollowWaypointCommand.java | 39 ++------- .../me/Danker/features/CrystalHollowWaypoints.java | 99 ++++++++++++++++++---- 4 files changed, 91 insertions(+), 51 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/build.gradle b/build.gradle index 3247272..fe6e801 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,7 @@ plugins { id "net.minecraftforge.gradle.forge" version "2.0.2" } */ -version = "1.8.7-beta5" +version = "1.8.7-beta6" group= "me.Danker.DankersSkyblockMod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Danker's Skyblock Mod" diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index cc96448..2139549 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -64,7 +64,7 @@ import java.util.Map; @Mod(modid = DankersSkyblockMod.MODID, version = DankersSkyblockMod.VERSION, clientSideOnly = true) public class DankersSkyblockMod { public static final String MODID = "Danker's Skyblock Mod"; - public static final String VERSION = "1.8.7-beta5"; + public static final String VERSION = "1.8.7-beta6"; public static int titleTimer = -1; public static boolean showTitle = false; public static String titleText = ""; diff --git a/src/main/java/me/Danker/commands/CrystalHollowWaypointCommand.java b/src/main/java/me/Danker/commands/CrystalHollowWaypointCommand.java index f5dea9b..4eaf2d6 100644 --- a/src/main/java/me/Danker/commands/CrystalHollowWaypointCommand.java +++ b/src/main/java/me/Danker/commands/CrystalHollowWaypointCommand.java @@ -1,14 +1,11 @@ package me.Danker.commands; -import me.Danker.DankersSkyblockMod; import me.Danker.features.CrystalHollowWaypoints; -import net.minecraft.client.Minecraft; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; -import net.minecraft.util.ChatComponentText; + +import java.util.Arrays; public class CrystalHollowWaypointCommand extends CommandBase { @@ -30,34 +27,12 @@ public class CrystalHollowWaypointCommand extends CommandBase { @Override public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { if (arg1.length == 0) return; - addWaypoints(String.join(" ", arg1), false); - } - - public static void addWaypoints(String list, boolean auto) { - EntityPlayer player = Minecraft.getMinecraft().thePlayer; - String[] waypoints = list.split("\\\\n"); - - for (String waypoint : waypoints) { - String[] parts = waypoint.split("@-"); - String[] coords = parts[1].split(","); - - String location = parts[0]; - BlockPos pos = new BlockPos(Integer.parseInt(coords[0]), Integer.parseInt(coords[1]), Integer.parseInt(coords[2])); - CrystalHollowWaypoints.Waypoint newWaypoint = new CrystalHollowWaypoints.Waypoint(location, pos); - - if (auto) { - boolean contains = false; - for (CrystalHollowWaypoints.Waypoint existing : CrystalHollowWaypoints.waypoints) { - if (existing.location.equals(location)) { - contains = true; - break; - } - } - if (contains) continue; - } - CrystalHollowWaypoints.waypoints.add(newWaypoint); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Added " + newWaypoint.location + " @ " + newWaypoint.getPos())); + if (arg1.length > 4 && arg1[0].equals("st")) { + String name = String.join(" ", Arrays.copyOfRange(arg1, 4, arg1.length)); + CrystalHollowWaypoints.addWaypoint(name, arg1[1], arg1[2], arg1[3]); + } else { + CrystalHollowWaypoints.addDSMWaypoints(String.join(" ", arg1), false); } } diff --git a/src/main/java/me/Danker/features/CrystalHollowWaypoints.java b/src/main/java/me/Danker/features/CrystalHollowWaypoints.java index f367877..795c49c 100644 --- a/src/main/java/me/Danker/features/CrystalHollowWaypoints.java +++ b/src/main/java/me/Danker/features/CrystalHollowWaypoints.java @@ -1,7 +1,6 @@ package me.Danker.features; import me.Danker.DankersSkyblockMod; -import me.Danker.commands.CrystalHollowWaypointCommand; import me.Danker.commands.ToggleCommand; import me.Danker.handlers.ScoreboardHandler; import me.Danker.utils.RenderUtils; @@ -20,11 +19,14 @@ import net.minecraftforge.fml.common.gameevent.TickEvent; import java.util.ArrayList; import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; public class CrystalHollowWaypoints { public static List waypoints = new ArrayList<>(); - + public static Pattern skytilsPattern = Pattern.compile("(?.*?): (?\\d{1,3}) (?\\d{1,3}) (?\\d{1,3})"); + static boolean khazad = false; static boolean fairy = false; static boolean temple = false; @@ -123,25 +125,54 @@ public class CrystalHollowWaypoints { $SBECHWP:Khazad-dûm@-292,63,281\nFairy Grotto@-216,110,400\njungle temple@-525,110,395\nJungle Temple@-493,101,425\nMines of Divan@-673,117,426 */ if (ToggleCommand.crystalHollowWaypoints && Utils.tabLocation.equals("Crystal Hollows")) { - if (!message.contains(player.getName()) && (message.contains(": $DSMCHWP:") || message.contains(": $SBECHWP:"))) { - String waypoints = message.substring(message.lastIndexOf(":") + 1); + if (!message.contains(player.getName())) { + if (message.contains(": $DSMCHWP:") || message.contains(": $SBECHWP:")) { + String waypoints = message.substring(message.lastIndexOf(":") + 1); - if (ToggleCommand.crystalAutoPlayerWaypoints) { - CrystalHollowWaypointCommand.addWaypoints(waypoints, true); - return; - } + if (ToggleCommand.crystalAutoPlayerWaypoints) { + addDSMWaypoints(waypoints, true); + return; + } + + ChatComponentText add = new ChatComponentText(EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + " [ADD]\n"); + add.setChatStyle(add.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/dsmaddcrystalhollowwaypoints " + waypoints))); + + new Thread(() -> { + try { + Thread.sleep(10); + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + player.addChatMessage(new ChatComponentText("\n" + DankersSkyblockMod.MAIN_COLOUR + "DSM/SBE Crystal Hollows waypoints found. Click to add.\n").appendSibling(add)); + }).start(); + } else { + String text = message.substring(message.indexOf(":") + 2); + Matcher matcher = skytilsPattern.matcher(text); - ChatComponentText add = new ChatComponentText(EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + " [ADD]\n"); - add.setChatStyle(add.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/dsmaddcrystalhollowwaypoints " + waypoints))); + if (matcher.matches()) { + String name = matcher.group("name"); + String x = matcher.group("x"); + String y = matcher.group("y"); + String z = matcher.group("z"); - new Thread(() -> { - try { - Thread.sleep(10); - } catch (InterruptedException ex) { - ex.printStackTrace(); + if (ToggleCommand.crystalAutoPlayerWaypoints) { + addWaypoint(name, x, y, z); + return; + } + + ChatComponentText add = new ChatComponentText(EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + " [ADD]\n"); + add.setChatStyle(add.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/dsmaddcrystalhollowwaypoints st " + x + " " + y + " " + z + " " + name))); + + new Thread(() -> { + try { + Thread.sleep(10); + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + player.addChatMessage(new ChatComponentText("\n" + DankersSkyblockMod.MAIN_COLOUR + "Skytils Crystal Hollows waypoints found. Click to add.\n").appendSibling(add)); + }).start(); } - player.addChatMessage(new ChatComponentText("\n" + DankersSkyblockMod.MAIN_COLOUR + "DSM/SBE Crystal Hollows waypoints found. Click to add.\n").appendSibling(add)); - }).start(); + } } } } @@ -201,4 +232,38 @@ public class CrystalHollowWaypoints { } + public static void addWaypoint(String name, String x, String y, String z) { + BlockPos pos = new BlockPos(Integer.parseInt(x), Integer.parseInt(y), Integer.parseInt(z)); + Waypoint waypoint = new Waypoint(name, pos); + waypoints.add(waypoint); + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Added " + waypoint.location + " @ " + waypoint.getPos())); + } + + public static void addDSMWaypoints(String list, boolean auto) { + String[] waypointsList = list.split("\\\\n"); + + for (String waypoint : waypointsList) { + String[] parts = waypoint.split("@-"); + String[] coords = parts[1].split(","); + + String location = parts[0]; + BlockPos pos = new BlockPos(Integer.parseInt(coords[0]), Integer.parseInt(coords[1]), Integer.parseInt(coords[2])); + Waypoint newWaypoint = new Waypoint(location, pos); + + if (auto) { + boolean contains = false; + for (Waypoint existing : waypoints) { + if (existing.location.equals(location)) { + contains = true; + break; + } + } + if (contains) continue; + } + + waypoints.add(newWaypoint); + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Added " + newWaypoint.location + " @ " + newWaypoint.getPos())); + } + } + } -- cgit From b7a2bc13f61a60c99ce460d08d7c89d06ee72a34 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 28 Apr 2022 02:22:49 -0400 Subject: Add regex for alerts Capture support using $$x$$ where x is a group number Make util function for desktop notifications --- README.md | 14 ++++ src/main/java/me/Danker/features/Alerts.java | 83 +++++++++++++--------- .../me/Danker/features/GpartyNotifications.java | 13 +--- .../java/me/Danker/gui/alerts/AlertActionGui.java | 4 +- .../java/me/Danker/gui/alerts/AlertAddGui.java | 15 ++-- src/main/java/me/Danker/utils/Utils.java | 17 +++++ 6 files changed, 96 insertions(+), 50 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 30fec71..55fb29f 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,20 @@ By adding numbers to the end of the file, you can have multiple music files for - dungeon2.wav - dungeon99.wav +## Alert Regex +To replace alert text with a captured group, add `$$x$$` to the alert text, with `x` being the number of the capture group. `$$0$$` will always be replaced with the entire trigger message. + +For example, with the following alert + +Regex: `From (.*) (.*): (.*)` +Alert Text: `$$2$$ says $$3$$` +Trigger Message: `From [ADMIN] Plancke: Nice autogg` + +the following alert text would appear + +`Plancke says Nice autogg`. + + ### Notes - Slayer tracker for token drops and 20% chance drops uses a 12x12x12 bounding box centered on the player to detect the drops. If you are out of the range of the item drop, it will not count on the tracker. - API commands may take a while depending on your internet connection. The API may also go down. diff --git a/src/main/java/me/Danker/features/Alerts.java b/src/main/java/me/Danker/features/Alerts.java index aab99b3..8f45423 100644 --- a/src/main/java/me/Danker/features/Alerts.java +++ b/src/main/java/me/Danker/features/Alerts.java @@ -1,6 +1,7 @@ package me.Danker.features; import com.google.gson.GsonBuilder; +import javafx.scene.control.Alert; import me.Danker.commands.ToggleCommand; import me.Danker.utils.Utils; import net.minecraft.util.EnumChatFormatting; @@ -12,11 +13,15 @@ import java.awt.*; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; public class Alerts { public static List alerts = new ArrayList<>(); + public static HashMap patterns = new HashMap<>(); public static String configFile; @SubscribeEvent @@ -41,45 +46,59 @@ public class Alerts { } if (!location) continue; - boolean trigger; - switch (alert.mode) { - case "Starts With": - trigger = message.startsWith(alert.message); - break; - case "Contains": - trigger = message.contains(alert.message); - break; - case "Ends With": - trigger = message.endsWith(alert.message); - break; - default: - continue; - } - - if (trigger) { - Utils.createTitle(EnumChatFormatting.RED + alert.alert.replace("&", "§"), 2); - - if (alert.desktop) { - try { - final SystemTray tray = SystemTray.getSystemTray(); - final Image image = Toolkit.getDefaultToolkit().createImage("icon.png"); - final TrayIcon trayIcon = new TrayIcon(image, "Alert"); - trayIcon.setImageAutoSize(true); - trayIcon.setToolTip("Alert"); - tray.add(trayIcon); - trayIcon.displayMessage(StringUtils.stripControlCodes(alert.alert), message, TrayIcon.MessageType.INFO); - tray.remove(trayIcon); - } catch (Exception ex) { - ex.printStackTrace(); + if (alert.mode.equals("Regex")) { + Matcher matcher = patterns.get(alert).matcher(message); + if (matcher.matches()) { + matcher.reset(); + String alertText = alert.alert; + + int i = 0; + while (matcher.find()) { + for (int j = 0; j <= matcher.groupCount(); j++) { + alertText = alertText.replace("$$" + i + "$$", matcher.group(j)); + i++; + } } + + Utils.createTitle(EnumChatFormatting.RED + alertText.replace("&", "§"), 2); + if (alert.desktop) Utils.desktopNotification("Alert", alertText, message, TrayIcon.MessageType.INFO); + + return; } + } else { + boolean trigger; + switch (alert.mode) { + case "Starts With": + trigger = message.startsWith(alert.message); + break; + case "Contains": + trigger = message.contains(alert.message); + break; + case "Ends With": + trigger = message.endsWith(alert.message); + break; + default: + continue; + } + + if (trigger) { + Utils.createTitle(EnumChatFormatting.RED + alert.alert.replace("&", "§"), 2); + if (alert.desktop) Utils.desktopNotification("Alert", alert.alert, message, TrayIcon.MessageType.INFO); - return; + return; + } } } } - public static void saveToFile() { + public static void save() { + for (Alert alert : alerts) { + if (alert.mode.equals("Regex")) { + Pattern pattern = Pattern.compile(alert.message); + patterns.put(alert, pattern); + } + } + try (FileWriter writer = new FileWriter(configFile)) { new GsonBuilder().create().toJson(alerts, writer); writer.flush(); diff --git a/src/main/java/me/Danker/features/GpartyNotifications.java b/src/main/java/me/Danker/features/GpartyNotifications.java index f3aec69..76c0a66 100644 --- a/src/main/java/me/Danker/features/GpartyNotifications.java +++ b/src/main/java/me/Danker/features/GpartyNotifications.java @@ -19,18 +19,7 @@ public class GpartyNotifications { if (ToggleCommand.gpartyToggled) { if (message.contains(" has invited all members of ")) { - try { - final SystemTray tray = SystemTray.getSystemTray(); - final Image image = Toolkit.getDefaultToolkit().createImage("icon.png"); - final TrayIcon trayIcon = new TrayIcon(image, "Guild Party Notifier"); - trayIcon.setImageAutoSize(true); - trayIcon.setToolTip("Guild Party Notifier"); - tray.add(trayIcon); - trayIcon.displayMessage("Guild Party", message, TrayIcon.MessageType.INFO); - tray.remove(trayIcon); - } catch (Exception ex) { - ex.printStackTrace(); - } + Utils.desktopNotification("Guild Party Notifier", "Guild Party", message, TrayIcon.MessageType.INFO); } } } diff --git a/src/main/java/me/Danker/gui/alerts/AlertActionGui.java b/src/main/java/me/Danker/gui/alerts/AlertActionGui.java index 7a73f5a..3d0eb90 100644 --- a/src/main/java/me/Danker/gui/alerts/AlertActionGui.java +++ b/src/main/java/me/Danker/gui/alerts/AlertActionGui.java @@ -80,12 +80,12 @@ public class AlertActionGui extends GuiScreen { mc.displayGuiScreen(new AlertAddGui(alert, id)); } else if (button == delete) { Alerts.alerts.remove(id); - Alerts.saveToFile(); + Alerts.save(); mc.displayGuiScreen(new AlertsGui(1)); return; } Alerts.alerts.set(id, alert); - Alerts.saveToFile(); + Alerts.save(); } } diff --git a/src/main/java/me/Danker/gui/alerts/AlertAddGui.java b/src/main/java/me/Danker/gui/alerts/AlertAddGui.java index 5f01d6d..304c77a 100644 --- a/src/main/java/me/Danker/gui/alerts/AlertAddGui.java +++ b/src/main/java/me/Danker/gui/alerts/AlertAddGui.java @@ -25,6 +25,7 @@ public class AlertAddGui extends GuiScreen { private GuiButton startsWith; private GuiButton contains; private GuiButton endsWith; + private GuiButton regex; private GuiButton everywhere; private GuiButton skyblock; private GuiButton dungeons; @@ -57,9 +58,10 @@ public class AlertAddGui extends GuiScreen { cancel = new GuiButton(0, 2, height - 30, 100, 20, "Cancel"); - startsWith = new GuiButton(0, width / 2 - 200, (int) (height * 0.2), 120, 20, "Starts With"); - contains = new GuiButton(0, width / 2 - 60, (int) (height * 0.2), 120, 20, "Contains"); - endsWith = new GuiButton(0, width / 2 + 80, (int) (height * 0.2), 120, 20, "Ends With"); + startsWith = new GuiButton(0, width / 2 - 260, (int) (height * 0.2), 120, 20, "Starts With"); + contains = new GuiButton(0, width / 2 - 130, (int) (height * 0.2), 120, 20, "Contains"); + endsWith = new GuiButton(0, width / 2 + 10, (int) (height * 0.2), 120, 20, "Ends With"); + regex = new GuiButton(0, width / 2 + 140, (int) (height * 0.2), 120, 20, "Regex"); everywhere = new GuiButton(0, width / 2 - 200, (int) (height * 0.3), 120, 20, "Everywhere"); skyblock = new GuiButton(0, width / 2 - 60, (int) (height * 0.3), 120, 20, "Skyblock"); dungeons = new GuiButton(0, width / 2 + 80, (int) (height * 0.3), 120, 20, "Dungeons"); @@ -80,13 +82,16 @@ public class AlertAddGui extends GuiScreen { message.setVisible(true); message.setEnabled(true); + message.setMaxStringLength(100); alert.setVisible(true); alert.setEnabled(true); + alert.setMaxStringLength(100); this.buttonList.add(cancel); this.buttonList.add(startsWith); this.buttonList.add(contains); this.buttonList.add(endsWith); + this.buttonList.add(regex); this.buttonList.add(everywhere); this.buttonList.add(skyblock); this.buttonList.add(dungeons); @@ -119,6 +124,8 @@ public class AlertAddGui extends GuiScreen { mode = "Contains"; } else if (button == endsWith) { mode = "Ends With"; + } else if (button == regex) { + mode = "Regex"; } else if (button == everywhere) { location = "Everywhere"; } else if (button == skyblock) { @@ -132,7 +139,7 @@ public class AlertAddGui extends GuiScreen { } else { Alerts.alerts.add(newAlert); } - Alerts.saveToFile(); + Alerts.save(); mc.displayGuiScreen(new AlertsGui(1)); } } diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 2229d65..3cef436 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -19,7 +19,9 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.scoreboard.ScoreObjective; import net.minecraft.util.*; +import java.awt.*; import java.util.*; +import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -492,6 +494,21 @@ public class Utils { return (Math.floor(level / 2D) + 25) / 100D; } + public static void desktopNotification(String name, String title, String text, TrayIcon.MessageType messageType) { + try { + final SystemTray tray = SystemTray.getSystemTray(); + final Image image = Toolkit.getDefaultToolkit().createImage("icon.png"); + final TrayIcon trayIcon = new TrayIcon(image, name); + trayIcon.setImageAutoSize(true); + trayIcon.setToolTip(name); + tray.add(trayIcon); + trayIcon.displayMessage(title, text, messageType); + tray.remove(trayIcon); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + public enum DungeonFloor { NONE, E0, -- cgit From d35e43b33b98796acc7b8dc76bc06848d0ee3129 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 28 Apr 2022 02:26:15 -0400 Subject: Fix custom colour replacing with colour codes User 6940 makes 940k auctions become white --- src/main/java/me/Danker/features/ColouredNames.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/ColouredNames.java b/src/main/java/me/Danker/features/ColouredNames.java index aad1ab1..90d722e 100644 --- a/src/main/java/me/Danker/features/ColouredNames.java +++ b/src/main/java/me/Danker/features/ColouredNames.java @@ -11,6 +11,7 @@ import net.minecraft.network.play.server.S45PacketTitle; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +import net.minecraft.util.StringUtils; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.RenderLivingEvent; import net.minecraftforge.event.entity.player.ItemTooltipEvent; @@ -53,7 +54,7 @@ public class ColouredNames { for (String user : users) { for (int i = 0; i < event.toolTip.size(); i++) { - if (event.toolTip.get(i).contains(user)) { + if (StringUtils.stripControlCodes(event.toolTip.get(i)).contains(user)) { event.toolTip.set(i, replaceName(event.toolTip.get(i), user, getColourFromName(user))); } } -- cgit From 827fb6fc502e1e7159d15c1decfa35968668bb6f Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 28 Apr 2022 02:37:21 -0400 Subject: Add keybind for adding waypoint --- src/main/java/me/Danker/DankersSkyblockMod.java | 13 ++++--------- .../java/me/Danker/features/CrystalHollowWaypoints.java | 15 +++++++++++++++ .../CrystalHollowAddWaypointGui.java | 15 +++++++++++++++ 3 files changed, 34 insertions(+), 9 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 2139549..1816a3c 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -70,7 +70,7 @@ public class DankersSkyblockMod { public static String titleText = ""; public static int tickAmount = 1; public static int repoTickAmount = 1; - public static KeyBinding[] keyBindings = new KeyBinding[3]; + public static KeyBinding[] keyBindings = new KeyBinding[4]; public static boolean usingLabymod = false; public static boolean usingOAM = false; static boolean OAMWarning = false; @@ -188,6 +188,7 @@ public class DankersSkyblockMod { keyBindings[0] = new KeyBinding("Open Maddox Menu", Keyboard.KEY_M, "Danker's Skyblock Mod"); keyBindings[1] = new KeyBinding("Regular Ability", Keyboard.KEY_NUMPAD4, "Danker's Skyblock Mod"); keyBindings[2] = new KeyBinding("Start/Stop Skill Tracker", Keyboard.KEY_NUMPAD5, "Danker's Skyblock Mod"); + keyBindings[3] = new KeyBinding("Create Waypoint", Keyboard.KEY_NUMPAD6, "Danker's Skyblock Mod"); for (KeyBinding keyBinding : keyBindings) { ClientRegistry.registerKeyBinding(keyBinding); @@ -457,14 +458,8 @@ public class DankersSkyblockMod { @SubscribeEvent public void onKey(KeyInputEvent event) { - if (!Utils.inSkyblock) return; - - EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; - if (keyBindings[1].isPressed()) { - if (Utils.inDungeons) { - player.dropOneItem(true); - } - } + if (!Utils.inDungeons) return; + if (keyBindings[1].isPressed()) Minecraft.getMinecraft().thePlayer.dropOneItem(true); } @SubscribeEvent diff --git a/src/main/java/me/Danker/features/CrystalHollowWaypoints.java b/src/main/java/me/Danker/features/CrystalHollowWaypoints.java index 795c49c..a8ee0f9 100644 --- a/src/main/java/me/Danker/features/CrystalHollowWaypoints.java +++ b/src/main/java/me/Danker/features/CrystalHollowWaypoints.java @@ -2,10 +2,12 @@ package me.Danker.features; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; +import me.Danker.gui.crystalhollowwaypoints.CrystalHollowAddWaypointGui; import me.Danker.handlers.ScoreboardHandler; import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.KeyBinding; import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.event.ClickEvent; @@ -15,6 +17,7 @@ import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.InputEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import java.util.ArrayList; @@ -177,6 +180,18 @@ public class CrystalHollowWaypoints { } } + @SubscribeEvent + public void onKey(InputEvent.KeyInputEvent event) { + if (!Utils.tabLocation.equals("Crystal Hollows")) return; + + if (DankersSkyblockMod.keyBindings[3].isPressed()) { + Minecraft mc = Minecraft.getMinecraft(); + EntityPlayer player = mc.thePlayer; + + mc.displayGuiScreen(new CrystalHollowAddWaypointGui((int) player.posX, (int) player.posY, (int) player.posZ)); + } + } + @SubscribeEvent public void onWorldRender(RenderWorldLastEvent event) { if (ToggleCommand.crystalHollowWaypoints && Utils.tabLocation.equals("Crystal Hollows")) { diff --git a/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowAddWaypointGui.java b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowAddWaypointGui.java index df91f04..52c0fba 100644 --- a/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowAddWaypointGui.java +++ b/src/main/java/me/Danker/gui/crystalhollowwaypoints/CrystalHollowAddWaypointGui.java @@ -23,6 +23,18 @@ public class CrystalHollowAddWaypointGui extends GuiScreen { private GuiTextField z; private GuiButton add; + private int xPos = -1; + private int yPos = -1; + private int zPos = -1; + + public CrystalHollowAddWaypointGui() {} + + public CrystalHollowAddWaypointGui(int x, int y, int z) { + xPos = x; + yPos = y; + zPos = z; + } + @Override public boolean doesGuiPauseGame() { return false; @@ -49,10 +61,13 @@ public class CrystalHollowAddWaypointGui extends GuiScreen { name.setEnabled(true); x.setVisible(true); x.setEnabled(true); + if (xPos != -1) x.setText(xPos + ""); y.setVisible(true); y.setEnabled(true); + if (yPos != -1) y.setText(yPos + ""); z.setVisible(true); z.setEnabled(true); + if (zPos != -1) z.setText(zPos + ""); this.buttonList.add(cancel); this.buttonList.add(curPos); -- cgit From e20025121af75e505aa154f304339fab7beddf6e Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 28 Apr 2022 03:22:39 -0400 Subject: Add new slayer drops Add furball to wolf tracker and hazmat enderman to enderman tracket Also make variable names less redudant --- src/main/java/me/Danker/commands/LootCommand.java | 288 ++++++++++---------- .../java/me/Danker/commands/ResetLootCommand.java | 124 ++++----- .../me/Danker/features/loot/EndermanTracker.java | 228 ++++++++-------- .../java/me/Danker/features/loot/LootDisplay.java | 292 +++++++++++---------- .../java/me/Danker/features/loot/LootTracker.java | 24 +- .../me/Danker/features/loot/SpiderTracker.java | 122 ++++----- .../java/me/Danker/features/loot/WolfTracker.java | 128 ++++----- .../me/Danker/features/loot/ZombieTracker.java | 172 ++++++------ .../java/me/Danker/handlers/ConfigHandler.java | 126 ++++----- 9 files changed, 766 insertions(+), 738 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/LootCommand.java b/src/main/java/me/Danker/commands/LootCommand.java index 3be46a4..0d86668 100644 --- a/src/main/java/me/Danker/commands/LootCommand.java +++ b/src/main/java/me/Danker/commands/LootCommand.java @@ -70,294 +70,298 @@ public class LootCommand extends CommandBase { switch (arg1[0].toLowerCase()) { case "wolf": if (showSession) { - if (WolfTracker.wolfTimeSession == -1) { + if (WolfTracker.timeSession == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(WolfTracker.wolfTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(WolfTracker.timeSession, timeNow); } - if (WolfTracker.wolfBossesSession == -1) { + if (WolfTracker.bossesSession == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(WolfTracker.wolfBossesSession); + bossesBetween = nf.format(WolfTracker.bossesSession); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(WolfTracker.wolfWheelsSession); + drop20 = nf.format(WolfTracker.wheelsSession); } else { - drop20 = nf.format(WolfTracker.wolfWheelsDropsSession) + " times"; + drop20 = nf.format(WolfTracker.wheelsDropsSession) + " times"; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.DARK_AQUA + EnumChatFormatting.BOLD + " Sven Loot Summary (Current Session):\n" + - EnumChatFormatting.GOLD + " Svens Killed: " + nf.format(WolfTracker.wolfSvensSession) + "\n" + - EnumChatFormatting.GREEN + " Wolf Teeth: " + nf.format(WolfTracker.wolfTeethSession) + "\n" + + EnumChatFormatting.GOLD + " Svens Killed: " + nf.format(WolfTracker.svensSession) + "\n" + + EnumChatFormatting.GREEN + " Wolf Teeth: " + nf.format(WolfTracker.teethSession) + "\n" + EnumChatFormatting.BLUE + " Hamster Wheels: " + drop20 + "\n" + - EnumChatFormatting.AQUA + " Spirit Runes: " + WolfTracker.wolfSpiritsSession + "\n" + - EnumChatFormatting.WHITE + " Critical VI Books: " + WolfTracker.wolfBooksSession + "\n" + - EnumChatFormatting.DARK_RED + " Red Claw Eggs: " + WolfTracker.wolfEggsSession + "\n" + - EnumChatFormatting.GOLD + " Couture Runes: " + WolfTracker.wolfCouturesSession + "\n" + - EnumChatFormatting.AQUA + " Grizzly Baits: " + WolfTracker.wolfBaitsSession + "\n" + - EnumChatFormatting.DARK_PURPLE + " Overfluxes: " + WolfTracker.wolfFluxesSession + "\n" + + EnumChatFormatting.AQUA + " Spirit Runes: " + WolfTracker.spiritsSession + "\n" + + EnumChatFormatting.WHITE + " Critical VI Books: " + WolfTracker.booksSession + "\n" + + EnumChatFormatting.DARK_AQUA + " Furballs: " + WolfTracker.furballsSession + "\n" + + EnumChatFormatting.DARK_RED + " Red Claw Eggs: " + WolfTracker.eggsSession + "\n" + + EnumChatFormatting.GOLD + " Couture Runes: " + WolfTracker.couturesSession + "\n" + + EnumChatFormatting.AQUA + " Grizzly Baits: " + WolfTracker.baitsSession + "\n" + + EnumChatFormatting.DARK_PURPLE + " Overfluxes: " + WolfTracker.fluxesSession + "\n" + EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " -------------------")); return; } - if (WolfTracker.wolfTime == -1) { + if (WolfTracker.time == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(WolfTracker.wolfTime, timeNow); + timeBetween = Utils.getTimeBetween(WolfTracker.time, timeNow); } - if (WolfTracker.wolfBosses == -1) { + if (WolfTracker.bosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(WolfTracker.wolfBosses); + bossesBetween = nf.format(WolfTracker.bosses); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(WolfTracker.wolfWheels); + drop20 = nf.format(WolfTracker.wheels); } else { - drop20 = nf.format(WolfTracker.wolfWheelsDrops) + " times"; + drop20 = nf.format(WolfTracker.wheelsDrops) + " times"; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.DARK_AQUA + EnumChatFormatting.BOLD + " Sven Loot Summary:\n" + - EnumChatFormatting.GOLD + " Svens Killed: " + nf.format(WolfTracker.wolfSvens) + "\n" + - EnumChatFormatting.GREEN + " Wolf Teeth: " + nf.format(WolfTracker.wolfTeeth) + "\n" + + EnumChatFormatting.GOLD + " Svens Killed: " + nf.format(WolfTracker.svens) + "\n" + + EnumChatFormatting.GREEN + " Wolf Teeth: " + nf.format(WolfTracker.teeth) + "\n" + EnumChatFormatting.BLUE + " Hamster Wheels: " + drop20 + "\n" + - EnumChatFormatting.AQUA + " Spirit Runes: " + WolfTracker.wolfSpirits + "\n" + - EnumChatFormatting.WHITE + " Critical VI Books: " + WolfTracker.wolfBooks + "\n" + - EnumChatFormatting.DARK_RED + " Red Claw Eggs: " + WolfTracker.wolfEggs + "\n" + - EnumChatFormatting.GOLD + " Couture Runes: " + WolfTracker.wolfCoutures + "\n" + - EnumChatFormatting.AQUA + " Grizzly Baits: " + WolfTracker.wolfBaits + "\n" + - EnumChatFormatting.DARK_PURPLE + " Overfluxes: " + WolfTracker.wolfFluxes + "\n" + + EnumChatFormatting.AQUA + " Spirit Runes: " + WolfTracker.spirits + "\n" + + EnumChatFormatting.WHITE + " Critical VI Books: " + WolfTracker.books + "\n" + + EnumChatFormatting.DARK_AQUA + " Furballs: " + WolfTracker.furballs + "\n" + + EnumChatFormatting.DARK_RED + " Red Claw Eggs: " + WolfTracker.eggs + "\n" + + EnumChatFormatting.GOLD + " Couture Runes: " + WolfTracker.coutures + "\n" + + EnumChatFormatting.AQUA + " Grizzly Baits: " + WolfTracker.baits + "\n" + + EnumChatFormatting.DARK_PURPLE + " Overfluxes: " + WolfTracker.fluxes + "\n" + EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " -------------------")); break; case "spider": if (showSession) { - if (SpiderTracker.spiderTimeSession == -1) { + if (SpiderTracker.timeSession == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(SpiderTracker.spiderTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(SpiderTracker.timeSession, timeNow); } - if (SpiderTracker.spiderBossesSession == -1) { + if (SpiderTracker.bossesSession == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(SpiderTracker.spiderBossesSession); + bossesBetween = nf.format(SpiderTracker.bossesSession); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(SpiderTracker.spiderTAPSession); + drop20 = nf.format(SpiderTracker.TAPSession); } else { - drop20 = nf.format(SpiderTracker.spiderTAPDropsSession) + " times"; + drop20 = nf.format(SpiderTracker.TAPDropsSession) + " times"; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " Spider Loot Summary (Current Session):\n" + - EnumChatFormatting.GOLD + " Tarantulas Killed: " + nf.format(SpiderTracker.spiderTarantulasSession) + "\n" + - EnumChatFormatting.GREEN + " Tarantula Webs: " + nf.format(SpiderTracker.spiderWebsSession) + "\n" + + EnumChatFormatting.GOLD + " Tarantulas Killed: " + nf.format(SpiderTracker.tarantulasSession) + "\n" + + EnumChatFormatting.GREEN + " Tarantula Webs: " + nf.format(SpiderTracker.websSession) + "\n" + EnumChatFormatting.DARK_GREEN + " Arrow Poison: " + drop20 + "\n" + - EnumChatFormatting.DARK_GRAY + " Bite Runes: " + SpiderTracker.spiderBitesSession + "\n" + - EnumChatFormatting.WHITE + " Bane VI Books: " + SpiderTracker.spiderBooksSession + "\n" + - EnumChatFormatting.AQUA + " Spider Catalysts: " + SpiderTracker.spiderCatalystsSession + "\n" + - EnumChatFormatting.DARK_PURPLE + " Tarantula Talismans: " + SpiderTracker.spiderTalismansSession + "\n" + - EnumChatFormatting.LIGHT_PURPLE + " Fly Swatters: " + SpiderTracker.spiderSwattersSession + "\n" + - EnumChatFormatting.GOLD + " Digested Mosquitos: " + SpiderTracker.spiderMosquitosSession + "\n" + + EnumChatFormatting.DARK_GRAY + " Bite Runes: " + SpiderTracker.bitesSession + "\n" + + EnumChatFormatting.WHITE + " Bane VI Books: " + SpiderTracker.booksSession + "\n" + + EnumChatFormatting.AQUA + " Spider Catalysts: " + SpiderTracker.catalystsSession + "\n" + + EnumChatFormatting.DARK_PURPLE + " Tarantula Talismans: " + SpiderTracker.talismansSession + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Fly Swatters: " + SpiderTracker.swattersSession + "\n" + + EnumChatFormatting.GOLD + " Digested Mosquitos: " + SpiderTracker.mosquitosSession + "\n" + EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " -------------------")); return; } - if (SpiderTracker.spiderTime == -1) { + if (SpiderTracker.time == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(SpiderTracker.spiderTime, timeNow); + timeBetween = Utils.getTimeBetween(SpiderTracker.time, timeNow); } - if (SpiderTracker.spiderBosses == -1) { + if (SpiderTracker.bosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(SpiderTracker.spiderBosses); + bossesBetween = nf.format(SpiderTracker.bosses); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(SpiderTracker.spiderTAP); + drop20 = nf.format(SpiderTracker.TAP); } else { - drop20 = nf.format(SpiderTracker.spiderTAPDrops) + " times"; + drop20 = nf.format(SpiderTracker.TAPDrops) + " times"; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + " Spider Loot Summary:\n" + - EnumChatFormatting.GOLD + " Tarantulas Killed: " + nf.format(SpiderTracker.spiderTarantulas) + "\n" + - EnumChatFormatting.GREEN + " Tarantula Webs: " + nf.format(SpiderTracker.spiderWebs) + "\n" + + EnumChatFormatting.GOLD + " Tarantulas Killed: " + nf.format(SpiderTracker.tarantulas) + "\n" + + EnumChatFormatting.GREEN + " Tarantula Webs: " + nf.format(SpiderTracker.webs) + "\n" + EnumChatFormatting.DARK_GREEN + " Arrow Poison: " + drop20 + "\n" + - EnumChatFormatting.DARK_GRAY + " Bite Runes: " + SpiderTracker.spiderBites + "\n" + - EnumChatFormatting.WHITE + " Bane VI Books: " + SpiderTracker.spiderBooks + "\n" + - EnumChatFormatting.AQUA + " Spider Catalysts: " + SpiderTracker.spiderCatalysts + "\n" + - EnumChatFormatting.DARK_PURPLE + " Tarantula Talismans: " + SpiderTracker.spiderTalismans + "\n" + - EnumChatFormatting.LIGHT_PURPLE + " Fly Swatters: " + SpiderTracker.spiderSwatters + "\n" + - EnumChatFormatting.GOLD + " Digested Mosquitos: " + SpiderTracker.spiderMosquitos + "\n" + + EnumChatFormatting.DARK_GRAY + " Bite Runes: " + SpiderTracker.bites + "\n" + + EnumChatFormatting.WHITE + " Bane VI Books: " + SpiderTracker.books + "\n" + + EnumChatFormatting.AQUA + " Spider Catalysts: " + SpiderTracker.catalysts + "\n" + + EnumChatFormatting.DARK_PURPLE + " Tarantula Talismans: " + SpiderTracker.talismans + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Fly Swatters: " + SpiderTracker.swatters + "\n" + + EnumChatFormatting.GOLD + " Digested Mosquitos: " + SpiderTracker.mosquitos + "\n" + EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " -------------------")); break; case "zombie": if (showSession) { - if (ZombieTracker.zombieTimeSession == -1) { + if (ZombieTracker.timeSession == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(ZombieTracker.zombieTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(ZombieTracker.timeSession, timeNow); } - if (ZombieTracker.zombieBossesSession == -1) { + if (ZombieTracker.bossesSession == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(ZombieTracker.zombieBossesSession); + bossesBetween = nf.format(ZombieTracker.bossesSession); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(ZombieTracker.zombieFoulFleshSession); + drop20 = nf.format(ZombieTracker.foulFleshSession); } else { - drop20 = nf.format(ZombieTracker.zombieFoulFleshDropsSession) + " times"; + drop20 = nf.format(ZombieTracker.foulFleshDropsSession) + " times"; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD + " Zombie Loot Summary (Current Session):\n" + - EnumChatFormatting.GOLD + " Revs Killed: " + nf.format(ZombieTracker.zombieRevsSession) + "\n" + - EnumChatFormatting.GREEN + " Revenant Flesh: " + nf.format(ZombieTracker.zombieRevFleshSession) + "\n" + - EnumChatFormatting.GREEN + " Revenant Viscera: " + nf.format(ZombieTracker.zombieRevVisceraSession) + "\n" + + EnumChatFormatting.GOLD + " Revs Killed: " + nf.format(ZombieTracker.revsSession) + "\n" + + EnumChatFormatting.GREEN + " Revenant Flesh: " + nf.format(ZombieTracker.revFleshSession) + "\n" + + EnumChatFormatting.GREEN + " Revenant Viscera: " + nf.format(ZombieTracker.revVisceraSession) + "\n" + EnumChatFormatting.BLUE + " Foul Flesh: " + drop20 + "\n" + - EnumChatFormatting.DARK_GREEN + " Pestilence Runes: " +ZombieTracker.zombiePestilencesSession + "\n" + - EnumChatFormatting.WHITE + " Smite VI Books: " + ZombieTracker.zombieBooksSession + "\n" + - EnumChatFormatting.WHITE + " Smite VII Books: " + ZombieTracker.zombieBooksT7Session + "\n" + - EnumChatFormatting.AQUA + " Undead Catalysts: " + ZombieTracker.zombieUndeadCatasSession + "\n" + - EnumChatFormatting.DARK_PURPLE + " Beheaded Horrors: " + ZombieTracker.zombieBeheadedsSession + "\n" + - EnumChatFormatting.RED + " Revenant Catalysts: " + ZombieTracker.zombieRevCatasSession + "\n" + - EnumChatFormatting.DARK_GREEN + " Snake Runes: " + ZombieTracker.zombieSnakesSession + "\n" + - EnumChatFormatting.GOLD + " Scythe Blades: " + ZombieTracker.zombieScythesSession + "\n" + - EnumChatFormatting.RED + " Shard of the Shreddeds: " + ZombieTracker.zombieShardsSession + "\n" + - EnumChatFormatting.RED + " Warden Hearts: " + ZombieTracker.zombieWardenHeartsSession + "\n" + + EnumChatFormatting.DARK_GREEN + " Pestilence Runes: " +ZombieTracker.pestilencesSession + "\n" + + EnumChatFormatting.WHITE + " Smite VI Books: " + ZombieTracker.booksSession + "\n" + + EnumChatFormatting.WHITE + " Smite VII Books: " + ZombieTracker.booksT7Session + "\n" + + EnumChatFormatting.AQUA + " Undead Catalysts: " + ZombieTracker.undeadCatasSession + "\n" + + EnumChatFormatting.DARK_PURPLE + " Beheaded Horrors: " + ZombieTracker.beheadedsSession + "\n" + + EnumChatFormatting.RED + " Revenant Catalysts: " + ZombieTracker.revCatasSession + "\n" + + EnumChatFormatting.DARK_GREEN + " Snake Runes: " + ZombieTracker.snakesSession + "\n" + + EnumChatFormatting.GOLD + " Scythe Blades: " + ZombieTracker.scythesSession + "\n" + + EnumChatFormatting.RED + " Shard of the Shreddeds: " + ZombieTracker.shardsSession + "\n" + + EnumChatFormatting.RED + " Warden Hearts: " + ZombieTracker.wardenHeartsSession + "\n" + EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + EnumChatFormatting.GREEN + EnumChatFormatting.BOLD + " -------------------")); return; } - if (ZombieTracker.zombieTime == -1) { + if (ZombieTracker.time == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(ZombieTracker.zombieTime, timeNow); + timeBetween = Utils.getTimeBetween(ZombieTracker.time, timeNow); } - if (ZombieTracker.zombieBosses == -1) { + if (ZombieTracker.bosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(ZombieTracker.zombieBosses); + bossesBetween = nf.format(ZombieTracker.bosses); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(ZombieTracker.zombieFoulFlesh); + drop20 = nf.format(ZombieTracker.foulFlesh); } else { - drop20 = nf.format(ZombieTracker.zombieFoulFleshDrops) + " times"; + drop20 = nf.format(ZombieTracker.foulFleshDrops) + " times"; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD + " Zombie Loot Summary:\n" + - EnumChatFormatting.GOLD + " Revs Killed: " + nf.format(ZombieTracker.zombieRevs) + "\n" + - EnumChatFormatting.GREEN + " Revenant Flesh: " + nf.format(ZombieTracker.zombieRevFlesh) + "\n" + - EnumChatFormatting.GREEN + " Revenant Viscera: " + nf.format(ZombieTracker.zombieRevViscera) + "\n" + + EnumChatFormatting.GOLD + " Revs Killed: " + nf.format(ZombieTracker.revs) + "\n" + + EnumChatFormatting.GREEN + " Revenant Flesh: " + nf.format(ZombieTracker.revFlesh) + "\n" + + EnumChatFormatting.GREEN + " Revenant Viscera: " + nf.format(ZombieTracker.revViscera) + "\n" + EnumChatFormatting.BLUE + " Foul Flesh: " + drop20 + "\n" + - EnumChatFormatting.DARK_GREEN + " Pestilence Runes: " + ZombieTracker.zombiePestilences + "\n" + - EnumChatFormatting.WHITE + " Smite VI Books: " + ZombieTracker.zombieBooks + "\n" + - EnumChatFormatting.WHITE + " Smite VII Books: " + ZombieTracker.zombieBooksT7 + "\n" + - EnumChatFormatting.AQUA + " Undead Catalysts: " + ZombieTracker.zombieUndeadCatas + "\n" + - EnumChatFormatting.DARK_PURPLE + " Beheaded Horrors: " + ZombieTracker.zombieBeheadeds + "\n" + - EnumChatFormatting.RED + " Revenant Catalysts: " + ZombieTracker.zombieRevCatas + "\n" + - EnumChatFormatting.DARK_GREEN + " Snake Runes: " + ZombieTracker.zombieSnakes + "\n" + - EnumChatFormatting.GOLD + " Scythe Blades: " + ZombieTracker.zombieScythes + "\n" + - EnumChatFormatting.RED + " Shard of the Shreddeds: " + ZombieTracker.zombieShards + "\n" + - EnumChatFormatting.RED + " Warden Hearts: " + ZombieTracker.zombieWardenHearts + "\n" + + EnumChatFormatting.DARK_GREEN + " Pestilence Runes: " + ZombieTracker.pestilences + "\n" + + EnumChatFormatting.WHITE + " Smite VI Books: " + ZombieTracker.books + "\n" + + EnumChatFormatting.WHITE + " Smite VII Books: " + ZombieTracker.booksT7 + "\n" + + EnumChatFormatting.AQUA + " Undead Catalysts: " + ZombieTracker.undeadCatas + "\n" + + EnumChatFormatting.DARK_PURPLE + " Beheaded Horrors: " + ZombieTracker.beheadeds + "\n" + + EnumChatFormatting.RED + " Revenant Catalysts: " + ZombieTracker.revCatas + "\n" + + EnumChatFormatting.DARK_GREEN + " Snake Runes: " + ZombieTracker.snakes + "\n" + + EnumChatFormatting.GOLD + " Scythe Blades: " + ZombieTracker.scythes + "\n" + + EnumChatFormatting.RED + " Shard of the Shreddeds: " + ZombieTracker.shards + "\n" + + EnumChatFormatting.RED + " Warden Hearts: " + ZombieTracker.wardenHearts + "\n" + EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + EnumChatFormatting.GREEN + EnumChatFormatting.BOLD + " -------------------")); break; case "enderman": if (showSession) { - if (EndermanTracker.endermanTimeSession == -1) { + if (EndermanTracker.timeSession == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(EndermanTracker.endermanTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(EndermanTracker.timeSession, timeNow); } - if (EndermanTracker.endermanBossesSession == -1) { + if (EndermanTracker.bossesSession == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(EndermanTracker.endermanBossesSession); + bossesBetween = nf.format(EndermanTracker.bossesSession); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(EndermanTracker.endermanTAPSession); + drop20 = nf.format(EndermanTracker.TAPSession); } else { - drop20 = nf.format(EndermanTracker.endermanTAPDropsSession) + " times"; + drop20 = nf.format(EndermanTracker.TAPDropsSession) + " times"; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD + " Enderman Loot Summary (Current Session):\n" + - EnumChatFormatting.GOLD + " Voidglooms Killed: " + nf.format(EndermanTracker.endermanVoidgloomsSession) + "\n" + - EnumChatFormatting.DARK_GRAY + " Null Spheres: " + nf.format(EndermanTracker.endermanNullSpheresSession) + "\n" + + EnumChatFormatting.GOLD + " Voidglooms Killed: " + nf.format(EndermanTracker.voidgloomsSession) + "\n" + + EnumChatFormatting.DARK_GRAY + " Null Spheres: " + nf.format(EndermanTracker.nullSpheresSession) + "\n" + EnumChatFormatting.DARK_PURPLE + " Arrow Poison: " + drop20 + "\n" + - EnumChatFormatting.LIGHT_PURPLE + " Endersnake Runes: " + EndermanTracker.endermanEndersnakesSession + "\n" + - EnumChatFormatting.DARK_GREEN + " Summoning Eyes: " + EndermanTracker.endermanSummoningEyesSession + "\n" + - EnumChatFormatting.AQUA + " Mana Steal Books: " + EndermanTracker.endermanManaBooksSession + "\n" + - EnumChatFormatting.BLUE + " Transmission Tuners: " + EndermanTracker.endermanTunersSession + "\n" + - EnumChatFormatting.YELLOW + " Null Atoms: " + EndermanTracker.endermanAtomsSession + "\n" + - EnumChatFormatting.AQUA + " Espresso Machines: " + EndermanTracker.endermanEspressoMachinesSession + "\n" + - EnumChatFormatting.WHITE + " Smarty Pants Books: " + EndermanTracker.endermanSmartyBooksSession + "\n" + - EnumChatFormatting.LIGHT_PURPLE + " End Runes: " + EndermanTracker.endermanEndRunesSession + "\n" + - EnumChatFormatting.RED + " Blood Chalices: " + EndermanTracker.endermanChalicesSession + "\n" + - EnumChatFormatting.RED + " Sinful Dice: " + EndermanTracker.endermanDiceSession + "\n" + - EnumChatFormatting.DARK_PURPLE + " Artifact Upgrader: " + EndermanTracker.endermanArtifactsSession + "\n" + - EnumChatFormatting.DARK_PURPLE + " Enderman Skins: " + EndermanTracker.endermanSkinsSession + "\n" + - EnumChatFormatting.GRAY + " Enchant Runes: " + EndermanTracker.endermanEnchantRunesSession + "\n" + - EnumChatFormatting.GOLD + " Etherwarp Mergers: " + EndermanTracker.endermanMergersSession + "\n" + - EnumChatFormatting.GOLD + " Judgement Cores: " + EndermanTracker.endermanCoresSession + "\n" + - EnumChatFormatting.RED + " Ender Slayer VII Books: " + EndermanTracker.endermanEnderBooksSession + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Endersnake Runes: " + EndermanTracker.endersnakesSession + "\n" + + EnumChatFormatting.DARK_GREEN + " Summoning Eyes: " + EndermanTracker.summoningEyesSession + "\n" + + EnumChatFormatting.AQUA + " Mana Steal Books: " + EndermanTracker.manaBooksSession + "\n" + + EnumChatFormatting.BLUE + " Transmission Tuners: " + EndermanTracker.tunersSession + "\n" + + EnumChatFormatting.YELLOW + " Null Atoms: " + EndermanTracker.atomsSession + "\n" + + EnumChatFormatting.YELLOW + " Hazmat Endermen: " + EndermanTracker.hazmatsSession + "\n" + + EnumChatFormatting.AQUA + " Espresso Machines: " + EndermanTracker.espressoMachinesSession + "\n" + + EnumChatFormatting.WHITE + " Smarty Pants Books: " + EndermanTracker.smartyBooksSession + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " End Runes: " + EndermanTracker.endRunesSession + "\n" + + EnumChatFormatting.RED + " Blood Chalices: " + EndermanTracker.chalicesSession + "\n" + + EnumChatFormatting.RED + " Sinful Dice: " + EndermanTracker.diceSession + "\n" + + EnumChatFormatting.DARK_PURPLE + " Artifact Upgrader: " + EndermanTracker.artifactsSession + "\n" + + EnumChatFormatting.DARK_PURPLE + " Enderman Skins: " + EndermanTracker.skinsSession + "\n" + + EnumChatFormatting.GRAY + " Enchant Runes: " + EndermanTracker.enchantRunesSession + "\n" + + EnumChatFormatting.GOLD + " Etherwarp Mergers: " + EndermanTracker.mergersSession + "\n" + + EnumChatFormatting.GOLD + " Judgement Cores: " + EndermanTracker.coresSession + "\n" + + EnumChatFormatting.RED + " Ender Slayer VII Books: " + EndermanTracker.enderBooksSession + "\n" + EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + EnumChatFormatting.DARK_PURPLE + EnumChatFormatting.BOLD + " -------------------")); return; } - if (EndermanTracker.endermanTime == -1) { + if (EndermanTracker.time == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(EndermanTracker.endermanTime, timeNow); + timeBetween = Utils.getTimeBetween(EndermanTracker.time, timeNow); } - if (EndermanTracker.endermanBosses == -1) { + if (EndermanTracker.bosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(EndermanTracker.endermanBosses); + bossesBetween = nf.format(EndermanTracker.bosses); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(EndermanTracker.endermanTAP); + drop20 = nf.format(EndermanTracker.TAP); } else { - drop20 = nf.format(EndermanTracker.endermanTAPDrops) + " times"; + drop20 = nf.format(EndermanTracker.TAPDrops) + " times"; } player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD + " Enderman Loot Summary:\n" + - EnumChatFormatting.GOLD + " Voidglooms Killed: " + nf.format(EndermanTracker.endermanVoidglooms) + "\n" + - EnumChatFormatting.DARK_GRAY + " Null Spheres: " + nf.format(EndermanTracker.endermanNullSpheres) + "\n" + + EnumChatFormatting.GOLD + " Voidglooms Killed: " + nf.format(EndermanTracker.voidglooms) + "\n" + + EnumChatFormatting.DARK_GRAY + " Null Spheres: " + nf.format(EndermanTracker.nullSpheres) + "\n" + EnumChatFormatting.DARK_PURPLE + " Arrow Poison: " + drop20 + "\n" + - EnumChatFormatting.LIGHT_PURPLE + " Endersnake Runes: " + EndermanTracker.endermanEndersnakes + "\n" + - EnumChatFormatting.DARK_GREEN + " Summoning Eyes: " + EndermanTracker.endermanSummoningEyes + "\n" + - EnumChatFormatting.AQUA + " Mana Steal Books: " + EndermanTracker.endermanManaBooks + "\n" + - EnumChatFormatting.BLUE + " Transmission Tuners: " + EndermanTracker.endermanTuners + "\n" + - EnumChatFormatting.YELLOW + " Null Atoms: " + EndermanTracker.endermanAtoms + "\n" + - EnumChatFormatting.AQUA + " Espresso Machines: " + EndermanTracker.endermanEspressoMachines + "\n" + - EnumChatFormatting.WHITE + " Smarty Pants Books: " + EndermanTracker.endermanSmartyBooks + "\n" + - EnumChatFormatting.LIGHT_PURPLE + " End Runes: " + EndermanTracker.endermanEndRunes + "\n" + - EnumChatFormatting.RED + " Blood Chalices: " + EndermanTracker.endermanChalices + "\n" + - EnumChatFormatting.RED + " Sinful Dice: " + EndermanTracker.endermanDice + "\n" + - EnumChatFormatting.DARK_PURPLE + " Artifact Upgrader: " + EndermanTracker.endermanArtifacts + "\n" + - EnumChatFormatting.DARK_PURPLE + " Enderman Skins: " + EndermanTracker.endermanSkins + "\n" + - EnumChatFormatting.GRAY + " Enchant Runes: " + EndermanTracker.endermanEnchantRunes + "\n" + - EnumChatFormatting.GOLD + " Etherwarp Mergers: " + EndermanTracker.endermanMergers + "\n" + - EnumChatFormatting.GOLD + " Judgement Cores: " + EndermanTracker.endermanCores + "\n" + - EnumChatFormatting.RED + " Ender Slayer VII Books: " + EndermanTracker.endermanEnderBooks + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " Endersnake Runes: " + EndermanTracker.endersnakes + "\n" + + EnumChatFormatting.DARK_GREEN + " Summoning Eyes: " + EndermanTracker.summoningEyes + "\n" + + EnumChatFormatting.AQUA + " Mana Steal Books: " + EndermanTracker.manaBooks + "\n" + + EnumChatFormatting.BLUE + " Transmission Tuners: " + EndermanTracker.tuners + "\n" + + EnumChatFormatting.YELLOW + " Null Atoms: " + EndermanTracker.atoms + "\n" + + EnumChatFormatting.YELLOW + " Hazmat Endermen: " + EndermanTracker.hazmats + "\n" + + EnumChatFormatting.AQUA + " Espresso Machines: " + EndermanTracker.espressoMachines + "\n" + + EnumChatFormatting.WHITE + " Smarty Pants Books: " + EndermanTracker.smartyBooks + "\n" + + EnumChatFormatting.LIGHT_PURPLE + " End Runes: " + EndermanTracker.endRunes + "\n" + + EnumChatFormatting.RED + " Blood Chalices: " + EndermanTracker.chalices + "\n" + + EnumChatFormatting.RED + " Sinful Dice: " + EndermanTracker.dice + "\n" + + EnumChatFormatting.DARK_PURPLE + " Artifact Upgrader: " + EndermanTracker.artifacts + "\n" + + EnumChatFormatting.DARK_PURPLE + " Enderman Skins: " + EndermanTracker.skins + "\n" + + EnumChatFormatting.GRAY + " Enchant Runes: " + EndermanTracker.enchantRunes + "\n" + + EnumChatFormatting.GOLD + " Etherwarp Mergers: " + EndermanTracker.mergers + "\n" + + EnumChatFormatting.GOLD + " Judgement Cores: " + EndermanTracker.cores + "\n" + + EnumChatFormatting.RED + " Ender Slayer VII Books: " + EndermanTracker.enderBooks + "\n" + EnumChatFormatting.AQUA + " Time Since RNG: " + timeBetween + "\n" + EnumChatFormatting.AQUA + " Bosses Since RNG: " + bossesBetween + "\n" + EnumChatFormatting.DARK_PURPLE + EnumChatFormatting.BOLD + " -------------------")); diff --git a/src/main/java/me/Danker/commands/ResetLootCommand.java b/src/main/java/me/Danker/commands/ResetLootCommand.java index c17c2ae..48cdb26 100644 --- a/src/main/java/me/Danker/commands/ResetLootCommand.java +++ b/src/main/java/me/Danker/commands/ResetLootCommand.java @@ -126,82 +126,84 @@ public class ResetLootCommand extends CommandBase { } static void resetZombie() { - ZombieTracker.zombieRevsSession = 0; - ZombieTracker.zombieRevFleshSession = 0; - ZombieTracker.zombieRevVisceraSession = 0; - ZombieTracker.zombieFoulFleshSession = 0; - ZombieTracker.zombieFoulFleshDropsSession = 0; - ZombieTracker.zombiePestilencesSession = 0; - ZombieTracker.zombieUndeadCatasSession = 0; - ZombieTracker.zombieBooksSession = 0; - ZombieTracker.zombieBooksT7Session = 0; - ZombieTracker.zombieBeheadedsSession = 0; - ZombieTracker.zombieRevCatasSession = 0; - ZombieTracker.zombieSnakesSession = 0; - ZombieTracker.zombieScythesSession = 0; - ZombieTracker.zombieTimeSession = -1; - ZombieTracker.zombieBossesSession = -1; + ZombieTracker.revsSession = 0; + ZombieTracker.revFleshSession = 0; + ZombieTracker.revVisceraSession = 0; + ZombieTracker.foulFleshSession = 0; + ZombieTracker.foulFleshDropsSession = 0; + ZombieTracker.pestilencesSession = 0; + ZombieTracker.undeadCatasSession = 0; + ZombieTracker.booksSession = 0; + ZombieTracker.booksT7Session = 0; + ZombieTracker.beheadedsSession = 0; + ZombieTracker.revCatasSession = 0; + ZombieTracker.snakesSession = 0; + ZombieTracker.scythesSession = 0; + ZombieTracker.timeSession = -1; + ZombieTracker.bossesSession = -1; ConfigHandler.deleteCategory("zombie"); ConfigHandler.reloadConfig(); } static void resetSpider() { - SpiderTracker.spiderTarantulasSession = 0; - SpiderTracker.spiderWebsSession = 0; - SpiderTracker.spiderTAPSession = 0; - SpiderTracker.spiderTAPDropsSession = 0; - SpiderTracker.spiderBitesSession = 0; - SpiderTracker.spiderCatalystsSession = 0; - SpiderTracker.spiderBooksSession = 0; - SpiderTracker.spiderSwattersSession = 0; - SpiderTracker.spiderTalismansSession = 0; - SpiderTracker.spiderMosquitosSession = 0; - SpiderTracker.spiderTimeSession = -1; - SpiderTracker.spiderBossesSession = -1; + SpiderTracker.tarantulasSession = 0; + SpiderTracker.websSession = 0; + SpiderTracker.TAPSession = 0; + SpiderTracker.TAPDropsSession = 0; + SpiderTracker.bitesSession = 0; + SpiderTracker.catalystsSession = 0; + SpiderTracker.booksSession = 0; + SpiderTracker.swattersSession = 0; + SpiderTracker.talismansSession = 0; + SpiderTracker.mosquitosSession = 0; + SpiderTracker.timeSession = -1; + SpiderTracker.bossesSession = -1; ConfigHandler.deleteCategory("spider"); ConfigHandler.reloadConfig(); } static void resetWolf() { - WolfTracker.wolfSvensSession = 0; - WolfTracker.wolfTeethSession = 0; - WolfTracker.wolfWheelsSession = 0; - WolfTracker.wolfWheelsDropsSession = 0; - WolfTracker.wolfSpiritsSession = 0; - WolfTracker.wolfBooksSession = 0; - WolfTracker.wolfEggsSession = 0; - WolfTracker.wolfCouturesSession = 0; - WolfTracker.wolfBaitsSession = 0; - WolfTracker.wolfFluxesSession = 0; - WolfTracker.wolfTimeSession = -1; - WolfTracker.wolfBossesSession = -1; + WolfTracker.svensSession = 0; + WolfTracker.teethSession = 0; + WolfTracker.wheelsSession = 0; + WolfTracker.wheelsDropsSession = 0; + WolfTracker.spiritsSession = 0; + WolfTracker.booksSession = 0; + WolfTracker.furballsSession = 0; + WolfTracker.eggsSession = 0; + WolfTracker.couturesSession = 0; + WolfTracker.baitsSession = 0; + WolfTracker.fluxesSession = 0; + WolfTracker.timeSession = -1; + WolfTracker.bossesSession = -1; ConfigHandler.deleteCategory("wolf"); ConfigHandler.reloadConfig(); } static void resetEnderman() { - EndermanTracker.endermanVoidgloomsSession = 0; - EndermanTracker.endermanNullSpheresSession = 0; - EndermanTracker.endermanTAPSession = 0; - EndermanTracker.endermanTAPDropsSession = 0; - EndermanTracker.endermanEndersnakesSession = 0; - EndermanTracker.endermanSummoningEyesSession = 0; - EndermanTracker.endermanManaBooksSession = 0; - EndermanTracker.endermanTunersSession = 0; - EndermanTracker.endermanAtomsSession = 0; - EndermanTracker.endermanEspressoMachinesSession = 0; - EndermanTracker.endermanSmartyBooksSession = 0; - EndermanTracker.endermanEndRunesSession = 0; - EndermanTracker.endermanChalicesSession = 0; - EndermanTracker.endermanDiceSession = 0; - EndermanTracker.endermanArtifactsSession = 0; - EndermanTracker.endermanSkinsSession = 0; - EndermanTracker.endermanMergersSession = 0; - EndermanTracker.endermanCoresSession = 0; - EndermanTracker.endermanEnchantRunesSession = 0; - EndermanTracker.endermanEnderBooksSession = 0; - EndermanTracker.endermanTimeSession = -1; - EndermanTracker.endermanBossesSession = -1; + EndermanTracker.voidgloomsSession = 0; + EndermanTracker.nullSpheresSession = 0; + EndermanTracker.TAPSession = 0; + EndermanTracker.TAPDropsSession = 0; + EndermanTracker.endersnakesSession = 0; + EndermanTracker.summoningEyesSession = 0; + EndermanTracker.manaBooksSession = 0; + EndermanTracker.tunersSession = 0; + EndermanTracker.atomsSession = 0; + EndermanTracker.hazmatsSession = 0; + EndermanTracker.espressoMachinesSession = 0; + EndermanTracker.smartyBooksSession = 0; + EndermanTracker.endRunesSession = 0; + EndermanTracker.chalicesSession = 0; + EndermanTracker.diceSession = 0; + EndermanTracker.artifactsSession = 0; + EndermanTracker.skinsSession = 0; + EndermanTracker.mergersSession = 0; + EndermanTracker.coresSession = 0; + EndermanTracker.enchantRunesSession = 0; + EndermanTracker.enderBooksSession = 0; + EndermanTracker.timeSession = -1; + EndermanTracker.bossesSession = -1; ConfigHandler.deleteCategory("enderman"); ConfigHandler.reloadConfig(); } diff --git a/src/main/java/me/Danker/features/loot/EndermanTracker.java b/src/main/java/me/Danker/features/loot/EndermanTracker.java index 38b22f9..1cc46db 100644 --- a/src/main/java/me/Danker/features/loot/EndermanTracker.java +++ b/src/main/java/me/Danker/features/loot/EndermanTracker.java @@ -10,51 +10,53 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class EndermanTracker { - public static int endermanVoidglooms; - public static int endermanNullSpheres; - public static int endermanTAP; - public static int endermanTAPDrops; - public static int endermanEndersnakes; - public static int endermanSummoningEyes; - public static int endermanManaBooks; - public static int endermanTuners; - public static int endermanAtoms; - public static int endermanEspressoMachines; - public static int endermanSmartyBooks; - public static int endermanEndRunes; - public static int endermanChalices; - public static int endermanDice; - public static int endermanArtifacts; - public static int endermanSkins; - public static int endermanMergers; - public static int endermanCores; - public static int endermanEnchantRunes; - public static int endermanEnderBooks; - public static double endermanTime; - public static int endermanBosses; + public static int voidglooms; + public static int nullSpheres; + public static int TAP; + public static int TAPDrops; + public static int endersnakes; + public static int summoningEyes; + public static int manaBooks; + public static int tuners; + public static int atoms; + public static int hazmats; + public static int espressoMachines; + public static int smartyBooks; + public static int endRunes; + public static int chalices; + public static int dice; + public static int artifacts; + public static int skins; + public static int mergers; + public static int cores; + public static int enchantRunes; + public static int enderBooks; + public static double time; + public static int bosses; - public static int endermanVoidgloomsSession = 0; - public static int endermanNullSpheresSession = 0; - public static int endermanTAPSession = 0; - public static int endermanTAPDropsSession = 0; - public static int endermanEndersnakesSession = 0; - public static int endermanSummoningEyesSession = 0; - public static int endermanManaBooksSession = 0; - public static int endermanTunersSession = 0; - public static int endermanAtomsSession = 0; - public static int endermanEspressoMachinesSession = 0; - public static int endermanSmartyBooksSession = 0; - public static int endermanEndRunesSession = 0; - public static int endermanChalicesSession = 0; - public static int endermanDiceSession = 0; - public static int endermanArtifactsSession = 0; - public static int endermanSkinsSession = 0; - public static int endermanMergersSession = 0; - public static int endermanCoresSession = 0; - public static int endermanEnchantRunesSession = 0; - public static int endermanEnderBooksSession = 0; - public static double endermanTimeSession = -1; - public static int endermanBossesSession = -1; + public static int voidgloomsSession = 0; + public static int nullSpheresSession = 0; + public static int TAPSession = 0; + public static int TAPDropsSession = 0; + public static int endersnakesSession = 0; + public static int summoningEyesSession = 0; + public static int manaBooksSession = 0; + public static int tunersSession = 0; + public static int atomsSession = 0; + public static int hazmatsSession = 0; + public static int espressoMachinesSession = 0; + public static int smartyBooksSession = 0; + public static int endRunesSession = 0; + public static int chalicesSession = 0; + public static int diceSession = 0; + public static int artifactsSession = 0; + public static int skinsSession = 0; + public static int mergersSession = 0; + public static int coresSession = 0; + public static int enchantRunesSession = 0; + public static int enderBooksSession = 0; + public static double timeSession = -1; + public static int bossesSession = -1; @SubscribeEvent public void onChat(ClientChatReceivedEvent event) { @@ -67,110 +69,114 @@ public class EndermanTracker { boolean rng = false; if (message.contains(" Enderman Slayer LVL ")) { - endermanVoidglooms++; - endermanVoidgloomsSession++; - if (endermanBosses != -1) { - endermanBosses++; + voidglooms++; + voidgloomsSession++; + if (bosses != -1) { + bosses++; } - if (endermanBossesSession != -1) { - endermanBossesSession++; + if (bossesSession != -1) { + bossesSession++; } - ConfigHandler.writeIntConfig("enderman", "voidglooms", endermanVoidglooms); - ConfigHandler.writeIntConfig("enderman", "bossRNG", endermanBosses); + ConfigHandler.writeIntConfig("enderman", "voidglooms", voidglooms); + ConfigHandler.writeIntConfig("enderman", "bossRNG", bosses); } else if (message.contains("RARE DROP! (") && message.contains("Twilight Arrow Poison)")) { int amount = LootTracker.getAmountfromMessage(message); - endermanTAP += amount; - endermanTAPSession += amount; - endermanTAPDrops++; - endermanTAPDropsSession++; - ConfigHandler.writeIntConfig("enderman", "tap", endermanTAP); - ConfigHandler.writeIntConfig("enderman", "tapDrops", endermanTAPDrops); + TAP += amount; + TAPSession += amount; + TAPDrops++; + TAPDropsSession++; + ConfigHandler.writeIntConfig("enderman", "tap", TAP); + ConfigHandler.writeIntConfig("enderman", "tapDrops", TAPDrops); } else if (message.contains("VERY RARE DROP! (") && message.contains(" Endersnake Rune I)")) { - endermanEndersnakes++; - endermanEndersnakesSession++; - ConfigHandler.writeIntConfig("enderman", "endersnakes", endermanEndersnakes); + endersnakes++; + endersnakesSession++; + ConfigHandler.writeIntConfig("enderman", "endersnakes", endersnakes); } else if (message.contains("VERY RARE DROP! (Summoning Eye)")) { - endermanSummoningEyes++; - endermanSummoningEyesSession++; - ConfigHandler.writeIntConfig("enderman", "summoningEyes", endermanSummoningEyes); + summoningEyes++; + summoningEyesSession++; + ConfigHandler.writeIntConfig("enderman", "summoningEyes", summoningEyes); } else if (message.contains("VERY RARE DROP! (Mana Steal I)")) { - endermanManaBooks++; - endermanManaBooksSession++; - ConfigHandler.writeIntConfig("enderman", "manaBooks", endermanManaBooks); + manaBooks++; + manaBooksSession++; + ConfigHandler.writeIntConfig("enderman", "manaBooks", manaBooks); } else if (message.contains("VERY RARE DROP! (Transmission Tuner)")) { - endermanTuners++; - endermanTunersSession++; - ConfigHandler.writeIntConfig("enderman", "tuners", endermanTuners); + tuners++; + tunersSession++; + ConfigHandler.writeIntConfig("enderman", "tuners", tuners); } else if (message.contains("VERY RARE DROP! (Null Atom)")) { - endermanAtoms++; - endermanAtomsSession++; - ConfigHandler.writeIntConfig("enderman", "atoms", endermanAtoms); + atoms++; + atomsSession++; + ConfigHandler.writeIntConfig("enderman", "atoms", atoms); + } else if (message.contains("VERY RARE DROP! (Hazmat Enderman)")) { + hazmats++; + hazmatsSession++; + ConfigHandler.writeIntConfig("enderman", "hazmats", hazmats); } else if (message.contains("CRAZY RARE DROP! (Pocket Espresso Machine)")) { rng = true; - endermanEspressoMachines++; - endermanEspressoMachinesSession++; - ConfigHandler.writeIntConfig("enderman", "espressoMachines", endermanEspressoMachines); + espressoMachines++; + espressoMachinesSession++; + ConfigHandler.writeIntConfig("enderman", "espressoMachines", espressoMachines); if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.AQUA + "POCKET ESPRESSO MACHINE!", 3); } else if (message.contains("VERY RARE DROP! (Smarty Pants I)")) { - endermanSmartyBooks++; - endermanSmartyBooksSession++; - ConfigHandler.writeIntConfig("enderman", "smartyBooks", endermanSmartyBooks); + smartyBooks++; + smartyBooksSession++; + ConfigHandler.writeIntConfig("enderman", "smartyBooks", smartyBooks); } else if (message.contains("VERY RARE DROP! (") && message.contains(" End Rune I)")) { - endermanEndRunes++; - endermanEndRunesSession++; - ConfigHandler.writeIntConfig("enderman", "endRunes", endermanEndRunes); + endRunes++; + endRunesSession++; + ConfigHandler.writeIntConfig("enderman", "endRunes", endRunes); } else if (message.contains("CRAZY RARE DROP! (Handy Blood Chalice)")) { rng = true; - endermanChalices++; - endermanChalicesSession++; - ConfigHandler.writeIntConfig("enderman", "chalices", endermanChalices); + chalices++; + chalicesSession++; + ConfigHandler.writeIntConfig("enderman", "chalices", chalices); if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.RED + "HANDY BLOOD CHALICE!", 3); } else if (message.contains("VERY RARE DROP! (Sinful Dice)")) { - endermanDice++; - endermanDiceSession++; - ConfigHandler.writeIntConfig("enderman", "dice", endermanDice); + dice++; + diceSession++; + ConfigHandler.writeIntConfig("enderman", "dice", dice); } else if (message.contains("CRAZY RARE DROP! (Exceedingly Rare Ender Artifact Upgrader)")) { rng = true; - endermanArtifacts++; - endermanArtifactsSession++; - ConfigHandler.writeIntConfig("enderman", "artifacts", endermanArtifacts); + artifacts++; + artifactsSession++; + ConfigHandler.writeIntConfig("enderman", "artifacts", artifacts); if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "ENDER ARTIFACT UPGRADER!", 3); } else if (message.contains("CRAZY RARE DROP! (Void Conqueror Enderman Skin)")) { rng = true; - endermanSkins++; - endermanSkinsSession++; - ConfigHandler.writeIntConfig("enderman", "skins", endermanSkins); + skins++; + skinsSession++; + ConfigHandler.writeIntConfig("enderman", "skins", skins); if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "ENDERMAN SKIN!", 3); } else if (message.contains("VERY RARE DROP! (Etherwarp Merger)")) { - endermanMergers++; - endermanMergersSession++; - ConfigHandler.writeIntConfig("enderman", "mergers", endermanMergers); + mergers++; + mergersSession++; + ConfigHandler.writeIntConfig("enderman", "mergers", mergers); } else if (message.contains("CRAZY RARE DROP! (Judgement Core)")) { rng = true; - endermanCores++; - endermanCoresSession++; - ConfigHandler.writeIntConfig("enderman", "cores", endermanCores); + cores++; + coresSession++; + ConfigHandler.writeIntConfig("enderman", "cores", cores); if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GOLD + "JUDGEMENT CORE!", 5); } else if (message.contains("CRAZY RARE DROP! (") && message.contains(" Enchant Rune I)")) { rng = true; - endermanEnchantRunes++; - endermanEnchantRunesSession++; - ConfigHandler.writeIntConfig("enderman", "enchantRunes", endermanEnchantRunes); + enchantRunes++; + enchantRunesSession++; + ConfigHandler.writeIntConfig("enderman", "enchantRunes", enchantRunes); if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GRAY + "ENCHANT RUNE!", 3); } else if (message.contains("INSANE DROP! (Ender Slayer VII)") || message.contains("CRAZY RARE DROP! (Ender Slayer VII)")) { rng = true; - endermanEnderBooks++; - endermanEnderBooksSession++; - ConfigHandler.writeIntConfig("enderman", "enderBooks", endermanEnderBooks); + enderBooks++; + enderBooksSession++; + ConfigHandler.writeIntConfig("enderman", "enderBooks", enderBooks); if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.RED + "ENDER SLAYER VII!", 3); } if (rng) { - endermanTime = System.currentTimeMillis() / 1000; - endermanBosses = 0; - endermanTimeSession = System.currentTimeMillis() / 1000; - endermanBossesSession = 0; - ConfigHandler.writeDoubleConfig("enderman", "timeRNG", endermanTime); + time = System.currentTimeMillis() / 1000; + bosses = 0; + timeSession = System.currentTimeMillis() / 1000; + bossesSession = 0; + ConfigHandler.writeDoubleConfig("enderman", "timeRNG", time); ConfigHandler.writeIntConfig("enderman", "bossRNG", 0); } } diff --git a/src/main/java/me/Danker/features/loot/LootDisplay.java b/src/main/java/me/Danker/features/loot/LootDisplay.java index e1ddcb0..f2f86b0 100644 --- a/src/main/java/me/Danker/features/loot/LootDisplay.java +++ b/src/main/java/me/Danker/features/loot/LootDisplay.java @@ -37,20 +37,20 @@ public class LootDisplay { switch (display) { case "wolf": - if (WolfTracker.wolfTime == -1) { + if (WolfTracker.time == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(WolfTracker.wolfTime, timeNow); + timeBetween = Utils.getTimeBetween(WolfTracker.time, timeNow); } - if (WolfTracker.wolfBosses == -1) { + if (WolfTracker.bosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(WolfTracker.wolfBosses); + bossesBetween = nf.format(WolfTracker.bosses); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(WolfTracker.wolfWheels); + drop20 = nf.format(WolfTracker.wheels); } else { - drop20 = nf.format(WolfTracker.wolfWheelsDrops) + " times"; + drop20 = nf.format(WolfTracker.wheelsDrops) + " times"; } dropsText = EnumChatFormatting.GOLD + "Svens Killed:\n" + @@ -58,39 +58,41 @@ public class LootDisplay { EnumChatFormatting.BLUE + "Hamster Wheels:\n" + EnumChatFormatting.AQUA + "Spirit Runes:\n" + EnumChatFormatting.WHITE + "Critical VI Books:\n" + + EnumChatFormatting.DARK_AQUA + "Furballs:\n" + EnumChatFormatting.DARK_RED + "Red Claw Eggs:\n" + EnumChatFormatting.GOLD + "Couture Runes:\n" + EnumChatFormatting.AQUA + "Grizzly Baits:\n" + EnumChatFormatting.DARK_PURPLE + "Overfluxes:\n" + EnumChatFormatting.AQUA + "Time Since RNG:\n" + EnumChatFormatting.AQUA + "Bosses Since RNG:"; - countText = EnumChatFormatting.GOLD + nf.format(WolfTracker.wolfSvens) + "\n" + - EnumChatFormatting.GREEN + nf.format(WolfTracker.wolfTeeth) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(WolfTracker.svens) + "\n" + + EnumChatFormatting.GREEN + nf.format(WolfTracker.teeth) + "\n" + EnumChatFormatting.BLUE + drop20 + "\n" + - EnumChatFormatting.AQUA + WolfTracker.wolfSpirits + "\n" + - EnumChatFormatting.WHITE + WolfTracker.wolfBooks + "\n" + - EnumChatFormatting.DARK_RED + WolfTracker.wolfEggs + "\n" + - EnumChatFormatting.GOLD + WolfTracker.wolfCoutures + "\n" + - EnumChatFormatting.AQUA + WolfTracker.wolfBaits + "\n" + - EnumChatFormatting.DARK_PURPLE + WolfTracker.wolfFluxes + "\n" + + EnumChatFormatting.AQUA + WolfTracker.spirits + "\n" + + EnumChatFormatting.WHITE + WolfTracker.books + "\n" + + EnumChatFormatting.DARK_AQUA + WolfTracker.furballs + "\n" + + EnumChatFormatting.DARK_RED + WolfTracker.eggs + "\n" + + EnumChatFormatting.GOLD + WolfTracker.coutures + "\n" + + EnumChatFormatting.AQUA + WolfTracker.baits + "\n" + + EnumChatFormatting.DARK_PURPLE + WolfTracker.fluxes + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; break; case "wolf_session": - if (WolfTracker.wolfTimeSession == -1) { + if (WolfTracker.timeSession == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(WolfTracker.wolfTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(WolfTracker.timeSession, timeNow); } - if (WolfTracker.wolfBossesSession == -1) { + if (WolfTracker.bossesSession == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(WolfTracker.wolfBossesSession); + bossesBetween = nf.format(WolfTracker.bossesSession); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(WolfTracker.wolfWheelsSession); + drop20 = nf.format(WolfTracker.wheelsSession); } else { - drop20 = nf.format(WolfTracker.wolfWheelsDropsSession) + " times"; + drop20 = nf.format(WolfTracker.wheelsDropsSession) + " times"; } dropsText = EnumChatFormatting.GOLD + "Svens Killed:\n" + @@ -98,39 +100,41 @@ public class LootDisplay { EnumChatFormatting.BLUE + "Hamster Wheels:\n" + EnumChatFormatting.AQUA + "Spirit Runes:\n" + EnumChatFormatting.WHITE + "Critical VI Books:\n" + + EnumChatFormatting.DARK_AQUA + "Furballs:\n" + EnumChatFormatting.DARK_RED + "Red Claw Eggs:\n" + EnumChatFormatting.GOLD + "Couture Runes:\n" + EnumChatFormatting.AQUA + "Grizzly Baits:\n" + EnumChatFormatting.DARK_PURPLE + "Overfluxes:\n" + EnumChatFormatting.AQUA + "Time Since RNG:\n" + EnumChatFormatting.AQUA + "Bosses Since RNG:"; - countText = EnumChatFormatting.GOLD + nf.format(WolfTracker.wolfSvensSession) + "\n" + - EnumChatFormatting.GREEN + nf.format(WolfTracker.wolfTeethSession) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(WolfTracker.svensSession) + "\n" + + EnumChatFormatting.GREEN + nf.format(WolfTracker.teethSession) + "\n" + EnumChatFormatting.BLUE + drop20 + "\n" + - EnumChatFormatting.AQUA + WolfTracker.wolfSpiritsSession + "\n" + - EnumChatFormatting.WHITE + WolfTracker.wolfBooksSession + "\n" + - EnumChatFormatting.DARK_RED + WolfTracker.wolfEggsSession + "\n" + - EnumChatFormatting.GOLD + WolfTracker.wolfCouturesSession + "\n" + - EnumChatFormatting.AQUA + WolfTracker.wolfBaitsSession + "\n" + - EnumChatFormatting.DARK_PURPLE + WolfTracker.wolfFluxesSession + "\n" + + EnumChatFormatting.AQUA + WolfTracker.spiritsSession + "\n" + + EnumChatFormatting.WHITE + WolfTracker.booksSession + "\n" + + EnumChatFormatting.DARK_AQUA + WolfTracker.furballsSession + "\n" + + EnumChatFormatting.DARK_RED + WolfTracker.eggsSession + "\n" + + EnumChatFormatting.GOLD + WolfTracker.couturesSession + "\n" + + EnumChatFormatting.AQUA + WolfTracker.baitsSession + "\n" + + EnumChatFormatting.DARK_PURPLE + WolfTracker.fluxesSession + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; break; case "spider": - if (SpiderTracker.spiderTime == -1) { + if (SpiderTracker.time == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(SpiderTracker.spiderTime, timeNow); + timeBetween = Utils.getTimeBetween(SpiderTracker.time, timeNow); } - if (SpiderTracker.spiderBosses == -1) { + if (SpiderTracker.bosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(SpiderTracker.spiderBosses); + bossesBetween = nf.format(SpiderTracker.bosses); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(SpiderTracker.spiderTAP); + drop20 = nf.format(SpiderTracker.TAP); } else { - drop20 = nf.format(SpiderTracker.spiderTAPDrops) + " times"; + drop20 = nf.format(SpiderTracker.TAPDrops) + " times"; } dropsText = EnumChatFormatting.GOLD + "Tarantulas Killed:\n" + @@ -144,33 +148,33 @@ public class LootDisplay { EnumChatFormatting.GOLD + "Digested Mosquitos:\n" + EnumChatFormatting.AQUA + "Time Since RNG:\n" + EnumChatFormatting.AQUA + "Bosses Since RNG:"; - countText = EnumChatFormatting.GOLD + nf.format(SpiderTracker.spiderTarantulas) + "\n" + - EnumChatFormatting.GREEN + nf.format(SpiderTracker.spiderWebs) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(SpiderTracker.tarantulas) + "\n" + + EnumChatFormatting.GREEN + nf.format(SpiderTracker.webs) + "\n" + EnumChatFormatting.DARK_GREEN + drop20 + "\n" + - EnumChatFormatting.DARK_GRAY + SpiderTracker.spiderBites + "\n" + - EnumChatFormatting.WHITE + SpiderTracker.spiderBooks + "\n" + - EnumChatFormatting.AQUA + SpiderTracker.spiderCatalysts + "\n" + - EnumChatFormatting.DARK_PURPLE + SpiderTracker.spiderTalismans + "\n" + - EnumChatFormatting.LIGHT_PURPLE + SpiderTracker.spiderSwatters + "\n" + - EnumChatFormatting.GOLD + SpiderTracker.spiderMosquitos + "\n" + + EnumChatFormatting.DARK_GRAY + SpiderTracker.bites + "\n" + + EnumChatFormatting.WHITE + SpiderTracker.books + "\n" + + EnumChatFormatting.AQUA + SpiderTracker.catalysts + "\n" + + EnumChatFormatting.DARK_PURPLE + SpiderTracker.talismans + "\n" + + EnumChatFormatting.LIGHT_PURPLE + SpiderTracker.swatters + "\n" + + EnumChatFormatting.GOLD + SpiderTracker.mosquitos + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; break; case "spider_session": - if (SpiderTracker.spiderTimeSession == -1) { + if (SpiderTracker.timeSession == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(SpiderTracker.spiderTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(SpiderTracker.timeSession, timeNow); } - if (SpiderTracker.spiderBossesSession == -1) { + if (SpiderTracker.bossesSession == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(SpiderTracker.spiderBossesSession); + bossesBetween = nf.format(SpiderTracker.bossesSession); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(SpiderTracker.spiderTAPSession); + drop20 = nf.format(SpiderTracker.TAPSession); } else { - drop20 = nf.format(SpiderTracker.spiderTAPDropsSession) + " times"; + drop20 = nf.format(SpiderTracker.TAPDropsSession) + " times"; } dropsText = EnumChatFormatting.GOLD + "Tarantulas Killed:\n" + @@ -184,33 +188,33 @@ public class LootDisplay { EnumChatFormatting.GOLD + "Digested Mosquitos:\n" + EnumChatFormatting.AQUA + "Time Since RNG:\n" + EnumChatFormatting.AQUA + "Bosses Since RNG:"; - countText = EnumChatFormatting.GOLD + nf.format(SpiderTracker.spiderTarantulasSession) + "\n" + - EnumChatFormatting.GREEN + nf.format(SpiderTracker.spiderWebsSession) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(SpiderTracker.tarantulasSession) + "\n" + + EnumChatFormatting.GREEN + nf.format(SpiderTracker.websSession) + "\n" + EnumChatFormatting.DARK_GREEN + drop20 + "\n" + - EnumChatFormatting.DARK_GRAY + SpiderTracker.spiderBitesSession + "\n" + - EnumChatFormatting.WHITE + SpiderTracker.spiderBooksSession + "\n" + - EnumChatFormatting.AQUA + SpiderTracker.spiderCatalystsSession + "\n" + - EnumChatFormatting.DARK_PURPLE + SpiderTracker.spiderTalismansSession + "\n" + - EnumChatFormatting.LIGHT_PURPLE + SpiderTracker.spiderSwattersSession + "\n" + - EnumChatFormatting.GOLD + SpiderTracker.spiderMosquitosSession + "\n" + + EnumChatFormatting.DARK_GRAY + SpiderTracker.bitesSession + "\n" + + EnumChatFormatting.WHITE + SpiderTracker.booksSession + "\n" + + EnumChatFormatting.AQUA + SpiderTracker.catalystsSession + "\n" + + EnumChatFormatting.DARK_PURPLE + SpiderTracker.talismansSession + "\n" + + EnumChatFormatting.LIGHT_PURPLE + SpiderTracker.swattersSession + "\n" + + EnumChatFormatting.GOLD + SpiderTracker.mosquitosSession + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; break; case "zombie": - if (ZombieTracker.zombieTime == -1) { + if (ZombieTracker.time == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(ZombieTracker.zombieTime, timeNow); + timeBetween = Utils.getTimeBetween(ZombieTracker.time, timeNow); } - if (ZombieTracker.zombieBosses == -1) { + if (ZombieTracker.bosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(ZombieTracker.zombieBosses); + bossesBetween = nf.format(ZombieTracker.bosses); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(ZombieTracker.zombieFoulFlesh); + drop20 = nf.format(ZombieTracker.foulFlesh); } else { - drop20 = nf.format(ZombieTracker.zombieFoulFleshDrops) + " times"; + drop20 = nf.format(ZombieTracker.foulFleshDrops) + " times"; } dropsText = EnumChatFormatting.GOLD + "Revs Killed:\n" + @@ -229,38 +233,38 @@ public class LootDisplay { EnumChatFormatting.RED + "Warden Hearts:\n" + EnumChatFormatting.AQUA + "Time Since RNG:\n" + EnumChatFormatting.AQUA + "Bosses Since RNG:"; - countText = EnumChatFormatting.GOLD + nf.format(ZombieTracker.zombieRevs) + "\n" + - EnumChatFormatting.GREEN + nf.format(ZombieTracker.zombieRevFlesh) + "\n" + - EnumChatFormatting.GREEN + nf.format(ZombieTracker.zombieRevViscera) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(ZombieTracker.revs) + "\n" + + EnumChatFormatting.GREEN + nf.format(ZombieTracker.revFlesh) + "\n" + + EnumChatFormatting.GREEN + nf.format(ZombieTracker.revViscera) + "\n" + EnumChatFormatting.BLUE + drop20 + "\n" + - EnumChatFormatting.DARK_GREEN + ZombieTracker.zombiePestilences + "\n" + - EnumChatFormatting.WHITE + ZombieTracker.zombieBooks + "\n" + - EnumChatFormatting.WHITE + ZombieTracker.zombieBooksT7 + "\n" + - EnumChatFormatting.AQUA + ZombieTracker.zombieUndeadCatas + "\n" + - EnumChatFormatting.DARK_PURPLE + ZombieTracker.zombieBeheadeds + "\n" + - EnumChatFormatting.RED + ZombieTracker.zombieRevCatas + "\n" + - EnumChatFormatting.DARK_GREEN + ZombieTracker.zombieSnakes + "\n" + - EnumChatFormatting.GOLD + ZombieTracker.zombieScythes + "\n" + - EnumChatFormatting.RED + ZombieTracker.zombieShards + "\n" + - EnumChatFormatting.RED + ZombieTracker.zombieWardenHearts + "\n" + + EnumChatFormatting.DARK_GREEN + ZombieTracker.pestilences + "\n" + + EnumChatFormatting.WHITE + ZombieTracker.books + "\n" + + EnumChatFormatting.WHITE + ZombieTracker.booksT7 + "\n" + + EnumChatFormatting.AQUA + ZombieTracker.undeadCatas + "\n" + + EnumChatFormatting.DARK_PURPLE + ZombieTracker.beheadeds + "\n" + + EnumChatFormatting.RED + ZombieTracker.revCatas + "\n" + + EnumChatFormatting.DARK_GREEN + ZombieTracker.snakes + "\n" + + EnumChatFormatting.GOLD + ZombieTracker.scythes + "\n" + + EnumChatFormatting.RED + ZombieTracker.shards + "\n" + + EnumChatFormatting.RED + ZombieTracker.wardenHearts + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; break; case "zombie_session": - if (ZombieTracker.zombieTimeSession == -1) { + if (ZombieTracker.timeSession == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(ZombieTracker.zombieTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(ZombieTracker.timeSession, timeNow); } - if (ZombieTracker.zombieBossesSession == -1) { + if (ZombieTracker.bossesSession == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(ZombieTracker.zombieBossesSession); + bossesBetween = nf.format(ZombieTracker.bossesSession); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(ZombieTracker.zombieFoulFleshSession); + drop20 = nf.format(ZombieTracker.foulFleshSession); } else { - drop20 = nf.format(ZombieTracker.zombieFoulFleshDropsSession) + " times"; + drop20 = nf.format(ZombieTracker.foulFleshDropsSession) + " times"; } dropsText = EnumChatFormatting.GOLD + "Revs Killed:\n" + @@ -279,38 +283,38 @@ public class LootDisplay { EnumChatFormatting.RED + "Warden Hearts:\n" + EnumChatFormatting.AQUA + "Time Since RNG:\n" + EnumChatFormatting.AQUA + "Bosses Since RNG:"; - countText = EnumChatFormatting.GOLD + nf.format(ZombieTracker.zombieRevsSession) + "\n" + - EnumChatFormatting.GREEN + nf.format(ZombieTracker.zombieRevFleshSession) + "\n" + - EnumChatFormatting.GREEN + nf.format(ZombieTracker.zombieRevVisceraSession) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(ZombieTracker.revsSession) + "\n" + + EnumChatFormatting.GREEN + nf.format(ZombieTracker.revFleshSession) + "\n" + + EnumChatFormatting.GREEN + nf.format(ZombieTracker.revVisceraSession) + "\n" + EnumChatFormatting.BLUE + drop20 + "\n" + - EnumChatFormatting.DARK_GREEN + ZombieTracker.zombiePestilencesSession + "\n" + - EnumChatFormatting.WHITE + ZombieTracker.zombieBooksSession + "\n" + - EnumChatFormatting.WHITE + ZombieTracker.zombieBooksT7Session + "\n" + - EnumChatFormatting.AQUA + ZombieTracker.zombieUndeadCatasSession + "\n" + - EnumChatFormatting.DARK_PURPLE + ZombieTracker.zombieBeheadedsSession + "\n" + - EnumChatFormatting.RED + ZombieTracker.zombieRevCatasSession + "\n" + - EnumChatFormatting.DARK_GREEN + ZombieTracker.zombieSnakesSession + "\n" + - EnumChatFormatting.GOLD + ZombieTracker.zombieScythes + "\n" + - EnumChatFormatting.RED + ZombieTracker.zombieShardsSession + "\n" + - EnumChatFormatting.RED + ZombieTracker.zombieWardenHeartsSession + "\n" + + EnumChatFormatting.DARK_GREEN + ZombieTracker.pestilencesSession + "\n" + + EnumChatFormatting.WHITE + ZombieTracker.booksSession + "\n" + + EnumChatFormatting.WHITE + ZombieTracker.booksT7Session + "\n" + + EnumChatFormatting.AQUA + ZombieTracker.undeadCatasSession + "\n" + + EnumChatFormatting.DARK_PURPLE + ZombieTracker.beheadedsSession + "\n" + + EnumChatFormatting.RED + ZombieTracker.revCatasSession + "\n" + + EnumChatFormatting.DARK_GREEN + ZombieTracker.snakesSession + "\n" + + EnumChatFormatting.GOLD + ZombieTracker.scythes + "\n" + + EnumChatFormatting.RED + ZombieTracker.shardsSession + "\n" + + EnumChatFormatting.RED + ZombieTracker.wardenHeartsSession + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; break; case "enderman": - if (EndermanTracker.endermanTime == -1) { + if (EndermanTracker.time == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(EndermanTracker.endermanTime, timeNow); + timeBetween = Utils.getTimeBetween(EndermanTracker.time, timeNow); } - if (EndermanTracker.endermanBosses == -1) { + if (EndermanTracker.bosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(EndermanTracker.endermanBosses); + bossesBetween = nf.format(EndermanTracker.bosses); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(EndermanTracker.endermanTAP); + drop20 = nf.format(EndermanTracker.TAP); } else { - drop20 = nf.format(EndermanTracker.endermanTAPDrops) + " times"; + drop20 = nf.format(EndermanTracker.TAPDrops) + " times"; } dropsText = EnumChatFormatting.GOLD + "Voidglooms Killed:\n" + @@ -321,6 +325,7 @@ public class LootDisplay { EnumChatFormatting.AQUA + "Mana Steal Books:\n" + EnumChatFormatting.BLUE + "Transmission Tuners:\n" + EnumChatFormatting.YELLOW + "Null Atoms:\n" + + EnumChatFormatting.YELLOW + "Hazmat Endermen:\n" + EnumChatFormatting.AQUA + "Espresso Machines:\n" + EnumChatFormatting.WHITE + "Smarty Pants Books:\n" + EnumChatFormatting.LIGHT_PURPLE + "End Runes:\n" + @@ -334,43 +339,44 @@ public class LootDisplay { EnumChatFormatting.RED + "Ender Slayer Books:\n" + EnumChatFormatting.AQUA + "Time Since RNG:\n" + EnumChatFormatting.AQUA + "Bosses Since RNG:"; - countText = EnumChatFormatting.GOLD + nf.format(EndermanTracker.endermanVoidglooms) + "\n" + - EnumChatFormatting.DARK_GRAY + nf.format(EndermanTracker.endermanNullSpheres) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(EndermanTracker.voidglooms) + "\n" + + EnumChatFormatting.DARK_GRAY + nf.format(EndermanTracker.nullSpheres) + "\n" + EnumChatFormatting.DARK_PURPLE + drop20 + "\n" + - EnumChatFormatting.LIGHT_PURPLE + EndermanTracker.endermanEndersnakes + "\n" + - EnumChatFormatting.DARK_GREEN + EndermanTracker.endermanSummoningEyes + "\n" + - EnumChatFormatting.AQUA + EndermanTracker.endermanManaBooks + "\n" + - EnumChatFormatting.BLUE + EndermanTracker.endermanTuners + "\n" + - EnumChatFormatting.YELLOW + EndermanTracker.endermanAtoms + "\n" + - EnumChatFormatting.AQUA + EndermanTracker.endermanEspressoMachines + "\n" + - EnumChatFormatting.WHITE + EndermanTracker.endermanSmartyBooks + "\n" + - EnumChatFormatting.LIGHT_PURPLE + EndermanTracker.endermanEndRunes + "\n" + - EnumChatFormatting.RED + EndermanTracker.endermanChalices + "\n" + - EnumChatFormatting.RED + EndermanTracker.endermanDice + "\n" + - EnumChatFormatting.DARK_PURPLE + EndermanTracker.endermanArtifacts + "\n" + - EnumChatFormatting.DARK_PURPLE + EndermanTracker.endermanSkins + "\n" + - EnumChatFormatting.GRAY + EndermanTracker.endermanEnchantRunes + "\n" + - EnumChatFormatting.GOLD + EndermanTracker.endermanMergers + "\n" + - EnumChatFormatting.GOLD + EndermanTracker.endermanCores + "\n" + - EnumChatFormatting.RED + EndermanTracker.endermanEnderBooks + "\n" + + EnumChatFormatting.LIGHT_PURPLE + EndermanTracker.endersnakes + "\n" + + EnumChatFormatting.DARK_GREEN + EndermanTracker.summoningEyes + "\n" + + EnumChatFormatting.AQUA + EndermanTracker.manaBooks + "\n" + + EnumChatFormatting.BLUE + EndermanTracker.tuners + "\n" + + EnumChatFormatting.YELLOW + EndermanTracker.atoms + "\n" + + EnumChatFormatting.YELLOW + EndermanTracker.hazmats + "\n" + + EnumChatFormatting.AQUA + EndermanTracker.espressoMachines + "\n" + + EnumChatFormatting.WHITE + EndermanTracker.smartyBooks + "\n" + + EnumChatFormatting.LIGHT_PURPLE + EndermanTracker.endRunes + "\n" + + EnumChatFormatting.RED + EndermanTracker.chalices + "\n" + + EnumChatFormatting.RED + EndermanTracker.dice + "\n" + + EnumChatFormatting.DARK_PURPLE + EndermanTracker.artifacts + "\n" + + EnumChatFormatting.DARK_PURPLE + EndermanTracker.skins + "\n" + + EnumChatFormatting.GRAY + EndermanTracker.enchantRunes + "\n" + + EnumChatFormatting.GOLD + EndermanTracker.mergers + "\n" + + EnumChatFormatting.GOLD + EndermanTracker.cores + "\n" + + EnumChatFormatting.RED + EndermanTracker.enderBooks + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; break; case "enderman_session": - if (EndermanTracker.endermanTimeSession == -1) { + if (EndermanTracker.timeSession == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(EndermanTracker.endermanTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(EndermanTracker.timeSession, timeNow); } - if (EndermanTracker.endermanBossesSession == -1) { + if (EndermanTracker.bossesSession == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(EndermanTracker.endermanBossesSession); + bossesBetween = nf.format(EndermanTracker.bossesSession); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(EndermanTracker.endermanTAPSession); + drop20 = nf.format(EndermanTracker.TAPSession); } else { - drop20 = nf.format(EndermanTracker.endermanTAPDropsSession) + " times"; + drop20 = nf.format(EndermanTracker.TAPDropsSession) + " times"; } dropsText = EnumChatFormatting.GOLD + "Voidglooms Killed:\n" + @@ -381,6 +387,7 @@ public class LootDisplay { EnumChatFormatting.AQUA + "Mana Steal Books:\n" + EnumChatFormatting.BLUE + "Transmission Tuners:\n" + EnumChatFormatting.YELLOW + "Null Atoms:\n" + + EnumChatFormatting.YELLOW + "Hazmat Endermen:\n" + EnumChatFormatting.AQUA + "Espresso Machines:\n" + EnumChatFormatting.WHITE + "Smarty Pants Books:\n" + EnumChatFormatting.LIGHT_PURPLE + "End Runes:\n" + @@ -394,25 +401,26 @@ public class LootDisplay { EnumChatFormatting.RED + "Ender Slayer Books:\n" + EnumChatFormatting.AQUA + "Time Since RNG:\n" + EnumChatFormatting.AQUA + "Bosses Since RNG:"; - countText = EnumChatFormatting.GOLD + nf.format(EndermanTracker.endermanVoidgloomsSession) + "\n" + - EnumChatFormatting.DARK_GRAY + nf.format(EndermanTracker.endermanNullSpheresSession) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(EndermanTracker.voidgloomsSession) + "\n" + + EnumChatFormatting.DARK_GRAY + nf.format(EndermanTracker.nullSpheresSession) + "\n" + EnumChatFormatting.DARK_PURPLE + drop20 + "\n" + - EnumChatFormatting.LIGHT_PURPLE + EndermanTracker.endermanEndersnakesSession + "\n" + - EnumChatFormatting.DARK_GREEN + EndermanTracker.endermanSummoningEyesSession + "\n" + - EnumChatFormatting.AQUA + EndermanTracker.endermanManaBooksSession + "\n" + - EnumChatFormatting.BLUE + EndermanTracker.endermanTunersSession + "\n" + - EnumChatFormatting.YELLOW + EndermanTracker.endermanAtomsSession + "\n" + - EnumChatFormatting.AQUA + EndermanTracker.endermanEspressoMachinesSession + "\n" + - EnumChatFormatting.WHITE + EndermanTracker.endermanSmartyBooksSession + "\n" + - EnumChatFormatting.LIGHT_PURPLE + EndermanTracker.endermanEndRunesSession + "\n" + - EnumChatFormatting.RED + EndermanTracker.endermanChalicesSession + "\n" + - EnumChatFormatting.RED + EndermanTracker.endermanDiceSession + "\n" + - EnumChatFormatting.DARK_PURPLE + EndermanTracker.endermanArtifactsSession + "\n" + - EnumChatFormatting.DARK_PURPLE + EndermanTracker.endermanSkinsSession + "\n" + - EnumChatFormatting.GRAY + EndermanTracker.endermanEnchantRunesSession + "\n" + - EnumChatFormatting.GOLD + EndermanTracker.endermanMergersSession + "\n" + - EnumChatFormatting.GOLD + EndermanTracker.endermanCoresSession + "\n" + - EnumChatFormatting.RED + EndermanTracker.endermanEnderBooksSession + "\n" + + EnumChatFormatting.LIGHT_PURPLE + EndermanTracker.endersnakesSession + "\n" + + EnumChatFormatting.DARK_GREEN + EndermanTracker.summoningEyesSession + "\n" + + EnumChatFormatting.AQUA + EndermanTracker.manaBooksSession + "\n" + + EnumChatFormatting.BLUE + EndermanTracker.tunersSession + "\n" + + EnumChatFormatting.YELLOW + EndermanTracker.atomsSession + "\n" + + EnumChatFormatting.YELLOW + EndermanTracker.hazmatsSession + "\n" + + EnumChatFormatting.AQUA + EndermanTracker.espressoMachinesSession + "\n" + + EnumChatFormatting.WHITE + EndermanTracker.smartyBooksSession + "\n" + + EnumChatFormatting.LIGHT_PURPLE + EndermanTracker.endRunesSession + "\n" + + EnumChatFormatting.RED + EndermanTracker.chalicesSession + "\n" + + EnumChatFormatting.RED + EndermanTracker.diceSession + "\n" + + EnumChatFormatting.DARK_PURPLE + EndermanTracker.artifactsSession + "\n" + + EnumChatFormatting.DARK_PURPLE + EndermanTracker.skinsSession + "\n" + + EnumChatFormatting.GRAY + EndermanTracker.enchantRunesSession + "\n" + + EnumChatFormatting.GOLD + EndermanTracker.mergersSession + "\n" + + EnumChatFormatting.GOLD + EndermanTracker.coresSession + "\n" + + EnumChatFormatting.RED + EndermanTracker.enderBooksSession + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; break; diff --git a/src/main/java/me/Danker/features/loot/LootTracker.java b/src/main/java/me/Danker/features/loot/LootTracker.java index d654109..7fa223d 100644 --- a/src/main/java/me/Danker/features/loot/LootTracker.java +++ b/src/main/java/me/Danker/features/loot/LootTracker.java @@ -39,21 +39,21 @@ public class LootTracker { // If no items, are detected, allow check again. Should fix items not being found if (itemTeeth + itemWebs + itemRev + itemNullSphere + itemDerelictAshe > 0) { itemsChecked = System.currentTimeMillis() / 1000; - WolfTracker.wolfTeeth += itemTeeth; - SpiderTracker.spiderWebs += itemWebs; - ZombieTracker.zombieRevFlesh += itemRev; - EndermanTracker.endermanNullSpheres += itemNullSphere; + WolfTracker.teeth += itemTeeth; + SpiderTracker.webs += itemWebs; + ZombieTracker.revFlesh += itemRev; + EndermanTracker.nullSpheres += itemNullSphere; BlazeTracker.derelictAshes += itemDerelictAshe; - WolfTracker.wolfTeethSession += itemTeeth; - SpiderTracker.spiderWebsSession += itemWebs; - ZombieTracker.zombieRevFleshSession += itemRev; - EndermanTracker.endermanNullSpheresSession += itemNullSphere; + WolfTracker.teethSession += itemTeeth; + SpiderTracker.websSession += itemWebs; + ZombieTracker.revFleshSession += itemRev; + EndermanTracker.nullSpheresSession += itemNullSphere; BlazeTracker.derelictAshesSession += itemDerelictAshe; - ConfigHandler.writeIntConfig("wolf", "teeth", WolfTracker.wolfTeeth); - ConfigHandler.writeIntConfig("spider", "web", SpiderTracker.spiderWebs); - ConfigHandler.writeIntConfig("zombie", "revFlesh", ZombieTracker.zombieRevFlesh); - ConfigHandler.writeIntConfig("enderman", "nullSpheres", EndermanTracker.endermanNullSpheres); + ConfigHandler.writeIntConfig("wolf", "teeth", WolfTracker.teeth); + ConfigHandler.writeIntConfig("spider", "web", SpiderTracker.webs); + ConfigHandler.writeIntConfig("zombie", "revFlesh", ZombieTracker.revFlesh); + ConfigHandler.writeIntConfig("enderman", "nullSpheres", EndermanTracker.nullSpheres); ConfigHandler.writeIntConfig("blaze", "derelictAshe", BlazeTracker.derelictAshes); } } diff --git a/src/main/java/me/Danker/features/loot/SpiderTracker.java b/src/main/java/me/Danker/features/loot/SpiderTracker.java index 34ee695..05a8e75 100644 --- a/src/main/java/me/Danker/features/loot/SpiderTracker.java +++ b/src/main/java/me/Danker/features/loot/SpiderTracker.java @@ -10,31 +10,31 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class SpiderTracker { - public static int spiderTarantulas; - public static int spiderWebs; - public static int spiderTAP; - public static int spiderTAPDrops; - public static int spiderBites; - public static int spiderCatalysts; - public static int spiderBooks; - public static int spiderSwatters; - public static int spiderTalismans; - public static int spiderMosquitos; - public static double spiderTime; - public static int spiderBosses; + public static int tarantulas; + public static int webs; + public static int TAP; + public static int TAPDrops; + public static int bites; + public static int catalysts; + public static int books; + public static int swatters; + public static int talismans; + public static int mosquitos; + public static double time; + public static int bosses; - public static int spiderTarantulasSession = 0; - public static int spiderWebsSession = 0; - public static int spiderTAPSession = 0; - public static int spiderTAPDropsSession = 0; - public static int spiderBitesSession = 0; - public static int spiderCatalystsSession = 0; - public static int spiderBooksSession = 0; - public static int spiderSwattersSession = 0; - public static int spiderTalismansSession = 0; - public static int spiderMosquitosSession = 0; - public static double spiderTimeSession = -1; - public static int spiderBossesSession = -1; + public static int tarantulasSession = 0; + public static int websSession = 0; + public static int TAPSession = 0; + public static int TAPDropsSession = 0; + public static int bitesSession = 0; + public static int catalystsSession = 0; + public static int booksSession = 0; + public static int swattersSession = 0; + public static int talismansSession = 0; + public static int mosquitosSession = 0; + public static double timeSession = -1; + public static int bossesSession = -1; @SubscribeEvent public void onChat(ClientChatReceivedEvent event) { @@ -47,62 +47,62 @@ public class SpiderTracker { boolean rng = false; if (message.contains(" Spider Slayer LVL ")) { // Spider - spiderTarantulas++; - spiderTarantulasSession++; - if (spiderBosses != -1) { - spiderBosses++; + tarantulas++; + tarantulasSession++; + if (bosses != -1) { + bosses++; } - if (spiderBossesSession != -1) { - spiderBossesSession++; + if (bossesSession != -1) { + bossesSession++; } - ConfigHandler.writeIntConfig("spider", "tarantulas", spiderTarantulas); - ConfigHandler.writeIntConfig("spider", "bossRNG", spiderBosses); + ConfigHandler.writeIntConfig("spider", "tarantulas", tarantulas); + ConfigHandler.writeIntConfig("spider", "bossRNG", bosses); } else if (message.contains("RARE DROP! (") && message.contains("Toxic Arrow Poison)")) { int amount = LootTracker.getAmountfromMessage(message); - spiderTAP += amount; - spiderTAPSession += amount; - spiderTAPDrops++; - spiderTAPDropsSession++; - ConfigHandler.writeIntConfig("spider", "tap", spiderTAP); - ConfigHandler.writeIntConfig("spider", "tapDrops", spiderTAPDrops); + TAP += amount; + TAPSession += amount; + TAPDrops++; + TAPDropsSession++; + ConfigHandler.writeIntConfig("spider", "tap", TAP); + ConfigHandler.writeIntConfig("spider", "tapDrops", TAPDrops); } else if (message.contains("VERY RARE DROP! (") && message.contains(" Bite Rune I)")) { - spiderBites++; - spiderBitesSession++; - ConfigHandler.writeIntConfig("spider", "bite", spiderBites); + bites++; + bitesSession++; + ConfigHandler.writeIntConfig("spider", "bite", bites); } else if (message.contains("VERY RARE DROP! (Bane of Arthropods VI)")) { - spiderBooks++; - spiderBooksSession++; - ConfigHandler.writeIntConfig("spider", "book", spiderBooks); + books++; + booksSession++; + ConfigHandler.writeIntConfig("spider", "book", books); } else if (message.contains("VERY RARE DROP! (Spider Catalyst)")) { - spiderCatalysts++; - spiderCatalystsSession++; - ConfigHandler.writeIntConfig("spider", "catalyst", spiderCatalysts); + catalysts++; + catalystsSession++; + ConfigHandler.writeIntConfig("spider", "catalyst", catalysts); } else if (message.contains("CRAZY RARE DROP! (Fly Swatter)")) { rng = true; - spiderSwatters++; - spiderSwattersSession++; - ConfigHandler.writeIntConfig("spider", "swatter", spiderSwatters); + swatters++; + swattersSession++; + ConfigHandler.writeIntConfig("spider", "swatter", swatters); if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.LIGHT_PURPLE + "FLY SWATTER!", 3); } else if (message.contains("CRAZY RARE DROP! (Tarantula Talisman")) { rng = true; - spiderTalismans++; - spiderTalismansSession++; - ConfigHandler.writeIntConfig("spider", "talisman", spiderTalismans); + talismans++; + talismansSession++; + ConfigHandler.writeIntConfig("spider", "talisman", talismans); if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "TARANTULA TALISMAN!", 3); } else if (message.contains("CRAZY RARE DROP! (Digested Mosquito)")) { rng = true; - spiderMosquitos++; - spiderMosquitosSession++; - ConfigHandler.writeIntConfig("spider", "mosquito", spiderMosquitos); + mosquitos++; + mosquitosSession++; + ConfigHandler.writeIntConfig("spider", "mosquito", mosquitos); if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GOLD + "DIGESTED MOSQUITO!", 5); } if (rng) { - spiderTime = System.currentTimeMillis() / 1000; - spiderBosses = 0; - spiderTimeSession = System.currentTimeMillis() / 1000; - spiderBossesSession = 0; - ConfigHandler.writeDoubleConfig("spider", "timeRNG", spiderTime); + time = System.currentTimeMillis() / 1000; + bosses = 0; + timeSession = System.currentTimeMillis() / 1000; + bossesSession = 0; + ConfigHandler.writeDoubleConfig("spider", "timeRNG", time); ConfigHandler.writeIntConfig("spider", "bossRNG", 0); } } diff --git a/src/main/java/me/Danker/features/loot/WolfTracker.java b/src/main/java/me/Danker/features/loot/WolfTracker.java index 449a3b4..906f507 100644 --- a/src/main/java/me/Danker/features/loot/WolfTracker.java +++ b/src/main/java/me/Danker/features/loot/WolfTracker.java @@ -10,31 +10,33 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class WolfTracker { - public static int wolfSvens; - public static int wolfTeeth; - public static int wolfWheels; - public static int wolfWheelsDrops; - public static int wolfSpirits; - public static int wolfBooks; - public static int wolfEggs; - public static int wolfCoutures; - public static int wolfBaits; - public static int wolfFluxes; - public static double wolfTime; - public static int wolfBosses; + public static int svens; + public static int teeth; + public static int wheels; + public static int wheelsDrops; + public static int spirits; + public static int books; + public static int furballs; + public static int eggs; + public static int coutures; + public static int baits; + public static int fluxes; + public static double time; + public static int bosses; - public static int wolfSvensSession = 0; - public static int wolfTeethSession = 0; - public static int wolfWheelsSession = 0; - public static int wolfWheelsDropsSession = 0; - public static int wolfSpiritsSession = 0; - public static int wolfBooksSession = 0; - public static int wolfEggsSession = 0; - public static int wolfCouturesSession = 0; - public static int wolfBaitsSession = 0; - public static int wolfFluxesSession = 0; - public static double wolfTimeSession = -1; - public static int wolfBossesSession = -1; + public static int svensSession = 0; + public static int teethSession = 0; + public static int wheelsSession = 0; + public static int wheelsDropsSession = 0; + public static int spiritsSession = 0; + public static int booksSession = 0; + public static int furballsSession = 0; + public static int eggsSession = 0; + public static int couturesSession = 0; + public static int baitsSession = 0; + public static int fluxesSession = 0; + public static double timeSession = -1; + public static int bossesSession = -1; @SubscribeEvent public void onChat(ClientChatReceivedEvent event) { @@ -47,64 +49,68 @@ public class WolfTracker { boolean rng = false; if (message.contains(" Wolf Slayer LVL ")) { - wolfSvens++; - wolfSvensSession++; - if (wolfBosses != -1) { - wolfBosses++; + svens++; + svensSession++; + if (bosses != -1) { + bosses++; } - if (wolfBossesSession != -1) { - wolfBossesSession++; + if (bossesSession != -1) { + bossesSession++; } - ConfigHandler.writeIntConfig("wolf", "svens", wolfSvens); - ConfigHandler.writeIntConfig("wolf", "bossRNG", wolfBosses); + ConfigHandler.writeIntConfig("wolf", "svens", svens); + ConfigHandler.writeIntConfig("wolf", "bossRNG", bosses); } else if (message.contains("RARE DROP! (") && message.contains("Hamster Wheel)")) { int amount = LootTracker.getAmountfromMessage(message); - wolfWheels += amount; - wolfWheelsSession += amount; - wolfWheelsDrops++; - wolfWheelsDropsSession++; - ConfigHandler.writeIntConfig("wolf", "wheel", wolfWheels); - ConfigHandler.writeIntConfig("wolf", "wheelDrops", wolfWheelsDrops); + wheels += amount; + wheelsSession += amount; + wheelsDrops++; + wheelsDropsSession++; + ConfigHandler.writeIntConfig("wolf", "wheel", wheels); + ConfigHandler.writeIntConfig("wolf", "wheelDrops", wheelsDrops); } else if (message.contains("VERY RARE DROP! (") && message.contains(" Spirit Rune I)")) { // Removing the unicode here *should* fix rune drops not counting - wolfSpirits++; - wolfSpiritsSession++; - ConfigHandler.writeIntConfig("wolf", "spirit", wolfSpirits); + spirits++; + spiritsSession++; + ConfigHandler.writeIntConfig("wolf", "spirit", spirits); } else if (message.contains("VERY RARE DROP! (Critical VI)")) { - wolfBooks++; - wolfBooksSession++; - ConfigHandler.writeIntConfig("wolf", "book", wolfBooks); + books++; + booksSession++; + ConfigHandler.writeIntConfig("wolf", "book", books); + } else if (message.contains("VERY RARE DROP! (Furball)")) { + furballs++; + furballsSession++; + ConfigHandler.writeIntConfig("wolf", "furball", furballs); } else if (message.contains("CRAZY RARE DROP! (Red Claw Egg)")) { rng = true; - wolfEggs++; - wolfEggsSession++; - ConfigHandler.writeIntConfig("wolf", "egg", wolfEggs); + eggs++; + eggsSession++; + ConfigHandler.writeIntConfig("wolf", "egg", eggs); if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_RED + "RED CLAW EGG!", 3); } else if (message.contains("CRAZY RARE DROP! (") && message.contains(" Couture Rune I)")) { rng = true; - wolfCoutures++; - wolfCouturesSession++; - ConfigHandler.writeIntConfig("wolf", "couture", wolfCoutures); + coutures++; + couturesSession++; + ConfigHandler.writeIntConfig("wolf", "couture", coutures); if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GOLD + "COUTURE RUNE!", 3); } else if (message.contains("CRAZY RARE DROP! (Grizzly Bait)") || message.contains("CRAZY RARE DROP! (Rename Me)")) { // How did Skyblock devs even manage to make this item Rename Me rng = true; - wolfBaits++; - wolfBaitsSession++; - ConfigHandler.writeIntConfig("wolf", "bait", wolfBaits); + baits++; + baitsSession++; + ConfigHandler.writeIntConfig("wolf", "bait", baits); if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.AQUA + "GRIZZLY BAIT!", 3); } else if (message.contains("CRAZY RARE DROP! (Overflux Capacitor)")) { rng = true; - wolfFluxes++; - wolfFluxesSession++; - ConfigHandler.writeIntConfig("wolf", "flux", wolfFluxes); + fluxes++; + fluxesSession++; + ConfigHandler.writeIntConfig("wolf", "flux", fluxes); if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "OVERFLUX CAPACITOR!", 5); } if (rng) { - wolfTime = System.currentTimeMillis() / 1000; - wolfBosses = 0; - wolfTimeSession = System.currentTimeMillis() / 1000; - wolfBossesSession = 0; - ConfigHandler.writeDoubleConfig("wolf", "timeRNG", wolfTime); + time = System.currentTimeMillis() / 1000; + bosses = 0; + timeSession = System.currentTimeMillis() / 1000; + bossesSession = 0; + ConfigHandler.writeDoubleConfig("wolf", "timeRNG", time); ConfigHandler.writeIntConfig("wolf", "bossRNG", 0); } } diff --git a/src/main/java/me/Danker/features/loot/ZombieTracker.java b/src/main/java/me/Danker/features/loot/ZombieTracker.java index 1d71222..922e1f4 100644 --- a/src/main/java/me/Danker/features/loot/ZombieTracker.java +++ b/src/main/java/me/Danker/features/loot/ZombieTracker.java @@ -10,41 +10,41 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class ZombieTracker { - public static int zombieRevs; - public static int zombieRevFlesh; - public static int zombieRevViscera; - public static int zombieFoulFlesh; - public static int zombieFoulFleshDrops; - public static int zombiePestilences; - public static int zombieUndeadCatas; - public static int zombieBooks; - public static int zombieBooksT7; - public static int zombieBeheadeds; - public static int zombieRevCatas; - public static int zombieSnakes; - public static int zombieScythes; - public static int zombieShards; - public static int zombieWardenHearts; - public static double zombieTime; - public static int zombieBosses; + public static int revs; + public static int revFlesh; + public static int revViscera; + public static int foulFlesh; + public static int foulFleshDrops; + public static int pestilences; + public static int undeadCatas; + public static int books; + public static int booksT7; + public static int beheadeds; + public static int revCatas; + public static int snakes; + public static int scythes; + public static int shards; + public static int wardenHearts; + public static double time; + public static int bosses; - public static int zombieRevsSession = 0; - public static int zombieRevFleshSession = 0; - public static int zombieRevVisceraSession = 0; - public static int zombieFoulFleshSession = 0; - public static int zombieFoulFleshDropsSession = 0; - public static int zombiePestilencesSession = 0; - public static int zombieUndeadCatasSession = 0; - public static int zombieBooksSession = 0; - public static int zombieBooksT7Session = 0; - public static int zombieBeheadedsSession = 0; - public static int zombieRevCatasSession = 0; - public static int zombieSnakesSession = 0; - public static int zombieScythesSession = 0; - public static int zombieShardsSession = 0; - public static int zombieWardenHeartsSession = 0; - public static double zombieTimeSession = -1; - public static int zombieBossesSession = -1; + public static int revsSession = 0; + public static int revFleshSession = 0; + public static int revVisceraSession = 0; + public static int foulFleshSession = 0; + public static int foulFleshDropsSession = 0; + public static int pestilencesSession = 0; + public static int undeadCatasSession = 0; + public static int booksSession = 0; + public static int booksT7Session = 0; + public static int beheadedsSession = 0; + public static int revCatasSession = 0; + public static int snakesSession = 0; + public static int scythesSession = 0; + public static int shardsSession = 0; + public static int wardenHeartsSession = 0; + public static double timeSession = -1; + public static int bossesSession = -1; @SubscribeEvent public void onChat(ClientChatReceivedEvent event) { @@ -57,87 +57,87 @@ public class ZombieTracker { boolean rng = false; if (message.contains(" Zombie Slayer LVL ")) { // Zombie - zombieRevs++; - zombieRevsSession++; - if (zombieBosses != -1) { - zombieBosses++; + revs++; + revsSession++; + if (bosses != -1) { + bosses++; } - if (zombieBossesSession != 1) { - zombieBossesSession++; + if (bossesSession != 1) { + bossesSession++; } - ConfigHandler.writeIntConfig("zombie", "revs", zombieRevs); - ConfigHandler.writeIntConfig("zombie", "bossRNG", zombieBosses); + ConfigHandler.writeIntConfig("zombie", "revs", revs); + ConfigHandler.writeIntConfig("zombie", "bossRNG", bosses); } else if (message.contains("RARE DROP! (") && message.contains("Revenant Viscera)")) { int amount = LootTracker.getAmountfromMessage(message); - zombieRevViscera += amount; - zombieRevVisceraSession += amount; - ConfigHandler.writeIntConfig("zombie", "revViscera", zombieRevViscera); + revViscera += amount; + revVisceraSession += amount; + ConfigHandler.writeIntConfig("zombie", "revViscera", revViscera); } else if (message.contains("RARE DROP! (") && message.contains("Foul Flesh)")) { int amount = LootTracker.getAmountfromMessage(message); - zombieFoulFlesh += amount; - zombieFoulFleshSession += amount; - zombieFoulFleshDrops++; - zombieFoulFleshDropsSession++; - ConfigHandler.writeIntConfig("zombie", "foulFlesh", zombieFoulFlesh); - ConfigHandler.writeIntConfig("zombie", "foulFleshDrops", zombieFoulFleshDrops); + foulFlesh += amount; + foulFleshSession += amount; + foulFleshDrops++; + foulFleshDropsSession++; + ConfigHandler.writeIntConfig("zombie", "foulFlesh", foulFlesh); + ConfigHandler.writeIntConfig("zombie", "foulFleshDrops", foulFleshDrops); } else if (message.contains("VERY RARE DROP! (Revenant Catalyst)")) { - zombieRevCatas++; - zombieRevCatasSession++; - ConfigHandler.writeIntConfig("zombie", "revCatalyst", zombieRevCatas); + revCatas++; + revCatasSession++; + ConfigHandler.writeIntConfig("zombie", "revCatalyst", revCatas); } else if (message.contains("VERY RARE DROP! (") && message.contains(" Pestilence Rune I)")) { - zombiePestilences++; - zombiePestilencesSession++; - ConfigHandler.writeIntConfig("zombie", "pestilence", zombiePestilences); + pestilences++; + pestilencesSession++; + ConfigHandler.writeIntConfig("zombie", "pestilence", pestilences); } else if (message.contains("VERY RARE DROP! (Smite VI)")) { - zombieBooks++; - zombieBooksSession++; - ConfigHandler.writeIntConfig("zombie", "book", zombieBooks); + books++; + booksSession++; + ConfigHandler.writeIntConfig("zombie", "book", books); } else if (message.contains("VERY RARE DROP! (Smite VII)")) { - zombieBooksT7++; - zombieBooksT7Session++; - ConfigHandler.writeIntConfig("zombie", "bookT7", zombieBooksT7); + booksT7++; + booksT7Session++; + ConfigHandler.writeIntConfig("zombie", "bookT7", booksT7); } else if (message.contains("VERY RARE DROP! (Undead Catalyst)")) { - zombieUndeadCatas++; - zombieUndeadCatasSession++; - ConfigHandler.writeIntConfig("zombie", "undeadCatalyst", zombieUndeadCatas); + undeadCatas++; + undeadCatasSession++; + ConfigHandler.writeIntConfig("zombie", "undeadCatalyst", undeadCatas); } else if (message.contains("CRAZY RARE DROP! (Beheaded Horror)")) { rng = true; - zombieBeheadeds++; - zombieBeheadedsSession++; - ConfigHandler.writeIntConfig("zombie", "beheaded", zombieBeheadeds); + beheadeds++; + beheadedsSession++; + ConfigHandler.writeIntConfig("zombie", "beheaded", beheadeds); if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "BEHEADED HORROR!", 3); } else if (message.contains("CRAZY RARE DROP! (") && message.contains(" Snake Rune I)")) { rng = true; - zombieSnakes++; - zombieSnakesSession++; - ConfigHandler.writeIntConfig("zombie", "snake", zombieSnakes); + snakes++; + snakesSession++; + ConfigHandler.writeIntConfig("zombie", "snake", snakes); if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_GREEN + "SNAKE RUNE!", 3); } else if (message.contains("CRAZY RARE DROP! (Scythe Blade)")) { rng = true; - zombieScythes++; - zombieScythesSession++; - ConfigHandler.writeIntConfig("zombie", "scythe", zombieScythes); + scythes++; + scythesSession++; + ConfigHandler.writeIntConfig("zombie", "scythe", scythes); if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GOLD + "SCYTHE BLADE!", 5); } else if (message.contains("CRAZY RARE DROP! (Shard of the Shredded)")) { rng = true; - zombieShards++; - zombieShardsSession++; - ConfigHandler.writeIntConfig("zombie", "shard", zombieShards); + shards++; + shardsSession++; + ConfigHandler.writeIntConfig("zombie", "shard", shards); if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.RED + "SHARD OF THE SHREDDED!", 5); } else if (message.contains("INSANE DROP! (Warden Heart)") || message.contains("CRAZY RARE DROP! (Warden Heart)")) { rng = true; - zombieWardenHearts++; - zombieWardenHeartsSession++; - ConfigHandler.writeIntConfig("zombie", "heart", zombieWardenHearts); + wardenHearts++; + wardenHeartsSession++; + ConfigHandler.writeIntConfig("zombie", "heart", wardenHearts); if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.RED + "WARDEN HEART!", 5); } if (rng) { - zombieTime = System.currentTimeMillis() / 1000; - zombieBosses = 0; - zombieTimeSession = System.currentTimeMillis() / 1000; - zombieBossesSession = 0; - ConfigHandler.writeDoubleConfig("zombie", "timeRNG", zombieTime); + time = System.currentTimeMillis() / 1000; + bosses = 0; + timeSession = System.currentTimeMillis() / 1000; + bossesSession = 0; + ConfigHandler.writeDoubleConfig("zombie", "timeRNG", time); ConfigHandler.writeIntConfig("zombie", "bossRNG", 0); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index bf20d3c..fd3d391 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -321,71 +321,73 @@ public class ConfigHandler { } // Wolf - WolfTracker.wolfSvens = initInt("wolf", "svens", 0); - WolfTracker.wolfTeeth = initInt("wolf", "teeth", 0); - WolfTracker.wolfWheels = initInt("wolf", "wheel", 0); - WolfTracker.wolfWheelsDrops = initInt("wolf", "wheelDrops", 0); - WolfTracker.wolfSpirits = initInt("wolf", "spirit", 0); - WolfTracker.wolfBooks = initInt("wolf", "book", 0); - WolfTracker.wolfEggs = initInt("wolf", "egg", 0); - WolfTracker.wolfCoutures = initInt("wolf", "couture", 0); - WolfTracker.wolfBaits = initInt("wolf", "bait", 0); - WolfTracker.wolfFluxes = initInt("wolf", "flux", 0); - WolfTracker.wolfTime = initDouble("wolf", "timeRNG", -1); - WolfTracker.wolfBosses = initInt("wolf", "bossRNG", -1); + WolfTracker.svens = initInt("wolf", "svens", 0); + WolfTracker.teeth = initInt("wolf", "teeth", 0); + WolfTracker.wheels = initInt("wolf", "wheel", 0); + WolfTracker.wheelsDrops = initInt("wolf", "wheelDrops", 0); + WolfTracker.spirits = initInt("wolf", "spirit", 0); + WolfTracker.books = initInt("wolf", "book", 0); + WolfTracker.furballs = initInt("wolf", "furball", 0); + WolfTracker.eggs = initInt("wolf", "egg", 0); + WolfTracker.coutures = initInt("wolf", "couture", 0); + WolfTracker.baits = initInt("wolf", "bait", 0); + WolfTracker.fluxes = initInt("wolf", "flux", 0); + WolfTracker.time = initDouble("wolf", "timeRNG", -1); + WolfTracker.bosses = initInt("wolf", "bossRNG", -1); // Spider - SpiderTracker.spiderTarantulas = initInt("spider", "tarantulas", 0); - SpiderTracker.spiderWebs = initInt("spider", "web", 0); - SpiderTracker.spiderTAP = initInt("spider", "tap", 0); - SpiderTracker.spiderTAPDrops = initInt("spider", "tapDrops", 0); - SpiderTracker.spiderBites = initInt("spider", "bite", 0); - SpiderTracker.spiderCatalysts = initInt("spider", "catalyst", 0); - SpiderTracker.spiderBooks = initInt("spider", "book", 0); - SpiderTracker.spiderSwatters = initInt("spider", "swatter", 0); - SpiderTracker.spiderTalismans = initInt("spider", "talisman", 0); - SpiderTracker.spiderMosquitos = initInt("spider", "mosquito", 0); - SpiderTracker.spiderTime = initDouble("spider", "timeRNG", -1); - SpiderTracker.spiderBosses = initInt("spider", "bossRNG", -1); + SpiderTracker.tarantulas = initInt("spider", "tarantulas", 0); + SpiderTracker.webs = initInt("spider", "web", 0); + SpiderTracker.TAP = initInt("spider", "tap", 0); + SpiderTracker.TAPDrops = initInt("spider", "tapDrops", 0); + SpiderTracker.bites = initInt("spider", "bite", 0); + SpiderTracker.catalysts = initInt("spider", "catalyst", 0); + SpiderTracker.books = initInt("spider", "book", 0); + SpiderTracker.swatters = initInt("spider", "swatter", 0); + SpiderTracker.talismans = initInt("spider", "talisman", 0); + SpiderTracker.mosquitos = initInt("spider", "mosquito", 0); + SpiderTracker.time = initDouble("spider", "timeRNG", -1); + SpiderTracker.bosses = initInt("spider", "bossRNG", -1); // Zombie - ZombieTracker.zombieRevs = initInt("zombie", "revs", 0); - ZombieTracker.zombieRevFlesh = initInt("zombie", "revFlesh", 0); - ZombieTracker.zombieRevViscera = initInt("zombie", "revViscera", 0); - ZombieTracker.zombieFoulFlesh = initInt("zombie", "foulFlesh", 0); - ZombieTracker.zombieFoulFleshDrops = initInt("zombie", "foulFleshDrops", 0); - ZombieTracker.zombiePestilences = initInt("zombie", "pestilence", 0); - ZombieTracker.zombieUndeadCatas = initInt("zombie", "undeadCatalyst", 0); - ZombieTracker.zombieBooks = initInt("zombie", "book", 0); - ZombieTracker.zombieBeheadeds = initInt("zombie", "beheaded", 0); - ZombieTracker.zombieRevCatas = initInt("zombie", "revCatalyst", 0); - ZombieTracker.zombieSnakes = initInt("zombie", "snake", 0); - ZombieTracker.zombieScythes = initInt("zombie", "scythe", 0); - ZombieTracker.zombieShards = initInt("zombie", "shard", 0); - ZombieTracker.zombieWardenHearts = initInt("zombie", "heart", 0); - ZombieTracker.zombieTime = initDouble("zombie", "timeRNG", -1); - ZombieTracker.zombieBosses = initInt("zombie", "bossRNG", -1); + ZombieTracker.revs = initInt("zombie", "revs", 0); + ZombieTracker.revFlesh = initInt("zombie", "revFlesh", 0); + ZombieTracker.revViscera = initInt("zombie", "revViscera", 0); + ZombieTracker.foulFlesh = initInt("zombie", "foulFlesh", 0); + ZombieTracker.foulFleshDrops = initInt("zombie", "foulFleshDrops", 0); + ZombieTracker.pestilences = initInt("zombie", "pestilence", 0); + ZombieTracker.undeadCatas = initInt("zombie", "undeadCatalyst", 0); + ZombieTracker.books = initInt("zombie", "book", 0); + ZombieTracker.beheadeds = initInt("zombie", "beheaded", 0); + ZombieTracker.revCatas = initInt("zombie", "revCatalyst", 0); + ZombieTracker.snakes = initInt("zombie", "snake", 0); + ZombieTracker.scythes = initInt("zombie", "scythe", 0); + ZombieTracker.shards = initInt("zombie", "shard", 0); + ZombieTracker.wardenHearts = initInt("zombie", "heart", 0); + ZombieTracker.time = initDouble("zombie", "timeRNG", -1); + ZombieTracker.bosses = initInt("zombie", "bossRNG", -1); // Enderman - EndermanTracker.endermanVoidglooms = initInt("enderman", "voidglooms", 0); - EndermanTracker.endermanNullSpheres = initInt("enderman", "nullSpheres", 0); - EndermanTracker.endermanTAP = initInt("enderman", "tap", 0); - EndermanTracker.endermanTAPDrops = initInt("enderman", "tapDrops", 0); - EndermanTracker.endermanEndersnakes = initInt("enderman", "endersnakes", 0); - EndermanTracker.endermanSummoningEyes = initInt("enderman", "summoningEyes", 0); - EndermanTracker.endermanManaBooks = initInt("enderman", "manaBooks", 0); - EndermanTracker.endermanTuners = initInt("enderman", "tuners", 0); - EndermanTracker.endermanAtoms = initInt("enderman", "atoms", 0); - EndermanTracker.endermanEspressoMachines = initInt("enderman", "espressoMachines", 0); - EndermanTracker.endermanSmartyBooks = initInt("enderman", "smartyBooks", 0); - EndermanTracker.endermanEndRunes = initInt("enderman", "endRunes", 0); - EndermanTracker.endermanChalices = initInt("enderman", "chalices", 0); - EndermanTracker.endermanDice = initInt("enderman", "dice", 0); - EndermanTracker.endermanArtifacts = initInt("enderman", "artifacts", 0); - EndermanTracker.endermanSkins = initInt("enderman", "skins", 0); - EndermanTracker.endermanMergers = initInt("enderman", "mergers", 0); - EndermanTracker.endermanCores = initInt("enderman", "cores", 0); - EndermanTracker.endermanEnchantRunes = initInt("enderman", "enchantRunes", 0); - EndermanTracker.endermanEnderBooks = initInt("enderman", "enderBooks", 0); - EndermanTracker.endermanTime = initDouble("enderman", "timeRNG", -1); - EndermanTracker.endermanBosses = initInt("enderman", "bossRNG", -1); + EndermanTracker.voidglooms = initInt("enderman", "voidglooms", 0); + EndermanTracker.nullSpheres = initInt("enderman", "nullSpheres", 0); + EndermanTracker.TAP = initInt("enderman", "tap", 0); + EndermanTracker.TAPDrops = initInt("enderman", "tapDrops", 0); + EndermanTracker.endersnakes = initInt("enderman", "endersnakes", 0); + EndermanTracker.summoningEyes = initInt("enderman", "summoningEyes", 0); + EndermanTracker.manaBooks = initInt("enderman", "manaBooks", 0); + EndermanTracker.tuners = initInt("enderman", "tuners", 0); + EndermanTracker.atoms = initInt("enderman", "atoms", 0); + EndermanTracker.hazmats = initInt("enderman", "hazmats", 0); + EndermanTracker.espressoMachines = initInt("enderman", "espressoMachines", 0); + EndermanTracker.smartyBooks = initInt("enderman", "smartyBooks", 0); + EndermanTracker.endRunes = initInt("enderman", "endRunes", 0); + EndermanTracker.chalices = initInt("enderman", "chalices", 0); + EndermanTracker.dice = initInt("enderman", "dice", 0); + EndermanTracker.artifacts = initInt("enderman", "artifacts", 0); + EndermanTracker.skins = initInt("enderman", "skins", 0); + EndermanTracker.mergers = initInt("enderman", "mergers", 0); + EndermanTracker.cores = initInt("enderman", "cores", 0); + EndermanTracker.enchantRunes = initInt("enderman", "enchantRunes", 0); + EndermanTracker.enderBooks = initInt("enderman", "enderBooks", 0); + EndermanTracker.time = initDouble("enderman", "timeRNG", -1); + EndermanTracker.bosses = initInt("enderman", "bossRNG", -1); // Blaze BlazeTracker.demonlords = initInt("blaze", "demonlords", 0); BlazeTracker.derelictAshes = initInt("blaze", "derelictAshes", 0); -- cgit From a8ce0e5ef0ef4727b45b945c32d4d5e28cb5adbb Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 28 Apr 2022 03:27:42 -0400 Subject: Add plhlegblasts to lava fishing tracker --- src/main/java/me/Danker/commands/ImportFishingCommand.java | 2 ++ src/main/java/me/Danker/commands/LootCommand.java | 2 ++ src/main/java/me/Danker/commands/ResetLootCommand.java | 1 + src/main/java/me/Danker/features/loot/FishingTracker.java | 7 +++++++ src/main/java/me/Danker/features/loot/LootDisplay.java | 4 ++++ src/main/java/me/Danker/handlers/ConfigHandler.java | 1 + 6 files changed, 17 insertions(+) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/ImportFishingCommand.java b/src/main/java/me/Danker/commands/ImportFishingCommand.java index 16fecf5..46d9906 100644 --- a/src/main/java/me/Danker/commands/ImportFishingCommand.java +++ b/src/main/java/me/Danker/commands/ImportFishingCommand.java @@ -112,6 +112,7 @@ public class ImportFishingCommand extends CommandBase { FishingTracker.lavaBlazes = getSCFromApi(statsObject, "kills_lava_blaze"); FishingTracker.lavaPigmen = getSCFromApi(statsObject, "kills_lava_pigman"); FishingTracker.zombieMiners = getSCFromApi(statsObject, "kills_zombie_miner"); + FishingTracker.plhlegblasts = getSCFromApi(statsObject, "kills_plhlegblast"); FishingTracker.magmaSlugs = getSCFromApi(statsObject, "kills_magma_slug"); FishingTracker.moogmas = getSCFromApi(statsObject, "kills_moogma"); FishingTracker.lavaLeeches = getSCFromApi(statsObject, "kills_lava_leech"); @@ -160,6 +161,7 @@ public class ImportFishingCommand extends CommandBase { ConfigHandler.writeIntConfig("fishing", "lavaBlaze", FishingTracker.lavaBlazes); ConfigHandler.writeIntConfig("fishing", "lavaPigman", FishingTracker.lavaPigmen); ConfigHandler.writeIntConfig("fishing", "zombieMiner", FishingTracker.zombieMiners); + ConfigHandler.writeIntConfig("fishing", "plhlegblast", FishingTracker.plhlegblasts); ConfigHandler.writeIntConfig("fishing", "magmaSlug", FishingTracker.magmaSlugs); ConfigHandler.writeIntConfig("fishing", "moogma", FishingTracker.moogmas); ConfigHandler.writeIntConfig("fishing", "lavaLeech", FishingTracker.lavaLeeches); diff --git a/src/main/java/me/Danker/commands/LootCommand.java b/src/main/java/me/Danker/commands/LootCommand.java index 0d86668..af5479e 100644 --- a/src/main/java/me/Danker/commands/LootCommand.java +++ b/src/main/java/me/Danker/commands/LootCommand.java @@ -578,6 +578,7 @@ public class LootCommand extends CommandBase { player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Lava Fishing Summary (Current Session):\n" + + EnumChatFormatting.BLUE + " Plhlegblasts: " + nf.format(FishingTracker.plhlegblastsSession) + "\n" + EnumChatFormatting.DARK_RED + " Magma Slugs: " + nf.format(FishingTracker.magmaSlugsSession) + "\n" + EnumChatFormatting.RED + " Moogmas: " + nf.format(FishingTracker.moogmasSession) + "\n" + EnumChatFormatting.RED + " Lava Leeches: " + nf.format(FishingTracker.lavaLeechesSession) + "\n" + @@ -606,6 +607,7 @@ public class LootCommand extends CommandBase { player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + " Lava Fishing Summary:\n" + + EnumChatFormatting.BLUE + " Plhlegblasts: " + nf.format(FishingTracker.plhlegblasts) + "\n" + EnumChatFormatting.DARK_RED + " Magma Slugs: " + nf.format(FishingTracker.magmaSlugs) + "\n" + EnumChatFormatting.RED + " Moogmas: " + nf.format(FishingTracker.moogmas) + "\n" + EnumChatFormatting.RED + " Lava Leeches: " + nf.format(FishingTracker.lavaLeeches) + "\n" + diff --git a/src/main/java/me/Danker/commands/ResetLootCommand.java b/src/main/java/me/Danker/commands/ResetLootCommand.java index 48cdb26..9256394 100644 --- a/src/main/java/me/Danker/commands/ResetLootCommand.java +++ b/src/main/java/me/Danker/commands/ResetLootCommand.java @@ -279,6 +279,7 @@ public class ResetLootCommand extends CommandBase { FishingTracker.lavaBlazesSession = 0; FishingTracker.lavaPigmenSession = 0; FishingTracker.zombieMinersSession = 0; + FishingTracker.plhlegblastsSession = 0; FishingTracker.magmaSlugsSession = 0; FishingTracker.moogmasSession = 0; FishingTracker.lavaLeechesSession = 0; diff --git a/src/main/java/me/Danker/features/loot/FishingTracker.java b/src/main/java/me/Danker/features/loot/FishingTracker.java index bb7daba..f8adfa2 100644 --- a/src/main/java/me/Danker/features/loot/FishingTracker.java +++ b/src/main/java/me/Danker/features/loot/FishingTracker.java @@ -55,6 +55,7 @@ public class FishingTracker { public static int lavaPigmen; public static int zombieMiners; // Lava fishing + public static int plhlegblasts; public static int magmaSlugs; public static int moogmas; public static int lavaLeeches; @@ -114,6 +115,7 @@ public class FishingTracker { public static int lavaPigmenSession = 0; public static int zombieMinersSession = 0; // Lava fishing + public static int plhlegblastsSession = 0; public static int magmaSlugsSession = 0; public static int moogmasSession = 0; public static int lavaLeechesSession = 0; @@ -320,6 +322,11 @@ public class FishingTracker { zombieMinersSession++; ConfigHandler.writeIntConfig("fishing", "zombieMiner", zombieMiners); increaseSeaCreatures(); + } else if (message.contains("WOAH! A Plhlegblast appeared")) { + plhlegblasts++; + plhlegblastsSession++; + ConfigHandler.writeIntConfig("fishing", "plhlegblast", plhlegblasts); + increaseSeaCreatures(); } else if (message.contains("From beneath the lava appears a Magma Slug")) { magmaSlugs++; magmaSlugsSession++; diff --git a/src/main/java/me/Danker/features/loot/LootDisplay.java b/src/main/java/me/Danker/features/loot/LootDisplay.java index f2f86b0..7832362 100644 --- a/src/main/java/me/Danker/features/loot/LootDisplay.java +++ b/src/main/java/me/Danker/features/loot/LootDisplay.java @@ -872,6 +872,7 @@ public class LootDisplay { EnumChatFormatting.AQUA + "Fishing Milestone:\n" + EnumChatFormatting.GOLD + "Good Catches:\n" + EnumChatFormatting.DARK_PURPLE + "Great Catches:\n" + + EnumChatFormatting.BLUE + "Plhlegblasts:\n" + EnumChatFormatting.DARK_RED + "Magma Slugs:\n" + EnumChatFormatting.RED + "Moogmas:\n" + EnumChatFormatting.RED + "Lava Leeches:\n" + @@ -887,6 +888,7 @@ public class LootDisplay { EnumChatFormatting.AQUA + nf.format(FishingTracker.fishingMilestone) + "\n" + EnumChatFormatting.GOLD + nf.format(FishingTracker.goodCatches) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.greatCatches) + "\n" + + EnumChatFormatting.BLUE + nf.format(FishingTracker.plhlegblasts) + "\n" + EnumChatFormatting.DARK_RED + nf.format(FishingTracker.magmaSlugs) + "\n" + EnumChatFormatting.RED + nf.format(FishingTracker.moogmas) + "\n" + EnumChatFormatting.RED + nf.format(FishingTracker.lavaLeeches) + "\n" + @@ -915,6 +917,7 @@ public class LootDisplay { EnumChatFormatting.AQUA + "Fishing Milestone:\n" + EnumChatFormatting.GOLD + "Good Catches:\n" + EnumChatFormatting.DARK_PURPLE + "Great Catches:\n" + + EnumChatFormatting.BLUE + "Plhlegblasts:\n" + EnumChatFormatting.DARK_RED + "Magma Slugs:\n" + EnumChatFormatting.RED + "Moogmas:\n" + EnumChatFormatting.RED + "Lava Leeches:\n" + @@ -930,6 +933,7 @@ public class LootDisplay { EnumChatFormatting.AQUA + nf.format(FishingTracker.fishingMilestoneSession) + "\n" + EnumChatFormatting.GOLD + nf.format(FishingTracker.goodCatchesSession) + "\n" + EnumChatFormatting.DARK_PURPLE + nf.format(FishingTracker.greatCatchesSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(FishingTracker.plhlegblastsSession) + "\n" + EnumChatFormatting.DARK_RED + nf.format(FishingTracker.magmaSlugsSession) + "\n" + EnumChatFormatting.RED + nf.format(FishingTracker.moogmasSession) + "\n" + EnumChatFormatting.RED + nf.format(FishingTracker.lavaLeechesSession) + "\n" + diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index fd3d391..a35a2d4 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -461,6 +461,7 @@ public class ConfigHandler { FishingTracker.lavaPigmen = initInt("fishing", "lavaPigman", 0); FishingTracker.zombieMiners = initInt("fishing", "zombieMiner", 0); // Lava Fishing + FishingTracker.plhlegblasts = initInt("fishing", "plhlegblast", 0); FishingTracker.magmaSlugs = initInt("fishing", "magmaSlug", 0); FishingTracker.moogmas = initInt("fishing", "moogma", 0); FishingTracker.lavaLeeches = initInt("fishing", "lavaLeech", 0); -- cgit From 5586d4588c8d106a3b080bb45ba74b3c81113162 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 28 Apr 2022 20:24:38 -0400 Subject: Add F7 phases to custom music --- README.md | 6 +- .../me/Danker/commands/CustomMusicCommand.java | 26 +++- src/main/java/me/Danker/features/CustomMusic.java | 132 +++++++++++++-------- .../java/me/Danker/handlers/ConfigHandler.java | 4 + 4 files changed, 116 insertions(+), 52 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 55fb29f..723ab66 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ Discord Server: https://discord.gg/QsEkNQS - /reparty - Disbands and reparties all members in the party - /fairysouls - Check the fairysouls of a player - /lobbybank - Uses API to find the average bank total of the lobby, as well the three players with the highest total money in the bank (and purse). -- /dsmmusic [dungeonboss/bloodroom/dungeon/hub/island/dungeonhub/farmingislands/goldmine/deepcaverns/dwarvenmines/crystalhollows/spidersden/crimsonisle/end/park] [1-100] - Stops, reloads or changes the volume of custom music. +- /dsmmusic [dungeonboss/bloodroom/dungeon/p2/p3/p4/p5/hub/island/dungeonhub/farmingislands/goldmine/deepcaverns/dwarvenmines/crystalhollows/spidersden/crimsonisle/end/park] [1-100] - Stops, reloads or changes the volume of custom music. - /player [player] - Uses API to find skills, slayers, coins and weight of a player. - /reloadconfig - Reloads Danker's Skyblock Mod config. - /reloaddsmrepo - Reloads Danker's Skyblock Mod repository. @@ -112,6 +112,10 @@ Discord Server: https://discord.gg/QsEkNQS - Blood room: `bloodroom.wav` - Dungeon boss: `dungeonboss.wav` - Dungeon hub: `dungeonhub.wav` + - F7 Phase 2 (Storm): `phasetwo.wav` + - F7 Phase 3 (Goldor): `phasethree.wav` + - F7 Phase 4 (Necron): `phasefour.wav` + - F7 Phase 5 (Wither King): `phasefive.wav` - Hub: `hub.wav` - Private Island: `island.wav` - Farming Islands: `farmingislands.wav` diff --git a/src/main/java/me/Danker/commands/CustomMusicCommand.java b/src/main/java/me/Danker/commands/CustomMusicCommand.java index f0634fc..621a6f0 100644 --- a/src/main/java/me/Danker/commands/CustomMusicCommand.java +++ b/src/main/java/me/Danker/commands/CustomMusicCommand.java @@ -21,7 +21,7 @@ public class CustomMusicCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " [dungeonboss/bloodroom/dungeon/hub/island/dungeonhub/farmingislands/" + + return "/" + getCommandName() + " [dungeonboss/bloodroom/dungeon/p2/p3/p4/p5/hub/island/dungeonhub/farmingislands/" + "goldmine/deepcaverns/dwarvenmines/crystalhollows/spidersden/crimsonisle/end/park] [1-100]"; } @@ -90,6 +90,30 @@ public class CustomMusicCommand extends CommandBase { CustomMusic.dungeonVolume = volume; ConfigHandler.writeIntConfig("music", "DungeonVolume", volume); break; + case "p2": + if (!CustomMusic.phase2.setVolume(volume)) return; + + CustomMusic.phase2Volume = volume; + ConfigHandler.writeIntConfig("music", "Phase2Volume", volume); + break; + case "p3": + if (!CustomMusic.phase3.setVolume(volume)) return; + + CustomMusic.phase3Volume = volume; + ConfigHandler.writeIntConfig("music", "Phase3Volume", volume); + break; + case "p4": + if (!CustomMusic.phase4.setVolume(volume)) return; + + CustomMusic.phase4Volume = volume; + ConfigHandler.writeIntConfig("music", "Phase4Volume", volume); + break; + case "p5": + if (!CustomMusic.phase5.setVolume(volume)) return; + + CustomMusic.phase5Volume = volume; + ConfigHandler.writeIntConfig("music", "Phase5Volume", volume); + break; case "hub": if (!CustomMusic.hub.setVolume(volume)) return; diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java index a31e40a..3ea8d1f 100644 --- a/src/main/java/me/Danker/features/CustomMusic.java +++ b/src/main/java/me/Danker/features/CustomMusic.java @@ -27,12 +27,21 @@ import java.util.Random; public class CustomMusic { static boolean cancelNotes; + public static Song dungeonboss; public static int dungeonbossVolume; public static Song bloodroom; public static int bloodroomVolume; public static Song dungeon; public static int dungeonVolume; + public static Song phase2; + public static int phase2Volume; + public static Song phase3; + public static int phase3Volume; + public static Song phase4; + public static int phase4Volume; + public static Song phase5; + public static int phase5Volume; public static Song hub; public static int hubVolume; public static Song island; @@ -79,56 +88,56 @@ public class CustomMusic { String firstLine = ScoreboardHandler.cleanSB(scoreboard.get(scoreboard.size() - 1)); String secondLine = ScoreboardHandler.cleanSB(scoreboard.get(scoreboard.size() - 2)); if (firstLine.contains("30,30") || // F1 - firstLine.contains("30,125") || // F2 - firstLine.contains("30,225") || // F3 - secondLine.contains("- Healthy") || // F3 - firstLine.contains("30,344") || // F4 - firstLine.contains("livid") || // F5 - firstLine.contains("sadan") || // F6 - firstLine.contains("necron")) { // F7 - - if (ToggleCommand.dungeonBossMusic) dungeonboss.start(); - } - } - } else { - switch (Utils.tabLocation) { - case "Hub": - if (ToggleCommand.hubMusic) hub.start(); - break; - case "Private Island": - if (ToggleCommand.islandMusic) island.start(); - break; - case "Dungeon Hub": - if (ToggleCommand.dungeonHubMusic) dungeonHub.start(); - break; - case "The Farming Islands": - if (ToggleCommand.farmingIslandsMusic) farmingIslands.start(); - break; - case "Gold Mine": - if (ToggleCommand.goldMineMusic) goldMine.start(); - break; - case "Deep Caverns": - if (ToggleCommand.deepCavernsMusic) deepCaverns.start(); - break; - case "Dwarven Mines": - if (ToggleCommand.dwarvenMinesMusic) dwarvenMines.start(); - break; - case "Crystal Hollows": - if (ToggleCommand.crystalHollowsMusic) crystalHollows.start(); - break; - case "Spider's Den": - if (ToggleCommand.spidersDenMusic) spidersDen.start(); - break; - case "Crimson Isle": - if (ToggleCommand.crimsonIsleMusic) crimsonIsle.start(); - break; - case "The End": - if (ToggleCommand.endMusic) end.start(); - break; - case "The Park": - if (ToggleCommand.parkMusic) park.start(); - break; + firstLine.contains("30,125") || // F2 + firstLine.contains("30,225") || // F3 + secondLine.contains("- Healthy") || // F3 + firstLine.contains("30,344") || // F4 + firstLine.contains("livid") || // F5 + firstLine.contains("sadan") || // F6 + firstLine.contains("maxor")) { // F7 + + if (ToggleCommand.dungeonBossMusic) dungeonboss.start(); } + } + } else { + switch (Utils.tabLocation) { + case "Hub": + if (ToggleCommand.hubMusic) hub.start(); + break; + case "Private Island": + if (ToggleCommand.islandMusic) island.start(); + break; + case "Dungeon Hub": + if (ToggleCommand.dungeonHubMusic) dungeonHub.start(); + break; + case "The Farming Islands": + if (ToggleCommand.farmingIslandsMusic) farmingIslands.start(); + break; + case "Gold Mine": + if (ToggleCommand.goldMineMusic) goldMine.start(); + break; + case "Deep Caverns": + if (ToggleCommand.deepCavernsMusic) deepCaverns.start(); + break; + case "Dwarven Mines": + if (ToggleCommand.dwarvenMinesMusic) dwarvenMines.start(); + break; + case "Crystal Hollows": + if (ToggleCommand.crystalHollowsMusic) crystalHollows.start(); + break; + case "Spider's Den": + if (ToggleCommand.spidersDenMusic) spidersDen.start(); + break; + case "Crimson Isle": + if (ToggleCommand.crimsonIsleMusic) crimsonIsle.start(); + break; + case "The End": + if (ToggleCommand.endMusic) end.start(); + break; + case "The Park": + if (ToggleCommand.parkMusic) park.start(); + break; + } } } } @@ -147,10 +156,26 @@ public class CustomMusic { if (message.contains(":")) return; if (Utils.inDungeons) { + if (ToggleCommand.dungeonBossMusic) { + if (message.startsWith("[BOSS] Storm: Pathetic Maxor")) { + phase2.start(); + } else if (message.startsWith("[BOSS] Goldor: Who dares trespass into my domain?")) { + phase3.start(); + } else if (message.startsWith("[BOSS] Necron: You went further than any human before")) { + phase4.start(); + } else if (message.startsWith("[BOSS] ") && message.endsWith("You.. again?")) { + phase5.start(); + } + } + if (message.contains("EXTRA STATS ")) { dungeonboss.stop(); bloodroom.stop(); dungeon.stop(); + phase2.stop(); + phase3.stop(); + phase4.stop(); + phase5.stop(); } else if (message.contains("The BLOOD DOOR has been opened!")) { dungeon.stop(); if (ToggleCommand.bloodRoomMusic) bloodroom.start(); @@ -175,6 +200,10 @@ public class CustomMusic { dungeonboss = new Song(directory, "dungeonboss", dungeonbossVolume); bloodroom = new Song(directory, "bloodroom", bloodroomVolume); dungeon = new Song(directory, "dungeon", dungeonVolume); + phase2 = new Song(directory, "phasetwo", phase2Volume); + phase3 = new Song(directory, "phasethree", phase3Volume); + phase4 = new Song(directory, "phasefour", phase4Volume); + phase5 = new Song(directory, "phasefive", phase5Volume); hub = new Song(directory, "hub", hubVolume); island = new Song(directory, "island", hubVolume); dungeonHub = new Song(directory, "dungeonhub", dungeonHubVolume); @@ -193,6 +222,10 @@ public class CustomMusic { if (dungeonboss != null) dungeonboss.stop(); if (bloodroom != null) bloodroom.stop(); if (dungeon != null) dungeon.stop(); + if (phase2 != null) phase2.stop(); + if (phase3 != null) phase3.stop(); + if (phase4 != null) phase4.stop(); + if (phase5 != null) phase5.stop(); if (hub != null) hub.stop(); if (island != null) island.stop(); if (dungeonHub != null) dungeonHub.stop(); @@ -230,7 +263,6 @@ public class CustomMusic { public void start() throws UnsupportedAudioFileException, LineUnavailableException, IOException { try { - if (music == null) music = AudioSystem.getClip(); if (!music.isRunning()) { reset(); shuffle(); diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index a35a2d4..65e5c78 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -296,6 +296,10 @@ public class ConfigHandler { CustomMusic.dungeonbossVolume = initInt("music", "DungeonBossVolume", 50); CustomMusic.bloodroomVolume = initInt("music", "BloodRoomVolume", 50); CustomMusic.dungeonVolume = initInt("music", "DungeonVolume", 50); + CustomMusic.phase2Volume = initInt("music", "Phase2Volume", 50); + CustomMusic.phase3Volume = initInt("music", "Phase3Volume", 50); + CustomMusic.phase4Volume = initInt("music", "Phase4Volume", 50); + CustomMusic.phase5Volume = initInt("music", "Phase5Volume", 50); CustomMusic.hubVolume = initInt("music", "HubVolume", 50); CustomMusic.islandVolume = initInt("music", "IslandVolume", 50); CustomMusic.dungeonHubVolume = initInt("music", "DungeonHubVolume", 50); -- cgit From 276734f87ce984e634e74a9a203402a93c7f7f12 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 28 Apr 2022 22:10:18 -0400 Subject: Add chat aliases --- README.md | 1 + src/main/java/me/Danker/DankersSkyblockMod.java | 2 + .../java/me/Danker/commands/ToggleCommand.java | 1 + src/main/java/me/Danker/features/ChatAliases.java | 64 ++++++++++++ src/main/java/me/Danker/gui/DankerGui.java | 6 ++ .../java/me/Danker/gui/alerts/AlertActionGui.java | 3 - .../me/Danker/gui/aliases/AliasesActionGui.java | 81 +++++++++++++++ .../java/me/Danker/gui/aliases/AliasesAddGui.java | 115 +++++++++++++++++++++ .../java/me/Danker/gui/aliases/AliasesGui.java | 108 +++++++++++++++++++ .../java/me/Danker/handlers/ConfigHandler.java | 11 ++ 10 files changed, 389 insertions(+), 3 deletions(-) create mode 100644 src/main/java/me/Danker/features/ChatAliases.java create mode 100644 src/main/java/me/Danker/gui/aliases/AliasesActionGui.java create mode 100644 src/main/java/me/Danker/gui/aliases/AliasesAddGui.java create mode 100644 src/main/java/me/Danker/gui/aliases/AliasesGui.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 723ab66..2af7339 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ Discord Server: https://discord.gg/QsEkNQS - Hide player armour - Automatically join skyblock - Fire pillar display +- Chat aliases ## Commands - /dhelp - Returns this message in-game. diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 1816a3c..3eaac50 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -115,6 +115,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new BonzoMaskTimer()); MinecraftForge.EVENT_BUS.register(new BoulderSolver()); MinecraftForge.EVENT_BUS.register(new CakeTimer()); + MinecraftForge.EVENT_BUS.register(new ChatAliases()); MinecraftForge.EVENT_BUS.register(new ChronomatronSolver()); MinecraftForge.EVENT_BUS.register(new ClickInOrderSolver()); MinecraftForge.EVENT_BUS.register(new ColouredNames()); @@ -178,6 +179,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new ZombieTracker()); Alerts.configFile = configDirectory + "/dsmalerts.json"; + ChatAliases.configFile = configDirectory + "/dsmaliases.json"; ConfigHandler.reloadConfig(); GoldenEnchants.init(); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 7207565..6472d23 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -61,6 +61,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean hideArmour; public static boolean autoJoinSkyblock; public static boolean firePillar; + public static boolean aliases; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; diff --git a/src/main/java/me/Danker/features/ChatAliases.java b/src/main/java/me/Danker/features/ChatAliases.java new file mode 100644 index 0000000..ae9e0f7 --- /dev/null +++ b/src/main/java/me/Danker/features/ChatAliases.java @@ -0,0 +1,64 @@ +package me.Danker.features; + +import com.google.gson.GsonBuilder; +import me.Danker.events.PacketWriteEvent; +import net.minecraft.client.Minecraft; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.io.FileWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +public class ChatAliases { + + public static List aliases = new ArrayList<>(); + public static String configFile; + + @SubscribeEvent + public void onPacketWrite(PacketWriteEvent event) { + if (event.packet instanceof C01PacketChatMessage) { + C01PacketChatMessage packet = (C01PacketChatMessage) event.packet; + String message = packet.getMessage(); + + for (Alias alias : aliases) { + if (!alias.toggled) continue; + message = message.replace(alias.text, alias.alias); + } + + if (!packet.getMessage().equals(message)) { + event.setCanceled(true); + Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(new C01PacketChatMessage(message)); + } + } + } + + public static void save() { + try (FileWriter writer = new FileWriter(configFile)) { + new GsonBuilder().create().toJson(aliases, writer); + writer.flush(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + + public static class Alias { + + public String text; + public String alias; + public boolean toggled; + + public Alias(String text, String alias, boolean toggled) { + this.text = text; + this.alias = alias; + this.toggled = toggled; + } + + public void toggle() { + toggled = !toggled; + } + + } + +} diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 156a3a9..abf9ffa 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -2,6 +2,7 @@ package me.Danker.gui; import me.Danker.commands.ToggleCommand; import me.Danker.gui.alerts.AlertsGui; +import me.Danker.gui.aliases.AliasesGui; import me.Danker.gui.buttons.FeatureButton; import me.Danker.gui.crystalhollowwaypoints.CrystalHollowWaypointsGui; import me.Danker.handlers.ConfigHandler; @@ -45,6 +46,7 @@ public class DankerGui extends GuiScreen { private GuiButton customMusic; private GuiButton crystalHollowWaypoints; private GuiButton alerts; + private GuiButton aliases; // Toggles private GuiButton gparty; private GuiButton coords; @@ -132,6 +134,7 @@ public class DankerGui extends GuiScreen { customMusic = new GuiButton(0, 0, 0, "Custom Music"); crystalHollowWaypoints = new GuiButton(0, 0, 0, "Crystal Hollows Waypoints"); alerts = new GuiButton(0, 0, 0, "Alerts"); + aliases = new GuiButton(0, 0, 0, "Aliases"); outlineText = new FeatureButton("Outline Displayed Text: " + Utils.getColouredBoolean(ToggleCommand.outlineTextToggled), "Adds bold outline to on-screen text."); pickBlock = new FeatureButton("Auto-Swap to Pick Block: " + Utils.getColouredBoolean(ToggleCommand.swapToPickBlockToggled), "Automatically changes left clicks to middle clicks.\nHelpful when lagging."); coords = new FeatureButton("Coordinate/Angle Display: " + Utils.getColouredBoolean(ToggleCommand.coordsToggled), "Displays coordinates and angle."); @@ -191,6 +194,7 @@ public class DankerGui extends GuiScreen { allButtons.add(customMusic); allButtons.add(crystalHollowWaypoints); allButtons.add(alerts); + allButtons.add(aliases); allButtons.add(outlineText); allButtons.add(pickBlock); allButtons.add(coords); @@ -335,6 +339,8 @@ public class DankerGui extends GuiScreen { mc.displayGuiScreen(new CrystalHollowWaypointsGui(1)); } else if (button == alerts) { mc.displayGuiScreen(new AlertsGui(1)); + } else if (button == aliases) { + mc.displayGuiScreen(new AliasesGui(1)); } else if (button == outlineText) { ToggleCommand.outlineTextToggled = !ToggleCommand.outlineTextToggled; ConfigHandler.writeBooleanConfig("toggles", "OutlineText", ToggleCommand.outlineTextToggled); diff --git a/src/main/java/me/Danker/gui/alerts/AlertActionGui.java b/src/main/java/me/Danker/gui/alerts/AlertActionGui.java index 3d0eb90..4853ac1 100644 --- a/src/main/java/me/Danker/gui/alerts/AlertActionGui.java +++ b/src/main/java/me/Danker/gui/alerts/AlertActionGui.java @@ -60,9 +60,6 @@ public class AlertActionGui extends GuiScreen { Alerts.Alert alert = Alerts.alerts.get(id); RenderUtils.drawCenteredText(alert.alert, width, 10, 1D); - String alertText = alert.alert; - int textWidth = mc.fontRendererObj.getStringWidth(alertText); - new TextRenderer(mc, alertText, width / 2 - textWidth / 2, 10, 1D); } @Override diff --git a/src/main/java/me/Danker/gui/aliases/AliasesActionGui.java b/src/main/java/me/Danker/gui/aliases/AliasesActionGui.java new file mode 100644 index 0000000..d2c7a6a --- /dev/null +++ b/src/main/java/me/Danker/gui/aliases/AliasesActionGui.java @@ -0,0 +1,81 @@ +package me.Danker.gui.aliases; + +import me.Danker.features.ChatAliases; +import me.Danker.utils.RenderUtils; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.util.EnumChatFormatting; + +public class AliasesActionGui extends GuiScreen { + + private final int id; + + private GuiButton goBack; + private GuiButton toggle; + private GuiButton edit; + private GuiButton delete; + + public AliasesActionGui(int id) { + this.id = id; + } + + @Override + public boolean doesGuiPauseGame() { + return false; + } + + @Override + public void initGui() { + super.initGui(); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int height = sr.getScaledHeight(); + int width = sr.getScaledWidth(); + + ChatAliases.Alias alias = ChatAliases.aliases.get(id); + + goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); + toggle = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Enabled: " + Utils.getColouredBoolean(alias.toggled)); + edit = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Edit >"); + delete = new GuiButton(0, width / 2 - 100, (int) (height * 0.8), EnumChatFormatting.RED + "Delete Alias"); + + this.buttonList.add(toggle); + this.buttonList.add(edit); + this.buttonList.add(delete); + this.buttonList.add(goBack); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + + ChatAliases.Alias alias = ChatAliases.aliases.get(id); + + RenderUtils.drawCenteredText(alias.text, width, 10, 1D); + } + + @Override + public void actionPerformed(GuiButton button) { + ChatAliases.Alias alias = ChatAliases.aliases.get(id); + if (button == goBack) { + mc.displayGuiScreen(new AliasesGui(1)); + } else if (button == toggle) { + alias.toggle(); + toggle.displayString = "Enabled: " + Utils.getColouredBoolean(alias.toggled); + } else if (button == edit) { + mc.displayGuiScreen(new AliasesAddGui(alias, id)); + } else if (button == delete) { + ChatAliases.aliases.remove(id); + ChatAliases.save(); + mc.displayGuiScreen(new AliasesGui(1)); + return; + } + ChatAliases.aliases.set(id, alias); + ChatAliases.save(); + } + +} diff --git a/src/main/java/me/Danker/gui/aliases/AliasesAddGui.java b/src/main/java/me/Danker/gui/aliases/AliasesAddGui.java new file mode 100644 index 0000000..610354a --- /dev/null +++ b/src/main/java/me/Danker/gui/aliases/AliasesAddGui.java @@ -0,0 +1,115 @@ +package me.Danker.gui.aliases; + +import me.Danker.features.ChatAliases; +import me.Danker.handlers.TextRenderer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraftforge.fml.client.config.GuiCheckBox; + +import java.io.IOException; + +public class AliasesAddGui extends GuiScreen { + + private boolean editing; + private ChatAliases.Alias base = null; + private int id; + + private GuiButton cancel; + + private GuiTextField text; + private GuiTextField alias; + private GuiCheckBox toggled; + private GuiButton add; + + public AliasesAddGui() {} + + public AliasesAddGui(ChatAliases.Alias alias, int id) { + editing = true; + base = alias; + this.id = id; + } + + @Override + public boolean doesGuiPauseGame() { + return false; + } + + @Override + public void initGui() { + super.initGui(); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int height = sr.getScaledHeight(); + int width = sr.getScaledWidth(); + + cancel = new GuiButton(0, 2, height - 30, 100, 20, "Cancel"); + + + text = new GuiTextField(0, this.fontRendererObj, width / 2 - 100, (int) (height * 0.2), 200, 20); + alias = new GuiTextField(0, this.fontRendererObj, width / 2 - 100, (int) (height * 0.3), 200, 20); + toggled = new GuiCheckBox(0, width / 2 - 26, (int) (height * 0.4), "Toggled", true); + add = new GuiButton(0, width / 2 - 25, (int) (height * 0.8), 50, 20, "Add"); + + if (editing) { + text.setText(base.text); + alias.setText(base.alias); + toggled.setIsChecked(base.toggled); + } + + text.setVisible(true); + text.setEnabled(true); + alias.setVisible(true); + alias.setEnabled(true); + alias.setMaxStringLength(100); + + this.buttonList.add(cancel); + this.buttonList.add(toggled); + this.buttonList.add(add); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + + text.drawTextBox(); + alias.drawTextBox(); + + new TextRenderer(mc, "Text:", width / 2 - 135, (int) (height * 0.22), 1D); + new TextRenderer(mc, "Alias:", width / 2 - 137, (int) (height * 0.32), 1D); + } + + @Override + public void actionPerformed(GuiButton button) { + if (button == cancel) { + mc.displayGuiScreen(new AliasesGui(1)); + } else if (button == add) { + ChatAliases.Alias newAlias = new ChatAliases.Alias(text.getText(), alias.getText(), toggled.isChecked()); + if (editing) { + ChatAliases.aliases.set(id, newAlias); + } else { + ChatAliases.aliases.add(newAlias); + } + ChatAliases.save(); + mc.displayGuiScreen(new AliasesGui(1)); + } + } + + @Override + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { + super.mouseClicked(mouseX, mouseY, mouseButton); + text.mouseClicked(mouseX, mouseY, mouseButton); + alias.mouseClicked(mouseX, mouseY, mouseButton); + } + + @Override + protected void keyTyped(char typedChar, int keyCode) throws IOException { + super.keyTyped(typedChar, keyCode); + text.textboxKeyTyped(typedChar, keyCode); + alias.textboxKeyTyped(typedChar, keyCode); + } + +} diff --git a/src/main/java/me/Danker/gui/aliases/AliasesGui.java b/src/main/java/me/Danker/gui/aliases/AliasesGui.java new file mode 100644 index 0000000..f5b863a --- /dev/null +++ b/src/main/java/me/Danker/gui/aliases/AliasesGui.java @@ -0,0 +1,108 @@ +package me.Danker.gui.aliases; + +import me.Danker.commands.ToggleCommand; +import me.Danker.features.ChatAliases; +import me.Danker.gui.DankerGui; +import me.Danker.gui.buttons.FeatureButton; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.RenderUtils; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; + +import java.util.ArrayList; +import java.util.List; + +public class AliasesGui extends GuiScreen { + + private final int page; + private final List allButtons = new ArrayList<>(); + + private GuiButton goBack; + private GuiButton backPage; + private GuiButton nextPage; + private GuiButton add; + private GuiButton aliases; + + public AliasesGui(int page) { + this.page = page; + } + + @Override + public boolean doesGuiPauseGame() { + return false; + } + + @Override + public void initGui() { + super.initGui(); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int height = sr.getScaledHeight(); + int width = sr.getScaledWidth(); + + goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); + backPage = new GuiButton(0, width / 2 - 100, (int) (height * 0.8), 80, 20, "< Back"); + nextPage = new GuiButton(0, width / 2 + 20, (int) (height * 0.8), 80, 20, "Next >"); + aliases = new FeatureButton("Aliases: " + Utils.getColouredBoolean(ToggleCommand.aliases), "Replaces text in chat with an alias"); + add = new GuiButton(0, 0, 0, "Add Alias"); + + allButtons.clear(); + allButtons.add(aliases); + allButtons.add(add); + for (int i = 0; i < ChatAliases.aliases.size(); i++) { + ChatAliases.Alias alias = ChatAliases.aliases.get(i); + GuiButton button = new GuiButton(i, 0, 0, alias.text + " >"); + allButtons.add(button); + } + + reInit(); + } + + public void reInit() { + this.buttonList.clear(); + + for (int i = (page - 1) * 7, iteration = 0; iteration < 7 && i < allButtons.size(); i++, iteration++) { + GuiButton button = allButtons.get(i); + button.xPosition = width / 2 - 100; + button.yPosition = (int) (height * (0.1 * (iteration + 1))); + this.buttonList.add(button); + } + + if (page > 1) this.buttonList.add(backPage); + if (page < Math.ceil(allButtons.size() / 7D)) this.buttonList.add(nextPage); + + this.buttonList.add(goBack); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + + String pageText = "Page: " + page + "/" + (int) Math.ceil(allButtons.size() / 7D); + RenderUtils.drawCenteredText(pageText, width, 10, 1D); + } + + @Override + public void actionPerformed(GuiButton button) { + if (button == goBack) { + mc.displayGuiScreen(new DankerGui(1, "")); + } else if (button == nextPage) { + mc.displayGuiScreen(new AliasesGui(page + 1)); + } else if (button == backPage) { + mc.displayGuiScreen(new AliasesGui(page - 1)); + } else if (button == add) { + mc.displayGuiScreen(new AliasesAddGui()); + } else if (button == aliases) { + ToggleCommand.aliases = !ToggleCommand.aliases; + ConfigHandler.writeBooleanConfig("toggles", "Aliases", ToggleCommand.aliases); + aliases.displayString = "Aliases: " + Utils.getColouredBoolean(ToggleCommand.aliases); + } else { + mc.displayGuiScreen(new AliasesActionGui(button.id)); + } + } + +} diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 65e5c78..4415a8e 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -246,6 +246,7 @@ public class ConfigHandler { ToggleCommand.hideArmour = initBoolean("toggles", "HideArmour", false); ToggleCommand.autoJoinSkyblock = initBoolean("toggles", "AutoJoinSkyblock", false); ToggleCommand.firePillar = initBoolean("toggles", "FirePillar", false); + ToggleCommand.aliases = initBoolean("toggles", "Aliases", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); @@ -719,6 +720,7 @@ public class ConfigHandler { Gson gson = new Gson(); try { + // Alerts if (!(new File(Alerts.configFile).exists())) { FileWriter file = new FileWriter(Alerts.configFile); file.write(new JsonArray().toString()); @@ -726,6 +728,15 @@ public class ConfigHandler { } Alerts.Alert[] alerts = gson.fromJson(new FileReader(Alerts.configFile), Alerts.Alert[].class); if (alerts != null) Alerts.alerts = new ArrayList<>(Arrays.asList(alerts)); + + // Aliases + if (!(new File(ChatAliases.configFile).exists())) { + FileWriter file = new FileWriter(ChatAliases.configFile); + file.write(new JsonArray().toString()); + file.close(); + } + ChatAliases.Alias[] aliases = gson.fromJson(new FileReader(ChatAliases.configFile), ChatAliases.Alias[].class); + if (aliases != null) ChatAliases.aliases = new ArrayList<>(Arrays.asList(aliases)); } catch (IOException ex) { ex.printStackTrace(); } -- cgit From 7f71df3d99a2c9b318c0b9de7c4e1577af5c9294 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 30 Apr 2022 13:21:06 -0400 Subject: Fix custom music crash Re-add line I thought was useless --- src/main/java/me/Danker/features/CustomMusic.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java index 3ea8d1f..717a3ab 100644 --- a/src/main/java/me/Danker/features/CustomMusic.java +++ b/src/main/java/me/Danker/features/CustomMusic.java @@ -263,6 +263,7 @@ public class CustomMusic { public void start() throws UnsupportedAudioFileException, LineUnavailableException, IOException { try { + if (music == null) music = AudioSystem.getClip(); if (!music.isRunning()) { reset(); shuffle(); -- cgit From 5f2acec6bce0cfdd0c435982a01f7f6d7b79e8b9 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 30 Apr 2022 21:39:28 -0400 Subject: Add thunder/jawbus spawn alerts --- README.md | 1 + build.gradle | 2 +- src/main/java/me/Danker/DankersSkyblockMod.java | 3 +- .../java/me/Danker/commands/ToggleCommand.java | 1 + .../me/Danker/features/FishingSpawnAlerts.java | 60 ++++++++++++++++++++++ src/main/java/me/Danker/gui/DankerGui.java | 7 +++ .../java/me/Danker/handlers/ConfigHandler.java | 1 + 7 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 src/main/java/me/Danker/features/FishingSpawnAlerts.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 2a316a0..d22f75e 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,7 @@ Discord Server: https://discord.gg/QsEkNQS - Automatically join skyblock - Fire pillar display - Chat aliases +- Thunder/Lord Jawbus spawn alerts
diff --git a/build.gradle b/build.gradle index fe6e801..2d8bebc 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,7 @@ plugins { id "net.minecraftforge.gradle.forge" version "2.0.2" } */ -version = "1.8.7-beta6" +version = "1.8.7-beta7" group= "me.Danker.DankersSkyblockMod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Danker's Skyblock Mod" diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 3eaac50..6e82137 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -64,7 +64,7 @@ import java.util.Map; @Mod(modid = DankersSkyblockMod.MODID, version = DankersSkyblockMod.VERSION, clientSideOnly = true) public class DankersSkyblockMod { public static final String MODID = "Danker's Skyblock Mod"; - public static final String VERSION = "1.8.7-beta6"; + public static final String VERSION = "1.8.7-beta7"; public static int titleTimer = -1; public static boolean showTitle = false; public static String titleText = ""; @@ -128,6 +128,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new ExpertiseLore()); MinecraftForge.EVENT_BUS.register(new FasterMaddoxCalling()); MinecraftForge.EVENT_BUS.register(new FirePillarDisplay()); + MinecraftForge.EVENT_BUS.register(new FishingSpawnAlerts()); MinecraftForge.EVENT_BUS.register(new GemstonesLore()); MinecraftForge.EVENT_BUS.register(new GiantHPDisplay()); MinecraftForge.EVENT_BUS.register(new GoldenEnchants()); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 6472d23..09b59d9 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -62,6 +62,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean autoJoinSkyblock; public static boolean firePillar; public static boolean aliases; + public static boolean fishingAlert; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; diff --git a/src/main/java/me/Danker/features/FishingSpawnAlerts.java b/src/main/java/me/Danker/features/FishingSpawnAlerts.java new file mode 100644 index 0000000..3f11dfc --- /dev/null +++ b/src/main/java/me/Danker/features/FishingSpawnAlerts.java @@ -0,0 +1,60 @@ +package me.Danker.features; + +import me.Danker.DankersSkyblockMod; +import me.Danker.commands.ToggleCommand; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StringUtils; +import net.minecraft.world.World; +import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + +import java.util.List; + +public class FishingSpawnAlerts { + + static boolean lastThunder = false; + static boolean lastJawbus = false; + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + if (event.phase != TickEvent.Phase.START) return; + + World world = Minecraft.getMinecraft().theWorld; + if (DankersSkyblockMod.tickAmount % 10 == 0) { + if (ToggleCommand.fishingAlert && Utils.tabLocation.equals("Crimson Isle") && world != null) { + boolean thunder = false; + boolean jawbus = false; + List entities = world.getLoadedEntityList(); + + for (Entity entity : entities) { + if (entity instanceof EntityArmorStand) { + String name = StringUtils.stripControlCodes(entity.getName()); + if (name.contains("Thunder")) { + thunder = true; + } else if (name.contains("Lord Jawbus")) { + jawbus = true; + } + } + } + + if (thunder && !lastThunder) Utils.createTitle(EnumChatFormatting.AQUA + "THUNDER", 2); + if (jawbus && !lastJawbus) Utils.createTitle(EnumChatFormatting.AQUA + "JAWBUS", 2); + + lastThunder = thunder; + lastJawbus = jawbus; + } + } + } + + @SubscribeEvent + public void onWorldChange(WorldEvent.Load event) { + lastThunder = false; + lastJawbus = false; + } + +} diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index abf9ffa..9e013b7 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -90,6 +90,7 @@ public class DankerGui extends GuiScreen { private GuiButton hideArmour; private GuiButton autoJoinSkyblock; private GuiButton firePillar; + private GuiButton fishingAlert; // Chat Messages private GuiButton sceptreMessages; private GuiButton midasStaffMessages; @@ -184,6 +185,7 @@ public class DankerGui extends GuiScreen { hideArmour = new FeatureButton("Hide Player Armour: " + Utils.getColouredBoolean(ToggleCommand.hideArmour), "Makes player armour invisible, showing their skin."); autoJoinSkyblock = new FeatureButton("Automatically Join Skyblock: " + Utils.getColouredBoolean(ToggleCommand.autoJoinSkyblock), "Automatically join Skyblock when you join Hypixel.\nYou have an addiction."); firePillar = new FeatureButton("Fire Pillar Display: " + Utils.getColouredBoolean(ToggleCommand.firePillar), "Displays blaze fire pillar text on screen"); + fishingAlert = new FeatureButton("Fishing Spawn Alerts: " + Utils.getColouredBoolean(ToggleCommand.fishingAlert), "Alerts when a Thunder or Lord Jawbus spawns nearby"); allButtons.clear(); allButtons.add(changeDisplay); @@ -244,6 +246,7 @@ public class DankerGui extends GuiScreen { allButtons.add(hideArmour); allButtons.add(autoJoinSkyblock); allButtons.add(firePillar); + allButtons.add(fishingAlert); search.setText(initSearchText); search.setVisible(true); @@ -537,6 +540,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.firePillar = !ToggleCommand.firePillar; ConfigHandler.writeBooleanConfig("toggles", "FirePillar", ToggleCommand.firePillar); firePillar.displayString = "Fire Pillar Display: " + Utils.getColouredBoolean(ToggleCommand.firePillar); + } else if (button == fishingAlert) { + ToggleCommand.fishingAlert = !ToggleCommand.fishingAlert; + ConfigHandler.writeBooleanConfig("toggles", "FishingAlert", ToggleCommand.fishingAlert); + fishingAlert.displayString = "Fishing Spawn Alerts: " + Utils.getColouredBoolean(ToggleCommand.fishingAlert); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 4415a8e..48693c8 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -247,6 +247,7 @@ public class ConfigHandler { ToggleCommand.autoJoinSkyblock = initBoolean("toggles", "AutoJoinSkyblock", false); ToggleCommand.firePillar = initBoolean("toggles", "FirePillar", false); ToggleCommand.aliases = initBoolean("toggles", "Aliases", false); + ToggleCommand.fishingAlert = initBoolean("toggles", "FishingAlert", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); -- cgit From 7670b7d3aaa969fae9ac63a76b970aa53c263118 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Wed, 4 May 2022 20:02:58 -0400 Subject: Fix error with waypoints --- src/main/java/me/Danker/features/CrystalHollowWaypoints.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/CrystalHollowWaypoints.java b/src/main/java/me/Danker/features/CrystalHollowWaypoints.java index a8ee0f9..39a71b4 100644 --- a/src/main/java/me/Danker/features/CrystalHollowWaypoints.java +++ b/src/main/java/me/Danker/features/CrystalHollowWaypoints.java @@ -148,7 +148,7 @@ public class CrystalHollowWaypoints { } player.addChatMessage(new ChatComponentText("\n" + DankersSkyblockMod.MAIN_COLOUR + "DSM/SBE Crystal Hollows waypoints found. Click to add.\n").appendSibling(add)); }).start(); - } else { + } else if (message.indexOf(":") != message.lastIndexOf(":")) { String text = message.substring(message.indexOf(":") + 2); Matcher matcher = skytilsPattern.matcher(text); -- cgit From 5a706f3f139c795ba6b848db4d18c55490dc1788 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Wed, 4 May 2022 21:46:12 -0400 Subject: Update monster of the deep message --- src/main/java/me/Danker/features/loot/FishingTracker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/loot/FishingTracker.java b/src/main/java/me/Danker/features/loot/FishingTracker.java index f8adfa2..fb4fdbc 100644 --- a/src/main/java/me/Danker/features/loot/FishingTracker.java +++ b/src/main/java/me/Danker/features/loot/FishingTracker.java @@ -174,7 +174,7 @@ public class FishingTracker { seaArchersSession++; ConfigHandler.writeIntConfig("fishing", "seaArcher", seaArchers); increaseSeaCreatures(); - } else if (message.contains("The Monster of the Deep has emerged")) { + } else if (message.contains("The Rider of the Deep has emerged")) { monsterOfTheDeeps++; monsterOfTheDeepsSession++; ConfigHandler.writeIntConfig("fishing", "monsterOfDeep", monsterOfTheDeeps); -- cgit From b0954c47d499b922ca006a18a4331c8e1ae366b5 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Wed, 11 May 2022 19:18:07 -0400 Subject: Add option to disable custom colours on nametags --- src/main/java/me/Danker/commands/ToggleCommand.java | 1 + src/main/java/me/Danker/features/ColouredNames.java | 2 +- src/main/java/me/Danker/gui/DankerGui.java | 7 +++++++ src/main/java/me/Danker/handlers/ConfigHandler.java | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 09b59d9..91584f8 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -49,6 +49,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean giantHP; public static boolean hidePetCandy; public static boolean customColouredNames; + public static boolean customNametags; public static boolean endOfFarmAlert; public static boolean gemstoneLore; public static boolean crystalHollowWaypoints; diff --git a/src/main/java/me/Danker/features/ColouredNames.java b/src/main/java/me/Danker/features/ColouredNames.java index 90d722e..9f7890c 100644 --- a/src/main/java/me/Danker/features/ColouredNames.java +++ b/src/main/java/me/Danker/features/ColouredNames.java @@ -72,7 +72,7 @@ public class ColouredNames { @SubscribeEvent(priority = EventPriority.LOW) public void onRenderLiving(RenderLivingEvent.Specials.Pre event) { - if (!ToggleCommand.customColouredNames || !Utils.inSkyblock) return; + if (!ToggleCommand.customColouredNames || !ToggleCommand.customNametags || !Utils.inSkyblock) return; Entity entity = event.entity; if (entity instanceof EntityArmorStand && !entity.isDead && entity.hasCustomName()) { diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 9e013b7..663adf5 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -74,6 +74,7 @@ public class DankerGui extends GuiScreen { private GuiButton giantHP; private GuiButton hidePetCandy; private GuiButton customColouredNames; + private GuiButton customNametags; private GuiButton endOfFarmAlert; private GuiButton gemstoneLore; private GuiButton autoAcceptReparty; @@ -177,6 +178,7 @@ public class DankerGui extends GuiScreen { giantHP = new FeatureButton("Display Giant HP: " + Utils.getColouredBoolean(ToggleCommand.giantHP), "Displays health of Sadan's giants during F6 bossfight and F7 blood room."); hidePetCandy = new FeatureButton("Hide Pet Candy: " + Utils.getColouredBoolean(ToggleCommand.hidePetCandy), "Hide pet candy in pet tooltips."); customColouredNames = new FeatureButton("Custom Name Colors: " + Utils.getColouredBoolean(ToggleCommand.customColouredNames), "Replaces some player's usernames with a custom color."); + customNametags = new FeatureButton("Custom Color on Nametags: " + Utils.getColouredBoolean(ToggleCommand.customNametags), "Displays custom name colors on nametags. Disabling will increase performance with custom colors."); endOfFarmAlert = new FeatureButton("Alert When Reaching End of Farm: " + Utils.getColouredBoolean(ToggleCommand.endOfFarmAlert), "Alerts when you go past coords set with /dsmfarmlength."); gemstoneLore = new FeatureButton("Applied Gemstones in Lore: " + Utils.getColouredBoolean(ToggleCommand.gemstoneLore), "Adds applied gemstones to item tooltip."); autoAcceptReparty = new FeatureButton("Auto Accept Reparty: " + Utils.getColouredBoolean(ToggleCommand.autoAcceptReparty), "Automatically rejoins parties when disbanded and invited."); @@ -238,6 +240,7 @@ public class DankerGui extends GuiScreen { allButtons.add(giantHP); allButtons.add(hidePetCandy); allButtons.add(customColouredNames); + allButtons.add(customNametags); allButtons.add(endOfFarmAlert); allButtons.add(gemstoneLore); allButtons.add(autoAcceptReparty); @@ -544,6 +547,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.fishingAlert = !ToggleCommand.fishingAlert; ConfigHandler.writeBooleanConfig("toggles", "FishingAlert", ToggleCommand.fishingAlert); fishingAlert.displayString = "Fishing Spawn Alerts: " + Utils.getColouredBoolean(ToggleCommand.fishingAlert); + } else if (button == customNametags) { + ToggleCommand.customNametags = !ToggleCommand.customNametags; + ConfigHandler.writeBooleanConfig("toggles", "CustomNametags", ToggleCommand.customNametags); + customNametags.displayString = "Custom Color on Nametags: " + Utils.getColouredBoolean(ToggleCommand.customNametags); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 48693c8..1f00c9f 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -223,6 +223,7 @@ public class ConfigHandler { ToggleCommand.giantHP = initBoolean("toggles", "GiantHP", false); ToggleCommand.hidePetCandy = initBoolean("toggles", "HidePetCandy", false); ToggleCommand.customColouredNames = initBoolean("toggles", "CustomColouredNames", true); // enabled by default + ToggleCommand.customNametags = initBoolean("toggles", "CustomNametags", true); ToggleCommand.endOfFarmAlert = initBoolean("toggles", "EndOfFarmAlert", false); ToggleCommand.gemstoneLore = initBoolean("toggles", "GemstoneLore", false); ToggleCommand.crystalHollowWaypoints = initBoolean("toggles", "CrystalHollowWaypoints", false); -- cgit From 7c0cf9b290768c136420cb3b79f1933daa24dbd2 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Wed, 11 May 2022 19:20:16 -0400 Subject: Fix jawbus session default values --- src/main/java/me/Danker/commands/ResetLootCommand.java | 4 ++-- src/main/java/me/Danker/features/loot/FishingTracker.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/ResetLootCommand.java b/src/main/java/me/Danker/commands/ResetLootCommand.java index 9256394..9ccef33 100644 --- a/src/main/java/me/Danker/commands/ResetLootCommand.java +++ b/src/main/java/me/Danker/commands/ResetLootCommand.java @@ -289,8 +289,8 @@ public class ResetLootCommand extends CommandBase { FishingTracker.taurusesSession = 0; FishingTracker.thundersSession = 0; FishingTracker.lordJawbusesSession = 0; - FishingTracker.jawbusTimeSession = 0; - FishingTracker.jawbusSCsSession = 0; + FishingTracker.jawbusTimeSession = -1; + FishingTracker.jawbusSCsSession = -1; ConfigHandler.deleteCategory("fishing"); ConfigHandler.reloadConfig(); } diff --git a/src/main/java/me/Danker/features/loot/FishingTracker.java b/src/main/java/me/Danker/features/loot/FishingTracker.java index fb4fdbc..1690793 100644 --- a/src/main/java/me/Danker/features/loot/FishingTracker.java +++ b/src/main/java/me/Danker/features/loot/FishingTracker.java @@ -125,8 +125,8 @@ public class FishingTracker { public static int taurusesSession = 0; public static int thundersSession = 0; public static int lordJawbusesSession = 0; - public static double jawbusTimeSession = 0; - public static int jawbusSCsSession = 0; + public static double jawbusTimeSession = -1; + public static int jawbusSCsSession = -1; @SubscribeEvent public void onChat(ClientChatReceivedEvent event) { -- cgit From 28e9921fa38a4a6365b761275dc40bad61db94ca Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Wed, 11 May 2022 19:21:29 -0400 Subject: Add winter fishing to auto display --- src/main/java/me/Danker/features/AutoDisplay.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/AutoDisplay.java b/src/main/java/me/Danker/features/AutoDisplay.java index 7f86035..9ef3b4d 100644 --- a/src/main/java/me/Danker/features/AutoDisplay.java +++ b/src/main/java/me/Danker/features/AutoDisplay.java @@ -97,6 +97,8 @@ public class AutoDisplay { if (lore.get(j).contains("FISHING ROD")) { if (Utils.tabLocation.equals("Crimson Isle")) { LootDisplay.display = "fishing_lava"; + } else if (Utils.tabLocation.equals("Jerry's Workshop")) { + LootDisplay.display = "fishing_winter"; } else { LootDisplay.display = "fishing"; } -- cgit From dd5cd8de6de8edfe13d461619ae16f16724f59e5 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Wed, 11 May 2022 19:22:00 -0400 Subject: Add opal to gem list --- src/main/java/me/Danker/features/GemstonesLore.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/GemstonesLore.java b/src/main/java/me/Danker/features/GemstonesLore.java index c633c58..7db2d33 100644 --- a/src/main/java/me/Danker/features/GemstonesLore.java +++ b/src/main/java/me/Danker/features/GemstonesLore.java @@ -26,6 +26,7 @@ public class GemstonesLore { gemstoneColours.put("Topaz", EnumChatFormatting.YELLOW); gemstoneColours.put("Jade", EnumChatFormatting.GREEN); gemstoneColours.put("Ruby", EnumChatFormatting.RED); + gemstoneColours.put("Opal", EnumChatFormatting.WHITE); } @SubscribeEvent(priority = EventPriority.HIGHEST) -- cgit From a40f87f555e01b09e99ab61e83caf8939ad1a8fd Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Mon, 16 May 2022 22:17:17 -0400 Subject: Add minion last collected display --- README.md | 1 + src/main/java/me/Danker/DankersSkyblockMod.java | 2 + .../java/me/Danker/commands/ToggleCommand.java | 1 + .../me/Danker/features/MinionLastCollected.java | 128 +++++++++++++++++++++ src/main/java/me/Danker/gui/DankerGui.java | 7 ++ .../java/me/Danker/handlers/ConfigHandler.java | 11 ++ src/main/java/me/Danker/utils/RenderUtils.java | 24 ++++ 7 files changed, 174 insertions(+) create mode 100644 src/main/java/me/Danker/features/MinionLastCollected.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index d22f75e..98bf434 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ Discord Server: https://discord.gg/QsEkNQS - Fire pillar display - Chat aliases - Thunder/Lord Jawbus spawn alerts +- Show when minion was last collected
diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 6e82137..a63552c 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -141,6 +141,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new IceWalkSolver()); MinecraftForge.EVENT_BUS.register(new LividSolver()); MinecraftForge.EVENT_BUS.register(new LowHealthNotifications()); + MinecraftForge.EVENT_BUS.register(new MinionLastCollected()); MinecraftForge.EVENT_BUS.register(new NecronNotifications()); MinecraftForge.EVENT_BUS.register(new NoF3Coords()); MinecraftForge.EVENT_BUS.register(new NotifySlayerSlain()); @@ -181,6 +182,7 @@ public class DankersSkyblockMod { Alerts.configFile = configDirectory + "/dsmalerts.json"; ChatAliases.configFile = configDirectory + "/dsmaliases.json"; + MinionLastCollected.configFile = configDirectory + "/dsmminions.json"; ConfigHandler.reloadConfig(); GoldenEnchants.init(); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 91584f8..c08d50a 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -64,6 +64,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean firePillar; public static boolean aliases; public static boolean fishingAlert; + public static boolean minionLastCollected; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; diff --git a/src/main/java/me/Danker/features/MinionLastCollected.java b/src/main/java/me/Danker/features/MinionLastCollected.java new file mode 100644 index 0000000..884dccf --- /dev/null +++ b/src/main/java/me/Danker/features/MinionLastCollected.java @@ -0,0 +1,128 @@ +package me.Danker.features; + +import com.google.gson.GsonBuilder; +import me.Danker.commands.ToggleCommand; +import me.Danker.events.ChestSlotClickedEvent; +import me.Danker.events.PacketWriteEvent; +import me.Danker.utils.RenderUtils; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.util.BlockPos; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.io.FileWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +public class MinionLastCollected { + + public static List minions = new ArrayList<>(); + public static String configFile; + static BlockPos lastMinion = null; + public static int LAST_COLLECTED_COLOUR; + + @SubscribeEvent + public void onPacketWrite(PacketWriteEvent event) { + if (ToggleCommand.minionLastCollected && Utils.inSkyblock && Utils.isInScoreboard("Your Island")) { + if (event.packet instanceof C02PacketUseEntity) { + C02PacketUseEntity packet = (C02PacketUseEntity) event.packet; + Entity entity = packet.getEntityFromWorld(Minecraft.getMinecraft().theWorld); + if (isAMinion(entity)) { + lastMinion = entity.getPosition(); + if (getMinionFromPos(lastMinion) == null) { + minions.add(new Minion(lastMinion)); + save(); + } + } + } + } + } + + @SubscribeEvent + public void onSlotClick(ChestSlotClickedEvent event) { + if (ToggleCommand.minionLastCollected && Utils.tabLocation.equals("Private Island")) { + String inventoryName = event.inventoryName; + ItemStack item = event.item; + if (inventoryName.contains(" Minion ") && item != null && lastMinion != null) { + if (item.getDisplayName().contains("Collect All")) { + getMinionFromPos(lastMinion).collectNow(); + save(); + } else if (item.getDisplayName().contains("Pickup Minion")) { + minions.remove(getMinionFromPos(lastMinion)); + save(); + } + } + } + } + + @SubscribeEvent + public void onWorldRender(RenderWorldLastEvent event) { + if (ToggleCommand.minionLastCollected && Utils.inSkyblock && Utils.tabLocation.equals("Private Island")) { + for (Minion minion : minions) { + RenderUtils.draw3DString(minion.pos.getX() + 0.5, minion.pos.getY() + 2.2, minion.pos.getZ() + 0.5, minion.getTimeCollected(), LAST_COLLECTED_COLOUR, event.partialTicks); + } + } + } + + public boolean isAMinion(Entity entity) { + if (!(entity instanceof EntityArmorStand)) return false; + EntityArmorStand armourStand = (EntityArmorStand) entity; + + for (int i = 0; i <= 3; i++) { + if (armourStand.getCurrentArmor(i) == null) return false; + } + + return (Item.getIdFromItem(armourStand.getCurrentArmor(0).getItem()) == 301 && + Item.getIdFromItem(armourStand.getCurrentArmor(1).getItem()) == 300 && + Item.getIdFromItem(armourStand.getCurrentArmor(2).getItem()) == 299 && + Item.getIdFromItem(armourStand.getCurrentArmor(3).getItem()) == 397); + } + + public Minion getMinionFromPos(BlockPos pos) { + for (Minion minion : minions) { + if (minion.pos.equals(pos)) return minion; + } + return null; + } + + public static void save() { + try (FileWriter writer = new FileWriter(configFile)) { + new GsonBuilder().create().toJson(minions, writer); + writer.flush(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + + public static class Minion { + + public BlockPos pos; + public double lastCollect; + + public Minion(BlockPos pos) { + this.pos = pos; + this.lastCollect = -1; + } + + public String getTimeCollected() { + String lastCollected = "Last Collected: "; + if (lastCollect == -1) { + return lastCollected + "Never"; + } + return lastCollected + Utils.getTimeBetween(lastCollect, System.currentTimeMillis() / 1000) + " ago"; + } + + public void collectNow() { + lastCollect = System.currentTimeMillis() / 1000; + } + + } + +} diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 663adf5..c247eab 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -92,6 +92,7 @@ public class DankerGui extends GuiScreen { private GuiButton autoJoinSkyblock; private GuiButton firePillar; private GuiButton fishingAlert; + private GuiButton minionLastCollected; // Chat Messages private GuiButton sceptreMessages; private GuiButton midasStaffMessages; @@ -188,6 +189,7 @@ public class DankerGui extends GuiScreen { autoJoinSkyblock = new FeatureButton("Automatically Join Skyblock: " + Utils.getColouredBoolean(ToggleCommand.autoJoinSkyblock), "Automatically join Skyblock when you join Hypixel.\nYou have an addiction."); firePillar = new FeatureButton("Fire Pillar Display: " + Utils.getColouredBoolean(ToggleCommand.firePillar), "Displays blaze fire pillar text on screen"); fishingAlert = new FeatureButton("Fishing Spawn Alerts: " + Utils.getColouredBoolean(ToggleCommand.fishingAlert), "Alerts when a Thunder or Lord Jawbus spawns nearby"); + minionLastCollected = new FeatureButton("Show When Minion Last Collected: " + Utils.getColouredBoolean(ToggleCommand.minionLastCollected), "Displays when a minion was last collected over the minion."); allButtons.clear(); allButtons.add(changeDisplay); @@ -250,6 +252,7 @@ public class DankerGui extends GuiScreen { allButtons.add(autoJoinSkyblock); allButtons.add(firePillar); allButtons.add(fishingAlert); + allButtons.add(minionLastCollected); search.setText(initSearchText); search.setVisible(true); @@ -551,6 +554,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.customNametags = !ToggleCommand.customNametags; ConfigHandler.writeBooleanConfig("toggles", "CustomNametags", ToggleCommand.customNametags); customNametags.displayString = "Custom Color on Nametags: " + Utils.getColouredBoolean(ToggleCommand.customNametags); + } else if (button == minionLastCollected) { + ToggleCommand.minionLastCollected = !ToggleCommand.minionLastCollected; + ConfigHandler.writeBooleanConfig("toggles", "MinionLastCollected", ToggleCommand.minionLastCollected); + minionLastCollected.displayString = "Show When Minion Last Collected: " + Utils.getColouredBoolean(ToggleCommand.minionLastCollected); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 1f00c9f..bd60639 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -249,6 +249,7 @@ public class ConfigHandler { ToggleCommand.firePillar = initBoolean("toggles", "FirePillar", false); ToggleCommand.aliases = initBoolean("toggles", "Aliases", false); ToggleCommand.fishingAlert = initBoolean("toggles", "FishingAlert", false); + ToggleCommand.minionLastCollected = initBoolean("toggles", "MinionLastCollected", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); @@ -714,6 +715,7 @@ public class ConfigHandler { BoulderSolver.BOULDER_ARROW_COLOUR = initInt("colors", "boulderArrow", 0x006000); SilverfishSolver.SILVERFISH_LINE_COLOUR = initInt("colors", "silverfishLine", 0x40FF40); IceWalkSolver.ICE_WALK_LINE_COLOUR = initInt("colors", "iceWalkLine", 0x40FF40); + MinionLastCollected.LAST_COLLECTED_COLOUR = initInt("colors", "lastCollected", 0x55FFFF); // Commands if (!hasKey("commands", "reparty")) writeBooleanConfig("commands", "reparty", false); @@ -739,6 +741,15 @@ public class ConfigHandler { } ChatAliases.Alias[] aliases = gson.fromJson(new FileReader(ChatAliases.configFile), ChatAliases.Alias[].class); if (aliases != null) ChatAliases.aliases = new ArrayList<>(Arrays.asList(aliases)); + + // Minions + if (!(new File(MinionLastCollected.configFile).exists())) { + FileWriter file = new FileWriter(MinionLastCollected.configFile); + file.write(new JsonArray().toString()); + file.close(); + } + MinionLastCollected.Minion[] minions = gson.fromJson(new FileReader(MinionLastCollected.configFile), MinionLastCollected.Minion[].class); + if (minions != null) MinionLastCollected.minions = new ArrayList<>(Arrays.asList(minions)); } catch (IOException ex) { ex.printStackTrace(); } diff --git a/src/main/java/me/Danker/utils/RenderUtils.java b/src/main/java/me/Danker/utils/RenderUtils.java index b5ede19..c3efc90 100644 --- a/src/main/java/me/Danker/utils/RenderUtils.java +++ b/src/main/java/me/Danker/utils/RenderUtils.java @@ -138,6 +138,30 @@ public class RenderUtils { GlStateManager.popMatrix(); } + public static void draw3DString(double x, double y, double z, String text, int colour, float partialTicks) { + Minecraft mc = Minecraft.getMinecraft(); + EntityPlayer player = mc.thePlayer; + double realX = (x - player.lastTickPosX) + ((x - player.posX) - (x - player.lastTickPosX)) * partialTicks; + double realY = (y - player.lastTickPosY) + ((y - player.posY) - (y - player.lastTickPosY)) * partialTicks; + double realZ = (z - player.lastTickPosZ) + ((z - player.posZ) - (z - player.lastTickPosZ)) * partialTicks; + RenderManager renderManager = mc.getRenderManager(); + + float f = 1.6F; + float f1 = 0.016666668F * f; + int width = mc.fontRendererObj.getStringWidth(text) / 2; + GlStateManager.pushMatrix(); + GlStateManager.translate(realX, realY, realZ); + GL11.glNormal3f(0f, 1f, 0f); + GlStateManager.rotate(-renderManager.playerViewY, 0f, 1f, 0f); + GlStateManager.rotate(renderManager.playerViewX, 1f, 0f, 0f); + GlStateManager.scale(-f1, -f1, -f1); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + mc.fontRendererObj.drawString(text, -width, 0, colour); + GlStateManager.disableBlend(); + GlStateManager.popMatrix(); + } + // I couldnt get waypoint strings to work so in the end I just copied from NEU // If anyone sees this please help /*public static void draw3DWaypointString(CrystalHollowWaypoints.Waypoint waypoint, float partialTicks) { -- cgit From 77370ce777bf41fec125dbdd3d33b94d579191ba Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Wed, 3 Aug 2022 22:53:06 -0400 Subject: Fix F7 custom music I hope --- src/main/java/me/Danker/features/CustomMusic.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java index 717a3ab..8ce8c05 100644 --- a/src/main/java/me/Danker/features/CustomMusic.java +++ b/src/main/java/me/Danker/features/CustomMusic.java @@ -67,6 +67,8 @@ public class CustomMusic { public static Song park; public static int parkVolume; + static int curPhase = -1; + @SubscribeEvent public void onWorldChange(WorldEvent.Load event) { @@ -96,7 +98,7 @@ public class CustomMusic { firstLine.contains("sadan") || // F6 firstLine.contains("maxor")) { // F7 - if (ToggleCommand.dungeonBossMusic) dungeonboss.start(); + if (ToggleCommand.dungeonBossMusic && curPhase == -1) dungeonboss.start(); } } } else { @@ -159,12 +161,16 @@ public class CustomMusic { if (ToggleCommand.dungeonBossMusic) { if (message.startsWith("[BOSS] Storm: Pathetic Maxor")) { phase2.start(); + curPhase = 2; } else if (message.startsWith("[BOSS] Goldor: Who dares trespass into my domain?")) { phase3.start(); + curPhase = 3; } else if (message.startsWith("[BOSS] Necron: You went further than any human before")) { phase4.start(); + curPhase = 4; } else if (message.startsWith("[BOSS] ") && message.endsWith("You.. again?")) { phase5.start(); + curPhase = 5; } } @@ -238,6 +244,7 @@ public class CustomMusic { if (crimsonIsle != null) crimsonIsle.stop(); if (end != null) end.stop(); if (park != null) park.stop(); + curPhase = -1; } public static class Song { -- cgit From b3eb1191c49eee416b71859ee8303293e9aed72b Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 4 Aug 2022 16:37:26 -0400 Subject: Fix exception in scoreboard --- src/main/java/me/Danker/handlers/ScoreboardHandler.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/handlers/ScoreboardHandler.java b/src/main/java/me/Danker/handlers/ScoreboardHandler.java index c8bc7c7..b5785e3 100644 --- a/src/main/java/me/Danker/handlers/ScoreboardHandler.java +++ b/src/main/java/me/Danker/handlers/ScoreboardHandler.java @@ -11,6 +11,7 @@ import net.minecraft.util.StringUtils; import java.util.ArrayList; import java.util.Collection; +import java.util.ConcurrentModificationException; import java.util.List; import java.util.stream.Collectors; @@ -38,7 +39,14 @@ public class ScoreboardHandler { ScoreObjective objective = scoreboard.getObjectiveInDisplaySlot(1); if (objective == null) return lines; - Collection scores = scoreboard.getSortedScores(objective); + Collection scores; + try { + scores = scoreboard.getSortedScores(objective); + } catch (ConcurrentModificationException ex) { + ex.printStackTrace(); + return new ArrayList<>(); + } + List list = scores.stream() .filter(input -> input != null && input.getPlayerName() != null && !input.getPlayerName() .startsWith("#")) -- cgit From abd656382da708b8cd77df1f4f0a74f2287618c5 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 5 Aug 2022 00:30:35 -0400 Subject: Add trophy fishing tracker Also update trivia answers and add mod init event --- README.md | 6 +- src/main/java/me/Danker/DankersSkyblockMod.java | 11 +- .../java/me/Danker/commands/DisplayCommand.java | 11 +- .../me/Danker/commands/ImportFishingCommand.java | 39 ++++++- src/main/java/me/Danker/commands/LootCommand.java | 52 ++++++++- .../java/me/Danker/commands/ResetLootCommand.java | 4 + src/main/java/me/Danker/events/ModInitEvent.java | 13 +++ src/main/java/me/Danker/features/Alerts.java | 6 ++ src/main/java/me/Danker/features/ChatAliases.java | 6 ++ src/main/java/me/Danker/features/CustomMusic.java | 7 ++ .../java/me/Danker/features/GemstonesLore.java | 4 +- .../java/me/Danker/features/GoldenEnchants.java | 4 +- .../me/Danker/features/MinionLastCollected.java | 6 ++ .../java/me/Danker/features/loot/LootDisplay.java | 76 +++++++++++++ .../me/Danker/features/loot/TrophyFishTracker.java | 120 +++++++++++++++++++++ .../features/puzzlesolvers/TriviaSolver.java | 11 +- src/main/java/me/Danker/gui/DisplayGui.java | 18 ++-- .../java/me/Danker/handlers/ConfigHandler.java | 11 +- src/main/java/me/Danker/utils/Utils.java | 12 +++ 19 files changed, 386 insertions(+), 31 deletions(-) create mode 100644 src/main/java/me/Danker/events/ModInitEvent.java create mode 100644 src/main/java/me/Danker/features/loot/TrophyFishTracker.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index 98bf434..624989f 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Discord Server: https://discord.gg/QsEkNQS - Maddox menu keybind - Block starting other slayer quests - Slayer slain alert -- Fishing, jerry fishing, fishing festival, spooky fishing, crystal hollows fishing, lava fishing trackers +- Fishing, jerry fishing, fishing festival, spooky fishing, crystal hollows fishing, lava fishing, trophy fishing trackers - Expertise kills in fishing rod lore - Gemstones applied in item lore - Catacombs trackers @@ -87,8 +87,8 @@ Discord Server: https://discord.gg/QsEkNQS - /toggle - Toggles features. /toggle list returns values of every toggle. - /setkey - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. -- /loot [winter/festival/spooky/ch/lava/f(1-7)/mm/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. -- /display [winter/festival/spooky/ch/lava/f(1-7)/mm/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active. +- /loot [winter/festival/spooky/ch/lava/trophy/f(1-7)/mm/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. +- /display [winter/festival/spooky/ch/lava/trophy/f(1-7)/mm/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active. - /resetloot - - Resets loot for trackers. /resetloot confirm confirms the reset. - /move - Moves text display to specified X and Y coordinates. - /scale - Scales text display to a specified multipler between 0.1x and 10x. diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index a63552c..6322c33 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -4,6 +4,7 @@ import com.google.gson.JsonObject; import me.Danker.commands.*; import me.Danker.events.ChestSlotClickedEvent; import me.Danker.events.GuiChestBackgroundDrawnEvent; +import me.Danker.events.ModInitEvent; import me.Danker.events.RenderOverlayEvent; import me.Danker.features.*; import me.Danker.features.loot.*; @@ -177,18 +178,12 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new GhostTracker()); MinecraftForge.EVENT_BUS.register(new MythologicalTracker()); MinecraftForge.EVENT_BUS.register(new SpiderTracker()); + MinecraftForge.EVENT_BUS.register(new TrophyFishTracker()); MinecraftForge.EVENT_BUS.register(new WolfTracker()); MinecraftForge.EVENT_BUS.register(new ZombieTracker()); - Alerts.configFile = configDirectory + "/dsmalerts.json"; - ChatAliases.configFile = configDirectory + "/dsmaliases.json"; - MinionLastCollected.configFile = configDirectory + "/dsmminions.json"; - + MinecraftForge.EVENT_BUS.post(new ModInitEvent(configDirectory)); ConfigHandler.reloadConfig(); - GoldenEnchants.init(); - TriviaSolver.init(); - CustomMusic.init(configDirectory); - GemstonesLore.init(); keyBindings[0] = new KeyBinding("Open Maddox Menu", Keyboard.KEY_M, "Danker's Skyblock Mod"); keyBindings[1] = new KeyBinding("Regular Ability", Keyboard.KEY_NUMPAD4, "Danker's Skyblock Mod"); diff --git a/src/main/java/me/Danker/commands/DisplayCommand.java b/src/main/java/me/Danker/commands/DisplayCommand.java index 21ada93..c340ed8 100644 --- a/src/main/java/me/Danker/commands/DisplayCommand.java +++ b/src/main/java/me/Danker/commands/DisplayCommand.java @@ -21,7 +21,7 @@ public class DisplayCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " [winter/festival/spooky/ch/lava/session/f(1-7)/mm]"; + return "/" + getCommandName() + " [winter/festival/spooky/ch/lava/trophy/session/f(1-7)/mm]"; } public static String usage(ICommandSender arg0) { @@ -38,7 +38,7 @@ public class DisplayCommand extends CommandBase { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "enderman", "blaze", "fishing", "catacombs", "mythological", "ghost", "auto", "off"); } else if (args.length == 2 && args[0].equalsIgnoreCase("fishing")) { - return getListOfStringsMatchingLastWord(args, "winter", "festival", "spooky", "ch", "lava", "session"); + return getListOfStringsMatchingLastWord(args, "winter", "festival", "spooky", "ch", "lava", "trophy", "session"); } else if (args.length == 2 && args[0].equalsIgnoreCase("catacombs")) { return getListOfStringsMatchingLastWord(args, "f1", "floor1", "f2", "floor2", "f3", "floor3", "f4", "floor4", "f5", "floor5", "f6", "floor6", "f7", "floor7", "mm", "master"); } else if (args.length > 1) { @@ -132,6 +132,13 @@ public class DisplayCommand extends CommandBase { LootDisplay.display = "fishing_lava"; } break; + case "trophy": + if (showSession) { + LootDisplay.display = "fishing_trophy_session"; + } else { + LootDisplay.display = "fishing_trophy"; + } + break; default: if (showSession) { LootDisplay.display = "fishing_session"; diff --git a/src/main/java/me/Danker/commands/ImportFishingCommand.java b/src/main/java/me/Danker/commands/ImportFishingCommand.java index 46d9906..6658bcd 100644 --- a/src/main/java/me/Danker/commands/ImportFishingCommand.java +++ b/src/main/java/me/Danker/commands/ImportFishingCommand.java @@ -3,6 +3,7 @@ package me.Danker.commands; import com.google.gson.JsonObject; import me.Danker.DankersSkyblockMod; import me.Danker.features.loot.FishingTracker; +import me.Danker.features.loot.TrophyFishTracker; import me.Danker.handlers.APIHandler; import me.Danker.handlers.ConfigHandler; import net.minecraft.command.CommandBase; @@ -63,7 +64,9 @@ public class ImportFishingCommand extends CommandBase { } System.out.println("Fetching fishing stats..."); - JsonObject statsObject = profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject().get("stats").getAsJsonObject(); + JsonObject memberObject = profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject(); + JsonObject statsObject = memberObject.get("stats").getAsJsonObject(); + JsonObject trophyObject = memberObject.get("trophy_fish").getAsJsonObject(); FishingTracker.greatCatches = 0; FishingTracker.goodCatches = 0; @@ -123,7 +126,7 @@ public class ImportFishingCommand extends CommandBase { FishingTracker.thunders = getSCFromApi(statsObject, "kills_thunder"); FishingTracker.lordJawbuses = getSCFromApi(statsObject, "kills_lord_jawbus"); - System.out.println("Writing to config..."); + System.out.println("Writing SC to config..."); ConfigHandler.writeIntConfig("fishing", "goodCatch", FishingTracker.goodCatches); ConfigHandler.writeIntConfig("fishing", "greatCatch", FishingTracker.greatCatches); ConfigHandler.writeIntConfig("fishing", "seaCreature", FishingTracker.seaCreatures); @@ -172,6 +175,27 @@ public class ImportFishingCommand extends CommandBase { ConfigHandler.writeIntConfig("fishing", "thunder", FishingTracker.thunders); ConfigHandler.writeIntConfig("fishing", "lordJawbus", FishingTracker.lordJawbuses); + TrophyFishTracker.fish = TrophyFishTracker.createEmpty(); + TrophyFishTracker.fish.add("Sulpher Skitter", getTrophyFromAPI(trophyObject, "sulphur_skitter")); + TrophyFishTracker.fish.add("Obfuscated 1", getTrophyFromAPI(trophyObject, "obfuscated_fish_1")); + TrophyFishTracker.fish.add("Steaming-Hot Flounder", getTrophyFromAPI(trophyObject, "steaming_hot_flounder")); + TrophyFishTracker.fish.add("Obfuscated 2", getTrophyFromAPI(trophyObject, "obfuscated_fish_2")); + TrophyFishTracker.fish.add("Gusher", getTrophyFromAPI(trophyObject, "gusher")); + TrophyFishTracker.fish.add("Blobfish", getTrophyFromAPI(trophyObject, "blobfish")); + TrophyFishTracker.fish.add("Slugfish", getTrophyFromAPI(trophyObject, "slugfish")); + TrophyFishTracker.fish.add("Obfuscated 3", getTrophyFromAPI(trophyObject, "obfuscated_fish_3")); + TrophyFishTracker.fish.add("Flyfish", getTrophyFromAPI(trophyObject, "flyfish")); + TrophyFishTracker.fish.add("Lavahorse", getTrophyFromAPI(trophyObject, "lava_horse")); + TrophyFishTracker.fish.add("Mana Ray", getTrophyFromAPI(trophyObject, "mana_ray")); + TrophyFishTracker.fish.add("Volcanic Stonefish", getTrophyFromAPI(trophyObject, "volcanic_stonefish")); + TrophyFishTracker.fish.add("Vanille", getTrophyFromAPI(trophyObject, "vanille")); + TrophyFishTracker.fish.add("Skeleton Fish", getTrophyFromAPI(trophyObject, "skeleton_fish")); + TrophyFishTracker.fish.add("Moldfin", getTrophyFromAPI(trophyObject, "moldfin")); + TrophyFishTracker.fish.add("Soul Fish", getTrophyFromAPI(trophyObject, "soul_fish")); + TrophyFishTracker.fish.add("Karate Fish", getTrophyFromAPI(trophyObject, "karate_fish")); + TrophyFishTracker.fish.add("Golden Fish", getTrophyFromAPI(trophyObject, "golden_fish")); + TrophyFishTracker.save(); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Fishing stats imported.")); }).start(); } @@ -183,4 +207,15 @@ public class ImportFishingCommand extends CommandBase { return sc; } + static JsonObject getTrophyFromAPI(JsonObject obj, String name) { + JsonObject tiers = new JsonObject(); + + tiers.addProperty("BRONZE", obj.has(name + "_bronze") ? obj.get(name + "_bronze").getAsInt() : 0); + tiers.addProperty("SILVER", obj.has(name + "_silver") ? obj.get(name + "_silver").getAsInt() : 0); + tiers.addProperty("GOLD", obj.has(name + "_gold") ? obj.get(name + "_gold").getAsInt() : 0); + tiers.addProperty("DIAMOND", obj.has(name + "_diamond") ? obj.get(name + "_diamond").getAsInt() : 0); + + return tiers; + } + } diff --git a/src/main/java/me/Danker/commands/LootCommand.java b/src/main/java/me/Danker/commands/LootCommand.java index af5479e..3c224bb 100644 --- a/src/main/java/me/Danker/commands/LootCommand.java +++ b/src/main/java/me/Danker/commands/LootCommand.java @@ -24,7 +24,7 @@ public class LootCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " [winter/festival/spooky/ch/lava/f(1-7)/mm/session]"; + return "/" + getCommandName() + " [winter/festival/spooky/ch/lava/trophy/f(1-7)/mm/session]"; } public static String usage(ICommandSender arg0) { @@ -41,7 +41,7 @@ public class LootCommand extends CommandBase { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "enderman", "blaze", "fishing", "catacombs", "mythological"); } else if (args.length == 2 && args[0].equalsIgnoreCase("fishing")) { - return getListOfStringsMatchingLastWord(args, "winter", "festival", "spooky", "ch", "lava", "session"); + return getListOfStringsMatchingLastWord(args, "winter", "festival", "spooky", "ch", "lava", "trophy", "session"); } else if (args.length == 2 && args[0].equalsIgnoreCase("catacombs")) { return getListOfStringsMatchingLastWord(args, "f1", "floor1", "f2", "floor2", "f3", "floor3", "f4", "floor4", "f5", "floor5", "f6", "floor6", "f7", "floor7", "mm", "master"); } else if (args.length > 1) { @@ -621,6 +621,54 @@ public class LootCommand extends CommandBase { EnumChatFormatting.AQUA + " Creatures Since Lord Jawbus: " + bossesBetween + "\n" + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + " -------------------")); return; + } else if (arg1[1].equalsIgnoreCase("trophy")) { + if (showSession) { + player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.GOLD + EnumChatFormatting.BOLD + " Trophy Fishing Summary (Current Session):\n" + + EnumChatFormatting.WHITE + " Sulpher Skitter " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fishSession, "Sulpher Skitter") + ")" + EnumChatFormatting.WHITE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Sulpher Skitter") + "\n" + + EnumChatFormatting.WHITE + " Obfuscated 1 " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fishSession, "Obfuscated 1") + ")" + EnumChatFormatting.WHITE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Obfuscated 1") + "\n" + + EnumChatFormatting.WHITE + " Steaminghot Flounder " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fishSession, "Steaming-Hot Flounder") + ")" + EnumChatFormatting.WHITE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Steaming-Hot Flounder") + "\n" + + EnumChatFormatting.WHITE + " Gusher " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fishSession, "Gusher") + ")" + EnumChatFormatting.WHITE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Gusher") + "\n" + + EnumChatFormatting.WHITE + " Blobfish " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fishSession, "Blobfish") + ")" + EnumChatFormatting.WHITE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Blobfish") + "\n" + + EnumChatFormatting.GREEN + " Obfuscated 2 " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fishSession, "Obfuscated 2") + ")" + EnumChatFormatting.GREEN + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Obfuscated 2") + "\n" + + EnumChatFormatting.GREEN + " Slugfish " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fishSession, "Slugfish") + ")" + EnumChatFormatting.GREEN + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Slugfish") + "\n" + + EnumChatFormatting.GREEN + " Flyfish " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fishSession, "Flyfish") + ")" + EnumChatFormatting.GREEN + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Flyfish") + "\n" + + EnumChatFormatting.BLUE + " Obfuscated 3 " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fishSession, "Obfuscated 3") + ")" + EnumChatFormatting.BLUE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Obfuscated 3") + "\n" + + EnumChatFormatting.BLUE + " Lavahorse " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fishSession, "Lavahorse") + ")" + EnumChatFormatting.BLUE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Lavahorse") + "\n" + + EnumChatFormatting.BLUE + " Mana Ray " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fishSession, "Mana Ray") + ")" + EnumChatFormatting.BLUE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Mana Ray") + "\n" + + EnumChatFormatting.BLUE + " Volcanic Stonefish " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fishSession, "Volcanic Stonefish") + ")" + EnumChatFormatting.BLUE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Volcanic Stonefish") + "\n" + + EnumChatFormatting.BLUE + " Vanille " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fishSession, "Vanille") + ")" + EnumChatFormatting.BLUE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Vanille") + "\n" + + EnumChatFormatting.DARK_PURPLE + " Skeleton Fish " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fishSession, "Skeleton Fish") + ")" + EnumChatFormatting.DARK_PURPLE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Skeleton Fish") + "\n" + + EnumChatFormatting.DARK_PURPLE + " Moldfin " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fishSession, "Moldfin") + ")" + EnumChatFormatting.DARK_PURPLE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Moldfin") + "\n" + + EnumChatFormatting.DARK_PURPLE + " Soul Fish " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fishSession, "Soul Fish") + ")" + EnumChatFormatting.DARK_PURPLE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Soul Fish") + "\n" + + EnumChatFormatting.DARK_PURPLE + " Karate Fish " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fishSession, "Karate Fish") + ")" + EnumChatFormatting.DARK_PURPLE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Karate Fish") + "\n" + + EnumChatFormatting.GOLD + " Golden Fish " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fishSession, "Golden Fish") + ")" + EnumChatFormatting.GOLD + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Golden Fish") + "\n" + + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + "-------------------")); + return; + } + + player.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.GOLD + EnumChatFormatting.BOLD + " Trophy Fishing Summary:\n" + + EnumChatFormatting.WHITE + " Sulpher Skitter " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fish, "Sulpher Skitter") + ")" + EnumChatFormatting.WHITE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Sulpher Skitter") + "\n" + + EnumChatFormatting.WHITE + " Obfuscated 1 " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fish, "Obfuscated 1") + ")" + EnumChatFormatting.WHITE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Obfuscated 1") + "\n" + + EnumChatFormatting.WHITE + " Steaminghot Flounder " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fish, "Steaming-Hot Flounder") + ")" + EnumChatFormatting.WHITE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Steaming-Hot Flounder") + "\n" + + EnumChatFormatting.WHITE + " Gusher " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fish, "Gusher") + ")" + EnumChatFormatting.WHITE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Gusher") + "\n" + + EnumChatFormatting.WHITE + " Blobfish " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fish, "Blobfish") + ")" + EnumChatFormatting.WHITE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Blobfish") + "\n" + + EnumChatFormatting.GREEN + " Obfuscated 2 " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fish, "Obfuscated 2") + ")" + EnumChatFormatting.GREEN + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Obfuscated 2") + "\n" + + EnumChatFormatting.GREEN + " Slugfish " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fish, "Slugfish") + ")" + EnumChatFormatting.GREEN + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Slugfish") + "\n" + + EnumChatFormatting.GREEN + " Flyfish " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fish, "Flyfish") + ")" + EnumChatFormatting.GREEN + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Flyfish") + "\n" + + EnumChatFormatting.BLUE + " Obfuscated 3 " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fish, "Obfuscated 3") + ")" + EnumChatFormatting.BLUE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Obfuscated 3") + "\n" + + EnumChatFormatting.BLUE + " Lavahorse " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fish, "Lavahorse") + ")" + EnumChatFormatting.BLUE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Lavahorse") + "\n" + + EnumChatFormatting.BLUE + " Mana Ray " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fish, "Mana Ray") + ")" + EnumChatFormatting.BLUE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Mana Ray") + "\n" + + EnumChatFormatting.BLUE + " Volcanic Stonefish " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fish, "Volcanic Stonefish") + ")" + EnumChatFormatting.BLUE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Volcanic Stonefish") + "\n" + + EnumChatFormatting.BLUE + " Vanille " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fish, "Vanille") + ")" + EnumChatFormatting.BLUE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Vanille") + "\n" + + EnumChatFormatting.DARK_PURPLE + " Skeleton Fish " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fish, "Skeleton Fish") + ")" + EnumChatFormatting.DARK_PURPLE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Skeleton Fish") + "\n" + + EnumChatFormatting.DARK_PURPLE + " Moldfin " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fish, "Moldfin") + ")" + EnumChatFormatting.DARK_PURPLE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Moldfin") + "\n" + + EnumChatFormatting.DARK_PURPLE + " Soul Fish " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fish, "Soul Fish") + ")" + EnumChatFormatting.DARK_PURPLE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Soul Fish") + "\n" + + EnumChatFormatting.DARK_PURPLE + " Karate Fish " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fish, "Karate Fish") + ")" + EnumChatFormatting.DARK_PURPLE + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Karate Fish") + "\n" + + EnumChatFormatting.GOLD + " Golden Fish " + EnumChatFormatting.DARK_GRAY + "(" + TrophyFishTracker.getSum(TrophyFishTracker.fish, "Golden Fish") + ")" + EnumChatFormatting.GOLD + ": " + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Golden Fish") + "\n" + + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + "-------------------")); + return; } } diff --git a/src/main/java/me/Danker/commands/ResetLootCommand.java b/src/main/java/me/Danker/commands/ResetLootCommand.java index 9ccef33..00cf8f6 100644 --- a/src/main/java/me/Danker/commands/ResetLootCommand.java +++ b/src/main/java/me/Danker/commands/ResetLootCommand.java @@ -293,6 +293,10 @@ public class ResetLootCommand extends CommandBase { FishingTracker.jawbusSCsSession = -1; ConfigHandler.deleteCategory("fishing"); ConfigHandler.reloadConfig(); + + TrophyFishTracker.fish = TrophyFishTracker.createEmpty(); + TrophyFishTracker.fishSession = TrophyFishTracker.createEmpty(); + TrophyFishTracker.save(); } static void resetMythological() { diff --git a/src/main/java/me/Danker/events/ModInitEvent.java b/src/main/java/me/Danker/events/ModInitEvent.java new file mode 100644 index 0000000..e1cc644 --- /dev/null +++ b/src/main/java/me/Danker/events/ModInitEvent.java @@ -0,0 +1,13 @@ +package me.Danker.events; + +import net.minecraftforge.fml.common.eventhandler.Event; + +public class ModInitEvent extends Event { + + public final String configDirectory; + + public ModInitEvent(String configDirectory) { + this.configDirectory = configDirectory; + } + +} diff --git a/src/main/java/me/Danker/features/Alerts.java b/src/main/java/me/Danker/features/Alerts.java index 8f45423..e54a212 100644 --- a/src/main/java/me/Danker/features/Alerts.java +++ b/src/main/java/me/Danker/features/Alerts.java @@ -3,6 +3,7 @@ package me.Danker.features; import com.google.gson.GsonBuilder; import javafx.scene.control.Alert; import me.Danker.commands.ToggleCommand; +import me.Danker.events.ModInitEvent; import me.Danker.utils.Utils; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StringUtils; @@ -24,6 +25,11 @@ public class Alerts { public static HashMap patterns = new HashMap<>(); public static String configFile; + @SubscribeEvent + public void init(ModInitEvent event) { + configFile = event.configDirectory + "/dsmalerts.json"; + } + @SubscribeEvent public void onChat(ClientChatReceivedEvent event) { if (!ToggleCommand.alerts || event.type == 2) return; diff --git a/src/main/java/me/Danker/features/ChatAliases.java b/src/main/java/me/Danker/features/ChatAliases.java index ae9e0f7..76ab5f6 100644 --- a/src/main/java/me/Danker/features/ChatAliases.java +++ b/src/main/java/me/Danker/features/ChatAliases.java @@ -1,6 +1,7 @@ package me.Danker.features; import com.google.gson.GsonBuilder; +import me.Danker.events.ModInitEvent; import me.Danker.events.PacketWriteEvent; import net.minecraft.client.Minecraft; import net.minecraft.network.play.client.C01PacketChatMessage; @@ -16,6 +17,11 @@ public class ChatAliases { public static List aliases = new ArrayList<>(); public static String configFile; + @SubscribeEvent + public void init(ModInitEvent event) { + configFile = event.configDirectory + "/dsmaliases.json"; + } + @SubscribeEvent public void onPacketWrite(PacketWriteEvent event) { if (event.packet instanceof C01PacketChatMessage) { diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java index 8ce8c05..e6f8131 100644 --- a/src/main/java/me/Danker/features/CustomMusic.java +++ b/src/main/java/me/Danker/features/CustomMusic.java @@ -2,6 +2,7 @@ package me.Danker.features; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; +import me.Danker.events.ModInitEvent; import me.Danker.handlers.ScoreboardHandler; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; @@ -13,6 +14,7 @@ import net.minecraft.world.World; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.sound.PlaySoundEvent; import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; @@ -196,6 +198,11 @@ public class CustomMusic { } } + @SubscribeEvent + public void init(ModInitEvent event) { + init(event.configDirectory); + } + public static void init(String configDirectory) { if (configDirectory == null) return; File directory = new File(configDirectory + "/dsmmusic"); diff --git a/src/main/java/me/Danker/features/GemstonesLore.java b/src/main/java/me/Danker/features/GemstonesLore.java index 7db2d33..b16edaf 100644 --- a/src/main/java/me/Danker/features/GemstonesLore.java +++ b/src/main/java/me/Danker/features/GemstonesLore.java @@ -1,6 +1,7 @@ package me.Danker.features; import me.Danker.commands.ToggleCommand; +import me.Danker.events.ModInitEvent; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; @@ -18,7 +19,8 @@ public class GemstonesLore { static Map gemstoneColours = new HashMap<>(); - public static void init() { + @SubscribeEvent + public void init(ModInitEvent event) { gemstoneColours.put("Amber", EnumChatFormatting.GOLD); gemstoneColours.put("Sapphire", EnumChatFormatting.AQUA); gemstoneColours.put("Jasper", EnumChatFormatting.LIGHT_PURPLE); diff --git a/src/main/java/me/Danker/features/GoldenEnchants.java b/src/main/java/me/Danker/features/GoldenEnchants.java index d633ec5..228d43e 100644 --- a/src/main/java/me/Danker/features/GoldenEnchants.java +++ b/src/main/java/me/Danker/features/GoldenEnchants.java @@ -1,6 +1,7 @@ package me.Danker.features; import me.Danker.commands.ToggleCommand; +import me.Danker.events.ModInitEvent; import me.Danker.utils.Utils; import net.minecraftforge.event.entity.player.ItemTooltipEvent; import net.minecraftforge.fml.common.eventhandler.EventPriority; @@ -15,7 +16,8 @@ public class GoldenEnchants { public static Map t6Enchants = new HashMap<>(); public static Pattern t6EnchantPattern = Pattern.compile(""); - public static void init() { + @SubscribeEvent + public void init(ModInitEvent event) { t6Enchants.put("9Angler VI", "6Angler VI"); t6Enchants.put("9Bane of Arthropods VI", "6Bane of Arthropods VI"); t6Enchants.put("9Caster VI", "6Caster VI"); diff --git a/src/main/java/me/Danker/features/MinionLastCollected.java b/src/main/java/me/Danker/features/MinionLastCollected.java index 884dccf..7079f40 100644 --- a/src/main/java/me/Danker/features/MinionLastCollected.java +++ b/src/main/java/me/Danker/features/MinionLastCollected.java @@ -3,6 +3,7 @@ package me.Danker.features; import com.google.gson.GsonBuilder; import me.Danker.commands.ToggleCommand; import me.Danker.events.ChestSlotClickedEvent; +import me.Danker.events.ModInitEvent; import me.Danker.events.PacketWriteEvent; import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; @@ -28,6 +29,11 @@ public class MinionLastCollected { static BlockPos lastMinion = null; public static int LAST_COLLECTED_COLOUR; + @SubscribeEvent + public void init(ModInitEvent event) { + configFile = event.configDirectory + "/dsmminions.json"; + } + @SubscribeEvent public void onPacketWrite(PacketWriteEvent event) { if (ToggleCommand.minionLastCollected && Utils.inSkyblock && Utils.isInScoreboard("Your Island")) { diff --git a/src/main/java/me/Danker/features/loot/LootDisplay.java b/src/main/java/me/Danker/features/loot/LootDisplay.java index 7832362..556108c 100644 --- a/src/main/java/me/Danker/features/loot/LootDisplay.java +++ b/src/main/java/me/Danker/features/loot/LootDisplay.java @@ -946,6 +946,82 @@ public class LootDisplay { EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; break; + case "fishing_trophy": + dropsText = EnumChatFormatting.WHITE + "Sulpher Skitter:\n" + + EnumChatFormatting.WHITE + "Obfuscated 1:\n" + + EnumChatFormatting.WHITE + "Steaminghot Flounder:\n" + + EnumChatFormatting.WHITE + "Gusher:\n" + + EnumChatFormatting.WHITE + "Blobfish:\n" + + EnumChatFormatting.GREEN + "Obfuscated 2:\n" + + EnumChatFormatting.GREEN + "Slugfish:\n" + + EnumChatFormatting.GREEN + "Flyfish:\n" + + EnumChatFormatting.BLUE + "Obfuscated 3:\n" + + EnumChatFormatting.BLUE + "Lavahorse:\n" + + EnumChatFormatting.BLUE + "Mana Ray:\n" + + EnumChatFormatting.BLUE + "Volcanic Stonefish:\n" + + EnumChatFormatting.BLUE + "Vanille:\n" + + EnumChatFormatting.DARK_PURPLE + "Skeleton Fish:\n" + + EnumChatFormatting.DARK_PURPLE + "Moldfin:\n" + + EnumChatFormatting.DARK_PURPLE + "Soul Fish:\n" + + EnumChatFormatting.DARK_PURPLE + "Karate Fish:\n" + + EnumChatFormatting.GOLD + "Golden Fish:"; + countText = EnumChatFormatting.WHITE + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Sulpher Skitter") + "\n" + + EnumChatFormatting.WHITE + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Obfuscated 1") + "\n" + + EnumChatFormatting.WHITE + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Steaming-Hot Flounder") + "\n" + + EnumChatFormatting.WHITE + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Gusher") + "\n" + + EnumChatFormatting.WHITE + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Blobfish") + "\n" + + EnumChatFormatting.GREEN + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Obfuscated 2") + "\n" + + EnumChatFormatting.GREEN + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Slugfish") + "\n" + + EnumChatFormatting.GREEN + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Flyfish") + "\n" + + EnumChatFormatting.BLUE + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Obfuscated 3") + "\n" + + EnumChatFormatting.BLUE + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Lavahorse") + "\n" + + EnumChatFormatting.BLUE + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Mana Ray") + "\n" + + EnumChatFormatting.BLUE + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Volcanic Stonefish") + "\n" + + EnumChatFormatting.BLUE + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Vanille") + "\n" + + EnumChatFormatting.DARK_PURPLE + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Skeleton Fish") + "\n" + + EnumChatFormatting.DARK_PURPLE + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Moldfin") + "\n" + + EnumChatFormatting.DARK_PURPLE + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Soul Fish") + "\n" + + EnumChatFormatting.DARK_PURPLE + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Karate Fish") + "\n" + + EnumChatFormatting.GOLD + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Golden Fish"); + break; + case "fishing_trophy_session": + dropsText = EnumChatFormatting.WHITE + "Sulpher Skitter:\n" + + EnumChatFormatting.WHITE + "Obfuscated 1:\n" + + EnumChatFormatting.WHITE + "Steaminghot Flounder:\n" + + EnumChatFormatting.WHITE + "Gusher:\n" + + EnumChatFormatting.WHITE + "Blobfish:\n" + + EnumChatFormatting.GREEN + "Obfuscated 2:\n" + + EnumChatFormatting.GREEN + "Slugfish:\n" + + EnumChatFormatting.GREEN + "Flyfish:\n" + + EnumChatFormatting.BLUE + "Obfuscated 3:\n" + + EnumChatFormatting.BLUE + "Lavahorse:\n" + + EnumChatFormatting.BLUE + "Mana Ray:\n" + + EnumChatFormatting.BLUE + "Volcanic Stonefish:\n" + + EnumChatFormatting.BLUE + "Vanille:\n" + + EnumChatFormatting.DARK_PURPLE + "Skeleton Fish:\n" + + EnumChatFormatting.DARK_PURPLE + "Moldfin:\n" + + EnumChatFormatting.DARK_PURPLE + "Soul Fish:\n" + + EnumChatFormatting.DARK_PURPLE + "Karate Fish:\n" + + EnumChatFormatting.GOLD + "Golden Fish:"; + countText = EnumChatFormatting.WHITE + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Sulpher Skitter") + "\n" + + EnumChatFormatting.WHITE + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Obfuscated 1") + "\n" + + EnumChatFormatting.WHITE + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Steaming-Hot Flounder") + "\n" + + EnumChatFormatting.WHITE + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Gusher") + "\n" + + EnumChatFormatting.WHITE + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Blobfish") + "\n" + + EnumChatFormatting.GREEN + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Obfuscated 2") + "\n" + + EnumChatFormatting.GREEN + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Slugfish") + "\n" + + EnumChatFormatting.GREEN + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Flyfish") + "\n" + + EnumChatFormatting.BLUE + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Obfuscated 3") + "\n" + + EnumChatFormatting.BLUE + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Lavahorse") + "\n" + + EnumChatFormatting.BLUE + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Mana Ray") + "\n" + + EnumChatFormatting.BLUE + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Volcanic Stonefish") + "\n" + + EnumChatFormatting.BLUE + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Vanille") + "\n" + + EnumChatFormatting.DARK_PURPLE + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Skeleton Fish") + "\n" + + EnumChatFormatting.DARK_PURPLE + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Moldfin") + "\n" + + EnumChatFormatting.DARK_PURPLE + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Soul Fish") + "\n" + + EnumChatFormatting.DARK_PURPLE + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Karate Fish") + "\n" + + EnumChatFormatting.GOLD + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Golden Fish"); + break; case "mythological": dropsText = EnumChatFormatting.GOLD + "Coins:\n" + EnumChatFormatting.WHITE + "Griffin Feathers:\n" + diff --git a/src/main/java/me/Danker/features/loot/TrophyFishTracker.java b/src/main/java/me/Danker/features/loot/TrophyFishTracker.java new file mode 100644 index 0000000..d11fcfe --- /dev/null +++ b/src/main/java/me/Danker/features/loot/TrophyFishTracker.java @@ -0,0 +1,120 @@ +package me.Danker.features.loot; + +import com.google.gson.GsonBuilder; +import com.google.gson.JsonObject; +import me.Danker.events.ModInitEvent; +import me.Danker.utils.Utils; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StringUtils; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.io.FileWriter; +import java.io.IOException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class TrophyFishTracker { + + public static JsonObject fish = new JsonObject(); + public static JsonObject fishSession = new JsonObject(); + public static Pattern fishPattern = Pattern.compile("TROPHY FISH! You caught a (?.*) (?.*)."); + public static String configFile; + + public static JsonObject createEmpty() { + JsonObject fish = new JsonObject(); + + JsonObject tiers = new JsonObject(); + tiers.addProperty("BRONZE", 0); + tiers.addProperty("SILVER", 0); + tiers.addProperty("GOLD", 0); + tiers.addProperty("DIAMOND", 0); + + fish.add("Sulpher Skitter", Utils.deepCopy(tiers)); + fish.add("Obfuscated 1", Utils.deepCopy(tiers)); + fish.add("Steaming-Hot Flounder", Utils.deepCopy(tiers)); + fish.add("Obfuscated 2", Utils.deepCopy(tiers)); + fish.add("Gusher", Utils.deepCopy(tiers)); + fish.add("Blobfish", Utils.deepCopy(tiers)); + fish.add("Slugfish", Utils.deepCopy(tiers)); + fish.add("Obfuscated 3", Utils.deepCopy(tiers)); + fish.add("Flyfish", Utils.deepCopy(tiers)); + fish.add("Lavahorse", Utils.deepCopy(tiers)); + fish.add("Mana Ray", Utils.deepCopy(tiers)); + fish.add("Volcanic Stonefish", Utils.deepCopy(tiers)); + fish.add("Vanille", Utils.deepCopy(tiers)); + fish.add("Skeleton Fish", Utils.deepCopy(tiers)); + fish.add("Moldfin", Utils.deepCopy(tiers)); + fish.add("Soul Fish", Utils.deepCopy(tiers)); + fish.add("Karate Fish", Utils.deepCopy(tiers)); + fish.add("Golden Fish", Utils.deepCopy(tiers)); + + return fish; + } + + @SubscribeEvent + public void init(ModInitEvent event) { + configFile = event.configDirectory + "/dsmtrophyfish.json"; + if (fish.entrySet().isEmpty()) fish = createEmpty(); + fishSession = createEmpty(); + } + + @SubscribeEvent(receiveCanceled = true) + public void onChat(ClientChatReceivedEvent event) { + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + + if (!Utils.inSkyblock) return; + if (!Utils.tabLocation.equals("Crimson Isle")) return; + if (event.type == 2) return; + if (message.contains(":")) return; + + Matcher matcher = fishPattern.matcher(message); + + if (matcher.matches()) { + String fishName = matcher.group("fish"); + String tier = matcher.group("tier"); + + JsonObject fishObj = fish.get(fishName).getAsJsonObject(); + int amount = fishObj.get(tier).getAsInt(); + fishObj.addProperty(tier, amount + 1); + + JsonObject fishSessionObj = fishSession.get(fishName).getAsJsonObject(); + int amountSession = fishSessionObj.get(tier).getAsInt(); + fishSessionObj.addProperty(tier, amountSession + 1); + + save(); + } + } + + public static void save() { + try (FileWriter writer = new FileWriter(configFile)) { + new GsonBuilder().create().toJson(fish, writer); + writer.flush(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + + public static String getTierCount(JsonObject obj, String name) { + JsonObject type = obj.get(name).getAsJsonObject(); + + int bronze = type.get("BRONZE").getAsInt(); + int silver = type.get("SILVER").getAsInt(); + int gold = type.get("GOLD").getAsInt(); + int diamond = type.get("DIAMOND").getAsInt(); + + return EnumChatFormatting.DARK_GRAY + "" + bronze + EnumChatFormatting.WHITE + "-" + + EnumChatFormatting.GRAY + silver + EnumChatFormatting.WHITE + "-" + + EnumChatFormatting.GOLD + gold + EnumChatFormatting.WHITE + "-" + + EnumChatFormatting.AQUA + diamond; + } + + public static int getSum(JsonObject obj, String name) { + JsonObject type = obj.get(name).getAsJsonObject(); + return type.get("BRONZE").getAsInt() + + type.get("SILVER").getAsInt() + + type.get("GOLD").getAsInt() + + type.get("DIAMOND").getAsInt(); + } + +} diff --git a/src/main/java/me/Danker/features/puzzlesolvers/TriviaSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/TriviaSolver.java index dd2c23e..23d0228 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/TriviaSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/TriviaSolver.java @@ -5,6 +5,7 @@ import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; +import me.Danker.events.ModInitEvent; import me.Danker.utils.Utils; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; @@ -26,7 +27,8 @@ public class TriviaSolver { static JsonArray triviaAnswersJson = null; public static String TRIVIA_WRONG_ANSWER_COLOUR; - public static void init() { + @SubscribeEvent + public void init(ModInitEvent event) { // Hard coded solutions if api call fails triviaSolutions.put("What is the status of The Watcher?", new String[]{"Stalker"}); triviaSolutions.put("What is the status of Bonzo?", new String[]{"New Necromancer"}); @@ -39,11 +41,12 @@ public class TriviaSolver { triviaSolutions.put("What is the status of Goldor?", new String[]{"Wither Soldier"}); triviaSolutions.put("What is the status of Storm?", new String[]{"Elementalist"}); triviaSolutions.put("What is the status of Necron?", new String[]{"Wither Lord"}); - triviaSolutions.put("How many total Fairy Souls are there?", new String[]{"227 Fairy Souls"}); + triviaSolutions.put("What is the status of Maxor, Storm, Goldor and Necron?", new String[]{"Wither Lord"}); + triviaSolutions.put("How many total Fairy Souls are there?", new String[]{"238 Fairy Souls"}); triviaSolutions.put("How many Fairy Souls are there in Spider's Den?", new String[]{"19 Fairy Souls"}); triviaSolutions.put("How many Fairy Souls are there in The End?", new String[]{"12 Fairy Souls"}); triviaSolutions.put("How many Fairy Souls are there in The Farming Islands?", new String[]{"20 Fairy Souls"}); - triviaSolutions.put("How many Fairy Souls are there in Blazing Fortress?", new String[]{"19 Fairy Souls"}); + triviaSolutions.put("How many Fairy Souls are there in Crimson Isle?", new String[]{"29 Fairy Souls"}); triviaSolutions.put("How many Fairy Souls are there in The Park?", new String[]{"11 Fairy Souls"}); triviaSolutions.put("How many Fairy Souls are there in Jerry's Workshop?", new String[]{"5 Fairy Souls"}); triviaSolutions.put("How many Fairy Souls are there in Hub?", new String[]{"79 Fairy Souls"}); @@ -57,7 +60,7 @@ public class TriviaSolver { triviaSolutions.put("What is the name of the person that upgrades pets?", new String[]{"Kat"}); triviaSolutions.put("What is the name of the lady of the Nether?", new String[]{"Elle"}); triviaSolutions.put("Which villager in the Village gives you a Rogue Sword?", new String[]{"Jamie"}); - triviaSolutions.put("How many unique minions are there?", new String[]{"53 Minions"}); + triviaSolutions.put("How many unique minions are there?", new String[]{"55 Minions"}); triviaSolutions.put("Which of these enemies does not spawn in the Spider's Den?", new String[]{"Zombie Spider", "Cave Spider", "Wither Skeleton", "Dashing Spooder", "Broodfather", "Night Spider"}); triviaSolutions.put("Which of these monsters only spawns at night?", new String[]{"Zombie Villager", "Ghast"}); diff --git a/src/main/java/me/Danker/gui/DisplayGui.java b/src/main/java/me/Danker/gui/DisplayGui.java index b8be3d6..2afa187 100644 --- a/src/main/java/me/Danker/gui/DisplayGui.java +++ b/src/main/java/me/Danker/gui/DisplayGui.java @@ -5,6 +5,7 @@ import me.Danker.handlers.ConfigHandler; import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.ScaledResolution; @@ -28,6 +29,7 @@ public class DisplayGui extends GuiScreen { private GuiButton fishingSpooky; private GuiButton fishingCH; private GuiButton fishingLava; + private GuiButton fishingTrophy; private GuiButton catacombsF1; private GuiButton catacombsF2; private GuiButton catacombsF3; @@ -61,12 +63,13 @@ public class DisplayGui extends GuiScreen { wolf = new GuiButton(0, width / 2 - 50, (int) (height * 0.35), 100, 20, "Wolf"); enderman = new GuiButton(0, width / 2 + 60, (int) (height * 0.35), 100, 20, "Enderman"); blaze = new GuiButton(0, width / 2 + 170, (int) (height * 0.35), 100, 20, "Blaze"); - fishing = new GuiButton(0, width / 2 - 295, (int) (height * 0.5), 90, 20, "Fishing"); - fishingWinter = new GuiButton(0, width / 2 - 195, (int) (height * 0.5), 90, 20, "Fishing Winter"); - fishingFestival = new GuiButton(0, width / 2 - 95, (int) (height * 0.5), 90, 20, "Fishing Festival"); - fishingSpooky = new GuiButton(0, width / 2 + 5, (int) (height * 0.5), 90, 20, "Fishing Spooky"); - fishingCH = new GuiButton(0, width / 2 + 105, (int) (height * 0.5), 90, 20, "CH Fishing"); - fishingLava = new GuiButton(0, width / 2 + 205, (int) (height * 0.5), 90, 20, "Lava Fishing"); + fishing = new GuiButton(0, width / 2 - 310, (int) (height * 0.5), 80, 20, "Fishing"); + fishingWinter = new GuiButton(0, width / 2 - 220, (int) (height * 0.5), 80, 20, "Fishing Winter"); + fishingFestival = new GuiButton(0, width / 2 - 130, (int) (height * 0.5), 80, 20, "Fishing Festival"); + fishingSpooky = new GuiButton(0, width / 2 - 40, (int) (height * 0.5), 80, 20, "Fishing Spooky"); + fishingCH = new GuiButton(0, width / 2 + 50, (int) (height * 0.5), 80, 20, "CH Fishing"); + fishingLava = new GuiButton(0, width / 2 + 140, (int) (height * 0.5), 80, 20, "Lava Fishing"); + fishingTrophy = new GuiButton(0, width / 2 + 230, (int) (height * 0.5), 80, 20, "Fishing Trophy"); catacombsF1 = new GuiButton(0, width / 2 - 235, (int) (height * 0.65), 50, 20, "F1"); catacombsF2 = new GuiButton(0, width / 2 - 175, (int) (height * 0.65), 50, 20, "F2"); catacombsF3 = new GuiButton(0, width / 2 - 115, (int) (height * 0.65), 50, 20, "F3"); @@ -92,6 +95,7 @@ public class DisplayGui extends GuiScreen { this.buttonList.add(fishingSpooky); this.buttonList.add(fishingCH); this.buttonList.add(fishingLava); + this.buttonList.add(fishingTrophy); this.buttonList.add(catacombsF1); this.buttonList.add(catacombsF2); this.buttonList.add(catacombsF3); @@ -153,6 +157,8 @@ public class DisplayGui extends GuiScreen { setDisplay("fishing_ch"); } else if (button == fishingLava) { setDisplay("fishing_lava"); + } else if (button == fishingTrophy) { + setDisplay("fishing_trophy"); } else if (button == mythological) { setDisplay("mythological"); } else if (button == catacombsF1) { diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index bd60639..b2c51a4 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -1,7 +1,6 @@ package me.Danker.handlers; -import com.google.gson.Gson; -import com.google.gson.JsonArray; +import com.google.gson.*; import me.Danker.DankersSkyblockMod; import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; @@ -750,6 +749,14 @@ public class ConfigHandler { } MinionLastCollected.Minion[] minions = gson.fromJson(new FileReader(MinionLastCollected.configFile), MinionLastCollected.Minion[].class); if (minions != null) MinionLastCollected.minions = new ArrayList<>(Arrays.asList(minions)); + + // Trophy Fish + if (!(new File(TrophyFishTracker.configFile).exists())) { + FileWriter file = new FileWriter(TrophyFishTracker.configFile); + file.write(new JsonObject().toString()); + file.close(); + } + TrophyFishTracker.fish = new JsonParser().parse(new FileReader(TrophyFishTracker.configFile)).getAsJsonObject(); } catch (IOException ex) { ex.printStackTrace(); } diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 3cef436..094690e 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -1,5 +1,7 @@ package me.Danker.utils; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import me.Danker.DankersSkyblockMod; import me.Danker.features.ColouredNames; import me.Danker.features.GoldenEnchants; @@ -509,6 +511,16 @@ public class Utils { } } + public static JsonObject deepCopy(JsonObject obj) { + JsonObject newObj = new JsonObject(); + + for (Map.Entry entry : obj.entrySet()) { + newObj.add(entry.getKey(), entry.getValue()); + } + + return newObj; + } + public enum DungeonFloor { NONE, E0, -- cgit From 66fa83a1942b4ec79c5fa94168c04b84c60c628a Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 6 Aug 2022 22:08:32 -0400 Subject: Add trophy fish completion to display --- .../java/me/Danker/commands/ToggleCommand.java | 1 + src/main/java/me/Danker/features/Alerts.java | 1 - .../me/Danker/features/CrystalHollowWaypoints.java | 1 - src/main/java/me/Danker/features/CustomMusic.java | 1 - .../java/me/Danker/features/loot/LootDisplay.java | 46 +++++++++++++++++++++- .../me/Danker/features/loot/TrophyFishTracker.java | 23 +++++++++++ src/main/java/me/Danker/gui/DankerGui.java | 7 ++++ src/main/java/me/Danker/gui/DisplayGui.java | 1 - .../java/me/Danker/gui/alerts/AlertActionGui.java | 1 - .../java/me/Danker/handlers/ConfigHandler.java | 6 ++- src/main/java/me/Danker/utils/RenderUtils.java | 9 +++-- src/main/java/me/Danker/utils/Utils.java | 2 +- 12 files changed, 86 insertions(+), 13 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index c08d50a..3c353c8 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -65,6 +65,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean aliases; public static boolean fishingAlert; public static boolean minionLastCollected; + public static boolean showTrophyCompletion; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; diff --git a/src/main/java/me/Danker/features/Alerts.java b/src/main/java/me/Danker/features/Alerts.java index e54a212..aa6197f 100644 --- a/src/main/java/me/Danker/features/Alerts.java +++ b/src/main/java/me/Danker/features/Alerts.java @@ -1,7 +1,6 @@ package me.Danker.features; import com.google.gson.GsonBuilder; -import javafx.scene.control.Alert; import me.Danker.commands.ToggleCommand; import me.Danker.events.ModInitEvent; import me.Danker.utils.Utils; diff --git a/src/main/java/me/Danker/features/CrystalHollowWaypoints.java b/src/main/java/me/Danker/features/CrystalHollowWaypoints.java index 39a71b4..12aa94e 100644 --- a/src/main/java/me/Danker/features/CrystalHollowWaypoints.java +++ b/src/main/java/me/Danker/features/CrystalHollowWaypoints.java @@ -7,7 +7,6 @@ import me.Danker.handlers.ScoreboardHandler; import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; -import net.minecraft.client.settings.KeyBinding; import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.event.ClickEvent; diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java index e6f8131..32af6c9 100644 --- a/src/main/java/me/Danker/features/CustomMusic.java +++ b/src/main/java/me/Danker/features/CustomMusic.java @@ -14,7 +14,6 @@ import net.minecraft.world.World; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.sound.PlaySoundEvent; import net.minecraftforge.event.world.WorldEvent; -import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; diff --git a/src/main/java/me/Danker/features/loot/LootDisplay.java b/src/main/java/me/Danker/features/loot/LootDisplay.java index 556108c..fe68c3e 100644 --- a/src/main/java/me/Danker/features/loot/LootDisplay.java +++ b/src/main/java/me/Danker/features/loot/LootDisplay.java @@ -965,7 +965,7 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + "Soul Fish:\n" + EnumChatFormatting.DARK_PURPLE + "Karate Fish:\n" + EnumChatFormatting.GOLD + "Golden Fish:"; - countText = EnumChatFormatting.WHITE + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Sulpher Skitter") + "\n" + + if (!ToggleCommand.showTrophyCompletion) countText = EnumChatFormatting.WHITE + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Sulpher Skitter") + "\n" + EnumChatFormatting.WHITE + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Obfuscated 1") + "\n" + EnumChatFormatting.WHITE + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Steaming-Hot Flounder") + "\n" + EnumChatFormatting.WHITE + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Gusher") + "\n" + @@ -983,6 +983,27 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Soul Fish") + "\n" + EnumChatFormatting.DARK_PURPLE + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Karate Fish") + "\n" + EnumChatFormatting.GOLD + TrophyFishTracker.getTierCount(TrophyFishTracker.fish, "Golden Fish"); + + if (ToggleCommand.showTrophyCompletion) { + TrophyFishTracker.drawCompletion(TrophyFishTracker.fish, "Sulpher Skitter", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), MoveCommand.displayXY[1], ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fish, "Obfuscated 1", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fish, "Steaming-Hot Flounder", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (2 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fish, "Gusher", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (3 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fish, "Blobfish", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (4 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fish, "Obfuscated 2", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (5 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fish, "Slugfish", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (6 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fish, "Flyfish", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (7 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fish, "Obfuscated 3", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (8 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fish, "Lavahorse", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (9 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fish, "Mana Ray", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (10 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fish, "Volcanic Stonefish", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (11 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fish, "Vanille", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (12 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fish, "Skeleton Fish", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (13 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fish, "Moldfin", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (14 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fish, "Soul Fish", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (15 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fish, "Karate Fish", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (16 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fish, "Golden Fish", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (17 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + } break; case "fishing_trophy_session": dropsText = EnumChatFormatting.WHITE + "Sulpher Skitter:\n" + @@ -1003,7 +1024,7 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + "Soul Fish:\n" + EnumChatFormatting.DARK_PURPLE + "Karate Fish:\n" + EnumChatFormatting.GOLD + "Golden Fish:"; - countText = EnumChatFormatting.WHITE + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Sulpher Skitter") + "\n" + + if (!ToggleCommand.showTrophyCompletion) countText = EnumChatFormatting.WHITE + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Sulpher Skitter") + "\n" + EnumChatFormatting.WHITE + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Obfuscated 1") + "\n" + EnumChatFormatting.WHITE + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Steaming-Hot Flounder") + "\n" + EnumChatFormatting.WHITE + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Gusher") + "\n" + @@ -1021,6 +1042,27 @@ public class LootDisplay { EnumChatFormatting.DARK_PURPLE + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Soul Fish") + "\n" + EnumChatFormatting.DARK_PURPLE + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Karate Fish") + "\n" + EnumChatFormatting.GOLD + TrophyFishTracker.getTierCount(TrophyFishTracker.fishSession, "Golden Fish"); + + if (ToggleCommand.showTrophyCompletion) { + TrophyFishTracker.drawCompletion(TrophyFishTracker.fishSession, "Sulpher Skitter", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), MoveCommand.displayXY[1], ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fishSession, "Obfuscated 1", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fishSession, "Steaming-Hot Flounder", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (2 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fishSession, "Gusher", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (3 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fishSession, "Blobfish", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (4 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fishSession, "Obfuscated 2", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (5 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fishSession, "Slugfish", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (6 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fishSession, "Flyfish", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (7 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fishSession, "Obfuscated 3", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (8 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fishSession, "Lavahorse", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (9 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fishSession, "Mana Ray", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (10 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fishSession, "Volcanic Stonefish", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (11 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fishSession, "Vanille", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (12 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fishSession, "Skeleton Fish", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (13 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fishSession, "Moldfin", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (14 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fishSession, "Soul Fish", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (15 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fishSession, "Karate Fish", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (16 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + TrophyFishTracker.drawCompletion(TrophyFishTracker.fishSession, "Golden Fish", (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), (int) (MoveCommand.displayXY[1] + (17 * mc.fontRendererObj.FONT_HEIGHT * ScaleCommand.displayScale)), ScaleCommand.displayScale); + } break; case "mythological": dropsText = EnumChatFormatting.GOLD + "Coins:\n" + diff --git a/src/main/java/me/Danker/features/loot/TrophyFishTracker.java b/src/main/java/me/Danker/features/loot/TrophyFishTracker.java index d11fcfe..6202871 100644 --- a/src/main/java/me/Danker/features/loot/TrophyFishTracker.java +++ b/src/main/java/me/Danker/features/loot/TrophyFishTracker.java @@ -3,7 +3,10 @@ package me.Danker.features.loot; import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import me.Danker.events.ModInitEvent; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StringUtils; import net.minecraftforge.client.event.ClientChatReceivedEvent; @@ -117,4 +120,24 @@ public class TrophyFishTracker { type.get("DIAMOND").getAsInt(); } + public static void drawCompletion(JsonObject obj, String name, int x, int y, double scale) { + JsonObject type = obj.get(name).getAsJsonObject(); + + boolean bronze = type.get("BRONZE").getAsInt() > 0; + boolean silver = type.get("SILVER").getAsInt() > 0; + boolean gold = type.get("GOLD").getAsInt() > 0; + boolean diamond = type.get("DIAMOND").getAsInt() > 0; + + ItemStack incomplete = new ItemStack(Items.dye, 1, 8); + ItemStack bronzeComplete = new ItemStack(Items.brick); + ItemStack silverComplete = new ItemStack(Items.iron_ingot); + ItemStack goldComplete = new ItemStack(Items.gold_ingot); + ItemStack diamondComplete = new ItemStack(Items.diamond); + + RenderUtils.renderItem(bronze ? bronzeComplete : incomplete, x, y - 2, scale / 1.3D); + RenderUtils.renderItem(silver ? silverComplete : incomplete, x + 15, y - 2, scale / 1.3D); + RenderUtils.renderItem(gold ? goldComplete : incomplete, x + 30, y - 2, scale / 1.3D); + RenderUtils.renderItem(diamond ? diamondComplete : incomplete, x + 45, y - 2, scale / 1.3D); + } + } diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index c247eab..cab2b5c 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -93,6 +93,7 @@ public class DankerGui extends GuiScreen { private GuiButton firePillar; private GuiButton fishingAlert; private GuiButton minionLastCollected; + private GuiButton showTrophyCompletion; // Chat Messages private GuiButton sceptreMessages; private GuiButton midasStaffMessages; @@ -190,6 +191,7 @@ public class DankerGui extends GuiScreen { firePillar = new FeatureButton("Fire Pillar Display: " + Utils.getColouredBoolean(ToggleCommand.firePillar), "Displays blaze fire pillar text on screen"); fishingAlert = new FeatureButton("Fishing Spawn Alerts: " + Utils.getColouredBoolean(ToggleCommand.fishingAlert), "Alerts when a Thunder or Lord Jawbus spawns nearby"); minionLastCollected = new FeatureButton("Show When Minion Last Collected: " + Utils.getColouredBoolean(ToggleCommand.minionLastCollected), "Displays when a minion was last collected over the minion."); + showTrophyCompletion = new FeatureButton("Show Trophy Fish Completion: " + Utils.getColouredBoolean(ToggleCommand.showTrophyCompletion), "Show completion instead of count in trophy fish tracker display."); allButtons.clear(); allButtons.add(changeDisplay); @@ -253,6 +255,7 @@ public class DankerGui extends GuiScreen { allButtons.add(firePillar); allButtons.add(fishingAlert); allButtons.add(minionLastCollected); + allButtons.add(showTrophyCompletion); search.setText(initSearchText); search.setVisible(true); @@ -558,6 +561,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.minionLastCollected = !ToggleCommand.minionLastCollected; ConfigHandler.writeBooleanConfig("toggles", "MinionLastCollected", ToggleCommand.minionLastCollected); minionLastCollected.displayString = "Show When Minion Last Collected: " + Utils.getColouredBoolean(ToggleCommand.minionLastCollected); + } else if (button == showTrophyCompletion) { + ToggleCommand.showTrophyCompletion = !ToggleCommand.showTrophyCompletion; + ConfigHandler.writeBooleanConfig("toggles", "ShowTrophyCompletion", ToggleCommand.showTrophyCompletion); + showTrophyCompletion.displayString = "Show Trophy Fish Completion: " + Utils.getColouredBoolean(ToggleCommand.showTrophyCompletion); } } diff --git a/src/main/java/me/Danker/gui/DisplayGui.java b/src/main/java/me/Danker/gui/DisplayGui.java index 2afa187..f7fd2f3 100644 --- a/src/main/java/me/Danker/gui/DisplayGui.java +++ b/src/main/java/me/Danker/gui/DisplayGui.java @@ -5,7 +5,6 @@ import me.Danker.handlers.ConfigHandler; import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.ScaledResolution; diff --git a/src/main/java/me/Danker/gui/alerts/AlertActionGui.java b/src/main/java/me/Danker/gui/alerts/AlertActionGui.java index 4853ac1..02c3d3b 100644 --- a/src/main/java/me/Danker/gui/alerts/AlertActionGui.java +++ b/src/main/java/me/Danker/gui/alerts/AlertActionGui.java @@ -1,7 +1,6 @@ package me.Danker.gui.alerts; import me.Danker.features.Alerts; -import me.Danker.handlers.TextRenderer; import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index b2c51a4..484a7d5 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -1,6 +1,9 @@ package me.Danker.handlers; -import com.google.gson.*; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; import me.Danker.DankersSkyblockMod; import me.Danker.commands.MoveCommand; import me.Danker.commands.ScaleCommand; @@ -249,6 +252,7 @@ public class ConfigHandler { ToggleCommand.aliases = initBoolean("toggles", "Aliases", false); ToggleCommand.fishingAlert = initBoolean("toggles", "FishingAlert", false); ToggleCommand.minionLastCollected = initBoolean("toggles", "MinionLastCollected", false); + ToggleCommand.showTrophyCompletion = initBoolean("toggles", "ShowTrophyCompletion", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); diff --git a/src/main/java/me/Danker/utils/RenderUtils.java b/src/main/java/me/Danker/utils/RenderUtils.java index c3efc90..f334b7a 100644 --- a/src/main/java/me/Danker/utils/RenderUtils.java +++ b/src/main/java/me/Danker/utils/RenderUtils.java @@ -387,15 +387,16 @@ public class RenderUtils { GlStateManager.popMatrix(); } - public static void renderItem(ItemStack item, float x, float y, float z) { - + public static void renderItem(ItemStack stack, int x, int y, double scale) { GlStateManager.enableRescaleNormal(); RenderHelper.enableGUIStandardItemLighting(); GlStateManager.enableDepth(); GlStateManager.pushMatrix(); - GlStateManager.translate(x, y, z); - Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(item, 0, 0); + GlStateManager.translate(x, y, 0); + GlStateManager.scale(scale, scale, scale); + //Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(stack, 0, 0); + Minecraft.getMinecraft().getRenderItem().renderItemAndEffectIntoGUI(stack, 0, 0); GlStateManager.popMatrix(); GlStateManager.disableDepth(); diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 094690e..4aa094d 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -22,8 +22,8 @@ import net.minecraft.scoreboard.ScoreObjective; import net.minecraft.util.*; import java.awt.*; -import java.util.*; import java.util.List; +import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; -- cgit From 4431e9eddd09e4d43c42f6e541810c47c83efdcb Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 6 Aug 2022 22:58:03 -0400 Subject: Use sound packet for slayer token drop tracking Fixes token drops not being tracked when volume is off. --- .../java/me/Danker/features/loot/LootTracker.java | 25 +++++++++------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/loot/LootTracker.java b/src/main/java/me/Danker/features/loot/LootTracker.java index 7fa223d..13599a0 100644 --- a/src/main/java/me/Danker/features/loot/LootTracker.java +++ b/src/main/java/me/Danker/features/loot/LootTracker.java @@ -1,13 +1,11 @@ package me.Danker.features.loot; +import me.Danker.events.PacketReadEvent; import me.Danker.handlers.ConfigHandler; -import me.Danker.handlers.ScoreboardHandler; import me.Danker.utils.Utils; -import net.minecraftforge.client.event.sound.PlaySoundEvent; -import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraft.network.play.server.S29PacketSoundEffect; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -16,20 +14,17 @@ public class LootTracker { public static long itemsChecked = 0; static Pattern dropPattern = Pattern.compile(".*? \\((?\\d+)x .*\\).*"); - @SubscribeEvent(priority = EventPriority.HIGHEST) - public void onSound(PlaySoundEvent event) { + @SubscribeEvent + public void onPacketRead(PacketReadEvent event) { if (!Utils.inSkyblock) return; - if (event.name.equals("note.pling")) { - // Don't check twice within 3 seconds - long checkItemsNow = System.currentTimeMillis() / 1000; - if (checkItemsNow - itemsChecked < 3) return; - List scoreboard = ScoreboardHandler.getSidebarLines(); + if (event.packet instanceof S29PacketSoundEffect) { + S29PacketSoundEffect packet = (S29PacketSoundEffect) event.packet; - for (String line : scoreboard) { - String cleanedLine = ScoreboardHandler.cleanSB(line); - // If Hypixel lags and scoreboard doesn't update - if (cleanedLine.contains("Boss slain!") || cleanedLine.contains("Slay the boss!")) { + if (packet.getSoundName().equals("note.pling")) { + if (System.currentTimeMillis() / 1000 - itemsChecked < 3) return; + + if (Utils.isInScoreboard("Boss slain!") || Utils.isInScoreboard("Slay the boss!")) { int itemTeeth = Utils.getItems("Wolf Tooth"); int itemWebs = Utils.getItems("Tarantula Web"); int itemRev = Utils.getItems("Revenant Flesh"); -- cgit From 3482eff013fb83a7969847ee3acf1419438efc0f Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sun, 7 Aug 2022 16:00:23 -0400 Subject: Add xp + overflow to /skill command --- .../java/me/Danker/commands/SkillsCommand.java | 92 +++++++++++++++++++--- src/main/java/me/Danker/utils/Utils.java | 10 +++ 2 files changed, 89 insertions(+), 13 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/commands/SkillsCommand.java b/src/main/java/me/Danker/commands/SkillsCommand.java index f17c79d..be3cf3c 100644 --- a/src/main/java/me/Danker/commands/SkillsCommand.java +++ b/src/main/java/me/Danker/commands/SkillsCommand.java @@ -9,14 +9,20 @@ import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.event.HoverEvent; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatStyle; import net.minecraft.util.EnumChatFormatting; +import java.text.NumberFormat; import java.util.List; +import java.util.Locale; public class SkillsCommand extends CommandBase { - + + static NumberFormat nf = NumberFormat.getIntegerInstance(Locale.US); + @Override public String getCommandName() { return "skill"; @@ -85,7 +91,17 @@ public class SkillsCommand extends CommandBase { System.out.println("Fetching skills..."); JsonObject userObject = profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject(); - + + ChatComponentText farmingLevelText = new ChatComponentText(DankersSkyblockMod.TYPE_COLOUR + " Farming: "); + ChatComponentText miningLevelText = new ChatComponentText(DankersSkyblockMod.TYPE_COLOUR + " Mining: "); + ChatComponentText combatLevelText = new ChatComponentText(DankersSkyblockMod.TYPE_COLOUR + " Combat: "); + ChatComponentText foragingLevelText = new ChatComponentText(DankersSkyblockMod.TYPE_COLOUR + " Foraging: "); + ChatComponentText fishingLevelText = new ChatComponentText(DankersSkyblockMod.TYPE_COLOUR + " Fishing: "); + ChatComponentText enchantingLevelText = new ChatComponentText(DankersSkyblockMod.TYPE_COLOUR + " Enchanting: "); + ChatComponentText alchemyLevelText = new ChatComponentText(DankersSkyblockMod.TYPE_COLOUR + " Alchemy: "); + ChatComponentText tamingLevelText = new ChatComponentText(DankersSkyblockMod.TYPE_COLOUR + " Taming: "); + ChatComponentText newLine = new ChatComponentText("\n"); + double farmingLevel = 0; double miningLevel = 0; double combatLevel = 0; @@ -94,39 +110,55 @@ public class SkillsCommand extends CommandBase { double enchantingLevel = 0; double alchemyLevel = 0; double tamingLevel = 0; - + if (userObject.has("experience_skill_farming") || userObject.has("experience_skill_mining") || userObject.has("experience_skill_combat") || userObject.has("experience_skill_foraging") || userObject.has("experience_skill_fishing") || userObject.has("experience_skill_enchanting") || userObject.has("experience_skill_alchemy")) { if (userObject.has("experience_skill_farming")) { farmingLevel = Utils.xpToSkillLevel(userObject.get("experience_skill_farming").getAsDouble(), 60); farmingLevel = (double) Math.round(farmingLevel * 100) / 100; + farmingLevelText.setChatStyle(appendFormatted(farmingLevelText, "XP", userObject.get("experience_skill_farming").getAsDouble())); + farmingLevelText.setChatStyle(appendFormatted(farmingLevelText, "Overflow XP", getOverflowXP(userObject.get("experience_skill_farming").getAsDouble(), 60))); } if (userObject.has("experience_skill_mining")) { miningLevel = Utils.xpToSkillLevel(userObject.get("experience_skill_mining").getAsDouble(), 60); miningLevel = (double) Math.round(miningLevel * 100) / 100; + miningLevelText.setChatStyle(appendFormatted(miningLevelText, "XP", userObject.get("experience_skill_mining").getAsDouble())); + miningLevelText.setChatStyle(appendFormatted(miningLevelText, "Overflow XP", getOverflowXP(userObject.get("experience_skill_mining").getAsDouble(), 60))); } if (userObject.has("experience_skill_combat")) { combatLevel = Utils.xpToSkillLevel(userObject.get("experience_skill_combat").getAsDouble(), 60); combatLevel = (double) Math.round(combatLevel * 100) / 100; + combatLevelText.setChatStyle(appendFormatted(combatLevelText, "XP", userObject.get("experience_skill_combat").getAsDouble())); + combatLevelText.setChatStyle(appendFormatted(combatLevelText, "Overflow XP", getOverflowXP(userObject.get("experience_skill_combat").getAsDouble(), 60))); } if (userObject.has("experience_skill_foraging")) { foragingLevel = Utils.xpToSkillLevel(userObject.get("experience_skill_foraging").getAsDouble(), 50); foragingLevel = (double) Math.round(foragingLevel * 100) / 100; + foragingLevelText.setChatStyle(appendFormatted(foragingLevelText, "XP", userObject.get("experience_skill_foraging").getAsDouble())); + foragingLevelText.setChatStyle(appendFormatted(foragingLevelText, "Overflow XP", getOverflowXP(userObject.get("experience_skill_foraging").getAsDouble(), 50))); } if (userObject.has("experience_skill_fishing")) { fishingLevel = Utils.xpToSkillLevel(userObject.get("experience_skill_fishing").getAsDouble(), 50); fishingLevel = (double) Math.round(fishingLevel * 100) / 100; + fishingLevelText.setChatStyle(appendFormatted(fishingLevelText, "XP", userObject.get("experience_skill_fishing").getAsDouble())); + fishingLevelText.setChatStyle(appendFormatted(fishingLevelText, "Overflow XP", getOverflowXP(userObject.get("experience_skill_fishing").getAsDouble(), 50))); } if (userObject.has("experience_skill_enchanting")) { enchantingLevel = Utils.xpToSkillLevel(userObject.get("experience_skill_enchanting").getAsDouble(), 60); enchantingLevel = (double) Math.round(enchantingLevel * 100) / 100; + enchantingLevelText.setChatStyle(appendFormatted(enchantingLevelText, "XP", userObject.get("experience_skill_enchanting").getAsDouble())); + enchantingLevelText.setChatStyle(appendFormatted(enchantingLevelText, "Overflow XP", getOverflowXP(userObject.get("experience_skill_enchanting").getAsDouble(), 60))); } if (userObject.has("experience_skill_alchemy")) { alchemyLevel = Utils.xpToSkillLevel(userObject.get("experience_skill_alchemy").getAsDouble(), 50); alchemyLevel = (double) Math.round(alchemyLevel * 100) / 100; + alchemyLevelText.setChatStyle(appendFormatted(alchemyLevelText, "XP", userObject.get("experience_skill_alchemy").getAsDouble())); + alchemyLevelText.setChatStyle(appendFormatted(alchemyLevelText, "Overflow XP", getOverflowXP(userObject.get("experience_skill_alchemy").getAsDouble(), 50))); } if (userObject.has("experience_skill_taming")) { tamingLevel = Utils.xpToSkillLevel(userObject.get("experience_skill_taming").getAsDouble(), 50); tamingLevel = (double) Math.round(tamingLevel * 100) / 100; + tamingLevelText.setChatStyle(appendFormatted(tamingLevelText, "XP", userObject.get("experience_skill_taming").getAsDouble())); + tamingLevelText.setChatStyle(appendFormatted(tamingLevelText, "Overflow XP", getOverflowXP(userObject.get("experience_skill_taming").getAsDouble(), 50))); } } else { // Get skills from achievement API, will be floored @@ -144,48 +176,82 @@ public class SkillsCommand extends CommandBase { JsonObject achievementObject = playerObject.get("player").getAsJsonObject().get("achievements").getAsJsonObject(); if (achievementObject.has("skyblock_harvester")) { farmingLevel = achievementObject.get("skyblock_harvester").getAsInt(); + farmingLevelText.setChatStyle(appendFormatted(farmingLevelText, "XP", Utils.skillLevelToXp((int) farmingLevel))); } if (achievementObject.has("skyblock_excavator")) { miningLevel = achievementObject.get("skyblock_excavator").getAsInt(); + miningLevelText.setChatStyle(appendFormatted(miningLevelText, "XP", Utils.skillLevelToXp((int) miningLevel))); } if (achievementObject.has("skyblock_combat")) { combatLevel = achievementObject.get("skyblock_combat").getAsInt(); + combatLevelText.setChatStyle(appendFormatted(combatLevelText, "XP", Utils.skillLevelToXp((int) combatLevel))); } if (achievementObject.has("skyblock_gatherer")) { foragingLevel = Math.min(achievementObject.get("skyblock_gatherer").getAsInt(), 50); + foragingLevelText.setChatStyle(appendFormatted(foragingLevelText, "XP", Utils.skillLevelToXp((int) foragingLevel))); } if (achievementObject.has("skyblock_angler")) { fishingLevel = Math.min(achievementObject.get("skyblock_angler").getAsInt(), 50); + fishingLevelText.setChatStyle(appendFormatted(fishingLevelText, "XP", Utils.skillLevelToXp((int) fishingLevel))); } if (achievementObject.has("skyblock_augmentation")) { enchantingLevel = achievementObject.get("skyblock_augmentation").getAsInt(); + enchantingLevelText.setChatStyle(appendFormatted(enchantingLevelText, "XP", Utils.skillLevelToXp((int) enchantingLevel))); } if (achievementObject.has("skyblock_concoctor")) { alchemyLevel = Math.min(achievementObject.get("skyblock_concoctor").getAsInt(), 50); + alchemyLevelText.setChatStyle(appendFormatted(alchemyLevelText, "XP", Utils.skillLevelToXp((int) alchemyLevel))); } if (achievementObject.has("skyblock_domesticator")) { tamingLevel = Math.min(achievementObject.get("skyblock_domesticator").getAsInt(), 50); + tamingLevelText.setChatStyle(appendFormatted(tamingLevelText, "XP", Utils.skillLevelToXp((int) tamingLevel))); } } + farmingLevelText.appendSibling(new ChatComponentText(DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + farmingLevel)); + miningLevelText.appendSibling(new ChatComponentText(DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + miningLevel)); + combatLevelText.appendSibling(new ChatComponentText(DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + combatLevel)); + foragingLevelText.appendSibling(new ChatComponentText(DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + foragingLevel)); + fishingLevelText.appendSibling(new ChatComponentText(DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + fishingLevel)); + enchantingLevelText.appendSibling(new ChatComponentText(DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + enchantingLevel)); + alchemyLevelText.appendSibling(new ChatComponentText(DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + alchemyLevel)); + tamingLevelText.appendSibling(new ChatComponentText(DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + tamingLevel)); + double skillAvg = (farmingLevel + miningLevel + combatLevel + foragingLevel + fishingLevel + enchantingLevel + alchemyLevel + tamingLevel) / 8; skillAvg = (double) Math.round(skillAvg * 100) / 100; double trueAvg = (Math.floor(farmingLevel) + Math.floor(miningLevel) + Math.floor(combatLevel) + Math.floor(foragingLevel) + Math.floor(fishingLevel) + Math.floor(enchantingLevel) + Math.floor(alchemyLevel) + Math.floor(tamingLevel)) / 8; player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" + - EnumChatFormatting.AQUA + " " + username + "'s Skills:\n" + - DankersSkyblockMod.TYPE_COLOUR + " Farming: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + farmingLevel + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Mining: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + miningLevel + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Combat: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + combatLevel + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Foraging: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + foragingLevel + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Fishing: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + fishingLevel + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Enchanting: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + enchantingLevel + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Alchemy: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + alchemyLevel + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Taming: " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + tamingLevel + "\n" + + EnumChatFormatting.AQUA + " " + username + "'s Skills:\n") + .appendSibling(farmingLevelText).appendSibling(newLine) + .appendSibling(miningLevelText).appendSibling(newLine) + .appendSibling(combatLevelText).appendSibling(newLine) + .appendSibling(foragingLevelText).appendSibling(newLine) + .appendSibling(fishingLevelText).appendSibling(newLine) + .appendSibling(enchantingLevelText).appendSibling(newLine) + .appendSibling(alchemyLevelText).appendSibling(newLine) + .appendSibling(tamingLevelText).appendSibling(newLine) + .appendSibling(new ChatComponentText( EnumChatFormatting.AQUA + " Average Skill Level: " + DankersSkyblockMod.SKILL_AVERAGE_COLOUR + EnumChatFormatting.BOLD + skillAvg + "\n" + EnumChatFormatting.AQUA + " True Average Skill Level: " + DankersSkyblockMod.SKILL_AVERAGE_COLOUR + EnumChatFormatting.BOLD + trueAvg + "\n" + - DankersSkyblockMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------")); + DankersSkyblockMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------"))); }).start(); } + static ChatStyle appendHover(ChatComponentText component, String text) { + String original = ""; + if (component.getChatStyle().getChatHoverEvent() != null) original = component.getChatStyle().getChatHoverEvent().getValue().getFormattedText(); + if (original.length() > 0) original += "\n"; + return component.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(original + text))); + } + + static ChatStyle appendFormatted(ChatComponentText component, String category, double number) { + return appendHover(component, DankersSkyblockMod.TYPE_COLOUR + category + ": " + DankersSkyblockMod.VALUE_COLOUR + EnumChatFormatting.BOLD + nf.format(number)); + } + + static double getOverflowXP(double xp, int limit) { + if (limit == 50) return Math.max(0D, xp - 55172425D); + return Math.max(0D, xp - 111672425D); + } + } diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 4aa094d..8791a43 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -251,6 +251,16 @@ public class Utils { } return limit; } + + public static int skillLevelToXp(int level) { + int sum = 0; + + for (int i = 1; i <= level; i++) { + sum += skillXPPerLevel[i]; + } + + return sum; + } public static double xpToDungeonsLevel(double xp) { for (int i = 0, xpAdded = 0; i < dungeonsXPPerLevel.length; i++) { -- cgit From 1a0a3ca6e58adf11729fa9078150e3b140b6bfed Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sun, 7 Aug 2022 16:37:55 -0400 Subject: Fix minions showing across profiles --- src/main/java/me/Danker/features/MinionLastCollected.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/MinionLastCollected.java b/src/main/java/me/Danker/features/MinionLastCollected.java index 7079f40..d793970 100644 --- a/src/main/java/me/Danker/features/MinionLastCollected.java +++ b/src/main/java/me/Danker/features/MinionLastCollected.java @@ -13,6 +13,7 @@ import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -72,6 +73,7 @@ public class MinionLastCollected { public void onWorldRender(RenderWorldLastEvent event) { if (ToggleCommand.minionLastCollected && Utils.inSkyblock && Utils.tabLocation.equals("Private Island")) { for (Minion minion : minions) { + if (!minionExistsAtPos(minion.pos)) continue; RenderUtils.draw3DString(minion.pos.getX() + 0.5, minion.pos.getY() + 2.2, minion.pos.getZ() + 0.5, minion.getTimeCollected(), LAST_COLLECTED_COLOUR, event.partialTicks); } } @@ -98,6 +100,12 @@ public class MinionLastCollected { return null; } + public boolean minionExistsAtPos(BlockPos pos) { + AxisAlignedBB aabb = new AxisAlignedBB(pos, pos.add(1, 1, 1)); + List entities = Minecraft.getMinecraft().theWorld.getEntitiesWithinAABB(EntityArmorStand.class, aabb); + return entities.size() > 0; // just assume theres a minion there + } + public static void save() { try (FileWriter writer = new FileWriter(configFile)) { new GsonBuilder().create().toJson(minions, writer); -- cgit From 60d3517fc1f70aeeb83dd6627ade3093f7760b04 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 9 Aug 2022 19:31:36 -0400 Subject: Fix F7 custom music for real this time Also fix /dsmmusic volume not working --- src/main/java/me/Danker/features/CustomMusic.java | 58 ++++++++++++++++------- 1 file changed, 42 insertions(+), 16 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java index 32af6c9..6c5dd08 100644 --- a/src/main/java/me/Danker/features/CustomMusic.java +++ b/src/main/java/me/Danker/features/CustomMusic.java @@ -68,8 +68,7 @@ public class CustomMusic { public static Song park; public static int parkVolume; - static int curPhase = -1; - + static int curPhase = 0; @SubscribeEvent public void onWorldChange(WorldEvent.Load event) { @@ -97,9 +96,29 @@ public class CustomMusic { firstLine.contains("30,344") || // F4 firstLine.contains("livid") || // F5 firstLine.contains("sadan") || // F6 - firstLine.contains("maxor")) { // F7 - - if (ToggleCommand.dungeonBossMusic && curPhase == -1) dungeonboss.start(); + firstLine.contains("maxor") || // F7 + firstLine.contains("f7")) { + + if (ToggleCommand.dungeonBossMusic) { + switch (curPhase) { + case -1: + break; + case 2: + phase2.start(); + break; + case 3: + phase3.start(); + break; + case 4: + phase4.start(); + break; + case 5: + phase5.start(); + break; + default: + dungeonboss.start(); + } + } } } } else { @@ -156,26 +175,27 @@ public class CustomMusic { } } - if (message.contains(":")) return; - if (Utils.inDungeons) { if (ToggleCommand.dungeonBossMusic) { - if (message.startsWith("[BOSS] Storm: Pathetic Maxor")) { + if (phase2.hasSongs() && message.startsWith("[BOSS] Storm: Pathetic Maxor")) { phase2.start(); curPhase = 2; - } else if (message.startsWith("[BOSS] Goldor: Who dares trespass into my domain?")) { + } else if (phase3.hasSongs() && message.startsWith("[BOSS] Goldor: Who dares trespass into my domain?")) { phase3.start(); curPhase = 3; - } else if (message.startsWith("[BOSS] Necron: You went further than any human before")) { + } else if (phase4.hasSongs() && message.startsWith("[BOSS] Necron: You went further than any human before")) { phase4.start(); curPhase = 4; - } else if (message.startsWith("[BOSS] ") && message.endsWith("You.. again?")) { + } else if (phase5.hasSongs() && message.startsWith("[BOSS] ") && message.endsWith("You.. again?")) { phase5.start(); curPhase = 5; } } + if (message.contains(":")) return; + if (message.contains("EXTRA STATS ")) { + curPhase = -1; // force no play dungeonboss.stop(); bloodroom.stop(); dungeon.stop(); @@ -250,7 +270,7 @@ public class CustomMusic { if (crimsonIsle != null) crimsonIsle.stop(); if (end != null) end.stop(); if (park != null) park.stop(); - curPhase = -1; + curPhase = 0; } public static class Song { @@ -321,14 +341,20 @@ public class CustomMusic { return false; } - float decibels = (float) (20 * Math.log(volume / 100.0)); - FloatControl control = (FloatControl) music.getControl(FloatControl.Type.MASTER_GAIN); - if (decibels <= control.getMinimum() || decibels >= control.getMaximum()) return false; - control.setValue(decibels); + if (music != null) { + float decibels = (float) (20 * Math.log(volume / 100.0)); + FloatControl control = (FloatControl) music.getControl(FloatControl.Type.MASTER_GAIN); + if (decibels <= control.getMinimum() || decibels >= control.getMaximum()) return false; + control.setValue(decibels); + } return true; } + public boolean hasSongs() { + return playlist.size() > 0; + } + } } -- cgit From f56302bee3939677fc3fd015a97b12b5100c45b1 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 9 Aug 2022 20:24:18 -0400 Subject: Fix issues with custom music volume Fix custom music set to 50% volume on first load (ignoring config) Fix island music using hub volume --- src/main/java/me/Danker/DankersSkyblockMod.java | 8 +++----- src/main/java/me/Danker/events/PostConfigInitEvent.java | 13 +++++++++++++ src/main/java/me/Danker/features/CustomMusic.java | 5 +++-- 3 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 src/main/java/me/Danker/events/PostConfigInitEvent.java (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 6322c33..280fc96 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -2,10 +2,7 @@ package me.Danker; import com.google.gson.JsonObject; import me.Danker.commands.*; -import me.Danker.events.ChestSlotClickedEvent; -import me.Danker.events.GuiChestBackgroundDrawnEvent; -import me.Danker.events.ModInitEvent; -import me.Danker.events.RenderOverlayEvent; +import me.Danker.events.*; import me.Danker.features.*; import me.Danker.features.loot.*; import me.Danker.features.puzzlesolvers.*; @@ -181,9 +178,10 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new TrophyFishTracker()); MinecraftForge.EVENT_BUS.register(new WolfTracker()); MinecraftForge.EVENT_BUS.register(new ZombieTracker()); - + MinecraftForge.EVENT_BUS.post(new ModInitEvent(configDirectory)); ConfigHandler.reloadConfig(); + MinecraftForge.EVENT_BUS.post(new PostConfigInitEvent(configDirectory)); keyBindings[0] = new KeyBinding("Open Maddox Menu", Keyboard.KEY_M, "Danker's Skyblock Mod"); keyBindings[1] = new KeyBinding("Regular Ability", Keyboard.KEY_NUMPAD4, "Danker's Skyblock Mod"); diff --git a/src/main/java/me/Danker/events/PostConfigInitEvent.java b/src/main/java/me/Danker/events/PostConfigInitEvent.java new file mode 100644 index 0000000..3e58456 --- /dev/null +++ b/src/main/java/me/Danker/events/PostConfigInitEvent.java @@ -0,0 +1,13 @@ +package me.Danker.events; + +import net.minecraftforge.fml.common.eventhandler.Event; + +public class PostConfigInitEvent extends Event { + + public final String configDirectory; + + public PostConfigInitEvent(String configDirectory) { + this.configDirectory = configDirectory; + } + +} diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java index 6c5dd08..38e4ba0 100644 --- a/src/main/java/me/Danker/features/CustomMusic.java +++ b/src/main/java/me/Danker/features/CustomMusic.java @@ -3,6 +3,7 @@ package me.Danker.features; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; import me.Danker.events.ModInitEvent; +import me.Danker.events.PostConfigInitEvent; import me.Danker.handlers.ScoreboardHandler; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; @@ -218,7 +219,7 @@ public class CustomMusic { } @SubscribeEvent - public void init(ModInitEvent event) { + public void postConfigInit(PostConfigInitEvent event) { init(event.configDirectory); } @@ -237,7 +238,7 @@ public class CustomMusic { phase4 = new Song(directory, "phasefour", phase4Volume); phase5 = new Song(directory, "phasefive", phase5Volume); hub = new Song(directory, "hub", hubVolume); - island = new Song(directory, "island", hubVolume); + island = new Song(directory, "island", islandVolume); dungeonHub = new Song(directory, "dungeonhub", dungeonHubVolume); farmingIslands = new Song(directory, "farmingislands", farmingIslandsVolume); goldMine = new Song(directory, "goldmine", goldMineVolume); -- cgit From e26599e44252d0e16d8399d0b190ccae6e054352 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 9 Aug 2022 20:41:57 -0400 Subject: PR Fixes --- README.md | 58 +++++++++++----------- src/main/java/me/Danker/DankersSkyblockMod.java | 3 +- src/main/java/me/Danker/features/CustomMusic.java | 1 - .../me/Danker/features/HighlightCommissions.java | 7 ++- src/main/java/me/Danker/gui/DankerGui.java | 1 - src/main/java/me/Danker/utils/Utils.java | 16 ------ 6 files changed, 34 insertions(+), 52 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index b28600a..c3478b0 100644 --- a/README.md +++ b/README.md @@ -120,41 +120,41 @@ Discord Server: https://discord.gg/QsEkNQS
Keybinds -
- Warps -### Warps - -Shortcut commands that save you the time of typing the whole warp command. - - /deep - Warps you to the Deep Caverns. - - /nether - Warps you to the Crimson Isle. - - /isle - Warps you to the Crimson Isle. - - /crimson - Warps you to the Crimson Isle. - - /mines - Warps you to the Dwarven Mines. - - /forge - Warps you to the Dwarven Forge. - - /crystals - Warps you to the Crystal Hollows. - - /gold - Warps you to the Gold Mine. - - /desert - Warps you to the Desert. - - /spider - Warps you to the Spiders Den. - - /barn - Warps you to the Barn. - - /end - Warps you to the End. - - /park - Warps you to the Park. - - /castle - Warps you to the Hub Castle. - - /da - Warps you to the Dark Auction. - - /crypt - Warps you to the Crypt in the Hub. - - /nest - Warps you to the top of the Spider's Den. - - /void - Warps you to the Void Sepulture in the End. - - /drag - Warps you to the Dragons Nest in the End. - - /jungle - Warps you to the Jungle. - - /howl - Warps you to the Howling Cave in the Park. - - /dun - Warps you to the Dungeon Hub. -
- ## Keybinds - Open Maddox menu - M by default. - Regular Ability - Numpad 4 by default. - Start/Stop Skill Tracker - Numpad 5 by default.
+
+Warps + +## Warps +Shortcut commands that save you the time of typing the whole warp command. +- /deep - Warps you to the Deep Caverns. +- /nether - Warps you to the Crimson Isle. +- /isle - Warps you to the Crimson Isle. +- /crimson - Warps you to the Crimson Isle. +- /mines - Warps you to the Dwarven Mines. +- /forge - Warps you to the Dwarven Forge. +- /crystals - Warps you to the Crystal Hollows. +- /gold - Warps you to the Gold Mine. +- /desert - Warps you to the Desert. +- /spider - Warps you to the Spiders Den. +- /barn - Warps you to the Barn. +- /end - Warps you to the End. +- /park - Warps you to the Park. +- /castle - Warps you to the Hub Castle. +- /da - Warps you to the Dark Auction. +- /crypt - Warps you to the Crypt in the Hub. +- /nest - Warps you to the top of the Spider's Den. +- /void - Warps you to the Void Sepulture in the End. +- /drag - Warps you to the Dragons Nest in the End. +- /jungle - Warps you to the Jungle. +- /howl - Warps you to the Howling Cave in the Park. +- /dun - Warps you to the Dungeon Hub. +
+
Custom Music diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 73c996b..1bbaf89 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -137,6 +137,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new HidePetCandy()); MinecraftForge.EVENT_BUS.register(new HidePlayerArmour()); MinecraftForge.EVENT_BUS.register(new HideTooltipsInExperiments()); + MinecraftForge.EVENT_BUS.register(new HighlightCommissions()); MinecraftForge.EVENT_BUS.register(new HighlightSkeletonMasters()); MinecraftForge.EVENT_BUS.register(new IceWalkSolver()); MinecraftForge.EVENT_BUS.register(new LividSolver()); @@ -167,7 +168,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new UpdateChecker()); MinecraftForge.EVENT_BUS.register(new WatcherReadyAlert()); MinecraftForge.EVENT_BUS.register(new WaterSolver()); - MinecraftForge.EVENT_BUS.register(new HighlightCommissions()); + MinecraftForge.EVENT_BUS.register(new LootDisplay()); MinecraftForge.EVENT_BUS.register(new LootTracker()); MinecraftForge.EVENT_BUS.register(new BlazeTracker()); diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java index 38e4ba0..01279fd 100644 --- a/src/main/java/me/Danker/features/CustomMusic.java +++ b/src/main/java/me/Danker/features/CustomMusic.java @@ -2,7 +2,6 @@ package me.Danker.features; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; -import me.Danker.events.ModInitEvent; import me.Danker.events.PostConfigInitEvent; import me.Danker.handlers.ScoreboardHandler; import me.Danker.utils.Utils; diff --git a/src/main/java/me/Danker/features/HighlightCommissions.java b/src/main/java/me/Danker/features/HighlightCommissions.java index f59951a..3bf1cb2 100644 --- a/src/main/java/me/Danker/features/HighlightCommissions.java +++ b/src/main/java/me/Danker/features/HighlightCommissions.java @@ -2,13 +2,12 @@ package me.Danker.features; import me.Danker.commands.ToggleCommand; import me.Danker.events.GuiChestBackgroundDrawnEvent; -import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.inventory.Slot; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraft.item.ItemWritableBook; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import org.lwjgl.util.Color; import java.util.List; public class HighlightCommissions { @@ -27,7 +26,7 @@ public class HighlightCommissions { if (slot.getStack().getItem() instanceof ItemWritableBook) { for (String line : Utils.getItemLore(slot.getStack())) { if (line.contains("COMPLETED")) { - Utils.drawOnSlot(event.chestSize, slot.xDisplayPosition, slot.yDisplayPosition, HIGHLIGHT_COLOUR + 0xD7000000); + RenderUtils.drawOnSlot(event.chestSize, slot.xDisplayPosition, slot.yDisplayPosition, HIGHLIGHT_COLOUR + 0xD7000000); break; } } diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 06c50d0..9a8d283 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -14,7 +14,6 @@ import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.client.gui.*; import net.minecraft.util.StringUtils; import java.awt.*; diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index deb5018..8791a43 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -10,8 +10,6 @@ import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.ScoreboardHandler; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.network.NetworkPlayerInfo; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItemFrame; @@ -22,7 +20,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.scoreboard.ScoreObjective; import net.minecraft.util.*; -import org.lwjgl.opengl.GL11; import java.awt.*; import java.util.List; @@ -509,19 +506,6 @@ public class Utils { return (Math.floor(level / 2D) + 25) / 100D; } - public static void drawOnSlot(int size, int xSlotPos, int ySlotPos, int colour) { - ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); - int guiLeft = (sr.getScaledWidth() - 176) / 2; - int guiTop = (sr.getScaledHeight() - 222) / 2; - int x = guiLeft + xSlotPos; - int y = guiTop + ySlotPos; - // Move down when chest isn't 6 rows - if (size != 90) y += (6 - (size - 36) / 9) * 9; - - GL11.glTranslated(0, 0, 1); - Gui.drawRect(x, y, x + 16, y + 16, colour); - GL11.glTranslated(0, 0, -1); - public static void desktopNotification(String name, String title, String text, TrayIcon.MessageType messageType) { try { final SystemTray tray = SystemTray.getSystemTray(); -- cgit From ca5e1b8e9bccfb36f577d5d4fd32265ecdb0b2db Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 11 Aug 2022 18:29:53 -0400 Subject: Fix /dungeons not working --- src/main/java/me/Danker/DankersSkyblockMod.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 1bbaf89..1b428b6 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -203,11 +203,12 @@ public class DankersSkyblockMod { ClientCommandHandler.instance.registerCommand(new ArmourCommand()); ClientCommandHandler.instance.registerCommand(new BankCommand()); ClientCommandHandler.instance.registerCommand(new BlockSlayerCommand()); - ClientCommandHandler.instance.registerCommand(new CustomMusicCommand()); ClientCommandHandler.instance.registerCommand(new CrystalHollowWaypointCommand()); - ClientCommandHandler.instance.registerCommand(new DHelpCommand()); + ClientCommandHandler.instance.registerCommand(new CustomMusicCommand()); ClientCommandHandler.instance.registerCommand(new DankerGuiCommand()); + ClientCommandHandler.instance.registerCommand(new DHelpCommand()); ClientCommandHandler.instance.registerCommand(new DisplayCommand()); + ClientCommandHandler.instance.registerCommand(new DungeonsCommand()); ClientCommandHandler.instance.registerCommand(new FairySoulsCommand()); ClientCommandHandler.instance.registerCommand(new FarmLengthCommand()); ClientCommandHandler.instance.registerCommand(new GetkeyCommand()); @@ -227,8 +228,8 @@ public class DankersSkyblockMod { ClientCommandHandler.instance.registerCommand(new ResetLootCommand()); ClientCommandHandler.instance.registerCommand(new ScaleCommand()); ClientCommandHandler.instance.registerCommand(new SetkeyCommand()); - ClientCommandHandler.instance.registerCommand(new SkillTrackerCommand()); ClientCommandHandler.instance.registerCommand(new SkillsCommand()); + ClientCommandHandler.instance.registerCommand(new SkillTrackerCommand()); ClientCommandHandler.instance.registerCommand(new SkyblockPlayersCommand()); ClientCommandHandler.instance.registerCommand(new SlayerCommand()); ClientCommandHandler.instance.registerCommand(new ToggleCommand()); -- cgit From 57b96b1c968c95284a8f399b97a0ce96d998faf9 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 11 Aug 2022 18:30:08 -0400 Subject: Disable custom colours by default --- src/main/java/me/Danker/handlers/ConfigHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index edbd0b4..c12b511 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -225,7 +225,7 @@ public class ConfigHandler { ToggleCommand.teammatesInRadius = initBoolean("toggles", "TeammatesInRadius", false); ToggleCommand.giantHP = initBoolean("toggles", "GiantHP", false); ToggleCommand.hidePetCandy = initBoolean("toggles", "HidePetCandy", false); - ToggleCommand.customColouredNames = initBoolean("toggles", "CustomColouredNames", true); // enabled by default + ToggleCommand.customColouredNames = initBoolean("toggles", "CustomColouredNames", false); ToggleCommand.customNametags = initBoolean("toggles", "CustomNametags", true); ToggleCommand.endOfFarmAlert = initBoolean("toggles", "EndOfFarmAlert", false); ToggleCommand.gemstoneLore = initBoolean("toggles", "GemstoneLore", false); -- cgit From 8e4810bdaff443866f7c5a1346ba919bc8083899 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 11 Aug 2022 18:45:37 -0400 Subject: Fix trophy fish display crash --- src/main/java/me/Danker/features/loot/TrophyFishTracker.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/loot/TrophyFishTracker.java b/src/main/java/me/Danker/features/loot/TrophyFishTracker.java index 6202871..f9936f0 100644 --- a/src/main/java/me/Danker/features/loot/TrophyFishTracker.java +++ b/src/main/java/me/Danker/features/loot/TrophyFishTracker.java @@ -3,6 +3,7 @@ package me.Danker.features.loot; import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import me.Danker.events.ModInitEvent; +import me.Danker.events.PostConfigInitEvent; import me.Danker.utils.RenderUtils; import me.Danker.utils.Utils; import net.minecraft.init.Items; @@ -58,8 +59,13 @@ public class TrophyFishTracker { @SubscribeEvent public void init(ModInitEvent event) { configFile = event.configDirectory + "/dsmtrophyfish.json"; + } + + @SubscribeEvent + public void postConfigInit(PostConfigInitEvent event) { if (fish.entrySet().isEmpty()) fish = createEmpty(); fishSession = createEmpty(); + save(); } @SubscribeEvent(receiveCanceled = true) -- cgit From 189526f2d6d96cce6086af6947b4e752c13944e2 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 12 Aug 2022 19:37:53 -0400 Subject: Display trophy fish completion behind chat and tab Works for SBA custom tab and ST custom chat as well --- src/main/java/me/Danker/features/loot/TrophyFishTracker.java | 9 +++++---- src/main/java/me/Danker/utils/RenderUtils.java | 6 +++++- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/loot/TrophyFishTracker.java b/src/main/java/me/Danker/features/loot/TrophyFishTracker.java index f9936f0..1098e4b 100644 --- a/src/main/java/me/Danker/features/loot/TrophyFishTracker.java +++ b/src/main/java/me/Danker/features/loot/TrophyFishTracker.java @@ -140,10 +140,11 @@ public class TrophyFishTracker { ItemStack goldComplete = new ItemStack(Items.gold_ingot); ItemStack diamondComplete = new ItemStack(Items.diamond); - RenderUtils.renderItem(bronze ? bronzeComplete : incomplete, x, y - 2, scale / 1.3D); - RenderUtils.renderItem(silver ? silverComplete : incomplete, x + 15, y - 2, scale / 1.3D); - RenderUtils.renderItem(gold ? goldComplete : incomplete, x + 30, y - 2, scale / 1.3D); - RenderUtils.renderItem(diamond ? diamondComplete : incomplete, x + 45, y - 2, scale / 1.3D); + // -116 hides behind chat + tab + RenderUtils.renderItem(bronze ? bronzeComplete : incomplete, x, y - 2, -116, scale / 1.3D); + RenderUtils.renderItem(silver ? silverComplete : incomplete, x + 15, y - 2, -116, scale / 1.3D); + RenderUtils.renderItem(gold ? goldComplete : incomplete, x + 30, y - 2, -116, scale / 1.3D); + RenderUtils.renderItem(diamond ? diamondComplete : incomplete, x + 45, y - 2, -116, scale / 1.3D); } } diff --git a/src/main/java/me/Danker/utils/RenderUtils.java b/src/main/java/me/Danker/utils/RenderUtils.java index f334b7a..e1ee261 100644 --- a/src/main/java/me/Danker/utils/RenderUtils.java +++ b/src/main/java/me/Danker/utils/RenderUtils.java @@ -388,12 +388,16 @@ public class RenderUtils { } public static void renderItem(ItemStack stack, int x, int y, double scale) { + renderItem(stack, x, y, 0, scale); + } + + public static void renderItem(ItemStack stack, int x, int y, int z, double scale) { GlStateManager.enableRescaleNormal(); RenderHelper.enableGUIStandardItemLighting(); GlStateManager.enableDepth(); GlStateManager.pushMatrix(); - GlStateManager.translate(x, y, 0); + GlStateManager.translate(x, y, z); GlStateManager.scale(scale, scale, scale); //Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(stack, 0, 0); Minecraft.getMinecraft().getRenderItem().renderItemAndEffectIntoGUI(stack, 0, 0); -- cgit From 4ad452877d9d88a54669c5e6f04f6ab933a01a02 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 12 Aug 2022 21:27:32 -0400 Subject: Add amount of Magmafish if filleted display Shows amount of Magmafish you would get if you filleted all the trophy fish in your inventory --- README.md | 1 + src/main/java/me/Danker/DankersSkyblockMod.java | 1 + .../java/me/Danker/commands/ToggleCommand.java | 1 + .../java/me/Danker/features/FilletMagmafish.java | 139 +++++++++++++++++++++ src/main/java/me/Danker/gui/DankerGui.java | 7 ++ .../java/me/Danker/handlers/ConfigHandler.java | 1 + src/main/java/me/Danker/utils/Utils.java | 16 +++ 7 files changed, 166 insertions(+) create mode 100644 src/main/java/me/Danker/features/FilletMagmafish.java (limited to 'src/main/java/me/Danker') diff --git a/README.md b/README.md index c3478b0..53f2472 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ Discord Server: https://discord.gg/QsEkNQS - Chat aliases - Thunder/Lord Jawbus spawn alerts - Show when minion was last collected +- Show amount of Magmafish if trophy fish are filleted
diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 1b428b6..5d71b31 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -127,6 +127,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new EndOfFarmAlert()); MinecraftForge.EVENT_BUS.register(new ExpertiseLore()); MinecraftForge.EVENT_BUS.register(new FasterMaddoxCalling()); + MinecraftForge.EVENT_BUS.register(new FilletMagmafish()); MinecraftForge.EVENT_BUS.register(new FirePillarDisplay()); MinecraftForge.EVENT_BUS.register(new FishingSpawnAlerts()); MinecraftForge.EVENT_BUS.register(new GemstonesLore()); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 00b41f3..aefb979 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -67,6 +67,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean fishingAlert; public static boolean minionLastCollected; public static boolean showTrophyCompletion; + public static boolean showTotalMagmafish; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; diff --git a/src/main/java/me/Danker/features/FilletMagmafish.java b/src/main/java/me/Danker/features/FilletMagmafish.java new file mode 100644 index 0000000..06a35dc --- /dev/null +++ b/src/main/java/me/Danker/features/FilletMagmafish.java @@ -0,0 +1,139 @@ +package me.Danker.features; + +import me.Danker.commands.ToggleCommand; +import me.Danker.events.ModInitEvent; +import me.Danker.utils.RenderUtils; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.client.event.GuiOpenEvent; +import net.minecraftforge.client.event.GuiScreenEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.text.NumberFormat; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.Optional; + +public class FilletMagmafish { + + static Map fillet = new HashMap<>(); + static int total = 0; + + @SubscribeEvent + public void init(ModInitEvent event) { + fillet.put("SULPHER_SKITTER_BRONZE", 40); + fillet.put("SULPHER_SKITTER_SILVER", 60); + fillet.put("SULPHER_SKITTER_GOLD", 80); + fillet.put("SULPHER_SKITTER_DIAMOND", 120); + fillet.put("OBFUSCATED_FISH_1_BRONZE", 16); + fillet.put("OBFUSCATED_FISH_1_SILVER", 24); + fillet.put("OBFUSCATED_FISH_1_GOLD", 32); + fillet.put("OBFUSCATED_FISH_1_DIAMOND", 48); + fillet.put("STEAMING_HOT_FLOUNDER_BRONZE", 20); + fillet.put("STEAMING_HOT_FLOUNDER_SILVER", 28); + fillet.put("STEAMING_HOT_FLOUNDER_GOLD", 40); + fillet.put("STEAMING_HOT_FLOUNDER_DIAMOND", 60); + fillet.put("GUSHER_BRONZE", 32); + fillet.put("GUSHER_SILVER", 48); + fillet.put("GUSHER_GOLD", 64); + fillet.put("GUSHER_DIAMOND", 96); + fillet.put("BLOBFISH_BRONZE", 4); + fillet.put("BLOBFISH_SILVER", 8); + fillet.put("BLOBFISH_GOLD", 12); + fillet.put("BLOBFISH_DIAMOND", 16); + fillet.put("OBFUSCATED_FISH_2_BRONZE", 40); + fillet.put("OBFUSCATED_FISH_2_SILVER", 60); + fillet.put("OBFUSCATED_FISH_2_GOLD", 80); + fillet.put("OBFUSCATED_FISH_2_DIAMOND", 120); + fillet.put("SLUGFISH_BRONZE", 40); + fillet.put("SLUGFISH_SILVER", 60); + fillet.put("SLUGFISH_GOLD", 80); + fillet.put("SLUGFISH_DIAMOND", 120); + fillet.put("FLYFISH_BRONZE", 32); + fillet.put("FLYFISH_SILVER", 48); + fillet.put("FLYFISH_GOLD", 64); + fillet.put("FLYFISH_DIAMOND", 96); + fillet.put("OBFUSCATED_FISH_3_BRONZE", 400); + fillet.put("OBFUSCATED_FISH_3_SILVER", 700); + fillet.put("OBFUSCATED_FISH_3_GOLD", 1000); + fillet.put("OBFUSCATED_FISH_3_DIAMOND", 1300); + fillet.put("LAVA_HORSE_BRONZE", 12); + fillet.put("LAVA_HORSE_SILVER", 16); + fillet.put("LAVA_HORSE_GOLD", 20); + fillet.put("LAVA_HORSE_DIAMOND", 24); + fillet.put("MANA_RAY_BRONZE", 40); + fillet.put("MANA_RAY_SILVER", 60); + fillet.put("MANA_RAY_GOLD", 80); + fillet.put("MANA_RAY_DIAMOND", 120); + fillet.put("VOLCANIC_STONEFISH_BRONZE", 20); + fillet.put("VOLCANIC_STONEFISH_SILVER", 28); + fillet.put("VOLCANIC_STONEFISH_GOLD", 40); + fillet.put("VOLCANIC_STONEFISH_DIAMOND", 60); + fillet.put("VANILLE_BRONZE", 80); + fillet.put("VANILLE_SILVER", 120); + fillet.put("VANILLE_GOLD", 160); + fillet.put("VANILLE_DIAMOND", 240); + fillet.put("SKELETON_FISH_BRONZE", 32); + fillet.put("SKELETON_FISH_SILVER", 48); + fillet.put("SKELETON_FISH_GOLD", 64); + fillet.put("SKELETON_FISH_DIAMOND", 96); + fillet.put("MOLDFIN_BRONZE", 32); + fillet.put("MOLDFIN_SILVER", 48); + fillet.put("MOLDFIN_GOLD", 64); + fillet.put("MOLDFIN_DIAMOND", 96); + fillet.put("SOUL_FISH_BRONZE", 32); + fillet.put("SOUL_FISH_SILVER", 48); + fillet.put("SOUL_FISH_GOLD", 64); + fillet.put("SOUL_FISH_DIAMOND", 96); + fillet.put("KARATE_FISH_BRONZE", 40); + fillet.put("KARATE_FISH_SILVER", 60); + fillet.put("KARATE_FISH_GOLD", 80); + fillet.put("KARATE_FISH_DIAMOND", 120); + fillet.put("GOLDEN_FISH_BRONZE", 400); + fillet.put("GOLDEN_FISH_SILVER", 700); + fillet.put("GOLDEN_FISH_GOLD", 1000); + fillet.put("GOLDEN_FISH_DIAMOND", 1300); + } + + @SubscribeEvent + public void onGuiOpen(GuiOpenEvent event) { + if (!ToggleCommand.showTotalMagmafish || !Utils.inSkyblock) return; + + if (event.gui instanceof GuiInventory) { + ItemStack[] inv = Minecraft.getMinecraft().thePlayer.inventory.mainInventory; + + for (ItemStack stack : inv) { + String id = Utils.getSkyblockItemID(stack); + if (id == null) continue; + + total += Optional.ofNullable(fillet.get(id)).orElse(0); + } + } else { + total = 0; + } + } + + @SubscribeEvent + public void onGuiScreenRender(GuiScreenEvent.BackgroundDrawnEvent event) { + if (!ToggleCommand.showTotalMagmafish || !Utils.inSkyblock) return; + + if (event.gui instanceof GuiInventory) { + if (total == 0) return; + + NumberFormat nf = NumberFormat.getIntegerInstance(Locale.US); + String display = EnumChatFormatting.BLUE + "Magmafish: " + nf.format(total); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int width = sr.getScaledWidth(); + int height = (sr.getScaledHeight() - 222) / 2 + 10; + + RenderUtils.drawCenteredText(display, width, height, 1D); + } + } + +} diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 9a8d283..f009d34 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -95,6 +95,7 @@ public class DankerGui extends GuiScreen { private GuiButton fishingAlert; private GuiButton minionLastCollected; private GuiButton showTrophyCompletion; + private GuiButton showTotalMagmafish; // Chat Messages private GuiButton sceptreMessages; private GuiButton midasStaffMessages; @@ -194,6 +195,7 @@ public class DankerGui extends GuiScreen { fishingAlert = new FeatureButton("Fishing Spawn Alerts: " + Utils.getColouredBoolean(ToggleCommand.fishingAlert), "Alerts when a Thunder or Lord Jawbus spawns nearby"); minionLastCollected = new FeatureButton("Show When Minion Last Collected: " + Utils.getColouredBoolean(ToggleCommand.minionLastCollected), "Displays when a minion was last collected over the minion."); showTrophyCompletion = new FeatureButton("Show Trophy Fish Completion: " + Utils.getColouredBoolean(ToggleCommand.showTrophyCompletion), "Show completion instead of count in trophy fish tracker display."); + showTotalMagmafish = new FeatureButton("Show Total Fillet Magmafish: " + Utils.getColouredBoolean(ToggleCommand.showTotalMagmafish), "Show total Magmafish you would get if you filleted all the trophy fish in your inventory."); allButtons.clear(); allButtons.add(changeDisplay); @@ -259,6 +261,7 @@ public class DankerGui extends GuiScreen { allButtons.add(fishingAlert); allButtons.add(minionLastCollected); allButtons.add(showTrophyCompletion); + allButtons.add(showTotalMagmafish); search.setText(initSearchText); search.setVisible(true); @@ -572,6 +575,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.showTrophyCompletion = !ToggleCommand.showTrophyCompletion; ConfigHandler.writeBooleanConfig("toggles", "ShowTrophyCompletion", ToggleCommand.showTrophyCompletion); showTrophyCompletion.displayString = "Show Trophy Fish Completion: " + Utils.getColouredBoolean(ToggleCommand.showTrophyCompletion); + } else if (button == showTotalMagmafish) { + ToggleCommand.showTotalMagmafish = !ToggleCommand.showTotalMagmafish; + ConfigHandler.writeBooleanConfig("toggles", "ShowTotalMagmafish", ToggleCommand.showTotalMagmafish); + showTotalMagmafish.displayString = "Show Total Fillet Magmafish: " + Utils.getColouredBoolean(ToggleCommand.showTotalMagmafish); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index c12b511..ccc3143 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -254,6 +254,7 @@ public class ConfigHandler { ToggleCommand.fishingAlert = initBoolean("toggles", "FishingAlert", false); ToggleCommand.minionLastCollected = initBoolean("toggles", "MinionLastCollected", false); ToggleCommand.showTrophyCompletion = initBoolean("toggles", "ShowTrophyCompletion", false); + ToggleCommand.showTotalMagmafish = initBoolean("toggles", "ShowTotalMagmafish", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 8791a43..7c92620 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -531,6 +531,22 @@ public class Utils { return newObj; } + // https://github.com/BiscuitDevelopment/SkyblockAddons/blob/main/src/main/java/codes/biscuit/skyblockaddons/utils/ItemUtils.java#L139-L148 + public static NBTTagCompound getExtraAttributes(ItemStack item) { + if (item == null || !item.hasTagCompound()) return null; + return item.getSubCompound("ExtraAttributes", false); + } + + // https://github.com/BiscuitDevelopment/SkyblockAddons/blob/main/src/main/java/codes/biscuit/skyblockaddons/utils/ItemUtils.java#L116-L131 + public static String getSkyblockItemID(ItemStack item) { + if (item == null) return null; + + NBTTagCompound extraAttributes = getExtraAttributes(item); + if (extraAttributes == null || !extraAttributes.hasKey("id", 8)) return null; + + return extraAttributes.getString("id"); + } + public enum DungeonFloor { NONE, E0, -- cgit From d89f15d11550f3c3b1a5fdc447a1079035b1e759 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 12 Aug 2022 21:35:25 -0400 Subject: Fix rendering issues with trophy fish completion display --- src/main/java/me/Danker/utils/RenderUtils.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/utils/RenderUtils.java b/src/main/java/me/Danker/utils/RenderUtils.java index e1ee261..00f49b3 100644 --- a/src/main/java/me/Danker/utils/RenderUtils.java +++ b/src/main/java/me/Danker/utils/RenderUtils.java @@ -394,16 +394,15 @@ public class RenderUtils { public static void renderItem(ItemStack stack, int x, int y, int z, double scale) { GlStateManager.enableRescaleNormal(); RenderHelper.enableGUIStandardItemLighting(); - GlStateManager.enableDepth(); GlStateManager.pushMatrix(); GlStateManager.translate(x, y, z); GlStateManager.scale(scale, scale, scale); - //Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(stack, 0, 0); + Minecraft.getMinecraft().getRenderItem().renderItemAndEffectIntoGUI(stack, 0, 0); + GlStateManager.popMatrix(); - GlStateManager.disableDepth(); RenderHelper.disableStandardItemLighting(); GlStateManager.disableRescaleNormal(); } -- cgit From a89ec05fdba403946df8a0654cfcdfcdee160bbc Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 12 Aug 2022 21:43:03 -0400 Subject: Fix total magmafish not counting stack size Oops --- src/main/java/me/Danker/features/FilletMagmafish.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main/java/me/Danker') diff --git a/src/main/java/me/Danker/features/FilletMagmafish.java b/src/main/java/me/Danker/features/FilletMagmafish.java index 06a35dc..0d24ddd 100644 --- a/src/main/java/me/Danker/features/FilletMagmafish.java +++ b/src/main/java/me/Danker/features/FilletMagmafish.java @@ -108,10 +108,12 @@ public class FilletMagmafish { ItemStack[] inv = Minecraft.getMinecraft().thePlayer.inventory.mainInventory; for (ItemStack stack : inv) { + if (stack == null) continue; + String id = Utils.getSkyblockItemID(stack); if (id == null) continue; - total += Optional.ofNullable(fillet.get(id)).orElse(0); + total += Optional.ofNullable(fillet.get(id)).orElse(0) * stack.stackSize; } } else { total = 0; -- cgit From 77c7ec28f36a4cc910c80b6622461c6f7adea106 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Mon, 15 Aug 2022 20:31:30 -0400 Subject: Update version to 1.8.7 --- build.gradle | 2 +- src/main/java/me/Danker/DankersSkyblockMod.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/me/Danker') diff --git a/build.gradle b/build.gradle index 343c1da..1f653b2 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,7 @@ plugins { id "net.minecraftforge.gradle.forge" version "2.0.2" } */ -version = "1.8.7-beta7" +version = "1.8.7" group= "me.Danker.DankersSkyblockMod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Danker's Skyblock Mod" diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 5d71b31..980fddc 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -63,7 +63,7 @@ import java.util.Map; @Mod(modid = DankersSkyblockMod.MODID, version = DankersSkyblockMod.VERSION, clientSideOnly = true) public class DankersSkyblockMod { public static final String MODID = "Danker's Skyblock Mod"; - public static final String VERSION = "1.8.7-beta7"; + public static final String VERSION = "1.8.7"; public static int titleTimer = -1; public static boolean showTitle = false; public static String titleText = ""; -- cgit