From ad53066846fb168255499a332a1ad4bca39f5935 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 27 Feb 2021 18:25:51 -0500 Subject: Move features into their own files --- src/main/java/me/Danker/DankersSkyblockMod.java | 3914 +------------------- .../me/Danker/commands/BlockSlayerCommand.java | 30 +- .../java/me/Danker/commands/DankerGuiCommand.java | 3 +- .../me/Danker/commands/ImportFishingCommand.java | 249 +- src/main/java/me/Danker/commands/LootCommand.java | 1001 ++--- src/main/java/me/Danker/commands/PetsCommand.java | 1 - .../java/me/Danker/commands/RepartyCommand.java | 5 +- .../java/me/Danker/commands/ResetLootCommand.java | 273 +- .../me/Danker/commands/SkillTrackerCommand.java | 33 +- .../me/Danker/events/ChestSlotClickedEvent.java | 34 + .../events/GuiChestBackgroundDrawnEvent.java | 22 + src/main/java/me/Danker/events/RenderOverlay.java | 6 + src/main/java/me/Danker/features/AutoDisplay.java | 73 + .../me/Danker/features/AutoSwapToPickBlock.java | 51 + .../java/me/Danker/features/BlockWrongSlayer.java | 42 + .../java/me/Danker/features/BonzoMaskTimer.java | 86 + src/main/java/me/Danker/features/CakeTimer.java | 62 + src/main/java/me/Danker/features/DungeonTimer.java | 79 + .../java/me/Danker/features/ExpertiseLore.java | 40 + .../me/Danker/features/FasterMaddoxCalling.java | 64 + .../java/me/Danker/features/GoldenEnchants.java | 68 + .../me/Danker/features/GolemSpawningAlert.java | 26 + .../me/Danker/features/GpartyNotifications.java | 38 + .../Danker/features/HideTooltipsInExperiments.java | 35 + .../me/Danker/features/LowHealthNotifications.java | 36 + .../me/Danker/features/NecronNotifications.java | 78 + src/main/java/me/Danker/features/NoF3Coords.java | 33 + .../java/me/Danker/features/NotifySlayerSlain.java | 88 + src/main/java/me/Danker/features/PetColours.java | 69 + src/main/java/me/Danker/features/Reparty.java | 143 + .../java/me/Danker/features/Skill50Display.java | 77 + src/main/java/me/Danker/features/SkillTracker.java | 208 ++ src/main/java/me/Danker/features/SpamHider.java | 51 + .../java/me/Danker/features/SpiritBearAlert.java | 24 + .../Danker/features/StopSalvagingStarredItems.java | 34 + .../java/me/Danker/features/UpdateChecker.java | 52 + .../java/me/Danker/features/WatcherReadyAlert.java | 22 + .../java/me/Danker/features/loot/LootDisplay.java | 903 +++++ .../java/me/Danker/features/loot/LootTracker.java | 1097 ++++++ .../puzzlesolvers/ArrowTerminalSolver.java | 32 + .../Danker/features/puzzlesolvers/BlazeSolver.java | 86 + .../features/puzzlesolvers/BlockAbilities.java | 84 + .../puzzlesolvers/BlockPlacingFlowers.java | 44 + .../puzzlesolvers/BlockWrongTerminalClicks.java | 112 + .../features/puzzlesolvers/ChronomatronSolver.java | 114 + .../features/puzzlesolvers/ClickInOrderSolver.java | 107 + .../features/puzzlesolvers/CreeperSolver.java | 86 + .../Danker/features/puzzlesolvers/LividSolver.java | 89 + .../puzzlesolvers/SelectAllColourSolver.java | 59 + .../features/puzzlesolvers/StartsWithSolver.java | 31 + .../features/puzzlesolvers/SuperpairsSolver.java | 150 + .../features/puzzlesolvers/ThreeManSolver.java | 75 + .../features/puzzlesolvers/TicTacToeSolver.java | 135 + .../features/puzzlesolvers/TriviaSolver.java | 105 + .../puzzlesolvers/UltrasequencerSolver.java | 112 + .../Danker/features/puzzlesolvers/WaterSolver.java | 162 + src/main/java/me/Danker/gui/EditLocationsGui.java | 19 +- src/main/java/me/Danker/gui/OnlySlayerGui.java | 22 +- src/main/java/me/Danker/gui/SkillTrackerGui.java | 39 +- src/main/java/me/Danker/gui/WarningGui.java | 6 - .../java/me/Danker/gui/WarningGuiRedirect.java | 2 - .../java/me/Danker/handlers/ConfigHandler.java | 346 +- src/main/java/me/Danker/utils/Utils.java | 14 +- 63 files changed, 6268 insertions(+), 4913 deletions(-) create mode 100644 src/main/java/me/Danker/events/ChestSlotClickedEvent.java create mode 100644 src/main/java/me/Danker/events/GuiChestBackgroundDrawnEvent.java create mode 100644 src/main/java/me/Danker/events/RenderOverlay.java create mode 100644 src/main/java/me/Danker/features/AutoDisplay.java create mode 100644 src/main/java/me/Danker/features/AutoSwapToPickBlock.java create mode 100644 src/main/java/me/Danker/features/BlockWrongSlayer.java create mode 100644 src/main/java/me/Danker/features/BonzoMaskTimer.java create mode 100644 src/main/java/me/Danker/features/CakeTimer.java create mode 100644 src/main/java/me/Danker/features/DungeonTimer.java create mode 100644 src/main/java/me/Danker/features/ExpertiseLore.java create mode 100644 src/main/java/me/Danker/features/FasterMaddoxCalling.java create mode 100644 src/main/java/me/Danker/features/GoldenEnchants.java create mode 100644 src/main/java/me/Danker/features/GolemSpawningAlert.java create mode 100644 src/main/java/me/Danker/features/GpartyNotifications.java create mode 100644 src/main/java/me/Danker/features/HideTooltipsInExperiments.java create mode 100644 src/main/java/me/Danker/features/LowHealthNotifications.java create mode 100644 src/main/java/me/Danker/features/NecronNotifications.java create mode 100644 src/main/java/me/Danker/features/NoF3Coords.java create mode 100644 src/main/java/me/Danker/features/NotifySlayerSlain.java create mode 100644 src/main/java/me/Danker/features/PetColours.java create mode 100644 src/main/java/me/Danker/features/Reparty.java create mode 100644 src/main/java/me/Danker/features/Skill50Display.java create mode 100644 src/main/java/me/Danker/features/SkillTracker.java create mode 100644 src/main/java/me/Danker/features/SpamHider.java create mode 100644 src/main/java/me/Danker/features/SpiritBearAlert.java create mode 100644 src/main/java/me/Danker/features/StopSalvagingStarredItems.java create mode 100644 src/main/java/me/Danker/features/UpdateChecker.java create mode 100644 src/main/java/me/Danker/features/WatcherReadyAlert.java create mode 100644 src/main/java/me/Danker/features/loot/LootDisplay.java create mode 100644 src/main/java/me/Danker/features/loot/LootTracker.java create mode 100644 src/main/java/me/Danker/features/puzzlesolvers/ArrowTerminalSolver.java create mode 100644 src/main/java/me/Danker/features/puzzlesolvers/BlazeSolver.java create mode 100644 src/main/java/me/Danker/features/puzzlesolvers/BlockAbilities.java create mode 100644 src/main/java/me/Danker/features/puzzlesolvers/BlockPlacingFlowers.java create mode 100644 src/main/java/me/Danker/features/puzzlesolvers/BlockWrongTerminalClicks.java create mode 100644 src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java create mode 100644 src/main/java/me/Danker/features/puzzlesolvers/ClickInOrderSolver.java create mode 100644 src/main/java/me/Danker/features/puzzlesolvers/CreeperSolver.java create mode 100644 src/main/java/me/Danker/features/puzzlesolvers/LividSolver.java create mode 100644 src/main/java/me/Danker/features/puzzlesolvers/SelectAllColourSolver.java create mode 100644 src/main/java/me/Danker/features/puzzlesolvers/StartsWithSolver.java create mode 100644 src/main/java/me/Danker/features/puzzlesolvers/SuperpairsSolver.java create mode 100644 src/main/java/me/Danker/features/puzzlesolvers/ThreeManSolver.java create mode 100644 src/main/java/me/Danker/features/puzzlesolvers/TicTacToeSolver.java create mode 100644 src/main/java/me/Danker/features/puzzlesolvers/TriviaSolver.java create mode 100644 src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java create mode 100644 src/main/java/me/Danker/features/puzzlesolvers/WaterSolver.java (limited to 'src') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 12a8066..38e956f 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -1,52 +1,43 @@ package me.Danker; -import com.google.gson.JsonObject; import me.Danker.commands.*; +import me.Danker.events.ChestSlotClickedEvent; +import me.Danker.events.GuiChestBackgroundDrawnEvent; +import me.Danker.events.RenderOverlay; +import me.Danker.features.*; +import me.Danker.features.loot.LootDisplay; +import me.Danker.features.loot.LootTracker; +import me.Danker.features.puzzlesolvers.*; import me.Danker.gui.*; -import me.Danker.handlers.*; -import me.Danker.utils.TicTacToeUtils; +import me.Danker.handlers.ConfigHandler; +import me.Danker.handlers.PacketHandler; import me.Danker.utils.Utils; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; -import net.minecraft.client.gui.*; +import net.minecraft.client.gui.GuiMainMenu; import net.minecraft.client.gui.inventory.GuiChest; -import net.minecraft.client.settings.GameSettings; import net.minecraft.client.settings.KeyBinding; import net.minecraft.command.ICommand; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityArmorStand; -import net.minecraft.entity.item.EntityItemFrame; -import net.minecraft.entity.monster.EntityCreeper; -import net.minecraft.entity.monster.EntitySpider; -import net.minecraft.entity.monster.EntityZombie; -import net.minecraft.entity.passive.EntityWolf; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.event.ClickEvent; import net.minecraft.event.ClickEvent.Action; import net.minecraft.event.HoverEvent; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; import net.minecraft.inventory.Container; import net.minecraft.inventory.ContainerChest; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; -import net.minecraft.item.Item; -import net.minecraft.item.ItemMap; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.*; -import net.minecraft.world.World; -import net.minecraft.world.storage.MapData; +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.GuiIngameForge; -import net.minecraftforge.client.event.*; -import net.minecraftforge.client.event.sound.PlaySoundEvent; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.client.event.GuiOpenEvent; +import net.minecraftforge.client.event.GuiScreenEvent; +import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.EntityJoinWorldEvent; -import net.minecraftforge.event.entity.player.*; -import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.Mod; @@ -54,115 +45,31 @@ import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; 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.gameevent.TickEvent.Phase; import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent; -import net.minecraftforge.fml.common.versioning.DefaultArtifactVersion; -import org.apache.commons.lang3.time.StopWatch; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; -import java.awt.*; -import java.text.NumberFormat; import java.util.List; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; +import java.util.Map; @Mod(modid = DankersSkyblockMod.MODID, version = DankersSkyblockMod.VERSION, clientSideOnly = true) public class DankersSkyblockMod { public static final String MODID = "Danker's Skyblock Mod"; - public static final String VERSION = "1.8.5"; - static double checkItemsNow = 0; - static double itemsChecked = 0; - public static Map t6Enchants = new HashMap<>(); - public static Pattern t6EnchantPattern = Pattern.compile(""); - static Pattern petPattern = Pattern.compile("\\[Lvl [\\d]{1,3}]"); - static boolean updateChecked = false; + public static final String VERSION = "1.8.6-beta1"; public static int titleTimer = -1; public static boolean showTitle = false; public static String titleText = ""; - public static int SKILL_TIME; - public static int skillTimer = -1; - public static boolean showSkill = false; - public static String skillText = ""; - static int tickAmount = 1; - static String lastMaddoxCommand = "/cb placeholder"; - static double lastMaddoxTime = 0; - static KeyBinding[] keyBindings = new KeyBinding[3]; + public static int tickAmount = 1; + public static KeyBinding[] keyBindings = new KeyBinding[3]; static boolean usingLabymod = false; static boolean usingOAM = false; static boolean OAMWarning = false; public static String guiToOpen = null; - static boolean foundLivid = false; - static Entity livid = null; - public static double cakeTime; - public static double nextBonzoUse = 0; public static boolean firstLaunch = false; - - public static final ResourceLocation CAKE_ICON = new ResourceLocation("dsm", "icons/cake.png"); - public static final ResourceLocation BONZO_ICON = new ResourceLocation("dsm", "icons/bonzo.png"); - - 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."}; - static BlockPos riddleChest = null; - static Map triviaSolutions = new HashMap<>(); - static String[] triviaAnswers = null; - static Entity highestBlaze = null; - static Entity lowestBlaze = null; - // Among Us colours - static final int[] CREEPER_COLOURS = {0x50EF39, 0xC51111, 0x132ED1, 0x117F2D, 0xED54BA, 0xEF7D0D, 0xF5F557, 0xD6E0F0, 0x6B2FBB, 0x39FEDC}; - static boolean drawCreeperLines = false; - static Vec3 creeperLocation = new Vec3(0, 0, 0); - static List creeperLines = new ArrayList<>(); - static boolean prevInWaterRoom = false; - static boolean inWaterRoom = false; - static String waterAnswers = null; - static AxisAlignedBB correctTicTacToeButton = null; - static Pattern startsWithTerminalPattern = Pattern.compile("[A-Z]{2,}"); - static Slot[] clickInOrderSlots = new Slot[36]; - static int lastChronomatronRound = 0; - static List chronomatronPattern = new ArrayList<>(); - static int chronomatronMouseClicks = 0; - static int lastUltraSequencerClicked = 0; - static ItemStack[] experimentTableSlots = new ItemStack[54]; - static int pickBlockBind; - static boolean pickBlockBindSwapped = false; - static String terminalColorNeeded; - static int[] terminalNumberNeeded = new int[4]; - - 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; - - static String lastSkill = "Farming"; - public static boolean showSkillTracker; - public static StopWatch skillStopwatch = new StopWatch(); - static double farmingXP = 0; - public static double farmingXPGained = 0; - static double miningXP = 0; - public static double miningXPGained = 0; - static double combatXP = 0; - public static double combatXPGained = 0; - static double foragingXP = 0; - public static double foragingXPGained = 0; - static double fishingXP = 0; - public static double fishingXPGained = 0; - static double enchantingXP = 0; - public static double enchantingXPGained = 0; - static double alchemyXP = 0; - public static double alchemyXPGained = 0; - static double xpLeft = 0; - static double timeSinceGained = 0; public static String MAIN_COLOUR; public static String SECONDARY_COLOUR; @@ -172,112 +79,57 @@ public class DankersSkyblockMod { public static String VALUE_COLOUR; public static String SKILL_AVERAGE_COLOUR; public static String ANSWER_COLOUR; - public static String SKILL_50_COLOUR; - public static String COORDS_COLOUR; - public static String CAKE_COLOUR; - public static String SKILL_TRACKER_COLOUR; - public static String TRIVIA_WRONG_ANSWER_COLOUR; - public static String BONZO_COLOR; - public static int LOWEST_BLAZE_COLOUR; - public static int HIGHEST_BLAZE_COLOUR; - public static int PET_1_TO_9; - public static int PET_10_TO_19; - public static int PET_20_TO_29; - public static int PET_30_TO_39; - public static int PET_40_TO_49; - public static int PET_50_TO_59; - public static int PET_60_TO_69; - public static int PET_70_TO_79; - public static int PET_80_TO_89; - public static int PET_90_TO_99; - public static int PET_100; - public static int ULTRASEQUENCER_NEXT; - public static int ULTRASEQUENCER_NEXT_TO_NEXT; - public static int CHRONOMATRON_NEXT; - public static int CHRONOMATRON_NEXT_TO_NEXT; - public static int CLICK_IN_ORDER_NEXT; - public static int CLICK_IN_ORDER_NEXT_TO_NEXT; @EventHandler public void init(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(this); - MinecraftForge.EVENT_BUS.register(new PacketHandler()); + MinecraftForge.EVENT_BUS.register(new ArrowTerminalSolver()); + MinecraftForge.EVENT_BUS.register(new AutoDisplay()); + MinecraftForge.EVENT_BUS.register(new AutoSwapToPickBlock()); + MinecraftForge.EVENT_BUS.register(new BlazeSolver()); + MinecraftForge.EVENT_BUS.register(new BlockAbilities()); + MinecraftForge.EVENT_BUS.register(new BlockPlacingFlowers()); + MinecraftForge.EVENT_BUS.register(new BlockWrongSlayer()); + MinecraftForge.EVENT_BUS.register(new BlockWrongTerminalClicks()); + MinecraftForge.EVENT_BUS.register(new BonzoMaskTimer()); + MinecraftForge.EVENT_BUS.register(new CakeTimer()); + MinecraftForge.EVENT_BUS.register(new ChronomatronSolver()); + MinecraftForge.EVENT_BUS.register(new ClickInOrderSolver()); + MinecraftForge.EVENT_BUS.register(new CreeperSolver()); + MinecraftForge.EVENT_BUS.register(new DungeonTimer()); + MinecraftForge.EVENT_BUS.register(new ExpertiseLore()); + MinecraftForge.EVENT_BUS.register(new FasterMaddoxCalling()); + MinecraftForge.EVENT_BUS.register(new GoldenEnchants()); + MinecraftForge.EVENT_BUS.register(new GolemSpawningAlert()); + MinecraftForge.EVENT_BUS.register(new GpartyNotifications()); + MinecraftForge.EVENT_BUS.register(new HideTooltipsInExperiments()); + MinecraftForge.EVENT_BUS.register(new LividSolver()); + MinecraftForge.EVENT_BUS.register(new LootDisplay()); + MinecraftForge.EVENT_BUS.register(new LootTracker()); + MinecraftForge.EVENT_BUS.register(new LowHealthNotifications()); + MinecraftForge.EVENT_BUS.register(new NecronNotifications()); + MinecraftForge.EVENT_BUS.register(new NoF3Coords()); + MinecraftForge.EVENT_BUS.register(new NotifySlayerSlain()); + MinecraftForge.EVENT_BUS.register(new PetColours()); + MinecraftForge.EVENT_BUS.register(new Reparty()); + MinecraftForge.EVENT_BUS.register(new SelectAllColourSolver()); + MinecraftForge.EVENT_BUS.register(new Skill50Display()); + MinecraftForge.EVENT_BUS.register(new SkillTracker()); + MinecraftForge.EVENT_BUS.register(new SpamHider()); + MinecraftForge.EVENT_BUS.register(new SpiritBearAlert()); + MinecraftForge.EVENT_BUS.register(new StartsWithSolver()); + MinecraftForge.EVENT_BUS.register(new StopSalvagingStarredItems()); + MinecraftForge.EVENT_BUS.register(new SuperpairsSolver()); + MinecraftForge.EVENT_BUS.register(new ThreeManSolver()); + MinecraftForge.EVENT_BUS.register(new TicTacToeSolver()); + MinecraftForge.EVENT_BUS.register(new TriviaSolver()); + MinecraftForge.EVENT_BUS.register(new UltrasequencerSolver()); + MinecraftForge.EVENT_BUS.register(new UpdateChecker()); + MinecraftForge.EVENT_BUS.register(new WatcherReadyAlert()); + MinecraftForge.EVENT_BUS.register(new WaterSolver()); ConfigHandler.reloadConfig(); - - // For golden enchants - t6Enchants.put("9Angler VI", "6Angler VI"); - t6Enchants.put("9Bane of Arthropods VI", "6Bane of Arthropods VI"); - t6Enchants.put("9Caster VI", "6Caster VI"); - t6Enchants.put("9Compact X", "6Compact X"); - t6Enchants.put("9Critical VI", "6Critical VI"); - t6Enchants.put("9Dragon Hunter V", "6Dragon Hunter V"); - t6Enchants.put("9Efficiency VI", "6Efficiency VI"); - t6Enchants.put("9Ender Slayer VI", "6Ender Slayer VI"); - t6Enchants.put("9Experience IV", "6Experience IV"); - t6Enchants.put("9Expertise X", "6Expertise X"); - t6Enchants.put("9Feather Falling X", "6Feather Falling X"); - t6Enchants.put("9Frail VI", "6Frail VI"); - t6Enchants.put("9Giant Killer VI", "6Giant Killer VI"); - t6Enchants.put("9Growth VI", "6Growth VI"); - t6Enchants.put("9Infinite Quiver X", "6Infinite Quiver X"); - t6Enchants.put("9Lethality VI", "6Lethality VI"); - t6Enchants.put("9Life Steal IV", "6Life Steal IV"); - t6Enchants.put("9Looting IV", "6Looting IV"); - t6Enchants.put("9Luck VI", "6Luck 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("9Overload V", "6Overload V"); - t6Enchants.put("9Power VI", "6Power VI"); - t6Enchants.put("9Protection VI", "6Protection VI"); - t6Enchants.put("9Scavenger IV", "6Scavenger IV"); - t6Enchants.put("9Scavenger V", "6Scavenger V"); - t6Enchants.put("9Sharpness VI", "6Sharpness VI"); - t6Enchants.put("9Smite VI", "6Smite VI"); - t6Enchants.put("9Spiked Hook VI", "6Spiked Hook VI"); - t6Enchants.put("9Thunderlord VI", "6Thunderlord VI"); - t6Enchants.put("9Vampirism VI", "6Vampirism VI"); - - 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"}); - triviaSolutions.put("What is the status of The Professor?", new String[]{"Professor"}); - triviaSolutions.put("What is the status of Thorn?", new String[]{"Shaman Necromancer"}); - triviaSolutions.put("What is the status of Livid?", new String[]{"Master Necromancer"}); - triviaSolutions.put("What is the status of Sadan?", new String[]{"Necromancer Lord"}); - triviaSolutions.put("What is the status of Maxor?", new String[]{"Young Wither"}); - 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[]{"220 Fairy Souls"}); - triviaSolutions.put("How many Fairy Souls are there in Spider's Den?", new String[]{"17 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 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"}); - triviaSolutions.put("How many Fairy Souls are there in The Hub?", new String[]{"79 Fairy Souls"}); - triviaSolutions.put("How many Fairy Souls are there in Deep Caverns?", new String[]{"21 Fairy Souls"}); - triviaSolutions.put("How many Fairy Souls are there in Gold Mine?", new String[]{"12 Fairy Souls"}); - triviaSolutions.put("How many Fairy Souls are there in Dungeon Hub?", new String[]{"7 Fairy Souls"}); - triviaSolutions.put("Which brother is on the Spider's Den?", new String[]{"Rick"}); - triviaSolutions.put("What is the name of Rick's brother?", new String[]{"Pat"}); - triviaSolutions.put("What is the name of the Painter in the Hub?", new String[]{"Marco"}); - 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("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"}); - triviaSolutions.put("Which of these is not a dragon in The End?", new String[]{"Zoomer Dragon", "Weak Dragon", "Stonk Dragon", "Holy Dragon", "Boomer Dragon", - "Booger Dragon", "Older Dragon", "Elder Dragon", "Stable Dragon", "Professor Dragon"}); - - String patternString = "(" + String.join("|", t6Enchants.keySet()) + ")"; - t6EnchantPattern = Pattern.compile(patternString); + GoldenEnchants.init(); keyBindings[0] = new KeyBinding("Open Maddox Menu", Keyboard.KEY_M, "Danker's Skyblock Mod"); keyBindings[1] = new KeyBinding("Regular Ability", Keyboard.KEY_NUMPAD4, "Danker's Skyblock Mod"); @@ -319,9 +171,10 @@ public class DankersSkyblockMod { @EventHandler public void postInit(final FMLPostInitializationEvent event) { Package[] packages = Package.getPackages(); - for(Package p : packages){ - if(p.getName().startsWith("com.spiderfrog.gadgets") || p.getName().startsWith("com.spiderfrog.oldanimations")){ + for (Package p : packages){ + if (p.getName().startsWith("com.spiderfrog.gadgets") || p.getName().startsWith("com.spiderfrog.oldanimations")){ usingOAM = true; + break; } } System.out.println("OAM detection: " + usingOAM); @@ -329,10 +182,10 @@ public class DankersSkyblockMod { usingLabymod = Loader.isModLoaded("labymod"); System.out.println("LabyMod detection: " + usingLabymod); - if(!ClientCommandHandler.instance.getCommands().containsKey("reparty")) { + if (!ClientCommandHandler.instance.getCommands().containsKey("reparty")) { ClientCommandHandler.instance.registerCommand(new RepartyCommand()); } else if (ConfigHandler.getBoolean("commands", "reparty")) { - for(Map.Entry entry : ClientCommandHandler.instance.getCommands().entrySet()) { + for (Map.Entry entry : ClientCommandHandler.instance.getCommands().entrySet()) { if (entry.getKey().equals("reparty") || entry.getKey().equals("rp")) { entry.setValue(new RepartyCommand()); } @@ -342,19 +195,15 @@ public class DankersSkyblockMod { } @SubscribeEvent - public void onGuiOpenEvent(GuiOpenEvent event){ - if(event.gui instanceof GuiMainMenu && usingOAM && !OAMWarning){ - if(!(event.gui instanceof WarningGui)){ - event.gui = new WarningGuiRedirect(new WarningGui()); - OAMWarning = true; - } + public void onGuiOpenEvent(GuiOpenEvent event) { + if (event.gui instanceof GuiMainMenu && usingOAM && !OAMWarning) { + event.gui = new WarningGuiRedirect(new WarningGui()); + OAMWarning = true; } } - // Update checker @SubscribeEvent public void onJoin(EntityJoinWorldEvent event) { - if (firstLaunch) { firstLaunch = false; ConfigHandler.writeBooleanConfig("misc", "firstLaunch", false); @@ -385,1133 +234,17 @@ public class DankersSkyblockMod { } }).start(); } - - if (!updateChecked) { - updateChecked = true; - - // MULTI THREAD DRIFTING - new Thread(() -> { - EntityPlayer player = Minecraft.getMinecraft().thePlayer; - - System.out.println("Checking for updates..."); - JsonObject latestRelease = APIHandler.getResponse("https://api.github.com/repos/bowser0000/SkyblockMod/releases/latest"); - - String latestTag = latestRelease.get("tag_name").getAsString(); - DefaultArtifactVersion currentVersion = new DefaultArtifactVersion(VERSION); - DefaultArtifactVersion latestVersion = new DefaultArtifactVersion(latestTag.substring(1)); - - if (currentVersion.compareTo(latestVersion) < 0) { - String releaseURL = latestRelease.get("html_url").getAsString(); - - ChatComponentText update = new ChatComponentText(EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + " [UPDATE] "); - update.setChatStyle(update.getChatStyle().setChatClickEvent(new ClickEvent(Action.OPEN_URL, releaseURL))); - - try { - Thread.sleep(2000); - } catch (InterruptedException ex) { - ex.printStackTrace(); - } - player.addChatMessage(new ChatComponentText(ERROR_COLOUR + MODID + " is outdated. Please update to " + latestTag + ".\n").appendSibling(update)); - } - }).start(); - } } @SubscribeEvent - public void onWorldChange(WorldEvent.Load event) { - riddleChest = null; - foundLivid = false; - livid = null; - lowestBlaze = null; - highestBlaze = null; - nextBonzoUse = 0; - } - - // It randomly broke, so I had to make it the highest priority - @SubscribeEvent(priority = EventPriority.HIGHEST) public void onChat(ClientChatReceivedEvent event) { String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); - + if (message.startsWith("Your new API key is ") && Utils.isOnHypixel()) { String apiKey = event.message.getSiblings().get(0).getChatStyle().getChatClickEvent().getValue(); ConfigHandler.writeStringConfig("api", "APIKey", apiKey); Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Set API key to " + DankersSkyblockMod.SECONDARY_COLOUR + apiKey)); } - - // Reparty command - // Getting party - if (RepartyCommand.gettingParty) { - if (message.contains("-----")) { - switch(RepartyCommand.Delimiter) { - case 0: - System.out.println("Get Party Delimiter Cancelled"); - RepartyCommand.Delimiter++; - event.setCanceled(true); - return; - case 1: - System.out.println("Done querying party"); - RepartyCommand.gettingParty = false; - RepartyCommand.Delimiter = 0; - event.setCanceled(true); - return; - } - }else if (message.startsWith("Party M") || message.startsWith("Party Leader")){ - EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; - - Pattern party_start_pattern = Pattern.compile("^Party Members \\((\\d+)\\)$"); - Pattern leader_pattern = Pattern.compile("^Party Leader: (?:\\[.+?] )?(\\w+) ●$"); - Pattern members_pattern = Pattern.compile(" (?:\\[.+?] )?(\\w+) ●"); - Matcher party_start = party_start_pattern.matcher(message); - Matcher leader = leader_pattern.matcher(message); - Matcher members = members_pattern.matcher(message); - - if (party_start.matches() && Integer.parseInt(party_start.group(1)) == 1) { - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "You cannot reparty yourself.")); - RepartyCommand.partyThread.interrupt(); - } else if (leader.matches() && !(leader.group(1).equals(player.getName()))) { - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "You are not party leader.")); - RepartyCommand.partyThread.interrupt(); - } else { - while (members.find()) { - String partyMember = members.group(1); - if (!partyMember.equals(player.getName())) { - RepartyCommand.party.add(partyMember); - System.out.println(partyMember); - } - } - } - event.setCanceled(true); - return; - } - } - // Disbanding party - if (RepartyCommand.disbanding) { - if (message.contains("-----")) { - switch (RepartyCommand.Delimiter) { - case 0: - System.out.println("Disband Delimiter Cancelled"); - RepartyCommand.Delimiter++; - event.setCanceled(true); - return; - case 1: - System.out.println("Done disbanding"); - RepartyCommand.disbanding = false; - RepartyCommand.Delimiter = 0; - event.setCanceled(true); - return; - } - } else if (message.endsWith("has disbanded the party!")) { - event.setCanceled(true); - return; - } - } - // Inviting - if (RepartyCommand.inviting) { - if (message.contains("-----")) { - switch (RepartyCommand.Delimiter) { - case 1: - event.setCanceled(true); - RepartyCommand.Delimiter = 0; - System.out.println("Player Invited!"); - RepartyCommand.inviting = false; - return; - case 0: - RepartyCommand.Delimiter++; - event.setCanceled(true); - return; - } - } else if (message.endsWith(" to the party! They have 60 seconds to accept.")) { - Pattern invitePattern = Pattern.compile("(?:(?:\\[.+?] )?(?:\\w+) invited )(?:\\[.+?] )?(\\w+)"); - Matcher invitee = invitePattern.matcher(message); - if (invitee.find()) { - System.out.println("" + invitee.group(1) + ": " + RepartyCommand.repartyFailList.remove(invitee.group(1))); - } - event.setCanceled(true); - return; - } else if (message.contains("Couldn't find a player") || message.contains("You cannot invite that player")) { - event.setCanceled(true); - return; - } - } - // Fail Inviting - if (RepartyCommand.failInviting) { - if (message.contains("-----")) { - switch (RepartyCommand.Delimiter) { - case 1: - event.setCanceled(true); - RepartyCommand.Delimiter = 0; - System.out.println("Player Invited!"); - RepartyCommand.inviting = false; - return; - case 0: - RepartyCommand.Delimiter++; - event.setCanceled(true); - return; - } - } else if (message.endsWith(" to the party! They have 60 seconds to accept.")) { - Pattern invitePattern = Pattern.compile("(?:(?:\\[.+?] )?(?:\\w+) invited )(?:\\[.+?] )?(\\w+)"); - Matcher invitee = invitePattern.matcher(message); - if (invitee.find()) { - System.out.println("" + invitee.group(1) + ": " + RepartyCommand.repartyFailList.remove(invitee.group(1))); - } - event.setCanceled(true); - return; - } else if (message.contains("Couldn't find a player") || message.contains("You cannot invite that player")) { - event.setCanceled(true); - return; - } - } - - if (!Utils.inSkyblock) return; - - // Action Bar - if (event.type == 2) { - EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; - 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(); - } - } - timeSinceGained = System.currentTimeMillis() / 1000; - - int limit = section.contains("Farming") || section.contains("Enchanting") || section.contains("Mining") ? 60 : 50; - double currentXP = Double.parseDouble(section.substring(section.indexOf("(") + 1, section.indexOf("/")).replace(",", "")); - int xpToLevelUp = Integer.parseInt(section.substring(section.indexOf("/") + 1, section.indexOf(")")).replaceAll(",", "")); - xpLeft = xpToLevelUp - currentXP; - int previousXP = Utils.getPastXpEarned(xpToLevelUp, limit); - double totalXP = currentXP + previousXP; - - String skill = section.substring(section.indexOf(" ") + 1, section.lastIndexOf(" ")); - switch (skill) { - case "Farming": - lastSkill = "Farming"; - if (farmingXP != 0) { - if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) farmingXPGained += totalXP - farmingXP; - } - farmingXP = totalXP; - break; - case "Mining": - lastSkill = "Mining"; - if (miningXP != 0) { - if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) miningXPGained += totalXP - miningXP; - } - miningXP = totalXP; - break; - case "Combat": - lastSkill = "Combat"; - if (combatXP != 0) { - if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) combatXPGained += totalXP - combatXP; - } - combatXP = totalXP; - break; - case "Foraging": - lastSkill = "Foraging"; - if (foragingXP != 0) { - if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) foragingXPGained += totalXP - foragingXP; - } - foragingXP = totalXP; - break; - case "Fishing": - lastSkill = "Fishing"; - if (fishingXP != 0) { - if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) fishingXPGained += totalXP - fishingXP; - } - fishingXP = totalXP; - break; - case "Enchanting": - lastSkill = "Enchanting"; - if (enchantingXP != 0) { - if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) enchantingXPGained += totalXP - enchantingXP; - } - enchantingXP = totalXP; - break; - case "Alchemy": - lastSkill = "Alchemy"; - if (alchemyXP != 0) { - if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) alchemyXPGained += totalXP - alchemyXP; - } - alchemyXP = totalXP; - break; - default: - System.err.println("Unknown skill."); - } - } - - if (ToggleCommand.skill50DisplayToggled && !section.contains("Runecrafting")) { - String xpGained = section.substring(section.indexOf("+"), section.indexOf("(") - 1); - double currentXp = Double.parseDouble(section.substring(section.indexOf("(") + 1, section.indexOf("/")).replace(",", "")); - int limit; - int totalXp; - if (section.contains("Farming") || section.contains("Enchanting") || section.contains("Mining")) { - limit = 60; - totalXp = 111672425; - } else { - limit = 50; - totalXp = 55172425; - } - int previousXp = Utils.getPastXpEarned(Integer.parseInt(section.substring(section.indexOf("/") + 1, section.indexOf(")")).replaceAll(",", "")), limit); - double percentage = 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 + "%"; - } - } - } - return; - } - - if (ToggleCommand.bonzoTimerToggled && Utils.inDungeons && message.contains("Bonzo's Mask") && message.contains("saved your life!")) { - double usedTime = System.currentTimeMillis() / 1000; - Minecraft mc = Minecraft.getMinecraft(); - EntityPlayerSP player = mc.thePlayer; - ItemStack bonzoMask = player.getCurrentArmor(3); - if (bonzoMask != null && bonzoMask.getItem() == Items.skull) { - int cooldownSeconds = 0; - for (String line : Utils.getItemLore(bonzoMask)) { - String stripped = StringUtils.stripControlCodes(line); - if (stripped.startsWith("Cooldown: ")) - cooldownSeconds = Integer.parseInt(stripped.replaceAll("[^\\d]", "")); - } - System.out.println("Parsed Bonzo Mask Cooldown: " + cooldownSeconds); - if (cooldownSeconds > 0) - nextBonzoUse = usedTime + cooldownSeconds; - } - } - - // Dungeon chat spoken by an NPC, containing : - if (ToggleCommand.threeManToggled && Utils.inDungeons && 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(ANSWER_COLOUR + EnumChatFormatting.BOLD + StringUtils.stripControlCodes(npcName) + MAIN_COLOUR + " has the blessing.")); - if (riddleChest == null) { - List entities = mc.theWorld.getLoadedEntityList(); - for (Entity entity : entities) { - if (entity == null || !entity.hasCustomName()) continue; - if (entity.getCustomNameTag().contains(npcName)) { - BlockPos npcLocation = new BlockPos(entity.posX, 69, entity.posZ); - if (mc.theWorld.getBlockState(npcLocation.north()).getBlock() == Blocks.chest) { - riddleChest = npcLocation.north(); - } else if (mc.theWorld.getBlockState(npcLocation.east()).getBlock() == Blocks.chest) { - riddleChest = npcLocation.east(); - } else if (mc.theWorld.getBlockState(npcLocation.south()).getBlock() == Blocks.chest) { - riddleChest = npcLocation.south(); - } else if (mc.theWorld.getBlockState(npcLocation.west()).getBlock() == Blocks.chest) { - riddleChest = npcLocation.west(); - } else { - System.out.print("Could not find correct riddle chest."); - } - break; - } - } - } - break; - } - } - } - - if (ToggleCommand.necronNotificationsToggled && Utils.inDungeons && message.contains("[BOSS] Necron:")) { - Minecraft mc = Minecraft.getMinecraft(); - World world = mc.theWorld; - if (message.contains("You tricked me!") || message.contains("That beam, it hurts! IT HURTS!!")) { - Utils.createTitle(EnumChatFormatting.RED + "NECRON STUCK!", 2); - } else if (message.contains("STOP USING MY FACTORY AGAINST ME!") || message.contains("OOF") || message.contains("ANOTHER TRAP!! YOUR TRICKS ARE FUTILE!") || message.contains("SERIOUSLY? AGAIN?!") || message.contains("STOP!!!!!")) { - List necronLabels = world.getEntities(EntityArmorStand.class, (entity -> { - if (!entity.hasCustomName()) return false; - if (!entity.getCustomNameTag().contains("Necron")) return false; - return true; - })); - if (necronLabels.size() == 0) { - Utils.createTitle(EnumChatFormatting.WHITE + "NECRON STUNNED!", 2); - } else { - EntityArmorStand necron = necronLabels.get(0); - double x = necron.posX; - double z = necron.posZ; - - BlockPos blockPos = new BlockPos(x, 168, z); - - IBlockState blockState = world.getBlockState(blockPos); - Block block = blockState.getBlock(); - - 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); - } - } - - } - } 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!")) { - Utils.createTitle(EnumChatFormatting.RED + "EXPLOSION OVER!", 2); - } - } - - if (message.contains("[BOSS] The Watcher: You have proven yourself. You may pass.")) { - watcherClearTime = System.currentTimeMillis() / 1000; - } - if (message.contains("[BOSS] The Watcher: That will be enough for now.")) { - if (ToggleCommand.watcherReadyToggled) Utils.createTitle(EnumChatFormatting.RED + "WATCHER READY", 2); - } - if (message.contains("PUZZLE FAIL! ") || message.contains("chose the wrong answer! I shall never forget this moment")) { - puzzleFails++; - } - - if (message.contains(":")) return; - - // Spirit Sceptre - if (!ToggleCommand.sceptreMessages && message.contains("Your Spirit Sceptre hit ")) { - event.setCanceled(true); - return; - } - // Midas Staff - if (!ToggleCommand.midasStaffMessages && message.contains("Your Molten Wave hit ")) { - event.setCanceled(true); - return; - } - // Heals - if (!ToggleCommand.healMessages && message.contains(" health!") && (message.contains("You healed ") || message.contains(" healed you for "))) { - event.setCanceled(true); - return; - } - // Ability Cooldown - if (!ToggleCommand.cooldownMessages && message.contains("This ability is on cooldown for ")) { - event.setCanceled(true); - return; - } - // Out of mana messages - if (!ToggleCommand.manaMessages && message.contains("You do not have enough mana to do this!")) { - event.setCanceled(true); - return; - } - // Implosion - if (!ToggleCommand.implosionMessages) { - if (message.contains("Your Implosion hit ") || message.contains("There are blocks in the way")) { - event.setCanceled(true); - return; - } - } - - if (ToggleCommand.oruoToggled && Utils.inDungeons) { - 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; - } - } - } - - // 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); - return; - } - } - } - - 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(); - } - } - } - - if (ToggleCommand.golemAlertToggled) { - if (message.contains("The ground begins to shake as an Endstone Protector rises from below!")) { - Utils.createTitle(EnumChatFormatting.RED + "GOLEM SPAWNING!", 3); - } - } - - if (message.contains("Yum! You gain +") && message.contains(" for 48 hours!")) { - cakeTime = System.currentTimeMillis() / 1000 + 172800; // Add 48 hours - ConfigHandler.writeDoubleConfig("misc", "cakeTime", cakeTime); - } - - boolean wolfRNG = false; - boolean spiderRNG = false; - boolean zombieRNG = false; - // T6 books - if (message.contains("VERY RARE DROP! (Enchanted Book)") || message.contains("CRAZY RARE DROP! (Enchanted Book)")) { - // Loop through scoreboard to see what boss you're doing - List scoreboard = ScoreboardHandler.getSidebarLines(); - for (String s : scoreboard) { - String sCleaned = ScoreboardHandler.cleanSB(s); - if (sCleaned.contains("Sven Packmaster")) { - LootCommand.wolfBooks++; - ConfigHandler.writeIntConfig("wolf", "book", LootCommand.wolfBooks); - } else if (sCleaned.contains("Tarantula Broodfather")) { - LootCommand.spiderBooks++; - ConfigHandler.writeIntConfig("spider", "book", LootCommand.spiderBooks); - } else if (sCleaned.contains("Revenant Horror")) { - LootCommand.zombieBooks++; - ConfigHandler.writeIntConfig("zombie", "book", LootCommand.zombieBooks); - } - } - } - - // Wolf - if (message.contains("Talk to Maddox to claim your Wolf Slayer XP!")) { - LootCommand.wolfSvens++; - LootCommand.wolfSvensSession++; - if (LootCommand.wolfBosses != -1) { - LootCommand.wolfBosses++; - } - if (LootCommand.wolfBossesSession != -1) { - LootCommand.wolfBossesSession++; - } - ConfigHandler.writeIntConfig("wolf", "svens", LootCommand.wolfSvens); - ConfigHandler.writeIntConfig("wolf", "bossRNG", LootCommand.wolfBosses); - } else if (message.contains("RARE DROP! (Hamster Wheel)")) { - LootCommand.wolfWheelsDrops++; - LootCommand.wolfWheelsDropsSession++; - ConfigHandler.writeIntConfig("wolf", "wheelDrops", LootCommand.wolfWheelsDrops); - } else if (message.contains("VERY RARE DROP! (") && message.contains(" Spirit Rune I)")) { // Removing the unicode here *should* fix rune drops not counting - LootCommand.wolfSpirits++; - LootCommand.wolfSpiritsSession++; - ConfigHandler.writeIntConfig("wolf", "spirit", LootCommand.wolfSpirits); - } else if (message.contains("CRAZY RARE DROP! (Red Claw Egg)")) { - wolfRNG = true; - LootCommand.wolfEggs++; - LootCommand.wolfEggsSession++; - ConfigHandler.writeIntConfig("wolf", "egg", LootCommand.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; - LootCommand.wolfCoutures++; - LootCommand.wolfCouturesSession++; - ConfigHandler.writeIntConfig("wolf", "couture", LootCommand.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; - LootCommand.wolfBaits++; - LootCommand.wolfBaitsSession++; - ConfigHandler.writeIntConfig("wolf", "bait", LootCommand.wolfBaits); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.AQUA + "GRIZZLY BAIT!", 3); - } else if (message.contains("CRAZY RARE DROP! (Overflux Capacitor)")) { - wolfRNG = true; - LootCommand.wolfFluxes++; - LootCommand.wolfFluxesSession++; - ConfigHandler.writeIntConfig("wolf", "flux", LootCommand.wolfFluxes); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "OVERFLUX CAPACITOR!", 5); - } else if (message.contains("Talk to Maddox to claim your Spider Slayer XP!")) { // Spider - LootCommand.spiderTarantulas++; - LootCommand.spiderTarantulasSession++; - if (LootCommand.spiderBosses != -1) { - LootCommand.spiderBosses++; - } - if (LootCommand.spiderBossesSession != -1) { - LootCommand.spiderBossesSession++; - } - ConfigHandler.writeIntConfig("spider", "tarantulas", LootCommand.spiderTarantulas); - ConfigHandler.writeIntConfig("spider", "bossRNG", LootCommand.spiderBosses); - } else if (message.contains("RARE DROP! (Toxic Arrow Poison)")) { - LootCommand.spiderTAPDrops++; - LootCommand.spiderTAPDropsSession++; - ConfigHandler.writeIntConfig("spider", "tapDrops", LootCommand.spiderTAPDrops); - } else if (message.contains("VERY RARE DROP! (") && message.contains(" Bite Rune I)")) { - LootCommand.spiderBites++; - LootCommand.spiderBitesSession++; - ConfigHandler.writeIntConfig("spider", "bite", LootCommand.spiderBites); - } else if (message.contains("VERY RARE DROP! (Spider Catalyst)")) { - LootCommand.spiderCatalysts++; - LootCommand.spiderCatalystsSession++; - ConfigHandler.writeIntConfig("spider", "catalyst", LootCommand.spiderCatalysts); - } else if (message.contains("CRAZY RARE DROP! (Fly Swatter)")) { - spiderRNG = true; - LootCommand.spiderSwatters++; - LootCommand.spiderSwattersSession++; - ConfigHandler.writeIntConfig("spider", "swatter", LootCommand.spiderSwatters); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.LIGHT_PURPLE + "FLY SWATTER!", 3); - } else if (message.contains("CRAZY RARE DROP! (Tarantula Talisman")) { - spiderRNG = true; - LootCommand.spiderTalismans++; - LootCommand.spiderTalismansSession++; - ConfigHandler.writeIntConfig("spider", "talisman", LootCommand.spiderTalismans); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "TARANTULA TALISMAN!", 3); - } else if (message.contains("CRAZY RARE DROP! (Digested Mosquito)")) { - spiderRNG = true; - LootCommand.spiderMosquitos++; - LootCommand.spiderMosquitosSession++; - ConfigHandler.writeIntConfig("spider", "mosquito", LootCommand.spiderMosquitos); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GOLD + "DIGESTED MOSQUITO!", 5); - } else if (message.contains("Talk to Maddox to claim your Zombie Slayer XP!")) { // Zombie - LootCommand.zombieRevs++; - LootCommand.zombieRevsSession++; - if (LootCommand.zombieBosses != -1) { - LootCommand.zombieBosses++; - } - if (LootCommand.zombieBossesSession != 1) { - LootCommand.zombieBossesSession++; - } - ConfigHandler.writeIntConfig("zombie", "revs", LootCommand.zombieRevs); - ConfigHandler.writeIntConfig("zombie", "bossRNG", LootCommand.zombieBosses); - } else if (message.contains("RARE DROP! (Foul Flesh)")) { - LootCommand.zombieFoulFleshDrops++; - LootCommand.zombieFoulFleshDropsSession++; - ConfigHandler.writeIntConfig("zombie", "foulFleshDrops", LootCommand.zombieFoulFleshDrops); - } else if (message.contains("VERY RARE DROP! (Revenant Catalyst)")) { - LootCommand.zombieRevCatas++; - LootCommand.zombieRevCatasSession++; - ConfigHandler.writeIntConfig("zombie", "revCatalyst", LootCommand.zombieRevCatas); - } else if (message.contains("VERY RARE DROP! (") && message.contains(" Pestilence Rune I)")) { - LootCommand.zombiePestilences++; - LootCommand.zombiePestilencesSession++; - ConfigHandler.writeIntConfig("zombie", "pestilence", LootCommand.zombiePestilences); - } else if (message.contains("VERY RARE DROP! (Undead Catalyst)")) { - LootCommand.zombieUndeadCatas++; - LootCommand.zombieUndeadCatasSession++; - ConfigHandler.writeIntConfig("zombie", "undeadCatalyst", LootCommand.zombieUndeadCatas); - } else if (message.contains("CRAZY RARE DROP! (Beheaded Horror)")) { - zombieRNG = true; - LootCommand.zombieBeheadeds++; - LootCommand.zombieBeheadedsSession++; - ConfigHandler.writeIntConfig("zombie", "beheaded", LootCommand.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; - LootCommand.zombieSnakes++; - LootCommand.zombieSnakesSession++; - ConfigHandler.writeIntConfig("zombie", "snake", LootCommand.zombieSnakes); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.DARK_GREEN + "SNAKE RUNE!", 3); - } else if (message.contains("CRAZY RARE DROP! (Scythe Blade)")) { - zombieRNG = true; - LootCommand.zombieScythes++; - LootCommand.zombieScythesSession++; - ConfigHandler.writeIntConfig("zombie", "scythe", LootCommand.zombieScythes); - if (ToggleCommand.rngesusAlerts) Utils.createTitle(EnumChatFormatting.GOLD + "SCYTHE BLADE!", 5); - } else if (message.contains("GOOD CATCH!")) { // Fishing - LootCommand.goodCatches++; - LootCommand.goodCatchesSession++; - ConfigHandler.writeIntConfig("fishing", "goodCatch", LootCommand.goodCatches); - } else if (message.contains("GREAT CATCH!")) { - LootCommand.greatCatches++; - LootCommand.greatCatchesSession++; - ConfigHandler.writeIntConfig("fishing", "greatCatch", LootCommand.greatCatches); - } else if (message.contains("A Squid appeared")) { - LootCommand.squids++; - LootCommand.squidsSession++; - ConfigHandler.writeIntConfig("fishing", "squid", LootCommand.squids); - increaseSeaCreatures(); - } else if (message.contains("You caught a Sea Walker")) { - LootCommand.seaWalkers++; - LootCommand.seaWalkersSession++; - ConfigHandler.writeIntConfig("fishing", "seaWalker", LootCommand.seaWalkers); - increaseSeaCreatures(); - } else if (message.contains("Pitch darkness reveals a Night Squid")) { - LootCommand.nightSquids++; - LootCommand.nightSquidsSession++; - ConfigHandler.writeIntConfig("fishing", "nightSquid", LootCommand.nightSquids); - increaseSeaCreatures(); - } else if (message.contains("You stumbled upon a Sea Guardian")) { - LootCommand.seaGuardians++; - LootCommand.seaGuardiansSession++; - ConfigHandler.writeIntConfig("fishing", "seaGuardian", LootCommand.seaGuardians); - increaseSeaCreatures(); - } else if (message.contains("It looks like you've disrupted the Sea Witch's brewing session. Watch out, she's furious")) { - LootCommand.seaWitches++; - LootCommand.seaWitchesSession++; - ConfigHandler.writeIntConfig("fishing", "seaWitch", LootCommand.seaWitches); - increaseSeaCreatures(); - } else if (message.contains("You reeled in a Sea Archer")) { - LootCommand.seaArchers++; - LootCommand.seaArchersSession++; - ConfigHandler.writeIntConfig("fishing", "seaArcher", LootCommand.seaArchers); - increaseSeaCreatures(); - } else if (message.contains("The Monster of the Deep has emerged")) { - LootCommand.monsterOfTheDeeps++; - LootCommand.monsterOfTheDeepsSession++; - ConfigHandler.writeIntConfig("fishing", "monsterOfDeep", LootCommand.monsterOfTheDeeps); - increaseSeaCreatures(); - } else if (message.contains("Huh? A Catfish")) { - LootCommand.catfishes++; - LootCommand.catfishesSession++; - ConfigHandler.writeIntConfig("fishing", "catfish", LootCommand.catfishes); - increaseSeaCreatures(); - } else if (message.contains("Is this even a fish? It's the Carrot King")) { - LootCommand.carrotKings++; - LootCommand.carrotKingsSession++; - ConfigHandler.writeIntConfig("fishing", "carrotKing", LootCommand.carrotKings); - increaseSeaCreatures(); - } else if (message.contains("Gross! A Sea Leech")) { - LootCommand.seaLeeches++; - LootCommand.seaLeechesSession++; - ConfigHandler.writeIntConfig("fishing", "seaLeech", LootCommand.seaLeeches); - increaseSeaCreatures(); - } else if (message.contains("You've discover