diff options
author | bowser0000 <bowser0000@gmail.com> | 2020-09-05 18:35:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-05 18:35:43 -0400 |
commit | 20b405f59dcd92df1b4c3cd5b9ac353652ef4405 (patch) | |
tree | f387a1ca10387c77381a22568b486984da5b38a6 /src/main/java/me/Danker/TheMod.java | |
parent | 3ed5e14d43c6f3ff3cdce7598d01254e9465c33d (diff) | |
parent | a29cfb42db5da544f8445f56acb3742e396d8dee (diff) | |
download | SkyblockMod-20b405f59dcd92df1b4c3cd5b9ac353652ef4405.tar.gz SkyblockMod-20b405f59dcd92df1b4c3cd5b9ac353652ef4405.tar.bz2 SkyblockMod-20b405f59dcd92df1b4c3cd5b9ac353652ef4405.zip |
v1.7v1.7
Merge pull request #13 from bowser0000/development
Diffstat (limited to 'src/main/java/me/Danker/TheMod.java')
-rw-r--r-- | src/main/java/me/Danker/TheMod.java | 685 |
1 files changed, 624 insertions, 61 deletions
diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index b99ac42..ec2dedf 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -11,10 +11,14 @@ import java.util.Locale; import java.util.Map; import java.util.regex.Pattern; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; + import com.google.gson.JsonObject; import me.Danker.commands.ArmourCommand; import me.Danker.commands.BankCommand; +import me.Danker.commands.ChatMaddoxCommand; import me.Danker.commands.DHelpCommand; import me.Danker.commands.DisplayCommand; import me.Danker.commands.GetkeyCommand; @@ -28,6 +32,7 @@ import me.Danker.commands.ResetLootCommand; import me.Danker.commands.ScaleCommand; import me.Danker.commands.SetkeyCommand; import me.Danker.commands.SkillsCommand; +import me.Danker.commands.SkyblockPlayersCommand; import me.Danker.commands.SlayerCommand; import me.Danker.commands.ToggleCommand; import me.Danker.handlers.APIHandler; @@ -36,18 +41,28 @@ import me.Danker.handlers.ScoreboardHandler; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.inventory.GuiChest; +import net.minecraft.client.settings.KeyBinding; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.event.ClickEvent; import net.minecraft.event.ClickEvent.Action; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.StringUtils; import net.minecraftforge.client.ClientCommandHandler; import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.client.event.GuiScreenEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.sound.PlaySoundEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.entity.player.ItemTooltipEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; @@ -55,6 +70,7 @@ import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.InputEvent.KeyInputEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.fml.common.versioning.DefaultArtifactVersion; @@ -62,7 +78,7 @@ import net.minecraftforge.fml.common.versioning.DefaultArtifactVersion; public class TheMod { public static final String MODID = "Danker's Skyblock Mod"; - public static final String VERSION = "1.6.1"; + public static final String VERSION = "1.7"; static double checkItemsNow = 0; static double itemsChecked = 0; @@ -72,6 +88,18 @@ public class TheMod public static int titleTimer = -1; public static boolean showTitle = false; public static String titleText = ""; + static int tickAmount = 1; + public static String lastMaddoxCommand = "/cb placeholdervalue"; + static KeyBinding[] keyBindings = new KeyBinding[1]; + static int lastMouse = -1; + + static double dungeonStartTime = 0; + static double bloodOpenTime = 0; + static double watcherClearTime = 0; + static double bossClearTime = 0; + static int witherDoors = 0; + static int dungeonDeaths = 0; + static int puzzleFails = 0; @EventHandler public void init(FMLInitializationEvent event) @@ -83,35 +111,43 @@ public class TheMod cf.reloadConfig(); // For golden enchants - t6Enchants.put("Bane of Arthropods VI", EnumChatFormatting.GOLD + "Bane of Arthropods VI" + EnumChatFormatting.BLUE); - t6Enchants.put("Critical VI", EnumChatFormatting.GOLD + "Critical VI" + EnumChatFormatting.BLUE); - t6Enchants.put("Dragon Hunter V", EnumChatFormatting.GOLD + "Dragon Hunter V" + EnumChatFormatting.BLUE); - t6Enchants.put("Ender Slayer VI", EnumChatFormatting.GOLD + "Ender Slayer VI" + EnumChatFormatting.BLUE); - t6Enchants.put("Experience IV", EnumChatFormatting.GOLD + "Experience IV" + EnumChatFormatting.BLUE); - t6Enchants.put("Giant Killer VI", EnumChatFormatting.GOLD + "Giant Killer VI" + EnumChatFormatting.BLUE); - t6Enchants.put("Life Steal IV", EnumChatFormatting.GOLD + "Life Steal IV" + EnumChatFormatting.BLUE); - t6Enchants.put("Looting IV", EnumChatFormatting.GOLD + "Looting IV" + EnumChatFormatting.BLUE); - t6Enchants.put("Luck VI", EnumChatFormatting.GOLD + "Luck VI" + EnumChatFormatting.BLUE); - t6Enchants.put("Scavenger IV", EnumChatFormatting.GOLD + "Scavenger IV" + EnumChatFormatting.BLUE); - t6Enchants.put("Scavenger V", EnumChatFormatting.GOLD + "Scavenger V" + EnumChatFormatting.BLUE); - t6Enchants.put("Sharpness VI", EnumChatFormatting.GOLD + "Sharpness VI" + EnumChatFormatting.BLUE); - t6Enchants.put("Smite VI", EnumChatFormatting.GOLD + "Smite VI" + EnumChatFormatting.BLUE); - t6Enchants.put("Smite VII", EnumChatFormatting.GOLD + "Smite VII" + EnumChatFormatting.BLUE); - t6Enchants.put("Vampirism VI", EnumChatFormatting.GOLD + "Vampirism VI" + EnumChatFormatting.BLUE); - t6Enchants.put("Power VI", EnumChatFormatting.GOLD + "Power VI" + EnumChatFormatting.BLUE); - t6Enchants.put("Growth VI", EnumChatFormatting.GOLD + "Growth VI" + EnumChatFormatting.BLUE); - t6Enchants.put("Protection VI", EnumChatFormatting.GOLD + "Protection VI" + EnumChatFormatting.BLUE); - t6Enchants.put("Efficiency VI", EnumChatFormatting.GOLD + "Efficiency VI" + EnumChatFormatting.BLUE); - t6Enchants.put("Angler VI", EnumChatFormatting.GOLD + "Angler VI" + EnumChatFormatting.BLUE); - t6Enchants.put("Caster VI", EnumChatFormatting.GOLD + "Caster VI" + EnumChatFormatting.BLUE); - t6Enchants.put("Frail VI", EnumChatFormatting.GOLD + "Frail VI" + EnumChatFormatting.BLUE); - t6Enchants.put("Luck of the Sea VI", EnumChatFormatting.GOLD + "Luck of the Sea VI" + EnumChatFormatting.BLUE); - t6Enchants.put("Lure VI", EnumChatFormatting.GOLD + "Lure VI" + EnumChatFormatting.BLUE); - t6Enchants.put("Magnet VI", EnumChatFormatting.GOLD + "Magnet VI" + EnumChatFormatting.BLUE); - t6Enchants.put("Spiked Hook VI", EnumChatFormatting.GOLD + "Spiked Hook VI" + EnumChatFormatting.BLUE); + t6Enchants.put("9Bane of Arthropods VI", "6Bane of Arthropods VI"); + t6Enchants.put("9Critical VI", "6Critical VI"); + t6Enchants.put("9Dragon Hunter V", "6Dragon Hunter V"); + t6Enchants.put("9Ender Slayer VI", "6Ender Slayer VI"); + t6Enchants.put("9Experience IV", "6Experience IV"); + t6Enchants.put("9Giant Killer VI", "6Giant Killer VI"); + t6Enchants.put("9Life Steal IV", "6Life Steal IV"); + t6Enchants.put("9Looting IV", "6Looting IV"); + t6Enchants.put("9Luck VI", "6Luck VI"); + t6Enchants.put("9Scavenger IV", "6Scavenger IV"); + t6Enchants.put("9Scavenger V", "6Scavenger V"); + t6Enchants.put("9Sharpness VI", "6Sharpness VI"); + t6Enchants.put("9Smite VII", "6Smite VII"); + t6Enchants.put("9Smite VI", "6Smite VI"); + t6Enchants.put("9Vampirism VI", "6Vampirism VI"); + t6Enchants.put("9Power VI", "6Power VI"); + t6Enchants.put("9Growth VI", "6Growth VI"); + t6Enchants.put("9Protection VI", "6Protection VI"); + t6Enchants.put("9Efficiency VI", "6Efficiency VI"); + t6Enchants.put("9Angler VI", "6Angler VI"); + t6Enchants.put("9Caster VI", "6Caster VI"); + t6Enchants.put("9Frail VI", "6Frail VI"); + t6Enchants.put("9Luck of the Sea VI", "6Luck of the Sea VI"); + t6Enchants.put("9Lure VI", "6Lure VI"); + t6Enchants.put("9Magnet VI", "6Magnet VI"); + t6Enchants.put("9Spiked Hook VI", "6Spiked Hook VI"); + t6Enchants.put("9Feather Falling X", "6Feather Falling X"); + t6Enchants.put("9Infinite Quiver X", "6Infinite Quiver X"); String patternString = "(" + String.join("|", t6Enchants.keySet()) + ")"; pattern = Pattern.compile(patternString); + + keyBindings[0] = new KeyBinding("Open Maddox Menu", Keyboard.KEY_M, "Danker's Skyblock Mod"); + + for (int i = 0; i < keyBindings.length; i++) { + ClientRegistry.registerKeyBinding(keyBindings[i]); + } } @EventHandler @@ -133,6 +169,8 @@ public class TheMod ClientCommandHandler.instance.registerCommand(new ImportFishingCommand()); ClientCommandHandler.instance.registerCommand(new ResetLootCommand()); ClientCommandHandler.instance.registerCommand(new ScaleCommand()); + ClientCommandHandler.instance.registerCommand(new ChatMaddoxCommand()); + ClientCommandHandler.instance.registerCommand(new SkyblockPlayersCommand()); } // Update checker @@ -176,11 +214,29 @@ public class TheMod final ToggleCommand tc = new ToggleCommand(); String message = event.message.getUnformattedText(); + if (event.type == 2) return; + if (!Utils.inSkyblock) return; + + // Replace chat messages with Maddox command + List<IChatComponent> chatSiblings = event.message.getSiblings(); + for (IChatComponent sibling : chatSiblings) { + if (sibling.getChatStyle().getChatClickEvent() == null) { + sibling.setChatStyle(sibling.getChatStyle().setChatClickEvent(new ClickEvent(Action.RUN_COMMAND, "/dmodopenmaddoxmenu"))); + } + } + + // Dungeon chat spoken by an NPC, containing : + if (message.contains("[BOSS] The Watcher: You have proven yourself. You may pass.")) { + watcherClearTime = System.currentTimeMillis() / 1000; + } + if (message.contains(" PUZZLE FAIL! ") || message.contains("chose the wrong answer! I shall never forget this moment")) { + dungeonDeaths++; + } + if (message.contains(":")) return; if (tc.gpartyToggled) { if (message.contains(" has invited all members of ")) { - System.out.println(message); try { final SystemTray tray = SystemTray.getSystemTray(); final Image image = Toolkit.getDefaultToolkit().createImage("icon.png"); @@ -195,7 +251,7 @@ public class TheMod } } } - + final LootCommand lc = new LootCommand(); final ConfigHandler cf = new ConfigHandler(); boolean wolfRNG = false; @@ -335,7 +391,7 @@ public class TheMod lc.zombieBossesSession++; } cf.writeIntConfig("zombie", "revs", lc.zombieRevs); - cf.writeIntConfig("wolf", "bossRNG", lc.zombieBosses); + cf.writeIntConfig("zombie", "bossRNG", lc.zombieBosses); } if (message.contains("RARE DROP! (Foul Flesh)")) { lc.zombieFoulFleshDrops++; @@ -425,7 +481,7 @@ public class TheMod cf.writeIntConfig("fishing", "squid", lc.squids); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("From the depths of the waters, you've reeled in a Sea Walker")) { lc.seaWalkers++; @@ -437,7 +493,7 @@ public class TheMod cf.writeIntConfig("fishing", "seaWalker", lc.seaWalkers); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("Pitch darkness reveals you've caught a")) { lc.nightSquids++; @@ -449,7 +505,7 @@ public class TheMod cf.writeIntConfig("fishing", "nightSquid", lc.nightSquids); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("You've stumbled upon a patrolling Sea Guardian")) { lc.seaGuardians++; @@ -461,7 +517,7 @@ public class TheMod cf.writeIntConfig("fishing", "seaGuardian", lc.seaGuardians); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("It looks like you've disrupted the Sea Witch's brewing session. Watch out, she's furious")) { lc.seaWitches++; @@ -473,7 +529,7 @@ public class TheMod cf.writeIntConfig("fishing", "seaWitch", lc.seaWitches); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("From the depths of the waters, you've reeled in a Sea Archer")) { lc.seaArchers++; @@ -485,7 +541,7 @@ public class TheMod cf.writeIntConfig("fishing", "seaArcher", lc.seaArchers); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("The Monster of the Deep emerges from the dark depths")) { lc.monsterOfTheDeeps++; @@ -497,7 +553,7 @@ public class TheMod cf.writeIntConfig("fishing", "monsterOfDeep", lc.monsterOfTheDeeps); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("You have found a Catfish, don't let it steal your catches")) { lc.catfishes++; @@ -509,7 +565,7 @@ public class TheMod cf.writeIntConfig("fishing", "catfish", lc.catfishes); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("Is this even a fish? It's the Carrot King")) { lc.carrotKings++; @@ -521,7 +577,7 @@ public class TheMod cf.writeIntConfig("fishing", "carrotKing", lc.carrotKings); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("Gross! A Sea Leech")) { lc.seaLeeches++; @@ -533,7 +589,7 @@ public class TheMod cf.writeIntConfig("fishing", "seaLeech", lc.seaLeeches); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("You've discovered a Guardian Defender of the sea")) { lc.guardianDefenders++; @@ -545,7 +601,7 @@ public class TheMod cf.writeIntConfig("fishing", "guardianDefender", lc.guardianDefenders); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("You have awoken the Deep Sea Protector, prepare for a battle")) { lc.deepSeaProtectors++; @@ -557,7 +613,7 @@ public class TheMod cf.writeIntConfig("fishing", "deepSeaProtector", lc.deepSeaProtectors); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("The Water Hydra has come to test your strength")) { lc.hydras++; @@ -569,7 +625,7 @@ public class TheMod cf.writeIntConfig("fishing", "hydra", lc.hydras); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); - increaseEmpSC(); + increaseSeaCreatures(); } if (message.contains("The Sea Emperor arises from the depths")) { lc.seaEmperors++; @@ -599,6 +655,7 @@ public class TheMod cf.writeIntConfig("fishing", "frozenSteve", lc.frozenSteves); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); + increaseSeaCreatures(); } if (message.contains("It's a snowman! He looks harmless")) { lc.frostyTheSnowmans++; @@ -610,6 +667,7 @@ public class TheMod cf.writeIntConfig("fishing", "snowman", lc.frostyTheSnowmans); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); + increaseSeaCreatures(); } if (message.contains("stole Jerry's Gifts...get them back")) { lc.grinches++; @@ -621,18 +679,194 @@ public class TheMod cf.writeIntConfig("fishing", "grinch", lc.grinches); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); + increaseSeaCreatures(); } if (message.contains("What is this creature")) { lc.yetis++; lc.seaCreatures++; lc.fishingMilestone++; + lc.yetiTime = System.currentTimeMillis() / 1000; + lc.yetiSCs = 0; lc.yetisSession++; lc.seaCreaturesSession++; lc.fishingMilestoneSession++; + lc.yetiTimeSession = System.currentTimeMillis() / 1000; + lc.yetiSCsSession = 0; cf.writeIntConfig("fishing", "yeti", lc.yetis); + cf.writeDoubleConfig("fishing", "yetiTime", lc.yetiTime); + cf.writeIntConfig("fishing", "yetiSC", lc.yetiSCs); cf.writeIntConfig("fishing", "seaCreature", lc.seaCreatures); cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); } + + // Catacombs Dungeons + // Timers + if (message.contains("Dungeon starts in 1 second.")) { + dungeonStartTime = System.currentTimeMillis() / 1000; + bloodOpenTime = dungeonStartTime; + watcherClearTime = dungeonStartTime; + bossClearTime = dungeonStartTime; + witherDoors = 0; + dungeonDeaths = 0; + puzzleFails = 0; + } + if (message.contains("The BLOOD DOOR has been opened!")) { + bloodOpenTime = System.currentTimeMillis() / 1000; + } + if (message.contains(" opened a WITHER door!")) { + witherDoors++; + } + if (message.contains(" and became a ghost.")) { + dungeonDeaths++; + } + + // Trackers + if (message.contains(" Defeated ") && message.contains(" in ")) { + bossClearTime = System.currentTimeMillis() / 1000; + } + 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")) { + lc.f1TimeSpent = Math.floor(lc.f1TimeSpent + timeToAdd); + lc.f1TimeSpentSession = Math.floor(lc.f1TimeSpentSession + timeToAdd); + cf.writeDoubleConfig("catacombs", "floorOneTime", lc.f1TimeSpent); + } else if (sCleaned.contains("F2")) { + lc.f2TimeSpent = Math.floor(lc.f2TimeSpent + timeToAdd); + lc.f2TimeSpentSession = Math.floor(lc.f2TimeSpentSession + timeToAdd); + cf.writeDoubleConfig("catacombs", "floorTwoTime", lc.f2TimeSpent); + } else if (sCleaned.contains("F3")) { + lc.f3TimeSpent = Math.floor(lc.f3TimeSpent + timeToAdd); + lc.f3TimeSpentSession = Math.floor(lc.f3TimeSpentSession + timeToAdd); + cf.writeDoubleConfig("catacombs", "floorThreeTime", lc.f3TimeSpent); + } else if (sCleaned.contains("F4")) { + lc.f4TimeSpent = Math.floor(lc.f4TimeSpent + timeToAdd); + lc.f4TimeSpentSession = Math.floor(lc.f4TimeSpentSession + timeToAdd); + cf.writeDoubleConfig("catacombs", "floorFourTime", lc.f4TimeSpent); + } + } else if (sCleaned.contains("Time Elapsed:")) { + // Get floor time + String time = sCleaned.substring(sCleaned.indexOf(":") + 2); + 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; + } + } + } + if (message.contains(" RARE REWARD! Recombobulator 3000")) { + lc.recombobulators++; + lc.recombobulatorsSession++; + cf.writeIntConfig("catacombs", "recombobulator", lc.recombobulators); + } + if (message.contains(" RARE REWARD! Fuming Potato Book")) { + lc.fumingPotatoBooks++; + lc.fumingPotatoBooksSession++; + cf.writeIntConfig("catacombs", "fumingBooks", lc.fumingPotatoBooks); + } + // F1 + if (message.contains(" RARE REWARD! Bonzo's Staff")) { + lc.bonzoStaffs++; + lc.bonzoStaffsSession++; + cf.writeIntConfig("catacombs", "bonzoStaff", lc.bonzoStaffs); + } + // F2 + if (message.contains(" RARE REWARD! Scarf's Studies")) { + lc.scarfStudies++; + lc.scarfStudiesSession++; + cf.writeIntConfig("catacombs", "scarfStudies", lc.scarfStudies); + } + // F3 + if (message.contains(" RARE REWARD! Adaptive Helmet")) { + lc.adaptiveHelms++; + lc.adaptiveHelmsSession++; + cf.writeIntConfig("catacombs", "adaptiveHelm", lc.adaptiveHelms); + } + if (message.contains(" RARE REWARD! Adaptive Chestplate")) { + lc.adaptiveChests++; + lc.adaptiveChestsSession++; + cf.writeIntConfig("catacombs", "adaptiveChest", lc.adaptiveChests); + } + if (message.contains(" RARE REWARD! Adaptive Leggings")) { + lc.adaptiveLegs++; + lc.adaptiveLegsSession++; + cf.writeIntConfig("catacombs", "adaptiveLegging", lc.adaptiveLegs); + } + if (message.contains(" RARE REWARD! Adaptive Boots")) { + lc.adaptiveBoots++; + lc.adaptiveBootsSession++; + cf.writeIntConfig("catacombs", "adaptiveBoot", lc.adaptiveBoots); + } + if (message.contains(" RARE REWARD! Adaptive Blade")) { + lc.adaptiveSwords++; + lc.adaptiveSwordsSession++; + cf.writeIntConfig("catacombs", "adaptiveSword", lc.adaptiveSwords); + } + // F4 + if (message.contains(" Spirit Wing")) { + lc.spiritWings++; + lc.spiritWingsSession++; + cf.writeIntConfig("catacombs", "spiritWing", lc.spiritWings); + } + // TODO + // Fix strings for Spirit Bone, Spirit Boots + if (message.contains(" ") && message.contains("Spirit Bone")) { + lc.spiritBones++; + lc.spiritBonesSession++; + cf.writeIntConfig("catacombs", "spiritBone", lc.spiritBones); + } + if (message.contains(" ") && message.contains("Spirit Boots")) { + lc.spiritBoots++; + lc.spiritBootsSession++; + cf.writeIntConfig("catacombs", "spiritBoot", lc.spiritBoots); + } + 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")) { + lc.epicSpiritPets++; + lc.epicSpiritPetsSession++; + cf.writeIntConfig("catacombs", "spiritPetEpic", lc.epicSpiritPets); + } else if (formattedMessage.contains("6Spirit")) { + lc.legSpiritPets++; + lc.legSpiritPetsSession++; + cf.writeIntConfig("catacombs", "spiritPetLeg", lc.legSpiritPets); + } + } + if (message.contains(" Spirit Sword")) { + lc.spiritSwords++; + lc.spiritSwordsSession++; + cf.writeIntConfig("catacombs", "spiritSword", lc.spiritSwords); + } + if (message.contains(" Spirit Bow")) { + lc.spiritBows++; + lc.spiritBowsSession++; + cf.writeIntConfig("catacombs", "spiritBow", lc.spiritBows); + } + + // Chat Maddox + if (message.contains("[OPEN MENU]")) { + List<IChatComponent> listOfSiblings = event.message.getSiblings(); + for (IChatComponent sibling : listOfSiblings) { + if (sibling.getUnformattedText().contains("[OPEN MENU]")) { + lastMaddoxCommand = sibling.getChatStyle().getChatClickEvent().getValue(); + } + } + if (tc.chatMaddoxToggled) Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Click anywhere in chat to open Maddox")); + } + + // Spirit Bear alerts + if (tc.spiritBearAlerts && message.contains("The Spirit Bear has appeared!")) { + Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "SPIRIT BEAR", 2); + } + + // Spirit Sceptre + if (!tc.sceptreMessages && message.contains("Your Bat Staff hit ")) { + event.setCanceled(true); + } } @SubscribeEvent @@ -654,6 +888,23 @@ public class TheMod new TextRenderer(Minecraft.getMinecraft(), coordText, moc.coordsXY[0], moc.coordsXY[1], ScaleCommand.coordsScale); } + if (tc.dungeonTimerToggled) { + String dungeonTimerText = EnumChatFormatting.GRAY + "Wither Doors:\n" + + EnumChatFormatting.DARK_RED + "Blood Open:\n" + + EnumChatFormatting.RED + "Watcher Clear:\n" + + EnumChatFormatting.BLUE + "Boss Clear:\n" + + EnumChatFormatting.YELLOW + "Deaths:\n" + + EnumChatFormatting.YELLOW + "Puzzle Fails:"; + String dungeonTimers = EnumChatFormatting.GRAY + "" + witherDoors + "\n" + + EnumChatFormatting.DARK_RED + Utils.getTimeBetween(dungeonStartTime, bloodOpenTime) + "\n" + + EnumChatFormatting.RED + Utils.getTimeBetween(dungeonStartTime, watcherClearTime) + "\n" + + EnumChatFormatting.BLUE + Utils.getTimeBetween(dungeonStartTime, bossClearTime) + "\n" + + EnumChatFormatting.YELLOW + dungeonDeaths + "\n" + + EnumChatFormatting.YELLOW + puzzleFails; + new TextRenderer(Minecraft.getMinecraft(), dungeonTimerText, moc.dungeonTimerXY[0], moc.dungeonTimerXY[1], ScaleCommand.dungeonTimerScale); + new TextRenderer(Minecraft.getMinecraft(), dungeonTimers, (int) (moc.dungeonTimerXY[0] + (80 * ScaleCommand.dungeonTimerScale)), moc.dungeonTimerXY[1], ScaleCommand.dungeonTimerScale); + } + if (!ds.display.equals("off")) { final LootCommand lc = new LootCommand(); String dropsText = ""; @@ -668,7 +919,7 @@ public class TheMod if (lc.wolfTime == -1) { timeBetween = "Never"; } else { - timeBetween = lc.getTimeBetween(lc.wolfTime, timeNow); + timeBetween = Utils.getTimeBetween(lc.wolfTime, timeNow); } if (lc.wolfBosses == -1) { bossesBetween = "Never"; @@ -707,7 +958,7 @@ public class TheMod if (lc.wolfTimeSession == -1) { timeBetween = "Never"; } else { - timeBetween = lc.getTimeBetween(lc.wolfTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(lc.wolfTimeSession, timeNow); } if (lc.wolfBossesSession == -1) { bossesBetween = "Never"; @@ -746,7 +997,7 @@ public class TheMod if (lc.spiderTime == -1) { timeBetween = "Never"; } else { - timeBetween = lc.getTimeBetween(lc.spiderTime, timeNow); + timeBetween = Utils.getTimeBetween(lc.spiderTime, timeNow); } if (lc.spiderBosses == -1) { bossesBetween = "Never"; @@ -785,7 +1036,7 @@ public class TheMod if (lc.spiderTimeSession == -1) { timeBetween = "Never"; } else { - timeBetween = lc.getTimeBetween(lc.spiderTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(lc.spiderTimeSession, timeNow); } if (lc.spiderBossesSession == -1) { bossesBetween = "Never"; @@ -824,7 +1075,7 @@ public class TheMod if (lc.zombieTime == -1) { timeBetween = "Never"; } else { - timeBetween = lc.getTimeBetween(lc.zombieTime, timeNow); + timeBetween = Utils.getTimeBetween(lc.zombieTime, timeNow); } if (lc.zombieBosses == -1) { bossesBetween = "Never"; @@ -865,7 +1116,7 @@ public class TheMod if (lc.zombieTimeSession == -1) { timeBetween = "Never"; } else { - timeBetween = lc.getTimeBetween(lc.zombieTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(lc.zombieTimeSession, timeNow); } if (lc.zombieBossesSession == -1) { bossesBetween = "Never"; @@ -906,7 +1157,7 @@ public class TheMod if (lc.empTime == -1) { timeBetween = "Never"; } else { - timeBetween = lc.getTimeBetween(lc.empTime, timeNow); + timeBetween = Utils.getTimeBetween(lc.empTime, timeNow); } if (lc.empSCs == -1) { bossesBetween = "Never"; @@ -956,13 +1207,18 @@ public class TheMod EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; - new TextRenderer(Minecraft.getMinecraft(), dropsTextTwo, (int) (moc.displayXY[0] + (145 * ScaleCommand.displayScale)), moc.displayXY[1], ScaleCommand.displayScale); - new TextRenderer(Minecraft.getMinecraft(), countTextTwo, (int) (moc.displayXY[0] + (255 * ScaleCommand.displayScale)), moc.displayXY[1], ScaleCommand.displayScale); + if (tc.splitFishing) { + new TextRenderer(Minecraft.getMinecraft(), dropsTextTwo, (int) (moc.displayXY[0] + (160 * ScaleCommand.displayScale)), moc.displayXY[1], ScaleCommand.displayScale); + new TextRenderer(Minecraft.getMinecraft(), countTextTwo, (int) (moc.displayXY[0] + (270 * ScaleCommand.displayScale)), moc.displayXY[1], ScaleCommand.displayScale); + } else { + dropsText += "\n" + dropsTextTwo; + countText += "\n" + countTextTwo; + } } else if (ds.display.equals("fishing_session")) { if (lc.empTimeSession == -1) { timeBetween = "Never"; } else { - timeBetween = lc.getTimeBetween(lc.empTimeSession, timeNow); + timeBetween = Utils.getTimeBetween(lc.empTimeSession, timeNow); } if (lc.empSCsSession == -1) { bossesBetween = "Never"; @@ -1012,9 +1268,25 @@ public class TheMod EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; - new TextRenderer(Minecraft.getMinecraft(), dropsTextTwo, (int) (moc.displayXY[0] + (145 * ScaleCommand.displayScale)), moc.displayXY[1], ScaleCommand.displayScale); - new TextRenderer(Minecraft.getMinecraft(), countTextTwo, (int) (moc.displayXY[0] + (255 * ScaleCommand.displayScale)), moc.displayXY[1], ScaleCommand.displayScale); + if (tc.splitFishing) { + new TextRenderer(Minecraft.getMinecraft(), dropsTextTwo, (int) (moc.displayXY[0] + (160 * ScaleCommand.displayScale)), moc.displayXY[1], ScaleCommand.displayScale); + new TextRenderer(Minecraft.getMinecraft(), countTextTwo, (int) (moc.displayXY[0] + (270 * ScaleCommand.displayScale)), moc.displayXY[1], ScaleCommand.displayScale); + } else { + dropsText += "\n" + dropsTextTwo; + countText += "\n" + countTextTwo; + } } else if (ds.display.equals("fishing_winter")) { + if (lc.yetiTime == -1) { + timeBetween = "Never"; + } else { + timeBetween = Utils.getTimeBetween(lc.yetiTime, timeNow); + } + if (lc.yetiSCs == -1) { + bossesBetween = "Never"; + } else { + bossesBetween = nf.format(lc.yetiSCs); + } + dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + EnumChatFormatting.AQUA + "Fishing Milestone:\n" + EnumChatFormatting.GOLD + "Good Catches:\n" + @@ -1022,7 +1294,9 @@ public class TheMod EnumChatFormatting.AQUA + "Frozen Steves:\n" + EnumChatFormatting.WHITE + "Snowmans:\n" + EnumChatFormatting.DARK_GREEN + "Grinches:\n" + - EnumChatFormatting.GOLD + "Yetis:"; + EnumChatFormatting.GOLD + "Yetis:\n" + + EnumChatFormatting.AQUA + "Time Since Yeti:\n" + + EnumChatFormatting.AQUA + "Creatures Since Yeti:"; countText = EnumChatFormatting.AQUA + nf.format(lc.seaCreatures) + "\n" + EnumChatFormatting.AQUA + nf.format(lc.fishingMilestone) + "\n" + EnumChatFormatting.GOLD + nf.format(lc.goodCatches) + "\n" + @@ -1030,16 +1304,31 @@ public class TheMod EnumChatFormatting.AQUA + nf.format(lc.frozenSteves) + "\n" + EnumChatFormatting.WHITE + nf.format(lc.frostyTheSnowmans) + "\n" + EnumChatFormatting.DARK_GREEN + nf.format(lc.grinches) + "\n" + - EnumChatFormatting.GOLD + nf.format(lc.yetis); + EnumChatFormatting.GOLD + nf.format(lc.yetis) + "\n" + + EnumChatFormatting.AQUA + timeBetween + "\n" + + EnumChatFormatting.AQUA + bossesBetween; } else if (ds.display.equals("fishing_winter_session")) { + if (lc.yetiTimeSession == -1) { + timeBetween = "Never"; + } else { + timeBetween = Utils.getTimeBetween(lc.yetiTimeSession, timeNow); + } + if (lc.yetiSCsSession == -1) { + bossesBetween = "Never"; + } else { + bossesBetween = nf.format(lc.yetiSCsSession); + } + dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + - EnumChatFormatting.AQUA + "Fishing Milestone:\n" + + EnumChatFormatting.AQUA + "Fishing Milestone:\n" + EnumChatFormatting.GOLD + "Good Catches:\n" + EnumChatFormatting.DARK_PURPLE + "Great Catches:\n" + EnumChatFormatting.AQUA + "Frozen Steves:\n" + EnumChatFormatting.WHITE + "Snowmans:\n" + EnumChatFormatting.DARK_GREEN + "Grinches:\n" + - EnumChatFormatting.GOLD + "Yetis:"; + EnumChatFormatting.GOLD + "Yetis:\n" + + EnumChatFormatting.AQUA + "Time Since Yeti:\n" + + EnumChatFormatting.AQUA + "Creatures Since Yeti:"; countText = EnumChatFormatting.AQUA + nf.format(lc.seaCreaturesSession) + "\n" + EnumChatFormatting.AQUA + nf.format(lc.fishingMilestoneSession) + "\n" + EnumChatFormatting.GOLD + nf.format(lc.goodCatchesSession) + "\n" + @@ -1047,7 +1336,137 @@ public class TheMod EnumChatFormatting.AQUA + nf.format(lc.frozenStevesSession) + "\n" + EnumChatFormatting.WHITE + nf.format(lc.frostyTheSnowmansSession) + "\n" + EnumChatFormatting.DARK_GREEN + nf.format(lc.grinchesSession) + "\n" + - EnumChatFormatting.GOLD + nf.format(lc.yetisSession); + EnumChatFormatting.GOLD + nf.format(lc.yetisSession) + "\n" + + EnumChatFormatting.AQUA + timeBetween + "\n" + + EnumChatFormatting.AQUA + bossesBetween; + } else if (ds.display.equals("catacombs_floor_one")) { + dropsText = 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:\n"; + countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooks) + "\n" + + EnumChatFormatting.BLUE + nf.format(lc.bonzoStaffs) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(lc.f1CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, lc.f1TimeSpent); + } else if (ds.display.equals("catacombs_floor_one_session")) { + dropsText = 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:\n"; + countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(lc.bonzoStaffsSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(lc.f1CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, lc.f1TimeSpentSession); + } else if (ds.display.equals("catacombs_floor_two")) { + dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + + EnumChatFormatting.BLUE + "Scarf's Studies:\n" + + EnumChatFormatting.AQUA + "Coins Spent:\n" + + EnumChatFormatting.AQUA + "Time Spent:\n"; + countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooks) + "\n" + + EnumChatFormatting.BLUE + nf.format(lc.scarfStudies) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(lc.f2CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, lc.f2TimeSpent); + } else if (ds.display.equals("catacombs_floor_two_session")) { + dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + + EnumChatFormatting.BLUE + "Scarf's Studies:\n" + + EnumChatFormatting.AQUA + "Coins Spent:\n" + + EnumChatFormatting.AQUA + "Time Spent:\n"; + countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(lc.scarfStudiesSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(lc.f2CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, lc.f2TimeSpentSession); + } else if (ds.display.equals("catacombs_floor_three")) { + dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + + EnumChatFormatting.DARK_PURPLE + "Adaptive Helmets:\n" + + EnumChatFormatting.DARK_PURPLE + "Adaptive Chestplates:\n" + + EnumChatFormatting.DARK_PURPLE + "Adaptive Leggings:\n" + + EnumChatFormatting.DARK_PURPLE + "Adaptive Boots:\n" + + EnumChatFormatting.DARK_PURPLE + "Adaptive Blades:\n" + + EnumChatFormatting.AQUA + "Coins Spent:\n" + + EnumChatFormatting.AQUA + "Time Spent:\n"; + countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooks) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveHelms) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveChests) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveLegs) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveBoots) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveSwords) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(lc.f3CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, lc.f3TimeSpent); + } else if (ds.display.equals("catacombs_floor_three_session")) { + dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + + EnumChatFormatting.DARK_PURPLE + "Adaptive Helmets:\n" + + EnumChatFormatting.DARK_PURPLE + "Adaptive Chestplates:\n" + + EnumChatFormatting.DARK_PURPLE + "Adaptive Leggings:\n" + + EnumChatFormatting.DARK_PURPLE + "Adaptive Boots:\n" + + EnumChatFormatting.DARK_PURPLE + "Adaptive Blades:\n" + + EnumChatFormatting.AQUA + "Coins Spent:\n" + + EnumChatFormatting.AQUA + "Time Spent:\n"; + countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveHelmsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveChestsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveLegsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveBootsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.adaptiveSwordsSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(lc.f3CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, lc.f3TimeSpentSession); + } else if (ds.display.equals("catacombs_floor_four")) { + dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + + EnumChatFormatting.DARK_PURPLE + "Spirit Wings:\n" + + EnumChatFormatting.DARK_PURPLE + "Spirit Bones:\n" + + EnumChatFormatting.DARK_PURPLE + "Spirit Boots:\n" + + EnumChatFormatting.DARK_PURPLE + "Spirit Swords:\n" + + EnumChatFormatting.GOLD + "Spirit Bows:\n" + + EnumChatFormatting.DARK_PURPLE + "Epic Spirit Pets:\n" + + EnumChatFormatting.GOLD + "Leg Spirit Pets:\n" + + EnumChatFormatting.AQUA + "Coins Spent:\n" + + EnumChatFormatting.AQUA + "Time Spent:\n"; + countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulators) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooks) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.spiritWings) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.spiritBones) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.spiritBoots) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.spiritSwords) + "\n" + + EnumChatFormatting.GOLD + nf.format(lc.spiritBows) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.epicSpiritPets) + "\n" + + EnumChatFormatting.GOLD + nf.format(lc.legSpiritPets) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(lc.f4CoinsSpent) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, lc.f4TimeSpent); + } else if (ds.display.equals("catacombs_floor_four_session")) { + dropsText = EnumChatFormatting.GOLD + "Recombobulators:\n" + + EnumChatFormatting.DARK_PURPLE + "Fuming Potato Books:\n" + + EnumChatFormatting.DARK_PURPLE + "Spirit Wings:\n" + + EnumChatFormatting.DARK_PURPLE + "Spirit Bones:\n" + + EnumChatFormatting.DARK_PURPLE + "Spirit Boots:\n" + + EnumChatFormatting.DARK_PURPLE + "Spirit Swords:\n" + + EnumChatFormatting.GOLD + "Spirit Bows:\n" + + EnumChatFormatting.DARK_PURPLE + "Epic Spirit Pets:\n" + + EnumChatFormatting.GOLD + "Leg Spirit Pets:\n" + + EnumChatFormatting.AQUA + "Coins Spent:\n" + + EnumChatFormatting.AQUA + "Time Spent:\n"; + countText = EnumChatFormatting.GOLD + nf.format(lc.recombobulatorsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.fumingPotatoBooksSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.spiritWingsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.spiritBonesSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.spiritBootsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.spiritSwordsSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(lc.spiritBowsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(lc.epicSpiritPetsSession) + "\n" + + EnumChatFormatting.GOLD + nf.format(lc.legSpiritPetsSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getMoneySpent(lc.f4CoinsSpentSession) + "\n" + + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, lc.f4TimeSpentSession); } else { ConfigHandler cf = new ConfigHandler(); @@ -1066,6 +1485,7 @@ public class TheMod @SubscribeEvent(priority = EventPriority.HIGHEST) public void onSound(final PlaySoundEvent event) { + if (!Utils.inSkyblock) return; if (event.name.equals("note.pling")) { // Don't check twice within 3 seconds checkItemsNow = System.currentTimeMillis() / 1000; @@ -1118,6 +1538,7 @@ public class TheMod @SubscribeEvent(priority = EventPriority.HIGHEST) public void onTooltip(ItemTooltipEvent event) { + if (!Utils.inSkyblock) return; final ToggleCommand tc = new ToggleCommand(); if (event.toolTip == null) return; @@ -1130,6 +1551,16 @@ public class TheMod @SubscribeEvent public void onTick(TickEvent.ClientTickEvent event) { + // Check if player is in Skyblock every second + tickAmount++; + if (tickAmount % 20 == 0) { + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + if (player != null) { + Utils.checkForSkyblock(); + } + tickAmount = 1; + } + if (titleTimer >= 0) { if (titleTimer == 0) { showTitle = false; @@ -1138,7 +1569,124 @@ public class TheMod } } - public void increaseEmpSC() { + @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 (ToggleCommand.aotdToggled && item.getDisplayName().contains("Aspect of the Dragons") && event.action == PlayerInteractEvent.Action.RIGHT_CLICK_AIR) { + event.setCanceled(true); + } + } + + @SubscribeEvent + public void onKey(KeyInputEvent event) { + if (!Utils.inSkyblock) return; + if (keyBindings[0].isPressed()) { + Minecraft.getMinecraft().thePlayer.sendChatMessage(lastMaddoxCommand); + } + } + + @SubscribeEvent + public void onGuiMouseInput(GuiScreenEvent.MouseInputEvent.Pre event) { + if (!Utils.inSkyblock) return; + if (Mouse.getEventButton() == lastMouse) return; + lastMouse = Mouse.getEventButton(); + if (Mouse.getEventButton() != 0 && Mouse.getEventButton() != 1) return; // Left click or right click + + if (event.gui instanceof GuiChest) { + LootCommand lc = new LootCommand(); + ConfigHandler cf = new ConfigHandler(); + GuiChest inventory = (GuiChest) event.gui; + Slot mouseSlot = inventory.getSlotUnderMouse(); + if (mouseSlot == null || mouseSlot.getStack() == null) return; + ItemStack item = mouseSlot.getStack(); + + if (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")) { + lc.f1CoinsSpent += coinsSpent; + lc.f1CoinsSpentSession += coinsSpent; + cf.writeDoubleConfig("catacombs", "floorOneCoins", lc.f1CoinsSpent); + } else if (sCleaned.contains("F2")) { + lc.f2CoinsSpent += coinsSpent; + lc.f2CoinsSpentSession += coinsSpent; + cf.writeDoubleConfig("catacombs", "floorTwoCoins", lc.f2CoinsSpent); + } else if (sCleaned.contains("F3")) { + lc.f3CoinsSpent += coinsSpent; + lc.f3CoinsSpentSession += coinsSpent; + cf.writeDoubleConfig("catacombs", "floorThreeCoins", lc.f3CoinsSpent); + } else if (sCleaned.contains("F4")) { + lc.f4CoinsSpent += coinsSpent; + lc.f4CoinsSpentSession += coinsSpent; + cf.writeDoubleConfig("catacombs", "floorFourCoins", lc.f4CoinsSpent); + } + break; + } + } + break; + } + } + } + } + } + + @SubscribeEvent + public void onGuiRender(GuiScreenEvent.BackgroundDrawnEvent event) { + if (!Utils.inSkyblock) return; + if (ToggleCommand.petColoursToggled && event.gui instanceof GuiChest) { + GuiChest inventory = (GuiChest) event.gui; + List<Slot> invSlots = inventory.inventorySlots.inventorySlots; + for (Slot slot : invSlots) { + ItemStack item = slot.getStack(); + if (item == null) continue; + String name = item.getDisplayName(); + if (name.contains("[Lvl ")) { + if (name.endsWith("aHealer") || name.endsWith("aMage") || name.endsWith("aBerserk") || name.endsWith("aArcher") || name.endsWith("aTank")) continue; + int colour; + int petLevel = Integer.parseInt(item.getDisplayName().substring(item.getDisplayName().indexOf(" ") + 1, item.getDisplayName().indexOf("]"))); + if (petLevel == 100) { + colour = 0xBFF2D249; // Gold + } else if (petLevel >= 90) { + colour = 0xBF9E794E; // Brown + } else if (petLevel >= 80) { + colour = 0xBF5C1F35; // idk weird magenta + } else if (petLevel >= 70) { + colour = 0xBFD64FC8; // Pink + } else if (petLevel >= 60) { + colour = 0xBF7E4FC6; // Purple + } else if (petLevel >= 50) { + colour = 0xBF008AD8; // Light Blue + } else if (petLevel >= 40) { + colour = 0xBF0EAC35; // Green + } else if (petLevel >= 30) { + colour = 0xBFFFC400; // Yellow + } else if (petLevel >= 20) { + colour = 0xBFEF5230; // Orange + } else if (petLevel >= 10) { + colour = 0xBFD62440; // Red + } else { + colour = 0xBF999999; // Gray + } + Utils.drawOnSlot(inventory.inventorySlots.inventorySlots.size(), slot.xDisplayPosition, slot.yDisplayPosition, colour); + } + } + } + } + + public void increaseSeaCreatures() { LootCommand lc = new LootCommand(); ConfigHandler cf = new ConfigHandler(); @@ -1148,8 +1696,23 @@ public class TheMod if (lc.empSCsSession != -1) { lc.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")) { + if (lc.yetiSCs != -1) { + lc.yetiSCs++; + } + if (lc.yetiSCsSession != -1) { + lc.yetiSCsSession++; + } + } + } cf.writeIntConfig("fishing", "empSC", lc.empSCs); + cf.writeIntConfig("fishing", "yetiSC", lc.yetiSCs); + } } |