diff options
author | bowser0000 <bowser0000@gmail.com> | 2022-08-15 20:40:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-15 20:40:34 -0400 |
commit | 3aa11b859a2a22be30a5035f7273e1a604a4dde4 (patch) | |
tree | 8f428b29a6b56cc9d010b0441bf41b6b78373548 /src/main/java/me/Danker/features | |
parent | 33710ac6d9f57fa59e8dfb19a81b053346f1b097 (diff) | |
parent | daceea1e42371c295c36f80b3246601a6ffb2cc5 (diff) | |
download | SkyblockMod-3aa11b859a2a22be30a5035f7273e1a604a4dde4.tar.gz SkyblockMod-3aa11b859a2a22be30a5035f7273e1a604a4dde4.tar.bz2 SkyblockMod-3aa11b859a2a22be30a5035f7273e1a604a4dde4.zip |
1.8.7
Diffstat (limited to 'src/main/java/me/Danker/features')
73 files changed, 6475 insertions, 1891 deletions
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..e98660e --- /dev/null +++ b/src/main/java/me/Danker/features/AbilityCooldowns.java @@ -0,0 +1,129 @@ +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.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 { + + static List<Ability> cooldowns = new ArrayList<>(); + static double mageReduction = 0D; + + @SubscribeEvent(priority = EventPriority.LOW) + public void onChat(ClientChatReceivedEvent event) { + if (!Utils.inSkyblock || !ToggleCommand.abilityCooldowns) return; + + 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 (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()); + + 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 (ToggleCommand.abilityCooldowns && 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); + } + } + + @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<Slot> 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, double cooldown) { + this.ability = ability; + this.cooldown = (long) (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/Alerts.java b/src/main/java/me/Danker/features/Alerts.java new file mode 100644 index 0000000..aa6197f --- /dev/null +++ b/src/main/java/me/Danker/features/Alerts.java @@ -0,0 +1,143 @@ +package me.Danker.features; + +import com.google.gson.GsonBuilder; +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; +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; +import java.util.HashMap; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class Alerts { + + public static List<Alert> alerts = new ArrayList<>(); + public static HashMap<Alert, Pattern> 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; + + 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; + + 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; + } + } + } + } + + 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(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + + 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 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; + } + + public void toggle() { + toggled = !toggled; + } + + public void toggleDesktop() { + desktop = !desktop; + } + + } + +} diff --git a/src/main/java/me/Danker/features/ArachneESP.java b/src/main/java/me/Danker/features/ArachneESP.java index c78c385..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; @@ -30,19 +30,10 @@ public class ArachneESP { arachne = null; } - public boolean inSpidersDen(List<String> scoreboard) { - for (String s : scoreboard) { - if (ScoreboardHandler.cleanSB(s).contains("Spiders 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; @@ -66,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/AutoAcceptReparty.java b/src/main/java/me/Danker/features/AutoAcceptReparty.java new file mode 100644 index 0000000..b2e563d --- /dev/null +++ b/src/main/java/me/Danker/features/AutoAcceptReparty.java @@ -0,0 +1,36 @@ +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) { + + 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!")) { + 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/features/AutoDisplay.java b/src/main/java/me/Danker/features/AutoDisplay.java index 182c0b4..9ef3b4d 100644 --- a/src/main/java/me/Danker/features/AutoDisplay.java +++ b/src/main/java/me/Danker/features/AutoDisplay.java @@ -4,8 +4,10 @@ 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; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -37,24 +39,47 @@ 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("Inferno Demonlord")) { + LootDisplay.display = "blaze"; + found = true; } 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 (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; } @@ -65,6 +90,22 @@ public class AutoDisplay { if (hotbarItem.getDisplayName().contains("Ancestral Spade")) { LootDisplay.display = "mythological"; found = true; + break; + } else if (hotbarItem.getItem() == Items.fishing_rod) { + List<String> lore = hotbarItem.getTooltip(player, mc.gameSettings.advancedItemTooltips); + for (int j = lore.size() - 1; j >= 0; j--) { // reverse + 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"; + } + found = true; + break; + } + } } } if (!found) LootDisplay.display = "off"; 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/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/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<Block> 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/BonzoMaskTimer.java b/src/main/java/me/Danker/features/BonzoMaskTimer.java index e038786..5bec1ba 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; @@ -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; @@ -56,7 +57,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/ChatAliases.java b/src/main/java/me/Danker/features/ChatAliases.java new file mode 100644 index 0000000..76ab5f6 --- /dev/null +++ b/src/main/java/me/Danker/features/ChatAliases.java @@ -0,0 +1,70 @@ +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; +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<Alias> 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) { + 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/features/ColouredNames.java b/src/main/java/me/Danker/features/ColouredNames.java new file mode 100644 index 0000000..9f7890c --- /dev/null +++ b/src/main/java/me/Danker/features/ColouredNames.java @@ -0,0 +1,179 @@ +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; +import net.minecraft.util.StringUtils; +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 net.minecraftforge.fml.relauncher.ReflectionHelper; + +import java.lang.reflect.Field; +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<String> users = new ArrayList<>(); + public static Map<String, String> 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; + + for (String user : users) { + if (event.message.getFormattedText().contains(user)) { + event.message = replaceChat(event.message, user); + } + } + } + + @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 (StringUtils.stripControlCodes(event.toolTip.get(i)).contains(user)) { + event.toolTip.set(i, replaceName(event.toolTip.get(i), user, getColourFromName(user))); + } + } + } + } + + @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(priority = EventPriority.LOW) + public void onRenderLiving(RenderLivingEvent.Specials.Pre<EntityLivingBase> event) { + if (!ToggleCommand.customColouredNames || !ToggleCommand.customNametags || !Utils.inSkyblock) return; + + Entity entity = event.entity; + 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 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(); + } + + // 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("(?:.*(?:(?<colour>\\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); + } + + // 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) { + try { + return "§" + DankersSkyblockMod.data.get("colourednames").getAsJsonObject().get(name).getAsString(); + } catch (NullPointerException ex) { + return EnumChatFormatting.WHITE.toString(); + } + } + +} 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..12aa94e --- /dev/null +++ b/src/main/java/me/Danker/features/CrystalHollowWaypoints.java @@ -0,0 +1,283 @@ +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.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.InputEvent; +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<Waypoint> waypoints = new ArrayList<>(); + public static Pattern skytilsPattern = Pattern.compile("(?<name>.*?): (?<x>\\d{1,3}) (?<y>\\d{1,3}) (?<z>\\d{1,3})"); + + 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.tabLocation.equals("Crystal Hollows") && world != null) { + boolean found = false; + List<String> 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<EntityArmorStand> 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().contains("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; + + 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 + */ + if (ToggleCommand.crystalHollowWaypoints && Utils.tabLocation.equals("Crystal Hollows")) { + if (!message.contains(player.getName())) { + if (message.contains(": $DSMCHWP:") || message.contains(": $SBECHWP:")) { + String waypoints = message.substring(message.lastIndexOf(":") + 1); + + 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 if (message.indexOf(":") != message.lastIndexOf(":")) { + String text = message.substring(message.indexOf(":") + 2); + Matcher matcher = skytilsPattern.matcher(text); + + if (matcher.matches()) { + String name = matcher.group("name"); + String x = matcher.group("x"); + String y = matcher.group("y"); + String z = matcher.group("z"); + + 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(); + } + } + } + } + } + + @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")) { + for (Waypoint waypoint : waypoints) { + if (waypoint.toggled) RenderUtils.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; + } + + } + + 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())); + } + } + +} diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java index bb44bf5..01279fd 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.PostConfigInitEvent; import me.Danker.handlers.ScoreboardHandler; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; @@ -20,19 +21,54 @@ 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 { static boolean cancelNotes; - static boolean prevInDungeonBossRoom = false; - public static boolean inDungeonBossRoom = false; + 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; + 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 spidersDen; + public static int spidersDenVolume; + public static Song crimsonIsle; + public static int crimsonIsleVolume; + public static Song end; + public static int endVolume; + public static Song park; + public static int parkVolume; + + static int curPhase = 0; @SubscribeEvent public void onWorldChange(WorldEvent.Load event) { @@ -40,40 +76,97 @@ 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(); EntityPlayerSP player = mc.thePlayer; World world = mc.theWorld; if (DankersSkyblockMod.tickAmount % 10 == 0) { - if (ToggleCommand.dungeonBossMusic && Utils.inDungeons && world != null && player != null) { - prevInDungeonBossRoom = inDungeonBossRoom; - List<String> 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("maxor")) { // F7 - - inDungeonBossRoom = true; - if (!prevInDungeonBossRoom) { - dungeonboss.start(); + if (world != null && player != null) { + if (Utils.inDungeons) { + List<String> 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("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 { + 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; + } } } } } @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) { @@ -82,15 +175,37 @@ public class CustomMusic { } } - if (message.contains(":")) return; - if (Utils.inDungeons) { + if (ToggleCommand.dungeonBossMusic) { + if (phase2.hasSongs() && message.startsWith("[BOSS] Storm: Pathetic Maxor")) { + phase2.start(); + curPhase = 2; + } else if (phase3.hasSongs() && message.startsWith("[BOSS] Goldor: Who dares trespass into my domain?")) { + phase3.start(); + curPhase = 3; + } else if (phase4.hasSongs() && message.startsWith("[BOSS] Necron: You went further than any human before")) { + phase4.start(); + curPhase = 4; + } 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(); - } else if (ToggleCommand.bloodRoomMusic && message.contains("The BLOOD DOOR has been opened!")) { - bloodroom.start(); + 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(); } } } @@ -102,79 +217,144 @@ public class CustomMusic { } } - public static void init(String configDirectory) throws IOException, LineUnavailableException, UnsupportedAudioFileException { + @SubscribeEvent + public void postConfigInit(PostConfigInitEvent event) { + init(event.configDirectory); + } + + public static void init(String configDirectory) { if (configDirectory == null) return; File directory = new File(configDirectory + "/dsmmusic"); if (!directory.exists()) directory.mkdir(); 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); + 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", islandVolume); + 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); + spidersDen = new Song(directory, "spidersden", spidersDenVolume); + crimsonIsle = new Song(directory, "crimsonisle", crimsonIsleVolume); + 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 (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(); + 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 (spidersDen != null) spidersDen.stop(); + if (crimsonIsle != null) crimsonIsle.stop(); + if (end != null) end.stop(); + if (park != null) park.stop(); + curPhase = 0; } public static class Song { public Clip music; + private final List<File> playlist = new ArrayList<>(); + private int volume; - 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); + 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 + playlist.add(file); + System.out.println("Added " + file.getName() + " to " + songName + " playlist."); + } + } } + + this.volume = volume; } - public void start() { - reset(); - if (music != null) { - cancelNotes = true; - music.setMicrosecondPosition(0); - music.start(); - music.loop(Clip.LOOP_CONTINUOUSLY); + public void start() throws UnsupportedAudioFileException, LineUnavailableException, IOException { + + 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.")); + } } } public void stop() { cancelNotes = false; - if (music != null) music.stop(); + if (music != null) { + music.stop(); + if (music.isOpen()) music.close(); + } + } + + 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) { - EntityPlayer player = Minecraft.getMinecraft().thePlayer; - if (music == null) return false; + this.volume = volume; + 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; + 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); } - control.setValue(decibels); return true; } + public boolean hasSongs() { + return playlist.size() > 0; + } + } } 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..588db8a --- /dev/null +++ b/src/main/java/me/Danker/features/DungeonScore.java @@ -0,0 +1,200 @@ +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.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; + +public class DungeonScore { + + int failedPuzzles; + int deaths; + 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.")) { + deaths++; + } + } + + @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) { + int missingPuzzles = 0; + double openedRooms = 0; + double completedRooms = 0; + double roomScore = 0; + double secretScore = 0; + + if (Minecraft.getMinecraft().getNetHandler() == null) return; + Collection<NetworkPlayerInfo> 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 (Utils.currentFloor) { + 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 (Utils.currentFloor == Utils.DungeonFloor.F2) time -= 120; + + int base; + switch (Utils.currentFloor) { + 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 = MathHelper.clamp_int(100 - 14 * (failedPuzzles + missingPuzzles) - 2 * deaths, 0, 100); + 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; + deaths = 0; + skillScore = 100; + secrets = ""; + exploreScore = 0; + timeScore = 100; + bonusScore = 0; + } + +} 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/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/FilletMagmafish.java b/src/main/java/me/Danker/features/FilletMagmafish.java new file mode 100644 index 0000000..0d24ddd --- /dev/null +++ b/src/main/java/me/Danker/features/FilletMagmafish.java @@ -0,0 +1,141 @@ +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<String, Integer> 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) { + if (stack == null) continue; + + String id = Utils.getSkyblockItemID(stack); + if (id == null) continue; + + total += Optional.ofNullable(fillet.get(id)).orElse(0) * stack.stackSize; + } + } 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/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<Entity> 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/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<Entity> 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/features/GemstonesLore.java b/src/main/java/me/Danker/features/GemstonesLore.java new file mode 100644 index 0000000..b16edaf --- /dev/null +++ b/src/main/java/me/Danker/features/GemstonesLore.java @@ -0,0 +1,80 @@ +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; +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<String, EnumChatFormatting> gemstoneColours = new HashMap<>(); + + @SubscribeEvent + public void init(ModInitEvent event) { + 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); + gemstoneColours.put("Opal", EnumChatFormatting.WHITE); + } + + @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<String> 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_") || 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("_"))); + } + + 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/features/GiantHPDisplay.java b/src/main/java/me/Danker/features/GiantHPDisplay.java new file mode 100644 index 0000000..4af31ae --- /dev/null +++ b/src/main/java/me/Danker/features/GiantHPDisplay.java @@ -0,0 +1,73 @@ +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.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<Entity> 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<String> scoreboard = ScoreboardHandler.getSidebarLines(); + String firstLine = ScoreboardHandler.cleanSB(scoreboard.get(scoreboard.size() - 1)); + + if (firstLine.contains("sadan")) { + List<Entity> 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<Entity> entities = world.getLoadedEntityList(); + + for (Entity entity : entities) { + if (entity.getName().contains("Giant ")) { + giants.add(entity); + } + } + } + } + } + } + + @SubscribeEvent + public void renderPlayerInfo(RenderOverlayEvent 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(), MoveCommand.giantHPXY[0], MoveCommand.giantHPXY[1], ScaleCommand.giantHPScale); + } + } + +} 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<String, String> 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/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/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/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/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<ItemStack> armour = new ArrayList<>(); + + @SubscribeEvent + public void onRenderLivingPre(RenderLivingEvent.Pre<EntityLivingBase> 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<EntityLivingBase> 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/features/HighlightCommissions.java b/src/main/java/me/Danker/features/HighlightCommissions.java new file mode 100644 index 0000000..3bf1cb2 --- /dev/null +++ b/src/main/java/me/Danker/features/HighlightCommissions.java @@ -0,0 +1,38 @@ +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.ItemWritableBook; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.util.List; + +public class HighlightCommissions { + + public static int HIGHLIGHT_COLOUR; + + @SubscribeEvent + public void onGuiRender(GuiChestBackgroundDrawnEvent event) { + if(!Utils.inSkyblock) return; + if(!ToggleCommand.highlightCommissions) return; + List<Slot> 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")) { + RenderUtils.drawOnSlot(event.chestSize, slot.xDisplayPosition, slot.yDisplayPosition, HIGHLIGHT_COLOUR + 0xD7000000); + break; + } + } + + } + } + } + +} 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..72259db --- /dev/null +++ b/src/main/java/me/Danker/features/HighlightSkeletonMasters.java @@ -0,0 +1,43 @@ +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; +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<Entity> skeletonMasters = new ArrayList<>(); + public static int SKELETON_MASTER_COLOUR; + + @SubscribeEvent + public void onRenderEntity(RenderLivingEvent.Pre<EntityLivingBase> 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) + RenderUtils.draw3DBox(skeletonMaster.getEntityBoundingBox(), SKELETON_MASTER_COLOUR, event.partialTicks); + } + skeletonMasters.clear(); + } + } + +} 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..d793970 --- /dev/null +++ b/src/main/java/me/Danker/features/MinionLastCollected.java @@ -0,0 +1,142 @@ +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; +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.AxisAlignedBB; +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<Minion> minions = new ArrayList<>(); + public static String configFile; + 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")) { + 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) { + 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); + } + } + } + + 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 boolean minionExistsAtPos(BlockPos pos) { + AxisAlignedBB aabb = new AxisAlignedBB(pos, pos.add(1, 1, 1)); + List<EntityArmorStand> 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); + 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/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<EntityArmorStand> 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<EntityArmorStand> 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/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..7192f07 100644 --- a/src/main/java/me/Danker/features/PetColours.java +++ b/src/main/java/me/Danker/features/PetColours.java @@ -2,7 +2,7 @@ package me.Danker.features; import me.Danker.commands.ToggleCommand; import me.Danker.events.GuiChestBackgroundDrawnEvent; -import me.Danker.utils.Utils; +import me.Danker.utils.RenderUtils; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.util.StringUtils; @@ -37,30 +37,30 @@ 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; } - 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 3b73cf9..7025ac5 100644 --- a/src/main/java/me/Danker/features/Skill50Display.java +++ b/src/main/java/me/Danker/features/Skill50Display.java @@ -1,12 +1,14 @@ 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.events.RenderOverlayEvent; 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; @@ -43,13 +45,56 @@ 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 = (int) (Double.parseDouble(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); 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 + "%"; } } } @@ -68,7 +113,12 @@ 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; + } + 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..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; @@ -52,86 +52,127 @@ 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(",", "")); + + int xpToLevelUp; + String nextLevelXpString = section.substring(section.indexOf("/") + 1, section.indexOf(")")).replaceAll(",", ""); + if (nextLevelXpString.contains("k")) { + xpToLevelUp = (int) (Double.parseDouble(nextLevelXpString.substring(0, nextLevelXpString.indexOf("k"))) * 1000); + } else { + xpToLevelUp = Integer.parseInt(nextLevelXpString); + } + 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."); } } } } @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); + return; + } + int xpPerHour; double xpToShow = 0; switch (lastSkill) { @@ -196,12 +237,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/features/SlayerESP.java b/src/main/java/me/Danker/features/SlayerESP.java index 522e696..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; @@ -26,6 +27,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 +37,7 @@ public class SlayerESP { zombie = null; spider = null; wolf = null; + enderman = null; } @SubscribeEvent @@ -45,7 +48,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 +69,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 +93,7 @@ public class SlayerESP { zombie = null; spider = null; wolf = null; + enderman = null; } } @@ -100,17 +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); + RenderUtils.draw3DBox(aabb, SLAYER_COLOUR, event.partialTicks); return; } } 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); } } 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..8530f17 --- /dev/null +++ b/src/main/java/me/Danker/features/SpiritBootsFix.java @@ -0,0 +1,32 @@ +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; + +import java.lang.reflect.Field; + +public class SpiritBootsFix { + + static Field slot = ReflectionHelper.findField(S04PacketEntityEquipment.class, "equipmentSlot", "field_149392_b", "b"); + + @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 (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/TetherDisplay.java b/src/main/java/me/Danker/features/TetherDisplay.java new file mode 100644 index 0000000..1af3a0f --- /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.RenderOverlayEvent; +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<String> 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<EntityPlayer> 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(RenderOverlayEvent 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/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/loot/BlazeTracker.java b/src/main/java/me/Danker/features/loot/BlazeTracker.java new file mode 100644 index 0000000..955f83c --- /dev/null +++ b/src/main/java/me/Danker/features/loot/BlazeTracker.java @@ -0,0 +1,190 @@ +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! (") && 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! (") && 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! (") && 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! (") && 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! (") && 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++; + 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)")) { + int amount = LootTracker.getAmountfromMessage(message); + opalGems += amount; + opalGemsSession += amount; + 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/CatacombsTracker.java b/src/main/java/me/Danker/features/loot/CatacombsTracker.java new file mode 100644 index 0000000..772b65c --- /dev/null +++ b/src/main/java/me/Danker/features/loot/CatacombsTracker.java @@ -0,0 +1,725 @@ +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 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; + public static int adaptiveBoots; + 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; + 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 f5SPlus; + 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 f6SPlus; + 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 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; + 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 int f7Rerolls; + public static double f7CoinsSpent; + public static double f7TimeSpent; + // MM + 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 necronDyes; + public static int darkClaymores; + public static int masterRerolls; + public static double masterCoinsSpent; + public static double masterTimeSpent; + + // Catacombs Dungeons + 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; + public static int adaptiveBootsSession = 0; + 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; + 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 f5SPlusSession = 0; + 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 f6SPlusSession = 0; + 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 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; + 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 int f7RerollsSession = 0; + public static double f7CoinsSpentSession = 0; + public static double f7TimeSpentSession = 0; + // MM + 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 necronDyesSession = 0; + public static int darkClaymoresSession = 0; + public static int masterRerollsSession = 0; + public static double masterCoinsSpentSession = 0; + public static double masterTimeSpentSession = 0; + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent event) { + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + + if (!Utils.inDungeons) return; + if (event.type == 2) return; + + if (message.contains(" Team Score: ")) { + if (message.contains("(S+)")) { + 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)")) { + switch (Utils.currentFloor) { + case M1: + m1S++; + m1SSession++; + ConfigHandler.writeIntConfig("catacombs", "masterOneS", m1S); + break; + case M2: + m2S++; + m2SSession++; + ConfigHandler.writeIntConfig("catacombs", "masterTwoS", m2S); + break; + case M3: + m3S++; + m3SSession++; + ConfigHandler.writeIntConfig("catacombs", "masterThreeS", m3S); + break; + case M4: + m4S++; + m4SSession++; + ConfigHandler.writeIntConfig("catacombs", "masterFourS", m4S); + break; + case M5: + m5S++; + m5SSession++; + ConfigHandler.writeIntConfig("catacombs", "masterFiveS", m5S); + break; + case M6: + m6S++; + m6SSession++; + ConfigHandler.writeIntConfig("catacombs", "masterSixS", m6S); + break; + case M7: + m7S++; + m7SSession++; + ConfigHandler.writeIntConfig("catacombs", "masterSevenS", m7S); + break; + } + } + } + + 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); + } 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); + } else if (message.contains("Dark Claymore")) { + darkClaymores++; + darkClaymoresSession++; + ConfigHandler.writeIntConfig("catacombs", "darkClaymore", darkClaymores); + } else if (message.contains("Necron Dye")) { + necronDyes++; + necronDyesSession++; + ConfigHandler.writeIntConfig("catacombs", "necronDye", necronDyes); + } + } + + if (message.contains("EXTRA STATS ")) { + List<String> scoreboard = ScoreboardHandler.getSidebarLines(); + for (String s : scoreboard) { + String sCleaned = ScoreboardHandler.cleanSB(s); + 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"))); + 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; + } + } + } + } + } + + @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<String> tooltip = item.getTooltip(Minecraft.getMinecraft().thePlayer, false); + for (String lineUnclean : tooltip) { + String line = StringUtils.stripControlCodes(lineUnclean); + if (line.contains(" Coins") && !line.contains("NOTE:")) { + int coinsSpent = Integer.parseInt(line.replaceAll("[^\\d]", "")); + + 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")) { + 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/EndermanTracker.java b/src/main/java/me/Danker/features/loot/EndermanTracker.java new file mode 100644 index 0000000..1cc46db --- /dev/null +++ b/src/main/java/me/Danker/features/loot/EndermanTracker.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 EndermanTracker { + + 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 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) { + 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 ")) { + voidglooms++; + voidgloomsSession++; + if (bosses != -1) { + bosses++; + } + if (bossesSession != -1) { + bossesSession++; + } + 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); + 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)")) { + endersnakes++; + endersnakesSession++; + ConfigHandler.writeIntConfig("enderman", "endersnakes", endersnakes); + } else if (message.contains("VERY RARE DROP! (Summoning Eye)")) { + summoningEyes++; + summoningEyesSession++; + ConfigHandler.writeIntConfig("enderman", "summoningEyes", summoningEyes); + } else if (message.contains("VERY RARE DROP! (Mana Steal I)")) { + manaBooks++; + manaBooksSession++; + ConfigHandler.writeIntConfig("enderman", "manaBooks", manaBooks); + } else if (message.contains("VERY RARE DROP! (Transmission Tuner)")) { + tuners++; + tunersSession++; + ConfigHandler.writeIntConfig("enderman", "tuners", tuners); + } else if (message.contains("VERY RARE DROP! (Null Atom)")) { + 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; + 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)")) { + smartyBooks++; + smartyBooksSession++; + ConfigHandler.writeIntConfig("enderman", "smartyBooks", smartyBooks); + } else if (message.contains("VERY RARE DROP! (") && message.contains(" End Rune I)")) { + endRunes++; + endRunesSession++; + ConfigHandler.writeIntConfig("enderman", "endRunes", endRunes); + } else if (message.contains("CRAZY RARE DROP! (Handy Blood Chalice)")) { + rng = true; + 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)")) { + dice++; + diceSession++; + ConfigHandler.writeIntConfig("enderman", "dice", dice); + } else if (message.contains("CRAZY RARE DROP! (Exceedingly Rare Ender Artifact Upgrader)")) { + rng = true; + 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; + 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)")) { + mergers++; + mergersSession++; + ConfigHandler.writeIntConfig("enderman", "mergers", mergers); + } else if (message.contains("CRAZY RARE DROP! (Judgement Core)")) { + rng = true; + 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; + 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; + enderBooks++; + enderBooksSession++; + ConfigHandler.writeIntConfig("enderman", "enderBooks", enderBooks); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.RED + "ENDER SLAYER VII!", 3); + } + + if (rng) { + 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/FishingTracker.java b/src/main/java/me/Danker/features/loot/FishingTracker.java new file mode 100644 index 0000000..1690793 --- /dev/null +++ b/src/main/java/me/Danker/features/loot/FishingTracker.java @@ -0,0 +1,420 @@ +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; + // 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; + // Lava fishing + public static int plhlegblasts; + 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; + 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; + // 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; + // Lava fishing + public static int plhlegblastsSession = 0; + 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 = -1; + public static int jawbusSCsSession = -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; + + 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 Rider 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(); + } 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(); + } 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++; + 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() { + // 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++; + } + } 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++; + fishingMilestone++; + seaCreaturesSession++; + fishingMilestoneSession++; + ConfigHandler.writeIntConfig("fishing", "seaCreature", seaCreatures); + 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/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 cd34da7..fe68c3e 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 = ""; @@ -30,25 +30,27 @@ public class LootDisplay { String timeBetween; String bossesBetween; String drop20; + String runs; + String runsCount; double timeNow = System.currentTimeMillis() / 1000; NumberFormat nf = NumberFormat.getIntegerInstance(Locale.US); switch (display) { case "wolf": - if (LootTracker.wolfTime == -1) { + if (WolfTracker.time == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.wolfTime, timeNow); + timeBetween = Utils.getTimeBetween(WolfTracker.time, timeNow); } - if (LootTracker.wolfBosses == -1) { + if (WolfTracker.bosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.wolfBosses); + bossesBetween = nf.format(WolfTracker.bosses); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(LootTracker.wolfWheels); + drop20 = nf.format(WolfTracker.wheels); } else { - drop20 = nf.format(LootTracker.wolfWheelsDrops) + " times"; + drop20 = nf.format(WolfTracker.wheelsDrops) + " times"; } dropsText = EnumChatFormatting.GOLD + "Svens Killed:\n" + @@ -56,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(LootTracker.wolfSvens) + "\n" + - EnumChatFormatting.GREEN + nf.format(LootTracker.wolfTeeth) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(WolfTracker.svens) + "\n" + + EnumChatFormatting.GREEN + nf.format(WolfTracker.teeth) + "\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.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 (LootTracker.wolfTimeSession == -1) { + if (WolfTracker.timeSession == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.wolfTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(WolfTracker.timeSession, timeNow); } - if (LootTracker.wolfBossesSession == -1) { + if (WolfTracker.bossesSession == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.wolfBossesSession); + bossesBetween = nf.format(WolfTracker.bossesSession); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(LootTracker.wolfWheelsSession); + drop20 = nf.format(WolfTracker.wheelsSession); } else { - drop20 = nf.format(LootTracker.wolfWheelsDropsSession) + " times"; + drop20 = nf.format(WolfTracker.wheelsDropsSession) + " times"; } dropsText = EnumChatFormatting.GOLD + "Svens Killed:\n" + @@ -96,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(LootTracker.wolfSvensSession) + "\n" + - EnumChatFormatting.GREEN + nf.format(LootTracker.wolfTeethSession) + "\n" + + countText = EnumChatFormatting.GOLD + nf.format(WolfTracker.svensSession) + "\n" + + EnumChatFormatting.GREEN + nf.format(WolfTracker.teethSession) + "\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.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 (LootTracker.spiderTime == -1) { + if (SpiderTracker.time == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.spiderTime, timeNow); + timeBetween = Utils.getTimeBetween(SpiderTracker.time, timeNow); } - if (LootTracker.spiderBosses == -1) { + if (SpiderTracker.bosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.spiderBosses); + bossesBetween = nf.format(SpiderTracker.bosses); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(LootTracker.spiderTAP); + drop20 = nf.format(SpiderTracker.TAP); } else { - drop20 = nf.format(LootTracker.spiderTAPDrops) + " times"; + drop20 = nf.format(SpiderTracker.TAPDrops) + " times"; } dropsText = EnumChatFormatting.GOLD + "Tarantulas Killed:\n" + @@ -142,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(LootTracker.spiderTarantulas) + "\n" + - EnumChatFormatting.GREEN + nf.format(LootTracker.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 + 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.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 (LootTracker.spiderTimeSession == -1) { + if (SpiderTracker.timeSession == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.spiderTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(SpiderTracker.timeSession, timeNow); } - if (LootTracker.spiderBossesSession == -1) { + if (SpiderTracker.bossesSession == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.spiderBossesSession); + bossesBetween = nf.format(SpiderTracker.bossesSession); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(LootTracker.spiderTAPSession); + drop20 = nf.format(SpiderTracker.TAPSession); } else { - drop20 = nf.format(LootTracker.spiderTAPDropsSession) + " times"; + drop20 = nf.format(SpiderTracker.TAPDropsSession) + " times"; } dropsText = EnumChatFormatting.GOLD + "Tarantulas Killed:\n" + @@ -182,40 +188,42 @@ 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.tarantulasSession) + "\n" + + EnumChatFormatting.GREEN + nf.format(SpiderTracker.websSession) + "\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.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 (LootTracker.zombieTime == -1) { + if (ZombieTracker.time == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.zombieTime, timeNow); + timeBetween = Utils.getTimeBetween(ZombieTracker.time, timeNow); } - if (LootTracker.zombieBosses == -1) { + if (ZombieTracker.bosses == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.zombieBosses); + bossesBetween = nf.format(ZombieTracker.bosses); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(LootTracker.zombieFoulFlesh); + drop20 = nf.format(ZombieTracker.foulFlesh); } else { - drop20 = nf.format(LootTracker.zombieFoulFleshDrops) + " times"; + drop20 = nf.format(ZombieTracker.foulFleshDrops) + " times"; } 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" + + EnumChatFormatting.WHITE + "Smite VII Books:\n" + EnumChatFormatting.AQUA + "Undead Catalysts:\n" + EnumChatFormatting.DARK_PURPLE + "Beheaded Horrors:\n" + EnumChatFormatting.RED + "Revenant Catalysts:\n" + @@ -225,43 +233,47 @@ 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" + + 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 + 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.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 (LootTracker.zombieTimeSession == -1) { + if (ZombieTracker.timeSession == -1) { timeBetween = "Never"; } else { - timeBetween = Utils.getTimeBetween(LootTracker.zombieTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(ZombieTracker.timeSession, timeNow); } - if (LootTracker.zombieBossesSession == -1) { + if (ZombieTracker.bossesSession == -1) { bossesBetween = "Never"; } else { - bossesBetween = nf.format(LootTracker.zombieBossesSession); + bossesBetween = nf.format(ZombieTracker.bossesSession); } if (ToggleCommand.slayerCountTotal) { - drop20 = nf.format(LootTracker.zombieFoulFleshSession); + drop20 = nf.format(ZombieTracker.foulFleshSession); } else { - drop20 = nf.format(LootTracker.zombieFoulFleshDropsSession) + " times"; + drop20 = nf.format(ZombieTracker.foulFleshDropsSession) + " times"; } 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" + + EnumChatFormatting.WHITE + "Smite VII Books:\n" + EnumChatFormatting.AQUA + "Undead Catalysts:\n" + EnumChatFormatting.DARK_PURPLE + "Beheaded Horrors:\n" + EnumChatFormatting.RED + "Revenant Catalysts:\n" + @@ -271,31 +283,279 @@ 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" + + 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 + 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.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.time == -1) { + timeBetween = "Never"; + } else { + timeBetween = Utils.getTimeBetween(EndermanTracker.time, timeNow); + } + if (EndermanTracker.bosses == -1) { + bossesBetween = "Never"; + } else { + bossesBetween = nf.format(EndermanTracker.bosses); + } + if (ToggleCommand.slayerCountTotal) { + drop20 = nf.format(EndermanTracker.TAP); + } else { + drop20 = nf.format(EndermanTracker.TAPDrops) + " 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.YELLOW + "Hazmat Endermen:\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(EndermanTracker.voidglooms) + "\n" + + EnumChatFormatting.DARK_GRAY + nf.format(EndermanTracker.nullSpheres) + "\n" + + EnumChatFormatting.DARK_PURPLE + drop20 + "\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.timeSession == -1) { + timeBetween = "Never"; + } else { + timeBetween = Utils.getTimeBetween(EndermanTracker.timeSession, timeNow); + } + if (EndermanTracker.bossesSession == -1) { + bossesBetween = "Never"; + } else { + bossesBetween = nf.format(EndermanTracker.bossesSession); + } + if (ToggleCommand.slayerCountTotal) { + drop20 = nf.format(EndermanTracker.TAPSession); + } else { + drop20 = nf.format(EndermanTracker.TAPDropsSession) + " 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.YELLOW + "Hazmat Endermen:\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(EndermanTracker.voidgloomsSession) + "\n" + + EnumChatFormatting.DARK_GRAY + nf.format(EndermanTracker.nullSpheresSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + drop20 + "\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; + 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 Distillates:\n" + + EnumChatFormatting.BLUE + "Wart Distillates:\n" + + EnumChatFormatting.BLUE + "Gabagool Distillates:\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 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 Distillates:\n" + + EnumChatFormatting.BLUE + "Wart Distillates:\n" + + EnumChatFormatting.BLUE + "Gabagool Distillates:\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 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 (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" + @@ -308,16 +568,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" + @@ -329,14 +589,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; @@ -349,15 +609,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" + @@ -370,16 +630,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" + @@ -391,14 +651,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; @@ -411,15 +671,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" + @@ -432,27 +692,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" + @@ -465,14 +725,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; @@ -485,14 +745,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" + @@ -503,14 +763,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" + @@ -522,15 +782,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" + @@ -542,15 +802,267 @@ 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 "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 "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.BLUE + "Plhlegblasts:\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.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" + + 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.BLUE + "Plhlegblasts:\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.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" + + 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 "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:"; + 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" + + 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"); + + 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" + + 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:"; + 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" + + 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"); + + 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" + @@ -563,16 +1075,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" + @@ -585,71 +1097,80 @@ 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" + + 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(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.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(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.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(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.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" + + 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" + + 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(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.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" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.f2CoinsSpentSession) + "\n" + + 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" + @@ -657,17 +1178,19 @@ 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.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" + + 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" + + 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" + @@ -675,17 +1198,19 @@ 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.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" + + 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" + + 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" + @@ -696,20 +1221,22 @@ 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.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" + + 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" + + 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" + @@ -720,20 +1247,22 @@ 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.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" + + 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" + + 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" + @@ -745,21 +1274,23 @@ 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.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" + + 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" + + 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" + @@ -771,21 +1302,23 @@ 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.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" + + 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" + + 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" + @@ -795,23 +1328,27 @@ 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(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.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" + + 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.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" + @@ -821,23 +1358,27 @@ 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(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.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" + + 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.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" + @@ -850,26 +1391,30 @@ 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(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.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" + + 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.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" + @@ -882,23 +1427,146 @@ 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.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" + + 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.WHITE + nf.format(CatacombsTracker.f7RerollsSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(CatacombsTracker.f7CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.f7TimeSpentSession); + break; + case "catacombs_master": + 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" + + 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.GOLD + "Necron Dyes:\n" + + EnumChatFormatting.GOLD + "Dark Claymores:\n" + + EnumChatFormatting.WHITE + "Rerolls:\n" + + EnumChatFormatting.AQUA + "Coins Spent:\n" + + EnumChatFormatting.AQUA + "Time Spent:"; + 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" + + 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.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" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.masterTimeSpent); + break; + case "catacombs_master_session": + 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" + + 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.GOLD + "Necron Dyes:\n" + + EnumChatFormatting.GOLD + "Dark Claymores:\n" + + EnumChatFormatting.WHITE + "Rerolls:\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 = runsCount + + 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.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" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, CatacombsTracker.masterTimeSpentSession); break; case "ghost_session": dropsText = EnumChatFormatting.GOLD + "Bags of Cash:\n" + @@ -907,12 +1575,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" + @@ -921,12 +1589,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 7919366..13599a0 100644 --- a/src/main/java/me/Danker/features/loot/LootTracker.java +++ b/src/main/java/me/Danker/features/loot/LootTracker.java @@ -1,1163 +1,67 @@ package me.Danker.features.loot; -import me.Danker.commands.ToggleCommand; -import me.Danker.events.ChestSlotClickedEvent; +import me.Danker.events.PacketReadEvent; 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.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; 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 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; - - // 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 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; - - // 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; - - - - // 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<String> 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! (Hamster Wheel)")) { - wolfWheelsDrops++; - wolfWheelsDropsSession++; - 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! (Toxic Arrow Poison)")) { - spiderTAPDrops++; - spiderTAPDropsSession++; - 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! (Foul Flesh)")) { - zombieFoulFleshDrops++; - zombieFoulFleshDropsSession++; - 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)")) { - zombieRNG = true; - zombieWardenHearts++; - zombieWardenHeartsSession++; - ConfigHandler.writeIntConfig("zombie", "heart", zombieWardenHearts); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.RED + "WARDEN HEART!", 5); - } - - 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); - } - - // 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<String> 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("Bag of Cash")) { - bagOfCashs++; - bagOfCashSession++; - ConfigHandler.writeIntConfig("ghosts", "bagOfCash", bagOfCashs); - } - } - } + public static long itemsChecked = 0; + static Pattern dropPattern = Pattern.compile(".*? \\((?<amount>\\d+)x .*\\).*"); @SubscribeEvent - public void onSlotClick(ChestSlotClickedEvent event) { - ItemStack item = event.item; - - if (event.inventoryName.endsWith(" Chest") && item != null && item.getDisplayName().contains("Open Reward Chest")) { - List<String> 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<String> 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; - } - } - } - } - - @SubscribeEvent(priority = EventPriority.HIGHEST) - public void onSound(PlaySoundEvent event) { + public void onPacketRead(PacketReadEvent event) { if (!Utils.inSkyblock) return; - if (event.name.equals("note.pling")) { - // Don't check twice within 3 seconds - checkItemsNow = System.currentTimeMillis() / 1000; - if (checkItemsNow - itemsChecked < 3) return; - List<String> scoreboard = ScoreboardHandler.getSidebarLines(); + if (event.packet instanceof S29PacketSoundEffect) { + S29PacketSoundEffect packet = (S29PacketSoundEffect) event.packet; + + if (packet.getSoundName().equals("note.pling")) { + if (System.currentTimeMillis() / 1000 - itemsChecked < 3) return; - 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 (Utils.isInScoreboard("Boss slain!") || Utils.isInScoreboard("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"); + int itemDerelictAshe = Utils.getItems("Derelict Ashe"); // 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 + itemDerelictAshe > 0) { itemsChecked = System.currentTimeMillis() / 1000; - wolfTeeth += itemTeeth; - wolfWheels += itemWheels; - spiderWebs += itemWebs; - spiderTAP += itemTAP; - zombieRevFlesh += itemRev; - zombieFoulFlesh += itemFoul; - wolfTeethSession += itemTeeth; - wolfWheelsSession += itemWheels; - spiderWebsSession += itemWebs; - spiderTAPSession += itemTAP; - zombieRevFleshSession += itemRev; - zombieFoulFleshSession += itemFoul; - - 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); + WolfTracker.teeth += itemTeeth; + SpiderTracker.webs += itemWebs; + ZombieTracker.revFlesh += itemRev; + EndermanTracker.nullSpheres += itemNullSphere; + BlazeTracker.derelictAshes += itemDerelictAshe; + WolfTracker.teethSession += itemTeeth; + SpiderTracker.websSession += itemWebs; + ZombieTracker.revFleshSession += itemRev; + EndermanTracker.nullSpheresSession += itemNullSphere; + BlazeTracker.derelictAshesSession += itemDerelictAshe; + + 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); } } } } } - - public void increaseSeaCreatures() { - if (empSCs != -1) { - empSCs++; - } - if (empSCsSession != -1) { - empSCsSession++; - } - // Only increment Yetis when in Jerry's Workshop - List<String> 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 static int getAmountfromMessage(String message) { + Matcher matcher = dropPattern.matcher(message); + if (matcher.find()) { + return Integer.parseInt(matcher.group("amount")); + } + return 1; } } 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..9a98466 --- /dev/null +++ b/src/main/java/me/Danker/features/loot/MythologicalTracker.java @@ -0,0 +1,101 @@ +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; + 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!")) { + Minecraft mc = Minecraft.getMinecraft(); + List<Entity> 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++; + 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..05a8e75 --- /dev/null +++ b/src/main/java/me/Danker/features/loot/SpiderTracker.java @@ -0,0 +1,110 @@ +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 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 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) { + 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(" Spider Slayer LVL ")) { // Spider + tarantulas++; + tarantulasSession++; + if (bosses != -1) { + bosses++; + } + if (bossesSession != -1) { + bossesSession++; + } + 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); + 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)")) { + bites++; + bitesSession++; + ConfigHandler.writeIntConfig("spider", "bite", bites); + } else if (message.contains("VERY RARE DROP! (Bane of Arthropods VI)")) { + books++; + booksSession++; + ConfigHandler.writeIntConfig("spider", "book", books); + } else if (message.contains("VERY RARE DROP! (Spider Catalyst)")) { + catalysts++; + catalystsSession++; + ConfigHandler.writeIntConfig("spider", "catalyst", catalysts); + } else if (message.contains("CRAZY RARE DROP! (Fly Swatter)")) { + rng = true; + 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; + 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; + mosquitos++; + mosquitosSession++; + ConfigHandler.writeIntConfig("spider", "mosquito", mosquitos); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GOLD + "DIGESTED MOSQUITO!", 5); + } + + if (rng) { + 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/TrophyFishTracker.java b/src/main/java/me/Danker/features/loot/TrophyFishTracker.java new file mode 100644 index 0000000..1098e4b --- /dev/null +++ b/src/main/java/me/Danker/features/loot/TrophyFishTracker.java @@ -0,0 +1,150 @@ +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; +import net.minecraft.item.ItemStack; +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 (?<fish>.*) (?<tier>.*)."); + 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"; + } + + @SubscribeEvent + public void postConfigInit(PostConfigInitEvent event) { + if (fish.entrySet().isEmpty()) fish = createEmpty(); + fishSession = createEmpty(); + save(); + } + + @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(); + } + + 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); + + // -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/features/loot/WolfTracker.java b/src/main/java/me/Danker/features/loot/WolfTracker.java new file mode 100644 index 0000000..906f507 --- /dev/null +++ b/src/main/java/me/Danker/features/loot/WolfTracker.java @@ -0,0 +1,118 @@ +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 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 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) { + 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(" Wolf Slayer LVL ")) { + svens++; + svensSession++; + if (bosses != -1) { + bosses++; + } + if (bossesSession != -1) { + bossesSession++; + } + 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); + 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 + spirits++; + spiritsSession++; + ConfigHandler.writeIntConfig("wolf", "spirit", spirits); + } else if (message.contains("VERY RARE DROP! (Critical VI)")) { + 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; + 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; + 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; + 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; + fluxes++; + fluxesSession++; + ConfigHandler.writeIntConfig("wolf", "flux", fluxes); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "OVERFLUX CAPACITOR!", 5); + } + + if (rng) { + 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 new file mode 100644 index 0000000..922e1f4 --- /dev/null +++ b/src/main/java/me/Danker/features/loot/ZombieTracker.java @@ -0,0 +1,145 @@ +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 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 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) { + 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(" Zombie Slayer LVL ")) { // Zombie + revs++; + revsSession++; + if (bosses != -1) { + bosses++; + } + if (bossesSession != 1) { + bossesSession++; + } + 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); + revViscera += amount; + revVisceraSession += amount; + ConfigHandler.writeIntConfig("zombie", "revViscera", revViscera); + } else if (message.contains("RARE DROP! (") && message.contains("Foul Flesh)")) { + int amount = LootTracker.getAmountfromMessage(message); + 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)")) { + revCatas++; + revCatasSession++; + ConfigHandler.writeIntConfig("zombie", "revCatalyst", revCatas); + } else if (message.contains("VERY RARE DROP! (") && message.contains(" Pestilence Rune I)")) { + pestilences++; + pestilencesSession++; + ConfigHandler.writeIntConfig("zombie", "pestilence", pestilences); + } else if (message.contains("VERY RARE DROP! (Smite VI)")) { + books++; + booksSession++; + ConfigHandler.writeIntConfig("zombie", "book", books); + } else if (message.contains("VERY RARE DROP! (Smite VII)")) { + booksT7++; + booksT7Session++; + ConfigHandler.writeIntConfig("zombie", "bookT7", booksT7); + } else if (message.contains("VERY RARE DROP! (Undead Catalyst)")) { + undeadCatas++; + undeadCatasSession++; + ConfigHandler.writeIntConfig("zombie", "undeadCatalyst", undeadCatas); + } else if (message.contains("CRAZY RARE DROP! (Beheaded Horror)")) { + rng = true; + 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; + 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; + 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; + 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; + wardenHearts++; + wardenHeartsSession++; + ConfigHandler.writeIntConfig("zombie", "heart", wardenHearts); + if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.RED + "WARDEN HEART!", 5); + } + + if (rng) { + 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/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/BlazeSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/BlazeSolver.java index 0910fc7..b76e3ca 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/BlazeSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/BlazeSolver.java @@ -2,13 +2,14 @@ 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; +import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.entity.Entity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StringUtils; +import net.minecraft.init.Blocks; +import net.minecraft.util.*; import net.minecraft.world.World; import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.event.world.WorldEvent; @@ -21,11 +22,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 +39,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<Entity> entities = world.getLoadedEntityList(); int highestHealth = 0; highestBlaze = null; @@ -61,6 +70,29 @@ public class BlazeSolver { } } } + + if (!foundChest) { + new Thread(() -> { + Iterable<BlockPos> 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; + 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; + } + } + } + }).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); + 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); + RenderUtils.draw3DBox(aabb, LOWEST_BLAZE_COLOUR, event.partialTicks); + } + if (highestBlaze != null && higherToLower) { + BlockPos stringPos = new BlockPos(highestBlaze.posX, highestBlaze.posY + 1, highestBlaze.posZ); + 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); + RenderUtils.draw3DBox(aabb, LOWEST_BLAZE_COLOUR, event.partialTicks); + } + } else { + if (lowestBlaze != null) { + BlockPos stringPos = new BlockPos(lowestBlaze.posX, lowestBlaze.posY + 1, lowestBlaze.posZ); + 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); + RenderUtils.draw3DBox(aabb, LOWEST_BLAZE_COLOUR, event.partialTicks); + } + if (highestBlaze != null) { + BlockPos stringPos = new BlockPos(highestBlaze.posX, highestBlaze.posY + 1, highestBlaze.posZ); + 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); + RenderUtils.draw3DBox(aabb, HIGHEST_BLAZE_COLOUR, event.partialTicks); + } } } } - } 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..7f76059 --- /dev/null +++ b/src/main/java/me/Danker/features/puzzlesolvers/BlockWrongTerminalClicks.java @@ -0,0 +1,93 @@ +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 "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; + 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) { + 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/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 208cf9b..7293f51 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java @@ -4,7 +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.Utils; +import me.Danker.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.init.Blocks; @@ -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,24 @@ 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))) { + 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); } } } @@ -67,19 +82,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))) { - Utils.drawOnSlot(chestSize, glassSlot.xDisplayPosition, glassSlot.yDisplayPosition, CHRONOMATRON_NEXT + 0xE5000000); + + if (glass.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks))) { + RenderUtils.drawOnSlot(chestSize, glassSlot.xDisplayPosition, glassSlot.yDisplayPosition, CHRONOMATRON_NEXT + 0xE5000000); + } else if (chronomatronMouseClicks + 1 < chronomatronPattern.size() && glass.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks + 1))) { + RenderUtils.drawOnSlot(chestSize, glassSlot.xDisplayPosition, glassSlot.yDisplayPosition, CHRONOMATRON_NEXT_TO_NEXT + 0XBE000000); } + } } } else if (invSlots.get(49).getStack().getDisplayName().equals("§aRemember the pattern!")) { 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<Slot> 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 7ff7e7a..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; @@ -78,7 +79,13 @@ 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]; + + 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 b537198..b947cdb 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/LividSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/LividSolver.java @@ -4,8 +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.handlers.ScoreboardHandler; +import me.Danker.events.RenderOverlayEvent; 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<String> 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.currentFloor == Utils.DungeonFloor.F5 || Utils.currentFloor == Utils.DungeonFloor.M5) { List<Entity> loadedLivids = new ArrayList<>(); List<Entity> entities = world.getLoadedEntityList(); for (Entity entity : entities) { @@ -69,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/SameColourSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/SameColourSolver.java new file mode 100644 index 0000000..a3c1bc1 --- /dev/null +++ b/src/main/java/me/Danker/features/puzzlesolvers/SameColourSolver.java @@ -0,0 +1,153 @@ +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.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<Integer> 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<Slot> 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<Slot> 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) { + if (!(event.gui instanceof GuiChest)) { + 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/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<Slot> 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/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<BlockPos> 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/features/puzzlesolvers/ThreeManSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/ThreeManSolver.java index 8f7de95..d97509c 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/ThreeManSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/ThreeManSolver.java @@ -1,7 +1,9 @@ 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; @@ -16,6 +18,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."}; @@ -32,34 +35,23 @@ 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<Entity> 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 (ToggleCommand.threeManToggled && message.startsWith("[NPC]")) { + 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; } } } @@ -68,7 +60,35 @@ 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); + } + } + + 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<Entity> 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/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/TriviaSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/TriviaSolver.java index 9adc555..23d0228 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/TriviaSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/TriviaSolver.java @@ -1,6 +1,11 @@ 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.events.ModInitEvent; import me.Danker.utils.Utils; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; @@ -9,16 +14,22 @@ 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<String, String[]> triviaSolutions = new HashMap<>(); static String[] triviaAnswers = null; + 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"}); triviaSolutions.put("What is the status of Scarf?", new String[]{"Apprentice Necromancer"}); @@ -30,12 +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[]{"222 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 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 Blazing Fortress?", new String[]{"19 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 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"}); @@ -49,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"}); @@ -65,35 +76,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<String> 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/features/puzzlesolvers/UltrasequencerSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java index 3df6fc4..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.Utils; +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; @@ -50,6 +53,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 (")) { List<Slot> invSlots = event.slots; @@ -66,12 +90,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); } |