From 1c464c705afa53b82d563e6fa05e776f16571e28 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Fri, 5 Mar 2021 08:22:22 +0100 Subject: fitted my code with the rework added Shadow Fury ability block added Special Hoe right click block added hide tooltips in melodys harp --- src/main/java/me/Danker/features/BlockAbilities.java | 12 ++++++++++++ .../java/me/Danker/features/HideTooltipsInExperiments.java | 3 +++ 2 files changed, 15 insertions(+) (limited to 'src/main/java/me/Danker/features') diff --git a/src/main/java/me/Danker/features/BlockAbilities.java b/src/main/java/me/Danker/features/BlockAbilities.java index 19a887c..814fd65 100644 --- a/src/main/java/me/Danker/features/BlockAbilities.java +++ b/src/main/java/me/Danker/features/BlockAbilities.java @@ -27,6 +27,12 @@ public class BlockAbilities { if (ToggleCommand.lividDaggerToggled && item.getDisplayName().contains("Livid Dagger")) { event.setCanceled(true); } + if (ToggleCommand.shadowFuryToggled && item.getDisplayName().contains("Shadow Fury")) { + event.setCanceled(true); + } + if (ToggleCommand.specialHoeRightClick && (item.getDisplayName().contains("Mathematical Hoe") || item.getDisplayName().contains("Potato Hoe") || item.getDisplayName().contains("Wheat Hoe") || item.getDisplayName().contains("Carrot Hoe") || item.getDisplayName().contains("Sugar Cane Hoe") || item.getDisplayName().contains("Nether Warts Hoe"))) { + event.setCanceled(true); + } } else if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) { Block block = Minecraft.getMinecraft().theWorld.getBlockState(event.pos).getBlock(); @@ -77,6 +83,12 @@ public class BlockAbilities { if (ToggleCommand.lividDaggerToggled && item.getDisplayName().contains("Livid Dagger")) { event.setCanceled(true); } + if (ToggleCommand.shadowFuryToggled && item.getDisplayName().contains("Shadow Fury")) { + event.setCanceled(true); + } + } + if (ToggleCommand.specialHoeRightClick && (item.getDisplayName().contains("Mathematical Hoe") || item.getDisplayName().contains("Potato Hoe") || item.getDisplayName().contains("Wheat Hoe") || item.getDisplayName().contains("Carrot Hoe") || item.getDisplayName().contains("Sugar Cane Hoe") || item.getDisplayName().contains("Nether Warts Hoe"))) { + event.setCanceled(true); } } } diff --git a/src/main/java/me/Danker/features/HideTooltipsInExperiments.java b/src/main/java/me/Danker/features/HideTooltipsInExperiments.java index 5866fc8..6e295e1 100644 --- a/src/main/java/me/Danker/features/HideTooltipsInExperiments.java +++ b/src/main/java/me/Danker/features/HideTooltipsInExperiments.java @@ -29,6 +29,9 @@ public class HideTooltipsInExperiments { if (ToggleCommand.hideTooltipsInExperimentAddonsToggled && (chestName.startsWith("Ultrasequencer (") || chestName.startsWith("Chronomatron ("))) { event.toolTip.clear(); } + if (ToggleCommand.melodyTooltips && chestName.startsWith("Harp")) { + event.toolTip.clear(); + } } } -- cgit From ed93b04124db9b8944ddd1ed33d0f4dabf4a486b Mon Sep 17 00:00:00 2001 From: RabbitType99 Date: Thu, 11 Mar 2021 19:48:53 +0100 Subject: Added Ghost Tracker/ Fixed Installer crashes due to renaming ModID --- .../java/DefenitlyNotAJoikedInstallerFrame.java | 10 ++-- .../java/me/Danker/commands/DisplayCommand.java | 11 ++++- .../java/me/Danker/commands/ToggleCommand.java | 20 ++++++-- src/main/java/me/Danker/features/AutoDisplay.java | 3 ++ .../java/me/Danker/features/loot/LootDisplay.java | 30 ++++++++++++ .../java/me/Danker/features/loot/LootTracker.java | 56 ++++++++++++++++++++++ src/main/java/me/Danker/gui/DisplayGui.java | 8 +++- .../java/me/Danker/handlers/ConfigHandler.java | 12 ++++- 8 files changed, 136 insertions(+), 14 deletions(-) (limited to 'src/main/java/me/Danker/features') diff --git a/src/main/java/DefenitlyNotAJoikedInstallerFrame.java b/src/main/java/DefenitlyNotAJoikedInstallerFrame.java index d52d65b..e4c9b64 100644 --- a/src/main/java/DefenitlyNotAJoikedInstallerFrame.java +++ b/src/main/java/DefenitlyNotAJoikedInstallerFrame.java @@ -155,7 +155,7 @@ public class DefenitlyNotAJoikedInstallerFrame extends JFrame implements ActionL versionInfo.setFont(new Font(Font.DIALOG, Font.BOLD, 14)); versionInfo.setHorizontalAlignment(SwingConstants.CENTER); versionInfo.setPreferredSize(new Dimension(w, h)); - versionInfo.setText("Danker's SkyblockMod - Installer by Biscuit
for Minecraft 1.8.9
"); + versionInfo.setText("Danker's Skyblock Mod - Installer by Biscuit
for Minecraft 1.8.9
"); y += h-5; } catch (Throwable ivjExc) { @@ -175,7 +175,7 @@ public class DefenitlyNotAJoikedInstallerFrame extends JFrame implements ActionL descriptionText = new JTextArea(); descriptionText.setName("TextArea"); setTextAreaProperties(descriptionText); - descriptionText.setText("This installer will copy Danker's SkyblockMod into your forge mods folder for you, and replace any old versions that already exist. " + + descriptionText.setText("This installer will copy Danker's Skyblock Mod into your forge mods folder for you, and replace any old versions that already exist. " + "Close this if you prefer to do this yourself!"); descriptionText.setWrapStyleWord(true); @@ -479,7 +479,7 @@ public class DefenitlyNotAJoikedInstallerFrame extends JFrame implements ActionL if (mcModInfo != null) { InputStream inputStream = jarFile.getInputStream(mcModInfo); String modID = getModIDFromInputStream(inputStream); - if (modID.equals("dankersskyblockmod")) { + if (modID.equals("Danker's Skyblock Mod")) { jarFile.close(); try { boolean deleted = file.delete(); @@ -589,11 +589,11 @@ public class DefenitlyNotAJoikedInstallerFrame extends JFrame implements ActionL } public void showMessage(String message) { - JOptionPane.showMessageDialog(null, message, "Danker's SkyblockMod", JOptionPane.INFORMATION_MESSAGE); + JOptionPane.showMessageDialog(null, message, "Danker's Skyblock Mod", JOptionPane.INFORMATION_MESSAGE); } public void showErrorMessage(String message) { - JOptionPane.showMessageDialog(null, message, "Danker's SkyblockMod - Error", JOptionPane.ERROR_MESSAGE); + JOptionPane.showMessageDialog(null, message, "Danker's Skyblock Mod - Error", JOptionPane.ERROR_MESSAGE); } public enum OperatingSystem { diff --git a/src/main/java/me/Danker/commands/DisplayCommand.java b/src/main/java/me/Danker/commands/DisplayCommand.java index 74f142a..7760ec9 100644 --- a/src/main/java/me/Danker/commands/DisplayCommand.java +++ b/src/main/java/me/Danker/commands/DisplayCommand.java @@ -21,7 +21,7 @@ public class DisplayCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " [winter/festival/spooky/session/f(1-7)]"; + return "/" + getCommandName() + " [winter/festival/spooky/session/f(1-7)]"; } @Override @@ -32,7 +32,7 @@ public class DisplayCommand extends CommandBase { @Override public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "fishing", "catacombs", "mythological", "auto", "off"); + return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "fishing", "catacombs", "mythological", "ghost", "auto", "off"); } else if (args.length == 2 && args[0].equalsIgnoreCase("fishing")) { return getListOfStringsMatchingLastWord(args, "winter", "festival", "spooky", "session"); } else if (args.length == 2 && args[0].equalsIgnoreCase("catacombs")) { @@ -192,6 +192,13 @@ public class DisplayCommand extends CommandBase { return; } break; + case "ghost": + if (showSession) { + LootDisplay.display = "ghost_session"; + } else { + LootDisplay.display = "ghost"; + } + case "auto": LootDisplay.auto = true; player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Display set to " + DankersSkyblockMod.SECONDARY_COLOUR + "auto" + DankersSkyblockMod.MAIN_COLOUR + ".")); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 294cf1a..2a4f588 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -18,6 +18,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean goldenToggled; public static boolean slayerCountTotal; public static boolean rngesusAlerts; + public static boolean ghostDisplay; public static boolean splitFishing; public static boolean chatMaddoxToggled; public static boolean spiritBearAlerts; @@ -25,6 +26,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean lividDaggerToggled; public static boolean petColoursToggled; public static boolean dungeonTimerToggled; + public static boolean ghostTimerToggled; public static boolean golemAlertToggled; public static boolean expertiseLoreToggled; public static boolean skill50DisplayToggled; @@ -78,8 +80,8 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", + return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", "ghostdisplay", "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "lividdagger", - "flowerweapons", "sceptremessages", "petcolors", "dungeontimer", "golemalerts", + "flowerweapons", "sceptremessages", "petcolors", "dungeontimer", /*"ghosttimer",*/ "golemalerts", "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", "implosionmessages", "healmessages", "cooldownmessages", "manamessages", "killcombomessages", "caketimer", "lowhealthnotify", "autoskilltracker", "lividsolver", @@ -148,6 +150,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "RNGesusAlerts", rngesusAlerts); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Slayer RNGesus alerts has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + rngesusAlerts + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "ghostDisplay": + ghostDisplay = !ghostDisplay; + ConfigHandler.writeBooleanConfig("toggles", "GhostDisplay", ghostDisplay); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Ghost Display has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + ghostDisplay + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "splitfishing": splitFishing = !splitFishing; ConfigHandler.writeBooleanConfig("toggles", "SplitFishing", splitFishing); @@ -224,6 +231,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "DungeonTimer", dungeonTimerToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Dungeon timer has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + dungeonTimerToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + /*case "ghostTimer": + ghostTimerToggled = !ghostTimerToggled; + ConfigHandler.writeBooleanConfig("toggles", "GhostTimer", ghostTimerToggled); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Ghost timer has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + ghostTimerToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; */ case "golemalerts": golemAlertToggled = !golemAlertToggled; ConfigHandler.writeBooleanConfig("toggles", "GolemAlerts", golemAlertToggled); diff --git a/src/main/java/me/Danker/features/AutoDisplay.java b/src/main/java/me/Danker/features/AutoDisplay.java index 876fb6a..182c0b4 100644 --- a/src/main/java/me/Danker/features/AutoDisplay.java +++ b/src/main/java/me/Danker/features/AutoDisplay.java @@ -37,6 +37,9 @@ public class AutoDisplay { } else if (sCleaned.contains("Revenant Horror")) { LootDisplay.display = "zombie"; found = true; + } else if (sCleaned.contains("The Mist")){ + LootDisplay.display = "ghost"; + found = true; } else if (sCleaned.contains("The Catacombs (")) { if (sCleaned.contains("F1")) { LootDisplay.display = "catacombs_floor_one"; diff --git a/src/main/java/me/Danker/features/loot/LootDisplay.java b/src/main/java/me/Danker/features/loot/LootDisplay.java index 363b70c..e3f43e8 100644 --- a/src/main/java/me/Danker/features/loot/LootDisplay.java +++ b/src/main/java/me/Danker/features/loot/LootDisplay.java @@ -892,6 +892,36 @@ public class LootDisplay { EnumChatFormatting.AQUA + Utils.getMoneySpent(LootTracker.f7CoinsSpentSession) + "\n" + EnumChatFormatting.AQUA + Utils.getTimeBetween(0, LootTracker.f7TimeSpentSession); break; + case "ghost_session": + dropsText = EnumChatFormatting.GOLD + "Bags of Cash:\n" + + EnumChatFormatting.BLUE + "Sorrows:\n" + + EnumChatFormatting.DARK_PURPLE + "Ghosty Boots:\n" + + EnumChatFormatting.DARK_PURPLE + "Voltas:\n" + + EnumChatFormatting.DARK_PURPLE + "Plasmas:" ; // + \n + // EnumChatFormatting.AQUA + "Time Spent:" + + countText = EnumChatFormatting.GOLD + nf.format(LootTracker.bagOfCashSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(LootTracker.sorrowSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.ghostlyBootsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.voltaSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.plasmaSession); //+ "\n" + + // EnumChatFormatting.AQUA + nf.format(LootTracker.ghostsTimeSpentSession); + break; + case "ghost": + dropsText = EnumChatFormatting.GOLD + "Bags of Cash:\n" + + EnumChatFormatting.BLUE + "Sorrows:\n" + + EnumChatFormatting.DARK_PURPLE + "Ghosty Boots:\n" + + EnumChatFormatting.DARK_PURPLE + "Voltas:\n" + + EnumChatFormatting.DARK_PURPLE + "Plasmas:" ; // + \n + // EnumChatFormatting.AQUA + "Time Spent:" + + countText = EnumChatFormatting.GOLD + nf.format(LootTracker.bagOfCashSession) + "\n" + + EnumChatFormatting.BLUE + nf.format(LootTracker.sorrowSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.ghostlyBootsSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.voltaSession) + "\n" + + EnumChatFormatting.DARK_PURPLE + nf.format(LootTracker.plasmaSession); //+ "\n" + + // EnumChatFormatting.AQUA + nf.format(LootTracker.ghostsTimeSpentSession); + break; + + default: System.out.println("Display was an unknown value, turning off."); display = "off"; diff --git a/src/main/java/me/Danker/features/loot/LootTracker.java b/src/main/java/me/Danker/features/loot/LootTracker.java index f7f7044..6430bc2 100644 --- a/src/main/java/me/Danker/features/loot/LootTracker.java +++ b/src/main/java/me/Danker/features/loot/LootTracker.java @@ -176,6 +176,15 @@ public class LootTracker { public static int witherBoots; public static double f7CoinsSpent; public static double f7TimeSpent; + // Ghosts + public static int sorrows = 0; + public static int bagOfCashs = 0; + public static int voltas = 0; + public static int plasmas = 0; + public static int ghostlyBoots = 0; + // public static double ghostsTimeSpent = -1; + + // Single sessions (No config saves) // Wolf @@ -336,6 +345,14 @@ public class LootTracker { public static int witherBootsSession = 0; public static double f7CoinsSpentSession = 0; public static double f7TimeSpentSession = 0; + // Ghosts + public static int sorrowSession = 0; + public static int bagOfCashSession = 0; + public static int voltaSession = 0; + public static int plasmaSession = 0; + public static int ghostlyBootsSession = 0; + // public static double ghostsSecondsSinceStarts = 0; + static double checkItemsNow = 0; static double itemsChecked = 0; @@ -344,6 +361,7 @@ public class LootTracker { public void onChat(ClientChatReceivedEvent event) { String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + if (!Utils.inSkyblock) return; if (event.type == 2) return; if (message.contains(":")) return; @@ -352,6 +370,8 @@ public class LootTracker { boolean spiderRNG = false; boolean zombieRNG = false; + + // Slayer tracker // T6 books if (message.contains("VERY RARE DROP! (Enchanted Book)") || message.contains("CRAZY RARE DROP! (Enchanted Book)")) { @@ -369,6 +389,7 @@ public class LootTracker { zombieBooks++; ConfigHandler.writeIntConfig("zombie", "book", zombieBooks); } + } } @@ -957,6 +978,41 @@ public class LootTracker { ConfigHandler.writeIntConfig("mythological", "minosInquisitor", minosInquisitors); } } + + + if (message.contains("RARE DROP!")) { + if (message.contains("Sorrow")) { + sorrows++; + sorrowSession++; + ConfigHandler.writeIntConfig("ghosts", "sorrow", sorrows); + } + if (message.contains("Volta")) { + voltas++; + voltaSession++; + ConfigHandler.writeIntConfig("ghosts", "volta", voltas); + } + if (message.contains("Plasma")) { + plasmas++; + plasmaSession++; + ConfigHandler.writeIntConfig("ghosts", "plasma", plasmas); + } + if (message.contains("Ghostly Boots")) { + ghostlyBoots++; + ghostlyBootsSession++; + ConfigHandler.writeIntConfig("ghosts", "ghostlyBoots", ghostlyBoots); + } + if (message.contains("Bag of Cash")) { + bagOfCashs++; + bagOfCashSession++; + ConfigHandler.writeIntConfig("ghosts", "bagOfCash", bagOfCashs); + } + + + + } + + + } @SubscribeEvent diff --git a/src/main/java/me/Danker/gui/DisplayGui.java b/src/main/java/me/Danker/gui/DisplayGui.java index ceda556..f38c29e 100644 --- a/src/main/java/me/Danker/gui/DisplayGui.java +++ b/src/main/java/me/Danker/gui/DisplayGui.java @@ -33,6 +33,7 @@ public class DisplayGui extends GuiScreen { private GuiButton catacombsF5; private GuiButton catacombsF6; private GuiButton catacombsF7; + private GuiButton ghost; @Override public boolean doesGuiPauseGame() { @@ -58,7 +59,7 @@ public class DisplayGui extends GuiScreen { fishingWinter = new GuiButton(0, width / 2 - 110, (int) (height * 0.4), 100, 20, "Fishing Winter"); fishingFestival = new GuiButton(0, width / 2 + 10, (int) (height * 0.4), 100, 20, "Fishing Festival"); fishingSpooky = new GuiButton(0, width / 2 + 130, (int) (height * 0.4), 100, 20, "Fishing Spooky"); - mythological = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), 200, 20, "Mythological"); + mythological = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), 95, 20, "Mythological"); catacombsF1 = new GuiButton(0, width / 2 - 205, (int) (height * 0.65), 50, 20, "F1"); catacombsF2 = new GuiButton(0, width / 2 - 145, (int) (height * 0.65), 50, 20, "F2"); catacombsF3 = new GuiButton(0, width / 2 - 85, (int) (height * 0.65), 50, 20, "F3"); @@ -66,6 +67,7 @@ public class DisplayGui extends GuiScreen { catacombsF5 = new GuiButton(0, width / 2 + 35, (int) (height * 0.65), 50, 20, "F5"); catacombsF6 = new GuiButton(0, width / 2 + 95, (int) (height * 0.65), 50, 20, "F6"); catacombsF7 = new GuiButton(0, width / 2 + 155, (int) (height * 0.65), 50, 20, "F7"); + ghost = new GuiButton(0, width / 2 + 5, (int) (height * 0.5), 95, 20, "Ghost"); this.buttonList.add(showSession); this.buttonList.add(off); @@ -85,6 +87,7 @@ public class DisplayGui extends GuiScreen { this.buttonList.add(catacombsF5); this.buttonList.add(catacombsF6); this.buttonList.add(catacombsF7); + this.buttonList.add(ghost); this.buttonList.add(goBack); } @@ -151,7 +154,8 @@ public class DisplayGui extends GuiScreen { setDisplay("catacombs_floor_six", false); } else if (button == catacombsF7) { setDisplay("catacombs_floor_seven", false); - } + } else if (button == ghost) + setDisplay("ghost",false); } public void setDisplay(String display, boolean forceNoSession) { diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 52b1883..759808d 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -214,6 +214,8 @@ public class ConfigHandler { ToggleCommand.goldenToggled = initBoolean("toggles", "Golden", false); ToggleCommand.slayerCountTotal = initBoolean("toggles", "SlayerCount", true); ToggleCommand.rngesusAlerts = initBoolean("toggles", "RNGesusAlerts", false); + ToggleCommand.ghostDisplay = initBoolean("toggles", "GhostDisplay", true); + ToggleCommand.dungeonTimerToggled = initBoolean("toggles", "GhostTimer", false); ToggleCommand.splitFishing = initBoolean("toggles", "SplitFishing", true); ToggleCommand.chatMaddoxToggled = initBoolean("toggles", "ChatMaddox", false); ToggleCommand.spiritBearAlerts = initBoolean("toggles", "SpiritBearAlerts", false); @@ -434,7 +436,15 @@ public class ConfigHandler { LootTracker.witherBoots = initInt("catacombs", "witherBoot", 0); LootTracker.f7CoinsSpent = initDouble("catacombs", "floorSevenCoins", 0); LootTracker.f7TimeSpent = initDouble("catacombs", "floorSevenTime", 0); - + + // Ghost + LootTracker.sorrows = initInt("ghosts", "sorrow", 0); + LootTracker.voltas = initInt("ghosts", "volta", 0); + LootTracker.plasmas = initInt("ghosts", "plasma", 0); + LootTracker.ghostlyBoots = initInt("ghosts", "ghostlyBoots", 0); + LootTracker.bagOfCashs = initInt("ghosts", "bagOfCash", 0); + + // Misc LootDisplay.display = initString("misc", "display", "off"); LootDisplay.auto = initBoolean("misc", "autoDisplay", false); -- cgit From a3f51f679364d8d97fe55f4aed3a80c61d6849b7 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Sat, 13 Mar 2021 16:56:33 +0100 Subject: added highlight slayer NOT FINISHED! missing: - ToggleCommand - README - ConfigHandler - DHelpCommand - Arachne - testing --- src/main/java/me/Danker/DankersSkyblockMod.java | 1 + src/main/java/me/Danker/features/SlayerESP.java | 113 ++++++++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 src/main/java/me/Danker/features/SlayerESP.java (limited to 'src/main/java/me/Danker/features') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index b5c1cff..46c1547 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -129,6 +129,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new UpdateChecker()); MinecraftForge.EVENT_BUS.register(new WatcherReadyAlert()); MinecraftForge.EVENT_BUS.register(new WaterSolver()); + MinecraftForge.EVENT_BUS.register(new SlayerESP()); ConfigHandler.reloadConfig(); GoldenEnchants.init(); diff --git a/src/main/java/me/Danker/features/SlayerESP.java b/src/main/java/me/Danker/features/SlayerESP.java new file mode 100644 index 0000000..fb17135 --- /dev/null +++ b/src/main/java/me/Danker/features/SlayerESP.java @@ -0,0 +1,113 @@ +package me.Danker.features; + +import me.Danker.DankersSkyblockMod; +import me.Danker.commands.ToggleCommand; +import me.Danker.handlers.ScoreboardHandler; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StringUtils; +import net.minecraft.world.World; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.event.entity.player.AttackEntityEvent; +import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + +import java.util.List; + +/** + * @author CuzImClicks + */ + +public class SlayerESP { + + static Entity zombie = null; + static Entity spider = null; + static Entity wolf = null; + static boolean slayerActive = false; + public static final int SLAYER_COLOUR = 0xFF0000; + + @SubscribeEvent + public void onWorldChange(WorldEvent.Load event) { + zombie = null; + spider = null; + wolf = null; + } + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + //if (!Utils.inSkyblock) return; + if (event.phase != TickEvent.Phase.START) return; + + World world = Minecraft.getMinecraft().theWorld; + if (DankersSkyblockMod.tickAmount % 2 == 0) { + if (world != null) { + List entities = world.getLoadedEntityList(); + for (Entity e : entities) { + System.out.println(e.getName()); + if (e.getName().contains("Revenant Horror")) { + zombie = e; + } else if (e.getName().contains("Tarantula Broodfather")) { + spider = e; + } else if (e.getName().contains("Sven Packmaster")) { + wolf = e; + } + + } + } + } + } + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent event) { + //if (!Utils.inSkyblock) return; + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + if (message.contains("SLAYER QUEST COMPLETE!")) { + slayerActive = false; + } + + } + @SubscribeEvent + public void onAttackingEntity(AttackEntityEvent event) { + if (event.target instanceof EntityZombie || event.target instanceof EntitySpider || event.target instanceof EntityWolf) { + List scoreboard = ScoreboardHandler.getSidebarLines(); + + for (String line : scoreboard) { + String cleanedLine = ScoreboardHandler.cleanSB(line); + if (cleanedLine.contains("Slay the boss!")) { + slayerActive = true; + break; + } + } + } + } + + @SubscribeEvent + public void onWorldRender(RenderWorldLastEvent event) { + //if (!Utils.inSkyblock) return; + if (slayerActive) { + if (zombie != null) { + AxisAlignedBB aabb = new AxisAlignedBB(zombie.posX - 0.5, zombie.posY - 2, zombie.posZ - 0.5, zombie.posX + 0.5, zombie.posY, zombie.posZ + 0.5); + Utils.draw3DBox(aabb, SLAYER_COLOUR, event.partialTicks); + } + if (spider != null) { + AxisAlignedBB aabb = new AxisAlignedBB(spider.posX - 0.5, spider.posY - 1, spider.posZ - 0.5, spider.posX + 0.5, spider.posY, spider.posZ + 0.5); + Utils.draw3DBox(aabb, SLAYER_COLOUR, event.partialTicks); + } + if (wolf != null) { + AxisAlignedBB aabb = new AxisAlignedBB(wolf.posX - 0.5, wolf.posY - 1, wolf.posZ - 0.5, wolf.posX + 0.5, wolf.posY, wolf.posZ + 0.5); + Utils.draw3DBox(aabb, SLAYER_COLOUR, event.partialTicks); + + } + } + } + +} -- cgit From 5e1870a01cfd3a253f17aae1c27aee9cdaa5ab70 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Sat, 13 Mar 2021 18:24:51 +0100 Subject: completed SlayerESP --- .../java/me/Danker/commands/ToggleCommand.java | 14 +++++++-- src/main/java/me/Danker/features/SlayerESP.java | 33 ++++++++++------------ src/main/java/me/Danker/gui/OnlySlayerGui.java | 10 +++++++ .../java/me/Danker/handlers/ConfigHandler.java | 1 + 4 files changed, 37 insertions(+), 21 deletions(-) (limited to 'src/main/java/me/Danker/features') diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index e44f8ce..02f5013 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -31,6 +31,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean skill50DisplayToggled; public static boolean outlineTextToggled; public static boolean cakeTimerToggled; + public static boolean highlightSlayers; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; @@ -73,6 +74,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean specialHoeRightClick; public static boolean melodyTooltips; + @Override public String getCommandName() { return "toggle"; @@ -89,7 +91,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "creeperpuzzle/waterpuzzle/tictactoepuzzle/boulderpuzzle/silverfishpuzzle/watchermessage/" + "startswithterminal/selectallterminal/clickinorderterminal/blockwrongterminalclicks/" + "itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/ " + - "/specialhoe/melodytooltips/list>"; + "/specialhoe/melodytooltips/highlightslayers/list>"; } @Override @@ -112,7 +114,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "silverfishpuzzle", "watchermessage", "startswithterminal", "selectallterminal", "clickinorderterminal", "blockwrongterminalclicks", "itemframeonsealanterns", "ultrasequencer", "chronomatron", "superpairs", - "hidetooltipsinaddons", "pickblock", "specialhoe", "melodytooltips", "list"); + "hidetooltipsinaddons", "pickblock", "specialhoe", "melodytooltips", "highlightslayers", "list"); } return null; } @@ -398,6 +400,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "MelodyTooltips", melodyTooltips); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Hide tooltips in Melody's Harp " + DankersSkyblockMod.SECONDARY_COLOUR + melodyTooltips + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "highlightslayers": + highlightSlayers = !highlightSlayers; + ConfigHandler.writeBooleanConfig("toggles", "HighlightSlayers", highlightSlayers); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Slayer Bosses " + DankersSkyblockMod.SECONDARY_COLOUR + highlightSlayers + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "list": player.addChatMessage(new ChatComponentText(DankersSkyblockMod.TYPE_COLOUR + "Guild party notifications: " + DankersSkyblockMod.VALUE_COLOUR + gpartyToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Coord/Angle display: " + DankersSkyblockMod.VALUE_COLOUR + coordsToggled + "\n" + @@ -444,7 +451,8 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Hide tooltips in experiment addons: " + DankersSkyblockMod.VALUE_COLOUR + hideTooltipsInExperimentAddonsToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Auto-swap to pick block " + DankersSkyblockMod.VALUE_COLOUR + swapToPickBlockToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Block Special Hoe right click " + DankersSkyblockMod.VALUE_COLOUR + specialHoeRightClick + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Hide tooltips in Melody's Harp " + DankersSkyblockMod.VALUE_COLOUR + melodyTooltips + DankersSkyblockMod.TYPE_COLOUR + " Hide tooltips in Melody's Harp " + DankersSkyblockMod.VALUE_COLOUR + melodyTooltips + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Highlight Slayer Bosses " + DankersSkyblockMod.VALUE_COLOUR + highlightSlayers )); break; default: diff --git a/src/main/java/me/Danker/features/SlayerESP.java b/src/main/java/me/Danker/features/SlayerESP.java index fb17135..79fc634 100644 --- a/src/main/java/me/Danker/features/SlayerESP.java +++ b/src/main/java/me/Danker/features/SlayerESP.java @@ -17,6 +17,7 @@ import net.minecraft.world.World; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.event.entity.player.AttackEntityEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; @@ -46,10 +47,19 @@ public class SlayerESP { public void onTick(TickEvent.ClientTickEvent event) { //if (!Utils.inSkyblock) return; if (event.phase != TickEvent.Phase.START) return; - + World world = Minecraft.getMinecraft().theWorld; - if (DankersSkyblockMod.tickAmount % 2 == 0) { + if (DankersSkyblockMod.tickAmount % 2 == 0 && ToggleCommand.highlightSlayers) { if (world != null) { + for (String line : ScoreboardHandler.getSidebarLines()) { + + String cleanedLine = ScoreboardHandler.cleanSB(line); + if (cleanedLine.contains("Slay the boss!")) { + slayerActive = true; + break; + } + } + if (!slayerActive) return; List entities = world.getLoadedEntityList(); for (Entity e : entities) { System.out.println(e.getName()); @@ -68,32 +78,19 @@ public class SlayerESP { @SubscribeEvent public void onChat(ClientChatReceivedEvent event) { - //if (!Utils.inSkyblock) return; + if (!Utils.inSkyblock) return; String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); if (message.contains("SLAYER QUEST COMPLETE!")) { slayerActive = false; } } - @SubscribeEvent - public void onAttackingEntity(AttackEntityEvent event) { - if (event.target instanceof EntityZombie || event.target instanceof EntitySpider || event.target instanceof EntityWolf) { - List scoreboard = ScoreboardHandler.getSidebarLines(); - for (String line : scoreboard) { - String cleanedLine = ScoreboardHandler.cleanSB(line); - if (cleanedLine.contains("Slay the boss!")) { - slayerActive = true; - break; - } - } - } - } @SubscribeEvent public void onWorldRender(RenderWorldLastEvent event) { - //if (!Utils.inSkyblock) return; - if (slayerActive) { + if (!Utils.inSkyblock) return; + if (slayerActive && ToggleCommand.highlightSlayers) { if (zombie != null) { AxisAlignedBB aabb = new AxisAlignedBB(zombie.posX - 0.5, zombie.posY - 2, zombie.posZ - 0.5, zombie.posX + 0.5, zombie.posY, zombie.posZ + 0.5); Utils.draw3DBox(aabb, SLAYER_COLOUR, event.partialTicks); diff --git a/src/main/java/me/Danker/gui/OnlySlayerGui.java b/src/main/java/me/Danker/gui/OnlySlayerGui.java index 552a354..ee6f3ec 100644 --- a/src/main/java/me/Danker/gui/OnlySlayerGui.java +++ b/src/main/java/me/Danker/gui/OnlySlayerGui.java @@ -1,10 +1,13 @@ package me.Danker.gui; import me.Danker.DankersSkyblockMod; +import me.Danker.commands.ToggleCommand; import me.Danker.features.BlockWrongSlayer; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.TextRenderer; +import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.ScaledResolution; @@ -23,6 +26,7 @@ public class OnlySlayerGui extends GuiScreen { private GuiButton two; private GuiButton three; private GuiButton four; + private GuiButton highlightSlayers; @Override public boolean doesGuiPauseGame() { @@ -62,6 +66,7 @@ public class OnlySlayerGui extends GuiScreen { two = new GuiButton(0, width / 2 - 95, (int) (height * 0.6), 85, 20, "II"); three = new GuiButton(0, width / 2 + 10, (int) (height * 0.6), 85, 20, "III"); four = new GuiButton(0, width / 2 + 115, (int) (height * 0.6), 85, 20, "IV"); + highlightSlayers = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Highlight Slayer Bosses: " + Utils.getColouredBoolean(ToggleCommand.highlightSlayers)); this.buttonList.add(off); this.buttonList.add(zombie); @@ -71,6 +76,7 @@ public class OnlySlayerGui extends GuiScreen { this.buttonList.add(two); this.buttonList.add(three); this.buttonList.add(four); + this.buttonList.add(highlightSlayers); this.buttonList.add(goBack); } @@ -115,6 +121,10 @@ public class OnlySlayerGui extends GuiScreen { onlyNumberInt = 3; } else if (button == four) { onlyNumberInt = 4; + } else if (button == highlightSlayers) { + ToggleCommand.highlightSlayers = !ToggleCommand.highlightSlayers; + ConfigHandler.writeBooleanConfig("toggles", "HighlightSlayers", ToggleCommand.highlightSlayers); + highlightSlayers.displayString = "Highlight Slayer Bosses: " + Utils.getColouredBoolean(ToggleCommand.highlightSlayers); } String onlyNumber; diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 892f231..209428a 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -228,6 +228,7 @@ public class ConfigHandler { ToggleCommand.cakeTimerToggled = initBoolean("toggles", "CakeTimer", false); ToggleCommand.specialHoeRightClick = initBoolean("toggles", "SpecialHoe", false); ToggleCommand.melodyTooltips = initBoolean("toggles", "MelodyTooltips", false); + ToggleCommand.highlightSlayers = initBoolean("toggles", "HighlightSlayers", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); -- cgit From 428f8e6ecdff1ea461d086633a86283048cedcfa Mon Sep 17 00:00:00 2001 From: RabbitType99 Date: Sat, 13 Mar 2021 20:11:26 +0100 Subject: Added Arachne highlighting, Added missing Text in README.md --- README.md | 5 +- .../java/me/Danker/commands/ToggleCommand.java | 14 +++- src/main/java/me/Danker/features/ArachneESP.java | 96 ++++++++++++++++++++++ src/main/java/me/Danker/gui/DankerGui.java | 8 +- 4 files changed, 118 insertions(+), 5 deletions(-) create mode 100644 src/main/java/me/Danker/features/ArachneESP.java (limited to 'src/main/java/me/Danker/features') diff --git a/README.md b/README.md index defecf8..848251e 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ Discord Server: https://discord.gg/QsEkNQS - Disable out of mana messages - Disable kill combo messages - Slayer item tracker +- Ghosts item tracker - RNGesus drop alerts - Click anywhere on-screen to open Maddox - Maddox menu keybind @@ -54,6 +55,8 @@ Discord Server: https://discord.gg/QsEkNQS - Update checker - Reparty command - Highlight Slayer Bosses +- Highlight Arachne + ## Commands - /dhelp - Returns this message in-game. @@ -62,7 +65,7 @@ Discord Server: https://discord.gg/QsEkNQS - /setkey - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. - /loot [winter/festival/spooky/f(1-7)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. -- /display [winter/festival/spooky/f(1-7)/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active. +- /display [winter/festival/spooky/f(1-7)/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active. - /resetloot - - Resets loot for trackers. /resetloot confirm confirms the reset. - /move - Moves text display to specified X and Y coordinates. - /scale - Scales text display to a specified multipler between 0.1x and 10x. diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 8840518..5b8e274 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -34,6 +34,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean outlineTextToggled; public static boolean cakeTimerToggled; public static boolean highlightSlayers; + public static boolean highlightArachne; // Chat Messages public static boolean sceptreMessages; public static boolean midasStaffMessages; @@ -92,7 +93,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "creeperpuzzle/waterpuzzle/tictactoepuzzle/boulderpuzzle/silverfishpuzzle/watchermessage/" + "startswithterminal/selectallterminal/clickinorderterminal/blockwrongterminalclicks/" + "itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/ " + - "/specialhoe/melodytooltips/highlightslayers/list>"; + "/specialhoe/melodytooltips/highlightslayers/highlightArachne/,list>"; } @Override @@ -103,7 +104,7 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", + return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", "highlightArachne", "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "lividdagger", "shadowfury", "flowerweapons", "sceptremessages", "petcolors", "dungeontimer", "golemalerts", "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", @@ -416,6 +417,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "HighlightSlayers", highlightSlayers); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Slayer Bosses " + DankersSkyblockMod.SECONDARY_COLOUR + highlightSlayers + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "highlighteArachne": + highlightArachne = !highlightArachne; + ConfigHandler.writeBooleanConfig("toggles", "HighlightSlayers", highlightSlayers); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Slayer Bosses " + DankersSkyblockMod.SECONDARY_COLOUR + highlightSlayers + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "list": player.addChatMessage(new ChatComponentText(DankersSkyblockMod.TYPE_COLOUR + "Guild party notifications: " + DankersSkyblockMod.VALUE_COLOUR + gpartyToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Coord/Angle display: " + DankersSkyblockMod.VALUE_COLOUR + coordsToggled + "\n" + @@ -463,7 +469,9 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Auto-swap to pick block " + DankersSkyblockMod.VALUE_COLOUR + swapToPickBlockToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Block Special Hoe right click " + DankersSkyblockMod.VALUE_COLOUR + specialHoeRightClick + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Hide tooltips in Melody's Harp " + DankersSkyblockMod.VALUE_COLOUR + melodyTooltips + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Highlight Slayer Bosses " + DankersSkyblockMod.VALUE_COLOUR + highlightSlayers + DankersSkyblockMod.TYPE_COLOUR + " Highlight Slayer Bosses " + DankersSkyblockMod.VALUE_COLOUR + highlightSlayers + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Highlight Arachne Boss " + DankersSkyblockMod.VALUE_COLOUR + highlightArachne + )); break; default: diff --git a/src/main/java/me/Danker/features/ArachneESP.java b/src/main/java/me/Danker/features/ArachneESP.java new file mode 100644 index 0000000..c0aeab6 --- /dev/null +++ b/src/main/java/me/Danker/features/ArachneESP.java @@ -0,0 +1,96 @@ +package me.Danker.features; + +import me.Danker.DankersSkyblockMod; +import me.Danker.commands.ToggleCommand; +import me.Danker.handlers.ScoreboardHandler; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StringUtils; +import net.minecraft.world.World; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.event.entity.player.AttackEntityEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + + +import java.util.List; + +/** + * @author RabbitType99 + */ + +public class ArachneESP { + + + static Entity arachne = null; + static boolean arachneActive = true; + public static final int ARACHANE_COLOUR = 0x00FF00; + + + @SubscribeEvent + public void onWorldChange(WorldEvent.Load event) { + arachne = null; + } + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + //if (!Utils.inSkyblock) return; + if (event.phase != TickEvent.Phase.START) return; + + World world = Minecraft.getMinecraft().theWorld; + if (DankersSkyblockMod.tickAmount % 2 == 0 && ToggleCommand.highlightArachne) { + if (world != null) { + if (!arachneActive) return; + List entities = world.getLoadedEntityList(); + List scoreboard = ScoreboardHandler.getSidebarLines(); + for (Entity e : entities) { + System.out.println(e.getName()); + if (e.getName().contains("Arachne")) { + for (String s : scoreboard) { + if (ScoreboardHandler.cleanSB(s).contains("Spiders Den")) { + arachne = e; + } + } + } + + } + } + } + } + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent event) { + if (!Utils.inSkyblock) return; + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + + if (message.contains("You dare call me, the queen of the dark, to accept you. I'll accept no excuses, you shall die!") || message.contains("Hahahahaha, YOU MORTAL FOOL! You dare to summon me at my full strength to this plane, you are seeking death. With this power, I will not let a weakling survive here, this land will be a brilliant place to start a new invasion of my empire. Tremble beneath me if you wish to survive!")){ + arachneActive = true; + } + if (message.contains("You are lucky this time, you only called out a portion of my power, if you dared to my face me at my peak, you would not survive!") || message.contains("How can this be...how could I lose to a puny being like you...I shall get my revenge") || message.contains("Arachne is bored with your feeble attempt!" )){ + arachneActive = false; + } + + } + + + @SubscribeEvent + public void onWorldRender(RenderWorldLastEvent event) { + if (!Utils.inSkyblock) return; + if (arachneActive && ToggleCommand.highlightSlayers) { + AxisAlignedBB aabb = new AxisAlignedBB(arachne.posX - 0.5, arachne.posY - 1, arachne.posZ - 0.5, arachne.posX + 0.5, arachne.posY, arachne.posZ + 0.5); + Utils.draw3DBox(aabb, ARACHANE_COLOUR, event.partialTicks); + } + } + +} + diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index fff4d9e..b0409fc 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -30,6 +30,7 @@ public class DankerGui extends GuiScreen { private GuiButton puzzleSolvers; private GuiButton experimentationTableSolvers; private GuiButton skillTracker; + private GuiButton highlightArachne; // Toggles private GuiButton gparty; private GuiButton coords; @@ -70,7 +71,7 @@ public class DankerGui extends GuiScreen { private GuiButton necronNotifications; private GuiButton bonzoTimer; private GuiButton autoSkillTracker; - + public DankerGui(int page) { this.page = page; } @@ -144,6 +145,9 @@ public class DankerGui extends GuiScreen { shadowFury = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Block Shadow Fury ability: " + Utils.getColouredBoolean(ToggleCommand.shadowFuryToggled)); specialHoe = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Block Special Hoe right click: " + Utils.getColouredBoolean(ToggleCommand.specialHoeRightClick)); melodyTooltips = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Hide tooltips in Melody's Harp: " + Utils.getColouredBoolean(ToggleCommand.melodyTooltips)); + //Page 7 + highlightArachne =new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Highlight Arachne: " + Utils.getColouredBoolean(ToggleCommand.highlightArachne)); + switch (page) { case 1: @@ -211,6 +215,8 @@ public class DankerGui extends GuiScreen { this.buttonList.add(melodyTooltips); this.buttonList.add(backPage); break; + case 7: + this.buttonList.add(highlightArachne); } this.buttonList.add(githubLink); -- cgit From d1dedf33d451235a8c8a83f80533871b268fa728 Mon Sep 17 00:00:00 2001 From: RabbitType99 Date: Sat, 13 Mar 2021 23:10:23 +0100 Subject: Clicks forgot that you can fail a slayer quest. XD --- src/main/java/me/Danker/features/SlayerESP.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/me/Danker/features') diff --git a/src/main/java/me/Danker/features/SlayerESP.java b/src/main/java/me/Danker/features/SlayerESP.java index 79fc634..c9b9c9b 100644 --- a/src/main/java/me/Danker/features/SlayerESP.java +++ b/src/main/java/me/Danker/features/SlayerESP.java @@ -80,7 +80,7 @@ public class SlayerESP { public void onChat(ClientChatReceivedEvent event) { if (!Utils.inSkyblock) return; String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); - if (message.contains("SLAYER QUEST COMPLETE!")) { + if (message.contains("SLAYER QUEST COMPLETE!") || message.contains("SLAYER QUEST FAILED!")) { slayerActive = false; } -- cgit From cfa878d994032f1d7f829b09e862587ad0db07e4 Mon Sep 17 00:00:00 2001 From: RabbitType99 Date: Sun, 14 Mar 2021 02:10:31 +0100 Subject: Not Working do not merge --- src/main/java/me/Danker/DankersSkyblockMod.java | 1 + src/main/java/me/Danker/commands/ToggleCommand.java | 6 +++--- src/main/java/me/Danker/features/ArachneESP.java | 13 +++++++------ src/main/java/me/Danker/features/SlayerESP.java | 2 +- src/main/java/me/Danker/gui/DankerGui.java | 9 ++++++++- 5 files changed, 20 insertions(+), 11 deletions(-) (limited to 'src/main/java/me/Danker/features') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 46c1547..74625f5 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -130,6 +130,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new WatcherReadyAlert()); MinecraftForge.EVENT_BUS.register(new WaterSolver()); MinecraftForge.EVENT_BUS.register(new SlayerESP()); + MinecraftForge.EVENT_BUS.register(new ArachneESP()); ConfigHandler.reloadConfig(); GoldenEnchants.init(); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 5b8e274..c4f3ca4 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -417,10 +417,10 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "HighlightSlayers", highlightSlayers); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Slayer Bosses " + DankersSkyblockMod.SECONDARY_COLOUR + highlightSlayers + DankersSkyblockMod.MAIN_COLOUR + ".")); break; - case "highlighteArachne": + case "highlightArachne": highlightArachne = !highlightArachne; - ConfigHandler.writeBooleanConfig("toggles", "HighlightSlayers", highlightSlayers); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Slayer Bosses " + DankersSkyblockMod.SECONDARY_COLOUR + highlightSlayers + DankersSkyblockMod.MAIN_COLOUR + ".")); + ConfigHandler.writeBooleanConfig("toggles", "HighlightArachne", highlightArachne); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Arachne " + DankersSkyblockMod.SECONDARY_COLOUR + highlightArachne + DankersSkyblockMod.MAIN_COLOUR + ".")); break; case "list": player.addChatMessage(new ChatComponentText(DankersSkyblockMod.TYPE_COLOUR + "Guild party notifications: " + DankersSkyblockMod.VALUE_COLOUR + gpartyToggled + "\n" + diff --git a/src/main/java/me/Danker/features/ArachneESP.java b/src/main/java/me/Danker/features/ArachneESP.java index c0aeab6..4ef9bc0 100644 --- a/src/main/java/me/Danker/features/ArachneESP.java +++ b/src/main/java/me/Danker/features/ArachneESP.java @@ -73,22 +73,23 @@ public class ArachneESP { if (!Utils.inSkyblock) return; String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); - if (message.contains("You dare call me, the queen of the dark, to accept you. I'll accept no excuses, you shall die!") || message.contains("Hahahahaha, YOU MORTAL FOOL! You dare to summon me at my full strength to this plane, you are seeking death. With this power, I will not let a weakling survive here, this land will be a brilliant place to start a new invasion of my empire. Tremble beneath me if you wish to survive!")){ + if (message.contains("You dare call me, the queen of the dark, to accept you. I'll accept no excuses, you shall die!") || message.contains("Hahahahaha, YOU MORTAL FOOL! You dare to summon me at my full strength to this plane, you are seeking death. With this power, I will not let a weakling survive here, this land will be a brilliant place to start a new invasion of my empire. Tremble beneath me if you wish to survive!") || message.contains("placed an Arachne Keeper Fragment! Something is awakening! (4/4)")){ arachneActive = true; } - if (message.contains("You are lucky this time, you only called out a portion of my power, if you dared to my face me at my peak, you would not survive!") || message.contains("How can this be...how could I lose to a puny being like you...I shall get my revenge") || message.contains("Arachne is bored with your feeble attempt!" )){ + if (message.contains("You are lucky this time, you only called out a portion of my power, if you dared to my face me at my peak, you would not survive!") || message.contains("How can this be...how could I lose to a puny being like you...I shall get my revenge") || message.contains("Arachne is bored with your feeble attempt!" ) || message.contains (" dealt the final blow")){ arachneActive = false; } - } @SubscribeEvent public void onWorldRender(RenderWorldLastEvent event) { if (!Utils.inSkyblock) return; - if (arachneActive && ToggleCommand.highlightSlayers) { - AxisAlignedBB aabb = new AxisAlignedBB(arachne.posX - 0.5, arachne.posY - 1, arachne.posZ - 0.5, arachne.posX + 0.5, arachne.posY, arachne.posZ + 0.5); - Utils.draw3DBox(aabb, ARACHANE_COLOUR, event.partialTicks); + if (arachneActive && ToggleCommand.highlightArachne) { + if (arachne != null) { + AxisAlignedBB aabb = new AxisAlignedBB(arachne.posX - 0.5, arachne.posY - 1, arachne.posZ - 0.5, arachne.posX + 0.5, arachne.posY, arachne.posZ + 0.5); + Utils.draw3DBox(aabb, ARACHANE_COLOUR, event.partialTicks); + } } } diff --git a/src/main/java/me/Danker/features/SlayerESP.java b/src/main/java/me/Danker/features/SlayerESP.java index c9b9c9b..ff53b7e 100644 --- a/src/main/java/me/Danker/features/SlayerESP.java +++ b/src/main/java/me/Danker/features/SlayerESP.java @@ -34,7 +34,7 @@ public class SlayerESP { static Entity spider = null; static Entity wolf = null; static boolean slayerActive = false; - public static final int SLAYER_COLOUR = 0xFF0000; + public static final int SLAYER_COLOUR = 0x0000FF; @SubscribeEvent public void onWorldChange(WorldEvent.Load event) { diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index b0409fc..fe791e1 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -214,9 +214,12 @@ public class DankerGui extends GuiScreen { this.buttonList.add(specialHoe); this.buttonList.add(melodyTooltips); this.buttonList.add(backPage); + this.buttonList.add(nextPage); break; case 7: this.buttonList.add(highlightArachne); + this.buttonList.add(backPage); + break; } this.buttonList.add(githubLink); @@ -228,7 +231,7 @@ public class DankerGui extends GuiScreen { @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); - String pageText = "Page: " + page + "/6"; + String pageText = "Page: " + page + "/7"; int pageWidth = mc.fontRendererObj.getStringWidth(pageText); new TextRenderer(mc, pageText, width / 2 - pageWidth / 2, 10, 1D); super.drawScreen(mouseX, mouseY, partialTicks); @@ -414,6 +417,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.killComboMessages = !ToggleCommand.killComboMessages; ConfigHandler.writeBooleanConfig("toggles", "KillComboMessages", ToggleCommand.killComboMessages); killComboMessages.displayString = "Kill Combo Messages: " + Utils.getColouredBoolean(ToggleCommand.killComboMessages); + } else if (button == highlightArachne) { + ToggleCommand.highlightArachne = !ToggleCommand.highlightArachne; + ConfigHandler.writeBooleanConfig("toggles", "HighlightArachne", ToggleCommand.highlightArachne); + highlightArachne.displayString = "Kill Combo Messages: " + Utils.getColouredBoolean(ToggleCommand.highlightArachne); } } -- cgit From 5fbbbdb0305f350ea857234ff72afea372a469fc Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Sun, 14 Mar 2021 02:50:36 +0100 Subject: fixed Arachne Highlight --- src/main/java/me/Danker/features/ArachneESP.java | 37 ++++++++++++++---------- src/main/java/me/Danker/gui/DankerGui.java | 2 +- 2 files changed, 22 insertions(+), 17 deletions(-) (limited to 'src/main/java/me/Danker/features') diff --git a/src/main/java/me/Danker/features/ArachneESP.java b/src/main/java/me/Danker/features/ArachneESP.java index 4ef9bc0..320338c 100644 --- a/src/main/java/me/Danker/features/ArachneESP.java +++ b/src/main/java/me/Danker/features/ArachneESP.java @@ -42,27 +42,33 @@ public class ArachneESP { arachne = null; } + public boolean isSpidersDen(List scoreboard) { + for (String s : scoreboard) { + if (ScoreboardHandler.cleanSB(s).contains("Spiders Den")) { + return true; + } + } + return false; + } + @SubscribeEvent public void onTick(TickEvent.ClientTickEvent event) { - //if (!Utils.inSkyblock) return; + if (!Utils.inSkyblock) return; if (event.phase != TickEvent.Phase.START) return; World world = Minecraft.getMinecraft().theWorld; if (DankersSkyblockMod.tickAmount % 2 == 0 && ToggleCommand.highlightArachne) { if (world != null) { - if (!arachneActive) return; + List entities = world.getLoadedEntityList(); List scoreboard = ScoreboardHandler.getSidebarLines(); + //if (!isSpidersDen(scoreboard)) return; + if (!arachneActive) return; for (Entity e : entities) { System.out.println(e.getName()); - if (e.getName().contains("Arachne")) { - for (String s : scoreboard) { - if (ScoreboardHandler.cleanSB(s).contains("Spiders Den")) { - arachne = e; - } - } + if (e.getName().contains("Arachne") && !e.getName().contains("Arachne's Brood")) { + arachne = e; } - } } } @@ -72,8 +78,7 @@ public class ArachneESP { public void onChat(ClientChatReceivedEvent event) { if (!Utils.inSkyblock) return; String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); - - if (message.contains("You dare call me, the queen of the dark, to accept you. I'll accept no excuses, you shall die!") || message.contains("Hahahahaha, YOU MORTAL FOOL! You dare to summon me at my full strength to this plane, you are seeking death. With this power, I will not let a weakling survive here, this land will be a brilliant place to start a new invasion of my empire. Tremble beneath me if you wish to survive!") || message.contains("placed an Arachne Keeper Fragment! Something is awakening! (4/4)")){ + if (message.contains("Something is awakening (4/4)") || message.contains("Hahahahaha, YOU MORTAL FOOL! You dare to summon me at my full strength to this plane, you are seeking death. With this power, I will not let a weakling survive here, this land will be a brilliant place to start a new invasion of my empire. Tremble beneath me if you wish to survive!") || message.contains("placed an Arachne Keeper Fragment! Something is awakening! (4/4)")){ arachneActive = true; } if (message.contains("You are lucky this time, you only called out a portion of my power, if you dared to my face me at my peak, you would not survive!") || message.contains("How can this be...how could I lose to a puny being like you...I shall get my revenge") || message.contains("Arachne is bored with your feeble attempt!" ) || message.contains (" dealt the final blow")){ @@ -85,11 +90,11 @@ public class ArachneESP { @SubscribeEvent public void onWorldRender(RenderWorldLastEvent event) { if (!Utils.inSkyblock) return; - if (arachneActive && ToggleCommand.highlightArachne) { - if (arachne != null) { - AxisAlignedBB aabb = new AxisAlignedBB(arachne.posX - 0.5, arachne.posY - 1, arachne.posZ - 0.5, arachne.posX + 0.5, arachne.posY, arachne.posZ + 0.5); - Utils.draw3DBox(aabb, ARACHANE_COLOUR, event.partialTicks); - } + if (arachneActive && ToggleCommand.highlightArachne) { + if (arachne != null) { + AxisAlignedBB aabb = new AxisAlignedBB(arachne.posX - 0.5, arachne.posY - 1, arachne.posZ - 0.5, arachne.posX + 0.5, arachne.posY, arachne.posZ + 0.5); + Utils.draw3DBox(aabb, ARACHANE_COLOUR, event.partialTicks); + } } } diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index fe791e1..c49f498 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -420,7 +420,7 @@ public class DankerGui extends GuiScreen { } else if (button == highlightArachne) { ToggleCommand.highlightArachne = !ToggleCommand.highlightArachne; ConfigHandler.writeBooleanConfig("toggles", "HighlightArachne", ToggleCommand.highlightArachne); - highlightArachne.displayString = "Kill Combo Messages: " + Utils.getColouredBoolean(ToggleCommand.highlightArachne); + highlightArachne.displayString = "Highlight Arachne: " + Utils.getColouredBoolean(ToggleCommand.highlightArachne); } } -- cgit From 22f9a760f373cfbedb542e02b08ebf15bc4dfb10 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Sun, 14 Mar 2021 03:31:35 +0100 Subject: reworked triggers --- src/main/java/me/Danker/features/ArachneESP.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/me/Danker/features') diff --git a/src/main/java/me/Danker/features/ArachneESP.java b/src/main/java/me/Danker/features/ArachneESP.java index 320338c..4ce7ff3 100644 --- a/src/main/java/me/Danker/features/ArachneESP.java +++ b/src/main/java/me/Danker/features/ArachneESP.java @@ -78,10 +78,10 @@ public class ArachneESP { public void onChat(ClientChatReceivedEvent event) { if (!Utils.inSkyblock) return; String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); - if (message.contains("Something is awakening (4/4)") || message.contains("Hahahahaha, YOU MORTAL FOOL! You dare to summon me at my full strength to this plane, you are seeking death. With this power, I will not let a weakling survive here, this land will be a brilliant place to start a new invasion of my empire. Tremble beneath me if you wish to survive!") || message.contains("placed an Arachne Keeper Fragment! Something is awakening! (4/4)")){ + if (message.contains("Something is awakening")){ arachneActive = true; } - if (message.contains("You are lucky this time, you only called out a portion of my power, if you dared to my face me at my peak, you would not survive!") || message.contains("How can this be...how could I lose to a puny being like you...I shall get my revenge") || message.contains("Arachne is bored with your feeble attempt!" ) || message.contains (" dealt the final blow")){ + if (message.contains("ARACHNE DOWN!")) { arachneActive = false; } } -- cgit From 740d6b33cb227ea0e2699e1bc24003463ec28d52 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Sun, 14 Mar 2021 04:42:48 +0100 Subject: performance improvement and config --- src/main/java/me/Danker/features/ArachneESP.java | 3 +- src/main/java/me/Danker/features/SlayerESP.java | 38 ++++++++++------------ .../java/me/Danker/handlers/ConfigHandler.java | 1 + 3 files changed, 20 insertions(+), 22 deletions(-) (limited to 'src/main/java/me/Danker/features') diff --git a/src/main/java/me/Danker/features/ArachneESP.java b/src/main/java/me/Danker/features/ArachneESP.java index 4ce7ff3..6187eed 100644 --- a/src/main/java/me/Danker/features/ArachneESP.java +++ b/src/main/java/me/Danker/features/ArachneESP.java @@ -62,10 +62,9 @@ public class ArachneESP { List entities = world.getLoadedEntityList(); List scoreboard = ScoreboardHandler.getSidebarLines(); - //if (!isSpidersDen(scoreboard)) return; + if (!isSpidersDen(scoreboard)) return; if (!arachneActive) return; for (Entity e : entities) { - System.out.println(e.getName()); if (e.getName().contains("Arachne") && !e.getName().contains("Arachne's Brood")) { arachne = e; } diff --git a/src/main/java/me/Danker/features/SlayerESP.java b/src/main/java/me/Danker/features/SlayerESP.java index ff53b7e..5628dcc 100644 --- a/src/main/java/me/Danker/features/SlayerESP.java +++ b/src/main/java/me/Danker/features/SlayerESP.java @@ -6,6 +6,7 @@ import me.Danker.handlers.ScoreboardHandler; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.entity.monster.EntitySpider; import net.minecraft.entity.monster.EntityZombie; import net.minecraft.entity.passive.EntityWolf; @@ -45,32 +46,29 @@ public class SlayerESP { @SubscribeEvent public void onTick(TickEvent.ClientTickEvent event) { - //if (!Utils.inSkyblock) return; + if (!Utils.inSkyblock) return; if (event.phase != TickEvent.Phase.START) return; World world = Minecraft.getMinecraft().theWorld; + if (world == null) return; if (DankersSkyblockMod.tickAmount % 2 == 0 && ToggleCommand.highlightSlayers) { - if (world != null) { - for (String line : ScoreboardHandler.getSidebarLines()) { + for (String line : ScoreboardHandler.getSidebarLines()) { - String cleanedLine = ScoreboardHandler.cleanSB(line); - if (cleanedLine.contains("Slay the boss!")) { - slayerActive = true; - break; - } + String cleanedLine = ScoreboardHandler.cleanSB(line); + if (cleanedLine.contains("Slay the boss!")) { + slayerActive = true; + break; } - if (!slayerActive) return; - List entities = world.getLoadedEntityList(); - for (Entity e : entities) { - System.out.println(e.getName()); - if (e.getName().contains("Revenant Horror")) { - zombie = e; - } else if (e.getName().contains("Tarantula Broodfather")) { - spider = e; - } else if (e.getName().contains("Sven Packmaster")) { - wolf = e; - } - + } + if (!slayerActive) return; + List entities = world.getLoadedEntityList(); + for (Entity e : entities) { + if (e.getName().contains("Revenant Horror")) { + zombie = e; + } else if (e.getName().contains("Tarantula Broodfather")) { + spider = e; + } else if (e.getName().contains("Sven Packmaster")) { + wolf = e; } } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 3b08e94..dc43dca 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -231,6 +231,7 @@ public class ConfigHandler { ToggleCommand.specialHoeRightClick = initBoolean("toggles", "SpecialHoe", false); ToggleCommand.melodyTooltips = initBoolean("toggles", "MelodyTooltips", false); ToggleCommand.highlightSlayers = initBoolean("toggles", "HighlightSlayers", false); + ToggleCommand.highlightArachne = initBoolean("toggles", "HighlightArachne", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); -- cgit From 42e10338f773cd444c92e21e83f4609140bc278a Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Sun, 14 Mar 2021 17:17:24 +0100 Subject: completely reworked ArachneESP due to performance issues --- src/main/java/me/Danker/features/ArachneESP.java | 44 ++++++++---------------- 1 file changed, 15 insertions(+), 29 deletions(-) (limited to 'src/main/java/me/Danker/features') diff --git a/src/main/java/me/Danker/features/ArachneESP.java b/src/main/java/me/Danker/features/ArachneESP.java index 6187eed..d31a0bd 100644 --- a/src/main/java/me/Danker/features/ArachneESP.java +++ b/src/main/java/me/Danker/features/ArachneESP.java @@ -42,7 +42,7 @@ public class ArachneESP { arachne = null; } - public boolean isSpidersDen(List scoreboard) { + public boolean inSpidersDen(List scoreboard) { for (String s : scoreboard) { if (ScoreboardHandler.cleanSB(s).contains("Spiders Den")) { return true; @@ -51,49 +51,35 @@ public class ArachneESP { return false; } - @SubscribeEvent - public void onTick(TickEvent.ClientTickEvent event) { - if (!Utils.inSkyblock) return; - if (event.phase != TickEvent.Phase.START) return; - - World world = Minecraft.getMinecraft().theWorld; - if (DankersSkyblockMod.tickAmount % 2 == 0 && ToggleCommand.highlightArachne) { - if (world != null) { - - List entities = world.getLoadedEntityList(); - List scoreboard = ScoreboardHandler.getSidebarLines(); - if (!isSpidersDen(scoreboard)) return; - if (!arachneActive) return; - for (Entity e : entities) { - if (e.getName().contains("Arachne") && !e.getName().contains("Arachne's Brood")) { - arachne = e; - } - } - } - } - } - @SubscribeEvent public void onChat(ClientChatReceivedEvent event) { if (!Utils.inSkyblock) return; + if (!inSpidersDen(ScoreboardHandler.getSidebarLines())) return; String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); if (message.contains("Something is awakening")){ arachneActive = true; + World world = Minecraft.getMinecraft().theWorld; + List entities = world.getLoadedEntityList(); + for (Entity e : entities) { + if (e.getName().contains("Arachne") && !e.getName().contains("Arachne's Brood")) { + arachne = e; + } + } } if (message.contains("ARACHNE DOWN!")) { arachneActive = false; + arachne = null; } } - @SubscribeEvent public void onWorldRender(RenderWorldLastEvent event) { if (!Utils.inSkyblock) return; - if (arachneActive && ToggleCommand.highlightArachne) { - if (arachne != null) { - AxisAlignedBB aabb = new AxisAlignedBB(arachne.posX - 0.5, arachne.posY - 1, arachne.posZ - 0.5, arachne.posX + 0.5, arachne.posY, arachne.posZ + 0.5); - Utils.draw3DBox(aabb, ARACHANE_COLOUR, event.partialTicks); - } + if (arachne != null) { + if (arachneActive && ToggleCommand.highlightArachne) { + AxisAlignedBB aabb = new AxisAlignedBB(arachne.posX - 0.5, arachne.posY - 1, arachne.posZ - 0.5, arachne.posX + 0.5, arachne.posY, arachne.posZ + 0.5); + Utils.draw3DBox(aabb, ARACHANE_COLOUR, event.partialTicks); + } } } -- cgit From dc597028f0575eaca3b71dd7139ca62fc56e4a24 Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Sun, 14 Mar 2021 17:33:43 +0100 Subject: more performance improvements --- src/main/java/me/Danker/features/SlayerESP.java | 61 +++++++++++++++---------- 1 file changed, 37 insertions(+), 24 deletions(-) (limited to 'src/main/java/me/Danker/features') diff --git a/src/main/java/me/Danker/features/SlayerESP.java b/src/main/java/me/Danker/features/SlayerESP.java index 5628dcc..b917c23 100644 --- a/src/main/java/me/Danker/features/SlayerESP.java +++ b/src/main/java/me/Danker/features/SlayerESP.java @@ -6,19 +6,12 @@ import me.Danker.handlers.ScoreboardHandler; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityArmorStand; -import net.minecraft.entity.monster.EntitySpider; -import net.minecraft.entity.monster.EntityZombie; -import net.minecraft.entity.passive.EntityWolf; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StringUtils; import net.minecraft.world.World; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.RenderWorldLastEvent; -import net.minecraftforge.event.entity.player.AttackEntityEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.event.AttachCapabilitiesEvent; import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; @@ -35,6 +28,7 @@ public class SlayerESP { static Entity spider = null; static Entity wolf = null; static boolean slayerActive = false; + static boolean slayerStarted = false; public static final int SLAYER_COLOUR = 0x0000FF; @SubscribeEvent @@ -43,7 +37,8 @@ public class SlayerESP { spider = null; wolf = null; } - + + @SubscribeEvent public void onTick(TickEvent.ClientTickEvent event) { if (!Utils.inSkyblock) return; @@ -51,26 +46,34 @@ public class SlayerESP { World world = Minecraft.getMinecraft().theWorld; if (world == null) return; - if (DankersSkyblockMod.tickAmount % 2 == 0 && ToggleCommand.highlightSlayers) { + if (!slayerStarted) return; + if (zombie != null || spider != null || wolf != null) { + return; + } + slayerActive = true; + if (DankersSkyblockMod.tickAmount % 10 == 0 && ToggleCommand.highlightSlayers) { for (String line : ScoreboardHandler.getSidebarLines()) { - String cleanedLine = ScoreboardHandler.cleanSB(line); if (cleanedLine.contains("Slay the boss!")) { slayerActive = true; + List entities = world.getLoadedEntityList(); + for (Entity e : entities) { + System.out.println(e.getName()); + if (e.getName().contains("Revenant Horror")) { + zombie = e; + return; + } else if (e.getName().contains("Tarantula Broodfather")) { + spider = e; + return; + } else if (e.getName().contains("Sven Packmaster")) { + wolf = e; + return; + } + + } break; } } - if (!slayerActive) return; - List entities = world.getLoadedEntityList(); - for (Entity e : entities) { - if (e.getName().contains("Revenant Horror")) { - zombie = e; - } else if (e.getName().contains("Tarantula Broodfather")) { - spider = e; - } else if (e.getName().contains("Sven Packmaster")) { - wolf = e; - } - } } } @@ -78,8 +81,15 @@ public class SlayerESP { public void onChat(ClientChatReceivedEvent event) { if (!Utils.inSkyblock) return; String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); - if (message.contains("SLAYER QUEST COMPLETE!") || message.contains("SLAYER QUEST FAILED!")) { + if (message.contains("SLAYER QUEST STARTED!")) { + slayerStarted = true; + } + if (message.contains("NICE! SLAYER QUEST COMPLETE!") || message.contains("SLAYER QUEST FAILED!")) { slayerActive = false; + slayerStarted = false; + zombie = null; + spider = null; + wolf = null; } } @@ -88,19 +98,22 @@ public class SlayerESP { @SubscribeEvent public void onWorldRender(RenderWorldLastEvent event) { if (!Utils.inSkyblock) return; + if (!slayerStarted) return; if (slayerActive && ToggleCommand.highlightSlayers) { if (zombie != null) { AxisAlignedBB aabb = new AxisAlignedBB(zombie.posX - 0.5, zombie.posY - 2, zombie.posZ - 0.5, zombie.posX + 0.5, zombie.posY, zombie.posZ + 0.5); Utils.draw3DBox(aabb, SLAYER_COLOUR, event.partialTicks); + return; } if (spider != null) { AxisAlignedBB aabb = new AxisAlignedBB(spider.posX - 0.5, spider.posY - 1, spider.posZ - 0.5, spider.posX + 0.5, spider.posY, spider.posZ + 0.5); Utils.draw3DBox(aabb, SLAYER_COLOUR, event.partialTicks); + return; } if (wolf != null) { AxisAlignedBB aabb = new AxisAlignedBB(wolf.posX - 0.5, wolf.posY - 1, wolf.posZ - 0.5, wolf.posX + 0.5, wolf.posY, wolf.posZ + 0.5); Utils.draw3DBox(aabb, SLAYER_COLOUR, event.partialTicks); - + return; } } } -- cgit From 894b747c4ae2b2da7c4a12142cf69bd2fef2cb7a Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Tue, 16 Mar 2021 19:08:48 +0100 Subject: implemented requested changes --- src/main/java/DefenitlyNotAJoikedInstallerFrame.java | 7 +++++-- src/main/java/me/Danker/features/SlayerESP.java | 2 +- src/main/java/me/Danker/features/loot/LootTracker.java | 6 ------ src/main/java/me/Danker/gui/DisplayGui.java | 4 ++-- 4 files changed, 8 insertions(+), 11 deletions(-) (limited to 'src/main/java/me/Danker/features') diff --git a/src/main/java/DefenitlyNotAJoikedInstallerFrame.java b/src/main/java/DefenitlyNotAJoikedInstallerFrame.java index e4c9b64..3aabca8 100644 --- a/src/main/java/DefenitlyNotAJoikedInstallerFrame.java +++ b/src/main/java/DefenitlyNotAJoikedInstallerFrame.java @@ -1,3 +1,5 @@ +import me.Danker.DankersSkyblockMod; + import javax.imageio.ImageIO; import javax.swing.*; import java.awt.*; @@ -424,7 +426,8 @@ public class DefenitlyNotAJoikedInstallerFrame extends JFrame implements ActionL inSubFolder = true; } - File newFile = new File(modsFolder, "Danker's Skyblock Mod-"+getVersionFromMcmodInfo()+".jar"); + File newFile = new File(modsFolder, getVersionFromMcmodInfo() + ".Danker.s.Skyblock.Mod.-." + DankersSkyblockMod.VERSION + ".jar"); + if (thisFile.equals(newFile)) { showErrorMessage("You are opening this file from where the file should be installed... there's nothing to be done!"); return; @@ -462,7 +465,7 @@ public class DefenitlyNotAJoikedInstallerFrame extends JFrame implements ActionL return; } - showMessage("Danker's SkyblockMod has been successfully installed into your mods folder."); + showMessage("Danker's Skyblock Mod has been successfully installed into your mods folder."); dispose(); System.exit(0); } diff --git a/src/main/java/me/Danker/features/SlayerESP.java b/src/main/java/me/Danker/features/SlayerESP.java index b917c23..5f1783c 100644 --- a/src/main/java/me/Danker/features/SlayerESP.java +++ b/src/main/java/me/Danker/features/SlayerESP.java @@ -84,7 +84,7 @@ public class SlayerESP { if (message.contains("SLAYER QUEST STARTED!")) { slayerStarted = true; } - if (message.contains("NICE! SLAYER QUEST COMPLETE!") || message.contains("SLAYER QUEST FAILED!")) { + if (message.contains("NICE! SLAYER BOSS SLAIN!") || message.contains("SLAYER QUEST COMPLETE!") || message.contains("SLAYER QUEST FAILED!")) { slayerActive = false; slayerStarted = false; zombie = null; diff --git a/src/main/java/me/Danker/features/loot/LootTracker.java b/src/main/java/me/Danker/features/loot/LootTracker.java index 6430bc2..f76725e 100644 --- a/src/main/java/me/Danker/features/loot/LootTracker.java +++ b/src/main/java/me/Danker/features/loot/LootTracker.java @@ -1006,13 +1006,7 @@ public class LootTracker { bagOfCashSession++; ConfigHandler.writeIntConfig("ghosts", "bagOfCash", bagOfCashs); } - - - } - - - } @SubscribeEvent diff --git a/src/main/java/me/Danker/gui/DisplayGui.java b/src/main/java/me/Danker/gui/DisplayGui.java index f38c29e..38459ee 100644 --- a/src/main/java/me/Danker/gui/DisplayGui.java +++ b/src/main/java/me/Danker/gui/DisplayGui.java @@ -60,6 +60,7 @@ public class DisplayGui extends GuiScreen { fishingFestival = new GuiButton(0, width / 2 + 10, (int) (height * 0.4), 100, 20, "Fishing Festival"); fishingSpooky = new GuiButton(0, width / 2 + 130, (int) (height * 0.4), 100, 20, "Fishing Spooky"); mythological = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), 95, 20, "Mythological"); + ghost = new GuiButton(0, width / 2 + 5, (int) (height * 0.5), 95, 20, "Ghost"); catacombsF1 = new GuiButton(0, width / 2 - 205, (int) (height * 0.65), 50, 20, "F1"); catacombsF2 = new GuiButton(0, width / 2 - 145, (int) (height * 0.65), 50, 20, "F2"); catacombsF3 = new GuiButton(0, width / 2 - 85, (int) (height * 0.65), 50, 20, "F3"); @@ -67,8 +68,7 @@ public class DisplayGui extends GuiScreen { catacombsF5 = new GuiButton(0, width / 2 + 35, (int) (height * 0.65), 50, 20, "F5"); catacombsF6 = new GuiButton(0, width / 2 + 95, (int) (height * 0.65), 50, 20, "F6"); catacombsF7 = new GuiButton(0, width / 2 + 155, (int) (height * 0.65), 50, 20, "F7"); - ghost = new GuiButton(0, width / 2 + 5, (int) (height * 0.5), 95, 20, "Ghost"); - + this.buttonList.add(showSession); this.buttonList.add(off); this.buttonList.add(auto); -- cgit From 4effca575301c7be5a964b4869531c46cb273a4e Mon Sep 17 00:00:00 2001 From: CuzImClicks Date: Tue, 16 Mar 2021 20:02:01 +0100 Subject: added colours to the config --- src/main/java/me/Danker/features/ArachneESP.java | 2 +- src/main/java/me/Danker/features/SlayerESP.java | 2 +- src/main/java/me/Danker/handlers/ConfigHandler.java | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main/java/me/Danker/features') diff --git a/src/main/java/me/Danker/features/ArachneESP.java b/src/main/java/me/Danker/features/ArachneESP.java index d31a0bd..1a9b0b2 100644 --- a/src/main/java/me/Danker/features/ArachneESP.java +++ b/src/main/java/me/Danker/features/ArachneESP.java @@ -34,7 +34,7 @@ public class ArachneESP { static Entity arachne = null; static boolean arachneActive = true; - public static final int ARACHANE_COLOUR = 0x00FF00; + public static int ARACHANE_COLOUR; @SubscribeEvent diff --git a/src/main/java/me/Danker/features/SlayerESP.java b/src/main/java/me/Danker/features/SlayerESP.java index 5f1783c..17a1c0e 100644 --- a/src/main/java/me/Danker/features/SlayerESP.java +++ b/src/main/java/me/Danker/features/SlayerESP.java @@ -29,7 +29,7 @@ public class SlayerESP { static Entity wolf = null; static boolean slayerActive = false; static boolean slayerStarted = false; - public static final int SLAYER_COLOUR = 0x0000FF; + public static int SLAYER_COLOUR; @SubscribeEvent public void onWorldChange(WorldEvent.Load event) { diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index dc43dca..aa35ded 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -508,6 +508,8 @@ public class ConfigHandler { BonzoMaskTimer.BONZO_COLOR = initString("colors", "bonzoDisplay", EnumChatFormatting.RED.toString()); BlazeSolver.LOWEST_BLAZE_COLOUR = initInt("colors", "blazeLowest", 0xFF0000); BlazeSolver.HIGHEST_BLAZE_COLOUR = initInt("colors", "blazeHighest", 0x40FF40); + SlayerESP.SLAYER_COLOUR = initInt("colors", "slayerColor", 0x0000FF); + ArachneESP.ARACHANE_COLOUR = initInt("colors", "arachneColor", 0x00FF00); PetColours.PET_1_TO_9 = initInt("colors", "pet1To9", 0x999999); // Grey PetColours.PET_10_TO_19 = initInt("colors", "pet10To19", 0xD62440); // Red PetColours.PET_20_TO_29 = initInt("colors", "pet20To29", 0xEF5230); // Orange -- cgit