From e7237307e71c649b4b7c880259ff1781fcc7c435 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 4 Mar 2021 22:00:19 -0500 Subject: Add boulder puzzle solver --- src/main/java/me/Danker/commands/ToggleCommand.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/main/java/me/Danker/commands/ToggleCommand.java') diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index b632abc..77dc82e 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -55,6 +55,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean creeperToggled; public static boolean waterToggled; public static boolean ticTacToeToggled; + public static boolean boulderToggled; // Terminal Helpers public static boolean startsWithToggled; public static boolean selectAllToggled; @@ -76,11 +77,13 @@ public class ToggleCommand extends CommandBase implements ICommand { public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName() + " "; + "aotd/lividdagger/flowerweapons/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/" + + "skill50display/outlinetext/midasstaffmessages/implosionmessages/healmessages/cooldownmessages/" + + "manamessages/caketimer/lowhealthnotify/lividsolver/stopsalvagestarred/notifyslayerslain/" + + "necronnotifications/bonzotimer/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/waterpuzzle/" + + "tictactoepuzzle/boulderpuzzle/watchermessage/startswithterminal/selectallterminal/" + + "clickinorderterminal/blockwrongterminalclicks/itemframeonsealanterns/ultrasequencer/" + + "chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>"; } @Override @@ -301,6 +304,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "TicTacToePuzzle", ticTacToeToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Tic tac toe puzzle solver has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + ticTacToeToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "boulderpuzzle": + boulderToggled = !boulderToggled; + ConfigHandler.writeBooleanConfig("toggles", "BoulderPuzzle", boulderToggled); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Boulder puzzle solver has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + boulderToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "watchermessage": watcherReadyToggled = !watcherReadyToggled; ConfigHandler.writeBooleanConfig("toggles", "WatcherReadyMessage", watcherReadyToggled); @@ -390,6 +398,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Creeper puzzle solver: " + DankersSkyblockMod.VALUE_COLOUR + creeperToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Water puzzle solver: " + DankersSkyblockMod.VALUE_COLOUR + waterToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Tic tac toe puzzle solver: " + DankersSkyblockMod.VALUE_COLOUR + ticTacToeToggled + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Boulder puzzle solver: " + DankersSkyblockMod.VALUE_COLOUR + boulderToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Watcher ready message: " + DankersSkyblockMod.VALUE_COLOUR + watcherReadyToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Starts with letter terminal solver: " + DankersSkyblockMod.VALUE_COLOUR + startsWithToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Select all color items terminal solver: " + DankersSkyblockMod.VALUE_COLOUR + selectAllToggled + "\n" + -- cgit 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 --- .../java/me/Danker/commands/ToggleCommand.java | 31 ++++++++++++++++++---- .../java/me/Danker/features/BlockAbilities.java | 12 +++++++++ .../Danker/features/HideTooltipsInExperiments.java | 3 +++ .../java/me/Danker/handlers/ConfigHandler.java | 3 +++ 4 files changed, 44 insertions(+), 5 deletions(-) (limited to 'src/main/java/me/Danker/commands/ToggleCommand.java') diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 77dc82e..0ce17ef 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -23,6 +23,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean spiritBearAlerts; public static boolean aotdToggled; public static boolean lividDaggerToggled; + public static boolean shadowFuryToggled; public static boolean petColoursToggled; public static boolean dungeonTimerToggled; public static boolean golemAlertToggled; @@ -67,6 +68,8 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean chronomatronToggled; public static boolean superpairsToggled; public static boolean hideTooltipsInExperimentAddonsToggled; + public static boolean specialHoeRightClick; + public static boolean melodyTooltips; @Override public String getCommandName() { @@ -77,13 +80,13 @@ public class ToggleCommand extends CommandBase implements ICommand { public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName() + " "; + "chronomatron/superpairs/hidetooltipsinaddons/pickblock/specialhoe/melodytooltips/list>"; } @Override @@ -95,7 +98,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", - "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "lividdagger", + "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "lividdagger", "shadowfury", "flowerweapons", "sceptremessages", "petcolors", "dungeontimer", "golemalerts", "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", "implosionmessages", "healmessages", "cooldownmessages", "manamessages", "caketimer", "lowhealthnotify", "autoskilltracker", @@ -103,7 +106,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "bonzotimer", "threemanpuzzle", "oruopuzzle", "blazepuzzle", "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "watchermessage", "startswithterminal", "selectallterminal", "clickinorderterminal", "blockwrongterminalclicks", "itemframeonsealanterns", "ultrasequencer", - "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "list"); + "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "specialhoe", "melodytooltips","list"); } return null; } @@ -166,6 +169,11 @@ public class ToggleCommand extends CommandBase implements ICommand { case "lividdagger": lividDaggerToggled = !lividDaggerToggled; ConfigHandler.writeBooleanConfig("toggles", "LividDagger", lividDaggerToggled); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Block Shadow Fury ability been set to " + DankersSkyblockMod.SECONDARY_COLOUR + shadowFuryToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "shadowfury": + shadowFuryToggled = !shadowFuryToggled; + ConfigHandler.writeBooleanConfig("toggles", "ShadowFury", shadowFuryToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Block Livid Dagger ability been set to " + DankersSkyblockMod.SECONDARY_COLOUR + lividDaggerToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; case "flowerweapons": @@ -364,6 +372,16 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "PickBlock", swapToPickBlockToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Auto-swap to pick block has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + swapToPickBlockToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "specialhoe": + specialHoeRightClick = !specialHoeRightClick; + ConfigHandler.writeBooleanConfig("toggles", "SpecialHoe", specialHoeRightClick); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Block right click ability of special hoes " + DankersSkyblockMod.SECONDARY_COLOUR + specialHoeRightClick + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "melodytooltips": + melodyTooltips = !melodyTooltips; + ConfigHandler.writeBooleanConfig("toggles", "MelodyTooltips", melodyTooltips); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Hide tooltips in Melody's Harp " + DankersSkyblockMod.SECONDARY_COLOUR + melodyTooltips + DankersSkyblockMod.MAIN_COLOUR + ".")); + 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" + @@ -375,6 +393,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Spirit Bear alerts: " + DankersSkyblockMod.VALUE_COLOUR + spiritBearAlerts + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Block AOTD ability: " + DankersSkyblockMod.VALUE_COLOUR + aotdToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Block Livid Dagger ability: " + DankersSkyblockMod.VALUE_COLOUR + lividDaggerToggled + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Block Shadow Fury ability: " + DankersSkyblockMod.VALUE_COLOUR + shadowFuryToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Prevent Placing FoT/Spirit Sceptre: " + DankersSkyblockMod.VALUE_COLOUR + flowerWeaponsToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Spirit Sceptre messages: " + DankersSkyblockMod.VALUE_COLOUR + sceptreMessages + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Midas Staff messages: " + DankersSkyblockMod.VALUE_COLOUR + midasStaffMessages + "\n" + @@ -407,7 +426,9 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Chronomatron solver: " + DankersSkyblockMod.VALUE_COLOUR + chronomatronToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Superpairs solver: " + DankersSkyblockMod.VALUE_COLOUR + superpairsToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Hide tooltips in experiment addons: " + DankersSkyblockMod.VALUE_COLOUR + hideTooltipsInExperimentAddonsToggled + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Auto-swap to pick block " + DankersSkyblockMod.VALUE_COLOUR + swapToPickBlockToggled + 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 )); break; default: 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(); + } } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 30778e7..23ccb09 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -219,12 +219,15 @@ public class ConfigHandler { ToggleCommand.spiritBearAlerts = initBoolean("toggles", "SpiritBearAlerts", false); ToggleCommand.aotdToggled = initBoolean("toggles", "AOTD", false); ToggleCommand.lividDaggerToggled = initBoolean("toggles", "LividDagger", false); + ToggleCommand.shadowFuryToggled = initBoolean("toggles", "Shadow Fury", false); ToggleCommand.petColoursToggled = initBoolean("toggles", "PetColors", false); ToggleCommand.golemAlertToggled = initBoolean("toggles", "GolemAlerts", false); ToggleCommand.expertiseLoreToggled = initBoolean("toggles", "ExpertiseLore", false); ToggleCommand.skill50DisplayToggled = initBoolean("toggles", "Skill50Display", false); ToggleCommand.outlineTextToggled = initBoolean("toggles", "OutlineText", false); ToggleCommand.cakeTimerToggled = initBoolean("toggles", "CakeTimer", false); + ToggleCommand.specialHoeRightClick = initBoolean("toggles", "SpecialHoe", false); + ToggleCommand.melodyTooltips = initBoolean("toggles", "MelodyTooltips", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); -- cgit From ec35b6f8d7583f9c92eb212bfe4cf8d2206fc403 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 9 Mar 2021 23:55:43 -0500 Subject: Add silverfish puzzle solver --- README.md | 4 +- build.gradle | 2 +- src/main/java/me/Danker/DankersSkyblockMod.java | 3 +- src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- .../java/me/Danker/commands/DankerGuiCommand.java | 1 + .../java/me/Danker/commands/ToggleCommand.java | 26 ++- .../features/puzzlesolvers/SilverfishSolver.java | 183 +++++++++++++++++++++ src/main/java/me/Danker/gui/PuzzleSolversGui.java | 17 +- .../java/me/Danker/handlers/ConfigHandler.java | 4 +- src/main/java/me/Danker/utils/SilverfishUtils.java | 104 ++++++++++++ 10 files changed, 327 insertions(+), 19 deletions(-) create mode 100644 src/main/java/me/Danker/features/puzzlesolvers/SilverfishSolver.java create mode 100644 src/main/java/me/Danker/utils/SilverfishUtils.java (limited to 'src/main/java/me/Danker/commands/ToggleCommand.java') diff --git a/README.md b/README.md index 6673b43..b1bf536 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Discord Server: https://discord.gg/QsEkNQS - Fishing, jerry fishing, fishing festival, spooky fishing trackers - Expertise kills in fishing rod lore - Catacombs trackers -- Dungeons puzzle solver (Riddle, trivia, blaze, creeper, water, tic tac toe, boulder) +- Dungeons puzzle solver (Riddle, trivia, blaze, creeper, water, tic tac toe, boulder, silverfish) - Dungeons timer (watcher, boss, deaths, and puzzle fails) - Watcher ready message - Catacombs F7 Stage 3 solvers (Starts with letter, select all colour, ignore arrows on sea lanterns) @@ -53,7 +53,7 @@ Discord Server: https://discord.gg/QsEkNQS ## Commands - /dhelp - Returns this message in-game. - /dsm - Opens the GUI for Danker's Skyblock Mod. -- /toggle - Toggles features. /toggle list returns values of every toggle. +- /toggle - Toggles features. /toggle list returns values of every toggle. - /setkey - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. - /loot [winter/festival/spooky/f(1-7)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. diff --git a/build.gradle b/build.gradle index ee8e79b..7fd2d15 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ plugins { id "net.minecraftforge.gradle.forge" version "2.0.2" } */ -version = "1.8.6-beta1" +version = "1.8.6-beta2" group= "me.Danker.DankersSkyblockMod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Danker's Skyblock Mod" diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 0920520..dbb79dc 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -59,7 +59,7 @@ import java.util.Map; @Mod(modid = DankersSkyblockMod.MODID, version = DankersSkyblockMod.VERSION, clientSideOnly = true) public class DankersSkyblockMod { public static final String MODID = "Danker's Skyblock Mod"; - public static final String VERSION = "1.8.6-beta1"; + public static final String VERSION = "1.8.6-beta2"; public static int titleTimer = -1; public static boolean showTitle = false; public static String titleText = ""; @@ -114,6 +114,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new PetColours()); MinecraftForge.EVENT_BUS.register(new Reparty()); MinecraftForge.EVENT_BUS.register(new SelectAllColourSolver()); + MinecraftForge.EVENT_BUS.register(new SilverfishSolver()); MinecraftForge.EVENT_BUS.register(new Skill50Display()); MinecraftForge.EVENT_BUS.register(new SkillTracker()); MinecraftForge.EVENT_BUS.register(new SpamHider()); diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 6272a60..71e2414 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -34,7 +34,7 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + " Commands, " + EnumChatFormatting.GREEN + " Keybinds.\n" + EnumChatFormatting.GOLD + " /dhelp" + EnumChatFormatting.AQUA + " - Returns this message.\n" + EnumChatFormatting.GOLD + " /dsm" + EnumChatFormatting.AQUA + " - Opens the GUI for Danker's Skyblock Mod.\n" + - EnumChatFormatting.GOLD + " /toggle " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + + EnumChatFormatting.GOLD + " /toggle " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + EnumChatFormatting.GOLD + " /setkey " + EnumChatFormatting.AQUA + " - Sets API key.\n" + EnumChatFormatting.GOLD + " /getkey" + EnumChatFormatting.AQUA + " - Returns key set with /setkey and copies it to your clipboard.\n" + EnumChatFormatting.GOLD + " /loot [winter/festival/spooky/f(1-7)/session]" + EnumChatFormatting.AQUA + " - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead.\n" + diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index 9ba86da..dddc662 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -73,6 +73,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[waterpuzzle][").append(ToggleCommand.waterToggled).append("]\n"); debug.append("[tictactoepuzzle][").append(ToggleCommand.ticTacToeToggled).append("]\n"); debug.append("[boulderpuzzle][").append(ToggleCommand.boulderToggled).append("]\n"); + debug.append("[silverfishpuzzle][").append(ToggleCommand.silverfishToggled).append("]\n"); debug.append("[watchermessage][").append(ToggleCommand.watcherReadyToggled).append("]\n"); debug.append("[startswithterminal][").append(ToggleCommand.startsWithToggled).append("]\n"); debug.append("[selectallterminal][").append(ToggleCommand.selectAllToggled).append("]\n"); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 77dc82e..a69457f 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -56,6 +56,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean waterToggled; public static boolean ticTacToeToggled; public static boolean boulderToggled; + public static boolean silverfishToggled; // Terminal Helpers public static boolean startsWithToggled; public static boolean selectAllToggled; @@ -81,9 +82,9 @@ public class ToggleCommand extends CommandBase implements ICommand { "skill50display/outlinetext/midasstaffmessages/implosionmessages/healmessages/cooldownmessages/" + "manamessages/caketimer/lowhealthnotify/lividsolver/stopsalvagestarred/notifyslayerslain/" + "necronnotifications/bonzotimer/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/waterpuzzle/" + - "tictactoepuzzle/boulderpuzzle/watchermessage/startswithterminal/selectallterminal/" + - "clickinorderterminal/blockwrongterminalclicks/itemframeonsealanterns/ultrasequencer/" + - "chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>"; + "tictactoepuzzle/boulderpuzzle/silverfishpuzzle/watchermessage/startswithterminal/" + + "selectallterminal/clickinorderterminal/blockwrongterminalclicks/itemframeonsealanterns/" + + "ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>"; } @Override @@ -98,12 +99,15 @@ public class ToggleCommand extends CommandBase implements ICommand { "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "lividdagger", "flowerweapons", "sceptremessages", "petcolors", "dungeontimer", "golemalerts", "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", - "implosionmessages", "healmessages", "cooldownmessages", "manamessages", "caketimer", "lowhealthnotify", "autoskilltracker", - "lividsolver", "stopsalvagestarred", "notifyslayerslain", "necronnotifications", + "implosionmessages", "healmessages", "cooldownmessages", "manamessages", + "caketimer", "lowhealthnotify", "autoskilltracker", "lividsolver", + "stopsalvagestarred", "notifyslayerslain", "necronnotifications", "bonzotimer", "threemanpuzzle", "oruopuzzle", "blazepuzzle", - "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "watchermessage", "startswithterminal", - "selectallterminal", "clickinorderterminal", "blockwrongterminalclicks", "itemframeonsealanterns", "ultrasequencer", - "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "list"); + "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "boulderpuzzle", + "silverfishpuzzle", "watchermessage", "startswithterminal", + "selectallterminal", "clickinorderterminal", "blockwrongterminalclicks", + "itemframeonsealanterns", "ultrasequencer", "chronomatron", "superpairs", + "hidetooltipsinaddons", "pickblock", "list"); } return null; } @@ -309,6 +313,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "BoulderPuzzle", boulderToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Boulder puzzle solver has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + boulderToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "silverfishpuzzle": + silverfishToggled = !silverfishToggled; + ConfigHandler.writeBooleanConfig("toggles", "SilverfishPuzzle", silverfishToggled); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Silverfish puzzle solver has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + silverfishToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "watchermessage": watcherReadyToggled = !watcherReadyToggled; ConfigHandler.writeBooleanConfig("toggles", "WatcherReadyMessage", watcherReadyToggled); @@ -399,6 +408,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Water puzzle solver: " + DankersSkyblockMod.VALUE_COLOUR + waterToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Tic tac toe puzzle solver: " + DankersSkyblockMod.VALUE_COLOUR + ticTacToeToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Boulder puzzle solver: " + DankersSkyblockMod.VALUE_COLOUR + boulderToggled + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Silverfish puzzle solver: " + DankersSkyblockMod.VALUE_COLOUR + silverfishToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Watcher ready message: " + DankersSkyblockMod.VALUE_COLOUR + watcherReadyToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Starts with letter terminal solver: " + DankersSkyblockMod.VALUE_COLOUR + startsWithToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Select all color items terminal solver: " + DankersSkyblockMod.VALUE_COLOUR + selectAllToggled + "\n" + diff --git a/src/main/java/me/Danker/features/puzzlesolvers/SilverfishSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/SilverfishSolver.java new file mode 100644 index 0000000..c07524d --- /dev/null +++ b/src/main/java/me/Danker/features/puzzlesolvers/SilverfishSolver.java @@ -0,0 +1,183 @@ +package me.Danker.features.puzzlesolvers; + +import me.Danker.DankersSkyblockMod; +import me.Danker.commands.ToggleCommand; +import me.Danker.utils.SilverfishUtils; +import me.Danker.utils.Utils; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.monster.EntitySilverfish; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.*; +import net.minecraft.world.World; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class SilverfishSolver { + + static boolean prevInSilverfishRoom = false; + static boolean inSilverfishRoom = false; + static BlockPos chest = null; + static EnumFacing silverfishRoomDirection = null; + static List route = new ArrayList<>(); + public static int SILVERFISH_LINE_COLOUR; + + @SubscribeEvent + public void onWorldChange(WorldEvent.Load event) { + reset(); + } + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + if (event.phase != TickEvent.Phase.START) return; + + Minecraft mc = Minecraft.getMinecraft(); + World world = mc.theWorld; + EntityPlayerSP player = mc.thePlayer; + if (DankersSkyblockMod.tickAmount % 20 == 0) { + if (ToggleCommand.silverfishToggled && Utils.inDungeons && world != null && player != null) { + new Thread(() -> { + boolean foundRoom = false; + prevInSilverfishRoom = inSilverfishRoom; + double x = player.posX; + double z = player.posZ; + // Find creepers nearby + AxisAlignedBB entityScan = new AxisAlignedBB(x - 25, 67, z - 25, x + 25, 68, z + 25); // 50x1x50 + List silverfishes = world.getEntitiesWithinAABB(EntitySilverfish.class, entityScan); + List items = world.getEntitiesWithinAABB(EntityItem.class, entityScan); + if (silverfishes.size() > 0 && items.size() > 0) { + double silverfishX = silverfishes.get(0).posX; + double silverfishZ = silverfishes.get(0).posZ; + for (EntityItem item : items) { + if (Item.getIdFromItem(item.getEntityItem().getItem()) == 46 && Math.abs(item.posX - silverfishX) < 1 && Math.abs(item.posZ - silverfishZ) < 1) { + Iterable blocks = BlockPos.getAllInBox(new BlockPos(player.posX - 27, 67, player.posZ - 27), new BlockPos(player.posX + 27, 67, player.posZ + 27)); + for (BlockPos blockPos : blocks) { + if (world.getBlockState(blockPos).getBlock() == Blocks.chest && world.getBlockState(blockPos.add(0, 2, 0)).getBlock() == Blocks.hopper) { + foundRoom = true; + inSilverfishRoom = true; + if (!prevInSilverfishRoom) { + chest = blockPos; + BlockPos silverfishBlock = new BlockPos(silverfishX, 67, silverfishZ); + TileEntity hopper = world.getTileEntity(blockPos.add(0, 2, 0)); + silverfishRoomDirection = BlockHopper.getFacing(hopper.getBlockMetadata()); + char[][] board = new char[19][19]; + SilverfishUtils.Point silverfishPoint = null; + + switch (silverfishRoomDirection) { + case NORTH: + for (int row = chest.getZ() + 3, xIteration = 0; xIteration < 19; row++, xIteration++) { + for (int column = chest.getX() - 9, yIteration = 0; yIteration < 19; column++, yIteration++) { + if (world.getBlockState(new BlockPos(column, 67, row)).getBlock() != Blocks.air) { + board[xIteration][yIteration] = 'X'; + } else if (silverfishBlock.equals(new BlockPos(column, 67, row))) { + silverfishPoint = new SilverfishUtils.Point(xIteration, yIteration); + } + } + } + break; + case EAST: + for (int row = chest.getX() - 3, xIteration = 0; xIteration < 19; row--, xIteration++) { + for (int column = chest.getZ() - 9, yIteration = 0; yIteration < 19; column++, yIteration++) { + if (world.getBlockState(new BlockPos(row, 67, column)).getBlock() != Blocks.air) { + board[xIteration][yIteration] = 'X'; + } else if (silverfishBlock.equals(new BlockPos(row, 67, column))) { + silverfishPoint = new SilverfishUtils.Point(xIteration, yIteration); + } + } + } + break; + case SOUTH: + for (int row = chest.getZ() - 3, xIteration = 0; xIteration < 19; row--, xIteration++) { + for (int column = chest.getX() + 9, yIteration = 0; yIteration < 19; column--, yIteration++) { + if (world.getBlockState(new BlockPos(column, 67, row)).getBlock() != Blocks.air) { + board[xIteration][yIteration] = 'X'; + } else if (silverfishBlock.equals(new BlockPos(column, 67, row))) { + silverfishPoint = new SilverfishUtils.Point(xIteration, yIteration); + } + } + } + break; + case WEST: + for (int row = chest.getX() + 3, xIteration = 0; xIteration < 19; row++, xIteration++) { + for (int column = chest.getZ() + 9, yIteration = 0; yIteration < 19; column--, yIteration++) { + if (world.getBlockState(new BlockPos(row, 67, column)).getBlock() != Blocks.air) { + board[xIteration][yIteration] = 'X'; + } else if (silverfishBlock.equals(new BlockPos(row, 67, column))) { + board[xIteration][yIteration] = 'S'; + silverfishPoint = new SilverfishUtils.Point(xIteration, yIteration); + } + } + } + break; + default: + return; + } + System.out.println(Arrays.deepToString(board)); + + List endPoints = new ArrayList<>(); + for (int column = 0; column < 19; column++) { + if (board[0][column] != 'X') endPoints.add(new SilverfishUtils.Point(0, column)); + } + + route = SilverfishUtils.solve(board, silverfishPoint, endPoints); + } + } + } + } + } + } + if (!foundRoom) reset(); + }).start(); + } + } + } + + @SubscribeEvent + public void onWorldRender(RenderWorldLastEvent event) { + if (ToggleCommand.silverfishToggled && Utils.inDungeons && route != null && route.size() > 0 && chest != null) { + for (int i = 0; i < route.size() - 1; i++) { + Vec3 pos1 = null; + Vec3 pos2 = null; + switch (silverfishRoomDirection) { + case NORTH: + pos1 = new Vec3(chest.getX() - 8.5 + route.get(i).column, 67.5, chest.getZ() + 3.5 + route.get(i).row); + pos2 = new Vec3(chest.getX() - 8.5 + route.get(i + 1).column, 67.5, chest.getZ() + 3.5 + route.get(i + 1).row); + break; + case EAST: + pos1 = new Vec3(chest.getX() - 2.5 - route.get(i).row, 67.5, chest.getZ() - 8.5 + route.get(i).column); + pos2 = new Vec3(chest.getX() - 2.5 - route.get(i + 1).row, 67.5, chest.getZ() - 8.5 + route.get(i + 1).column); + break; + case SOUTH: + pos1 = new Vec3(chest.getX() + 9.5 - route.get(i).column, 67.5, chest.getZ() - 2.5 - route.get(i).row); + pos2 = new Vec3(chest.getX() + 9.5 - route.get(i + 1).column, 67.5, chest.getZ() - 2.5 - route.get(i + 1).row); + break; + case WEST: + pos1 = new Vec3(chest.getX() + 3.5 + route.get(i).row, 67.5, chest.getZ() + 9.5 - route.get(i).column); + pos2 = new Vec3(chest.getX() + 3.5 + route.get(i + 1).row, 67.5, chest.getZ() + 9.5 - route.get(i + 1).column); + break; + default: + return; + } + Utils.draw3DLine(pos1, pos2, SILVERFISH_LINE_COLOUR, 5, true, event.partialTicks); + } + } + } + + static void reset() { + inSilverfishRoom = false; + chest = null; + silverfishRoomDirection = null; + route.clear(); + } + +} diff --git a/src/main/java/me/Danker/gui/PuzzleSolversGui.java b/src/main/java/me/Danker/gui/PuzzleSolversGui.java index f502df9..3864b80 100644 --- a/src/main/java/me/Danker/gui/PuzzleSolversGui.java +++ b/src/main/java/me/Danker/gui/PuzzleSolversGui.java @@ -23,6 +23,7 @@ public class PuzzleSolversGui extends GuiScreen { private GuiButton water; private GuiButton ticTacToe; private GuiButton boulder; + private GuiButton silverfish; private GuiButton startsWith; private GuiButton selectAll; private GuiButton clickOrder; @@ -59,11 +60,12 @@ public class PuzzleSolversGui extends GuiScreen { ticTacToe = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Tic Tac Toe Solver: " + Utils.getColouredBoolean(ToggleCommand.ticTacToeToggled)); boulder = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Boulder Solver: " + Utils.getColouredBoolean(ToggleCommand.boulderToggled)); // Page 2 - startsWith = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Starts With Letter Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.startsWithToggled)); - selectAll = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Select All Color Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.selectAllToggled)); - clickOrder = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Click in Order Terminal Helper: " + Utils.getColouredBoolean(ToggleCommand.clickInOrderToggled)); - blockClicks = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Block Wrong Clicks on Terminals: " + Utils.getColouredBoolean(ToggleCommand.blockWrongTerminalClicksToggled)); - itemFrameOnSeaLanterns = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Ignore Arrows On Sea Lanterns: " + Utils.getColouredBoolean(ToggleCommand.itemFrameOnSeaLanternsToggled)); + silverfish = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Silverfish Solver: " + Utils.getColouredBoolean(ToggleCommand.silverfishToggled)); + startsWith = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Starts With Letter Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.startsWithToggled)); + selectAll = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Select All Color Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.selectAllToggled)); + clickOrder = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Click in Order Terminal Helper: " + Utils.getColouredBoolean(ToggleCommand.clickInOrderToggled)); + blockClicks = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Block Wrong Clicks on Terminals: " + Utils.getColouredBoolean(ToggleCommand.blockWrongTerminalClicksToggled)); + itemFrameOnSeaLanterns = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Ignore Arrows On Sea Lanterns: " + Utils.getColouredBoolean(ToggleCommand.itemFrameOnSeaLanternsToggled)); switch (page) { case 1: @@ -77,6 +79,7 @@ public class PuzzleSolversGui extends GuiScreen { this.buttonList.add(nextPage); break; case 2: + this.buttonList.add(silverfish); this.buttonList.add(startsWith); this.buttonList.add(selectAll); this.buttonList.add(clickOrder); @@ -130,6 +133,10 @@ public class PuzzleSolversGui extends GuiScreen { ToggleCommand.boulderToggled = !ToggleCommand.boulderToggled; ConfigHandler.writeBooleanConfig("toggles", "BoulderPuzzle", ToggleCommand.boulderToggled); boulder.displayString = "Boulder Solver: " + Utils.getColouredBoolean(ToggleCommand.boulderToggled); + } else if (button == silverfish) { + ToggleCommand.silverfishToggled = !ToggleCommand.silverfishToggled; + ConfigHandler.writeBooleanConfig("toggles", "SilverfishPuzzle", ToggleCommand.silverfishToggled); + silverfish.displayString = "Silverfish Solver: " + Utils.getColouredBoolean(ToggleCommand.silverfishToggled); } else if (button == startsWith) { ToggleCommand.startsWithToggled = !ToggleCommand.startsWithToggled; ConfigHandler.writeBooleanConfig("toggles", "StartsWithTerminal", ToggleCommand.startsWithToggled); diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 30778e7..96c0e75 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -90,7 +90,7 @@ public class ConfigHandler { } return true; } - + public static void writeIntConfig(String category, String key, int value) { config = new Configuration(new File(file)); try { @@ -252,6 +252,7 @@ public class ConfigHandler { ToggleCommand.waterToggled = initBoolean("toggles", "WaterPuzzle", false); ToggleCommand.ticTacToeToggled = initBoolean("toggles", "TicTacToePuzzle", false); ToggleCommand.boulderToggled = initBoolean("toggles", "BoulderPuzzle", false); + ToggleCommand.silverfishToggled = initBoolean("toggles", "SilverfishPuzzle", false); ToggleCommand.startsWithToggled = initBoolean("toggles", "StartsWithTerminal", false); ToggleCommand.selectAllToggled = initBoolean("toggles", "SelectAllTerminal", false); ToggleCommand.clickInOrderToggled = initBoolean("toggles", "ClickInOrderTerminal", false); @@ -510,6 +511,7 @@ public class ConfigHandler { ClickInOrderSolver.CLICK_IN_ORDER_NEXT_TO_NEXT = initInt("colors", "clickInOrderNextToNext", 0x0BEFE7); BoulderSolver.BOULDER_COLOUR = initInt("colors", "boulder", 0x197F19); BoulderSolver.BOULDER_ARROW_COLOUR = initInt("colors", "boulderArrow", 0x006000); + SilverfishSolver.SILVERFISH_LINE_COLOUR = initInt("colors", "silverfishLine", 0x40FF40); // Commands if (!hasKey("commands", "reparty")) writeBooleanConfig("commands", "reparty", false); diff --git a/src/main/java/me/Danker/utils/SilverfishUtils.java b/src/main/java/me/Danker/utils/SilverfishUtils.java new file mode 100644 index 0000000..e495da5 --- /dev/null +++ b/src/main/java/me/Danker/utils/SilverfishUtils.java @@ -0,0 +1,104 @@ +package me.Danker.utils; + +import java.util.*; + +public class SilverfishUtils { + + // bfs + public static List solve(char[][] board, Point startPos, List endColumns) { + LinkedList queue = new LinkedList<>(); + Map visited = new HashMap<>(); + queue.add(startPos); + visited.put(startPos, null); + while (!queue.isEmpty()) { + if (queue.size() > 1000000) break; + Point position = queue.pollFirst(); + for (Direction direction : Direction.values()) { + Point pushedPoint = push(board, position, direction); + if (visited.containsKey(pushedPoint)) continue; + queue.add(pushedPoint); + visited.put(pushedPoint, position); + for (Point endColumn : endColumns) { + if (pushedPoint.equals(endColumn)) { + List route = new ArrayList<>(); + Point lastPoint = pushedPoint; + while (lastPoint != null) { + route.add(0, lastPoint); + lastPoint = visited.get(lastPoint); + } + return route; + } + } + } + } + return new ArrayList<>(); + } + + public static Point push(char[][] board, Point pos, Direction direction) { + switch (direction) { + case UP: + for (int row = pos.row; row >= 0; row--) { + if (board[row][pos.column] == 'X') { + return new Point(row + 1, pos.column); + } + } + return new Point(0, pos.column); + case DOWN: + for (int row = pos.row; row <= 18; row++) { + if (board[row][pos.column] == 'X') { + return new Point(row - 1, pos.column); + } + } + return new Point(18, pos.column); + case LEFT: + for (int column = pos.column; column >= 0; column--) { + if (board[pos.row][column] == 'X') { + return new Point(pos.row, column + 1); + } + } + return new Point(pos.row, 0); + case RIGHT: + for (int column = pos.column; column <= 18; column++) { + if (board[pos.row][column] == 'X') { + return new Point(pos.row, column - 1); + } + } + return new Point(pos.row, 18); + } + return null; + } + + public static class Point { + + public int row; + public int column; + + public Point(int row, int column) { + this.row = row; + this.column = column; + } + + @Override + public int hashCode() { + return Objects.hash(row, column); + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof Point) { + Point point = (Point) obj; + return row == point.row && column == point.column; + } + return false; + } + + } + + enum Direction { + UP, + DOWN, + LEFT, + RIGHT + } + +} -- cgit From 5a86451ed34e7d5c9baf20a4c9f4678ecc55fae1 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Wed, 10 Mar 2021 09:54:23 -0500 Subject: Hide kill combo messages --- README.md | 3 +- src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- .../java/me/Danker/commands/DankerGuiCommand.java | 3 ++ .../java/me/Danker/commands/ToggleCommand.java | 19 ++++++--- src/main/java/me/Danker/features/SpamHider.java | 7 ++++ src/main/java/me/Danker/gui/DankerGui.java | 47 +++++++++++++--------- .../java/me/Danker/handlers/ConfigHandler.java | 3 +- 7 files changed, 55 insertions(+), 29 deletions(-) (limited to 'src/main/java/me/Danker/commands/ToggleCommand.java') diff --git a/README.md b/README.md index b1bf536..026d08d 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ Discord Server: https://discord.gg/QsEkNQS - Disable heal messages - Disable ability cooldown messages - Disable out of mana messages +- Disable kill combo messages - Slayer item tracker - RNGesus drop alerts - Click anywhere on-screen to open Maddox @@ -53,7 +54,7 @@ Discord Server: https://discord.gg/QsEkNQS ## Commands - /dhelp - Returns this message in-game. - /dsm - Opens the GUI for Danker's Skyblock Mod. -- /toggle - Toggles features. /toggle list returns values of every toggle. +- /toggle - Toggles features. /toggle list returns values of every toggle. - /setkey - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. - /loot [winter/festival/spooky/f(1-7)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 71e2414..c1ae5af 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -34,7 +34,7 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + " Commands, " + EnumChatFormatting.GREEN + " Keybinds.\n" + EnumChatFormatting.GOLD + " /dhelp" + EnumChatFormatting.AQUA + " - Returns this message.\n" + EnumChatFormatting.GOLD + " /dsm" + EnumChatFormatting.AQUA + " - Opens the GUI for Danker's Skyblock Mod.\n" + - EnumChatFormatting.GOLD + " /toggle " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + + EnumChatFormatting.GOLD + " /toggle " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + EnumChatFormatting.GOLD + " /setkey " + EnumChatFormatting.AQUA + " - Sets API key.\n" + EnumChatFormatting.GOLD + " /getkey" + EnumChatFormatting.AQUA + " - Returns key set with /setkey and copies it to your clipboard.\n" + EnumChatFormatting.GOLD + " /loot [winter/festival/spooky/f(1-7)/session]" + EnumChatFormatting.AQUA + " - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead.\n" + diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index dddc662..fff1ce7 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -58,6 +58,9 @@ public class DankerGuiCommand extends CommandBase { debug.append("[midasstaffmessages][").append(ToggleCommand.midasStaffMessages).append("]\n"); debug.append("[implosionmessages][").append(ToggleCommand.implosionMessages).append("]\n"); debug.append("[healmessages][").append(ToggleCommand.healMessages).append("]\n"); + debug.append("[cooldownmessages][").append(ToggleCommand.cooldownMessages).append("]\n"); + debug.append("[manamessages][").append(ToggleCommand.manaMessages).append("]\n"); + debug.append("[killcombomessages][").append(ToggleCommand.killComboMessages).append("]\n"); debug.append("[caketimer][").append(ToggleCommand.cakeTimerToggled).append("]\n"); debug.append("[lowhealthnotify][").append(ToggleCommand.lowHealthNotifyToggled).append("]\n"); debug.append("[lividsolver][").append(ToggleCommand.lividSolverToggled).append("]\n"); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index a69457f..294cf1a 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -37,6 +37,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean healMessages; public static boolean cooldownMessages; public static boolean manaMessages; + public static boolean killComboMessages; // Dungeons Messages public static boolean lowHealthNotifyToggled; public static boolean lividSolverToggled; @@ -80,11 +81,11 @@ public class ToggleCommand extends CommandBase implements ICommand { return "/" + getCommandName() + " "; + "manamessages/killcombomessages/caketimer/lowhealthnotify/lividsolver/stopsalvagestarred/" + + "notifyslayerslain/necronnotifications/bonzotimer/threemanpuzzle/oruopuzzle/blazepuzzle/" + + "creeperpuzzle/waterpuzzle/tictactoepuzzle/boulderpuzzle/silverfishpuzzle/watchermessage/" + + "startswithterminal/selectallterminal/clickinorderterminal/blockwrongterminalclicks/" + + "itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>"; } @Override @@ -100,7 +101,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "flowerweapons", "sceptremessages", "petcolors", "dungeontimer", "golemalerts", "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", "implosionmessages", "healmessages", "cooldownmessages", "manamessages", - "caketimer", "lowhealthnotify", "autoskilltracker", "lividsolver", + "killcombomessages", "caketimer", "lowhealthnotify", "autoskilltracker", "lividsolver", "stopsalvagestarred", "notifyslayerslain", "necronnotifications", "bonzotimer", "threemanpuzzle", "oruopuzzle", "blazepuzzle", "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "boulderpuzzle", @@ -207,6 +208,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "ManaMessages", manaMessages); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Out of mana messages has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + manaMessages + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "killcombomessages": + killComboMessages = !killComboMessages; + ConfigHandler.writeBooleanConfig("toggles", "KillComboMessages", killComboMessages); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Kill combo messages has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + killComboMessages + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "petcolors": case "petcolours": petColoursToggled = !petColoursToggled; @@ -391,6 +397,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Heal messages: " + DankersSkyblockMod.VALUE_COLOUR + healMessages + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Ability cooldown messages: " + DankersSkyblockMod.VALUE_COLOUR + cooldownMessages + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Out of mana messages: " + DankersSkyblockMod.VALUE_COLOUR + manaMessages + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Kill combo messages: " + DankersSkyblockMod.VALUE_COLOUR + killComboMessages + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Pet colours: " + DankersSkyblockMod.VALUE_COLOUR + petColoursToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Dungeon timer: " + DankersSkyblockMod.VALUE_COLOUR + dungeonTimerToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Golem spawn alerts: " + DankersSkyblockMod.VALUE_COLOUR + golemAlertToggled + "\n" + diff --git a/src/main/java/me/Danker/features/SpamHider.java b/src/main/java/me/Danker/features/SpamHider.java index 4b22f61..a88d9e5 100644 --- a/src/main/java/me/Danker/features/SpamHider.java +++ b/src/main/java/me/Danker/features/SpamHider.java @@ -44,6 +44,13 @@ public class SpamHider { if (!ToggleCommand.implosionMessages) { if (message.contains("Your Implosion hit ") || message.contains("There are blocks in the way")) { event.setCanceled(true); + return; + } + } + // Kill Combo + if (!ToggleCommand.killComboMessages) { + if ((message.contains("+") && message.contains(" Kill Combo ")) || message.contains("Your Kill Combo has expired!")) { + event.setCanceled(true); } } } diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 90aa5e5..a6d2bb1 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -54,6 +54,7 @@ public class DankerGui extends GuiScreen { private GuiButton healMessages; private GuiButton cooldownMessages; private GuiButton manaMessages; + private GuiButton killComboMessages; //Dungeons private GuiButton dungeonTimer; private GuiButton lowHealthNotify; @@ -115,27 +116,28 @@ public class DankerGui extends GuiScreen { implosionMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Implosion Messages: " + Utils.getColouredBoolean(ToggleCommand.implosionMessages)); healMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Heal Messages: " + Utils.getColouredBoolean(ToggleCommand.healMessages)); cooldownMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Cooldown Messages: " + Utils.getColouredBoolean(ToggleCommand.cooldownMessages)); - manaMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Mana Messages: " + Utils.getColouredBoolean((ToggleCommand.manaMessages))); + manaMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Mana Messages: " + Utils.getColouredBoolean(ToggleCommand.manaMessages)); // Page 4 - goldenEnch = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Golden T10/T6/T4 Enchantments: " + Utils.getColouredBoolean(ToggleCommand.goldenToggled)); - petColours = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Colour Pet Backgrounds: " + Utils.getColouredBoolean(ToggleCommand.petColoursToggled)); - expertiseLore = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Expertise Kills In Lore: " + Utils.getColouredBoolean(ToggleCommand.expertiseLoreToggled)); - gparty = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Guild Party Notifications: " + Utils.getColouredBoolean(ToggleCommand.gpartyToggled)); - golemAlerts = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Alert When Golem Spawns: " + Utils.getColouredBoolean(ToggleCommand.golemAlertToggled)); - rngesusAlert = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "RNGesus Alerts: " + Utils.getColouredBoolean(ToggleCommand.rngesusAlerts)); - splitFishing = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing)); + killComboMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Kill Combo Messages: " + Utils.getColouredBoolean(ToggleCommand.killComboMessages)); + goldenEnch = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Golden T10/T6/T4 Enchantments: " + Utils.getColouredBoolean(ToggleCommand.goldenToggled)); + petColours = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Colour Pet Backgrounds: " + Utils.getColouredBoolean(ToggleCommand.petColoursToggled)); + expertiseLore = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Expertise Kills In Lore: " + Utils.getColouredBoolean(ToggleCommand.expertiseLoreToggled)); + gparty = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Guild Party Notifications: " + Utils.getColouredBoolean(ToggleCommand.gpartyToggled)); + golemAlerts = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Alert When Golem Spawns: " + Utils.getColouredBoolean(ToggleCommand.golemAlertToggled)); + rngesusAlert = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "RNGesus Alerts: " + Utils.getColouredBoolean(ToggleCommand.rngesusAlerts)); // Page 5 - lowHealthNotify = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Low Health Notifications: " + Utils.getColouredBoolean(ToggleCommand.lowHealthNotifyToggled)); - lividSolver = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Find Correct Livid: " + Utils.getColouredBoolean(ToggleCommand.lividSolverToggled)); - dungeonTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Display Dungeon Timers: " + Utils.getColouredBoolean(ToggleCommand.dungeonTimerToggled)); - stopSalvageStarred = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Stop Salvaging Starred Items: " + Utils.getColouredBoolean(ToggleCommand.stopSalvageStarredToggled)); - watcherReadyMessage = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Display Watcher Ready Message: " + Utils.getColouredBoolean(ToggleCommand.watcherReadyToggled)); - flowerWeapons = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Prevent Placing FoT/Spirit Sceptre: " + Utils.getColouredBoolean(ToggleCommand.flowerWeaponsToggled)); - notifySlayerSlain = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Notify when Slayer Slain: " + Utils.getColouredBoolean(ToggleCommand.notifySlayerSlainToggled)); + splitFishing = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing)); + lowHealthNotify = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Low Health Notifications: " + Utils.getColouredBoolean(ToggleCommand.lowHealthNotifyToggled)); + lividSolver = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Find Correct Livid: " + Utils.getColouredBoolean(ToggleCommand.lividSolverToggled)); + dungeonTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Display Dungeon Timers: " + Utils.getColouredBoolean(ToggleCommand.dungeonTimerToggled)); + stopSalvageStarred = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Stop Salvaging Starred Items: " + Utils.getColouredBoolean(ToggleCommand.stopSalvageStarredToggled)); + watcherReadyMessage = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Display Watcher Ready Message: " + Utils.getColouredBoolean(ToggleCommand.watcherReadyToggled)); + flowerWeapons = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Prevent Placing FoT/Spirit Sceptre: " + Utils.getColouredBoolean(ToggleCommand.flowerWeaponsToggled)); //Page 6 - necronNotifications = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Necron Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled)); - bonzoTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Bonzo's Mask Timer: " + Utils.getColouredBoolean(ToggleCommand.bonzoTimerToggled)); - autoSkillTracker = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Auto Start/Stop Skill Tracker: " + Utils.getColouredBoolean(ToggleCommand.autoSkillTrackerToggled)); + notifySlayerSlain = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Notify when Slayer Slain: " + Utils.getColouredBoolean(ToggleCommand.notifySlayerSlainToggled)); + necronNotifications = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Necron Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled)); + bonzoTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Bonzo's Mask Timer: " + Utils.getColouredBoolean(ToggleCommand.bonzoTimerToggled)); + autoSkillTracker = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Auto Start/Stop Skill Tracker: " + Utils.getColouredBoolean(ToggleCommand.autoSkillTrackerToggled)); switch (page) { case 1: @@ -171,28 +173,29 @@ public class DankerGui extends GuiScreen { this.buttonList.add(backPage); break; case 4: + this.buttonList.add(killComboMessages); this.buttonList.add(goldenEnch); this.buttonList.add(petColours); this.buttonList.add(expertiseLore); this.buttonList.add(gparty); this.buttonList.add(golemAlerts); this.buttonList.add(rngesusAlert); - this.buttonList.add(splitFishing); this.buttonList.add(nextPage); this.buttonList.add(backPage); break; case 5: + this.buttonList.add(splitFishing); this.buttonList.add(lowHealthNotify); this.buttonList.add(lividSolver); this.buttonList.add(dungeonTimer); this.buttonList.add(stopSalvageStarred); this.buttonList.add(watcherReadyMessage); this.buttonList.add(flowerWeapons); - this.buttonList.add(notifySlayerSlain); this.buttonList.add(nextPage); this.buttonList.add(backPage); break; case 6: + this.buttonList.add(notifySlayerSlain); this.buttonList.add(necronNotifications); this.buttonList.add(bonzoTimer); this.buttonList.add(autoSkillTracker); @@ -379,6 +382,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.autoSkillTrackerToggled = !ToggleCommand.autoSkillTrackerToggled; ConfigHandler.writeBooleanConfig("toggles", "AutoSkillTracker", ToggleCommand.autoSkillTrackerToggled); autoSkillTracker.displayString = "Auto Start/Stop Skill Tracker: " + Utils.getColouredBoolean(ToggleCommand.autoSkillTrackerToggled); + } else if (button == killComboMessages) { + ToggleCommand.killComboMessages = !ToggleCommand.killComboMessages; + ConfigHandler.writeBooleanConfig("toggles", "KillComboMessages", ToggleCommand.killComboMessages); + killComboMessages.displayString = "Kill Combo Messages: " + Utils.getColouredBoolean(ToggleCommand.killComboMessages); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 96c0e75..52b1883 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -232,7 +232,8 @@ public class ConfigHandler { ToggleCommand.healMessages = initBoolean("toggles", "HealMessages", true); ToggleCommand.cooldownMessages = initBoolean("toggles", "CooldownMessages", true); ToggleCommand.manaMessages = initBoolean("toggles", "ManaMessages", true); - //Dungeons + ToggleCommand.killComboMessages = initBoolean("toggles", "KillComboMessages", true); + // Dungeons ToggleCommand.dungeonTimerToggled = initBoolean("toggles", "DungeonTimer", false); ToggleCommand.lowHealthNotifyToggled = initBoolean("toggles", "LowHealthNotify", false); ToggleCommand.lividSolverToggled = initBoolean("toggles", "LividSolver", false); -- 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/commands/ToggleCommand.java') 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 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/commands/ToggleCommand.java') 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/commands/ToggleCommand.java') 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 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/commands/ToggleCommand.java') 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 668a2e184c270d01b259bd3f9269892a05bcc870 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 13 Mar 2021 21:38:33 -0500 Subject: Add ice walk puzzle solver --- README.md | 4 +- build.gradle | 2 +- src/main/java/me/Danker/DankersSkyblockMod.java | 3 +- src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- .../java/me/Danker/commands/DankerGuiCommand.java | 1 + .../java/me/Danker/commands/ToggleCommand.java | 11 +- .../me/Danker/features/BlockPlacingFlowers.java | 44 ++++ .../puzzlesolvers/BlockPlacingFlowers.java | 44 ---- .../features/puzzlesolvers/IceWalkSolver.java | 287 +++++++++++++++++++++ .../features/puzzlesolvers/SilverfishSolver.java | 5 +- src/main/java/me/Danker/gui/PuzzleSolversGui.java | 17 +- .../java/me/Danker/handlers/ConfigHandler.java | 2 + src/main/java/me/Danker/utils/IceWalkUtils.java | 99 +++++++ 13 files changed, 464 insertions(+), 57 deletions(-) create mode 100644 src/main/java/me/Danker/features/BlockPlacingFlowers.java delete mode 100644 src/main/java/me/Danker/features/puzzlesolvers/BlockPlacingFlowers.java create mode 100644 src/main/java/me/Danker/features/puzzlesolvers/IceWalkSolver.java create mode 100644 src/main/java/me/Danker/utils/IceWalkUtils.java (limited to 'src/main/java/me/Danker/commands/ToggleCommand.java') diff --git a/README.md b/README.md index 026d08d..0207b42 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Discord Server: https://discord.gg/QsEkNQS - Fishing, jerry fishing, fishing festival, spooky fishing trackers - Expertise kills in fishing rod lore - Catacombs trackers -- Dungeons puzzle solver (Riddle, trivia, blaze, creeper, water, tic tac toe, boulder, silverfish) +- Dungeons puzzle solver (Riddle, trivia, blaze, creeper, water, tic tac toe, boulder, silverfish, ice walk) - Dungeons timer (watcher, boss, deaths, and puzzle fails) - Watcher ready message - Catacombs F7 Stage 3 solvers (Starts with letter, select all colour, ignore arrows on sea lanterns) @@ -54,7 +54,7 @@ Discord Server: https://discord.gg/QsEkNQS ## Commands - /dhelp - Returns this message in-game. - /dsm - Opens the GUI for Danker's Skyblock Mod. -- /toggle - Toggles features. /toggle list returns values of every toggle. +- /toggle - Toggles features. /toggle list returns values of every toggle. - /setkey - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. - /loot [winter/festival/spooky/f(1-7)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. diff --git a/build.gradle b/build.gradle index 7fd2d15..79291b2 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ plugins { id "net.minecraftforge.gradle.forge" version "2.0.2" } */ -version = "1.8.6-beta2" +version = "1.8.6-beta3" group= "me.Danker.DankersSkyblockMod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Danker's Skyblock Mod" diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index dbb79dc..ab042d6 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -59,7 +59,7 @@ import java.util.Map; @Mod(modid = DankersSkyblockMod.MODID, version = DankersSkyblockMod.VERSION, clientSideOnly = true) public class DankersSkyblockMod { public static final String MODID = "Danker's Skyblock Mod"; - public static final String VERSION = "1.8.6-beta2"; + public static final String VERSION = "1.8.6-beta3"; public static int titleTimer = -1; public static boolean showTitle = false; public static String titleText = ""; @@ -104,6 +104,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new GolemSpawningAlert()); MinecraftForge.EVENT_BUS.register(new GpartyNotifications()); MinecraftForge.EVENT_BUS.register(new HideTooltipsInExperiments()); + MinecraftForge.EVENT_BUS.register(new IceWalkSolver()); MinecraftForge.EVENT_BUS.register(new LividSolver()); MinecraftForge.EVENT_BUS.register(new LootDisplay()); MinecraftForge.EVENT_BUS.register(new LootTracker()); diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index c1ae5af..841d0b5 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -34,7 +34,7 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + " Commands, " + EnumChatFormatting.GREEN + " Keybinds.\n" + EnumChatFormatting.GOLD + " /dhelp" + EnumChatFormatting.AQUA + " - Returns this message.\n" + EnumChatFormatting.GOLD + " /dsm" + EnumChatFormatting.AQUA + " - Opens the GUI for Danker's Skyblock Mod.\n" + - EnumChatFormatting.GOLD + " /toggle " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + + EnumChatFormatting.GOLD + " /toggle " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + EnumChatFormatting.GOLD + " /setkey " + EnumChatFormatting.AQUA + " - Sets API key.\n" + EnumChatFormatting.GOLD + " /getkey" + EnumChatFormatting.AQUA + " - Returns key set with /setkey and copies it to your clipboard.\n" + EnumChatFormatting.GOLD + " /loot [winter/festival/spooky/f(1-7)/session]" + EnumChatFormatting.AQUA + " - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead.\n" + diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index fff1ce7..bd92b3e 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -77,6 +77,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[tictactoepuzzle][").append(ToggleCommand.ticTacToeToggled).append("]\n"); debug.append("[boulderpuzzle][").append(ToggleCommand.boulderToggled).append("]\n"); debug.append("[silverfishpuzzle][").append(ToggleCommand.silverfishToggled).append("]\n"); + debug.append("[icewalkpuzzle][").append(ToggleCommand.iceWalkToggled).append("]\n"); debug.append("[watchermessage][").append(ToggleCommand.watcherReadyToggled).append("]\n"); debug.append("[startswithterminal][").append(ToggleCommand.startsWithToggled).append("]\n"); debug.append("[selectallterminal][").append(ToggleCommand.selectAllToggled).append("]\n"); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 294cf1a..06619ac 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -58,6 +58,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean ticTacToeToggled; public static boolean boulderToggled; public static boolean silverfishToggled; + public static boolean iceWalkToggled; // Terminal Helpers public static boolean startsWithToggled; public static boolean selectAllToggled; @@ -83,7 +84,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "skill50display/outlinetext/midasstaffmessages/implosionmessages/healmessages/cooldownmessages/" + "manamessages/killcombomessages/caketimer/lowhealthnotify/lividsolver/stopsalvagestarred/" + "notifyslayerslain/necronnotifications/bonzotimer/threemanpuzzle/oruopuzzle/blazepuzzle/" + - "creeperpuzzle/waterpuzzle/tictactoepuzzle/boulderpuzzle/silverfishpuzzle/watchermessage/" + + "creeperpuzzle/waterpuzzle/tictactoepuzzle/boulderpuzzle/silverfishpuzzle/icewalkpuzzle/watchermessage/" + "startswithterminal/selectallterminal/clickinorderterminal/blockwrongterminalclicks/" + "itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>"; } @@ -105,7 +106,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "stopsalvagestarred", "notifyslayerslain", "necronnotifications", "bonzotimer", "threemanpuzzle", "oruopuzzle", "blazepuzzle", "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "boulderpuzzle", - "silverfishpuzzle", "watchermessage", "startswithterminal", + "silverfishpuzzle", "icewalkpuzzle", "watchermessage", "startswithterminal", "selectallterminal", "clickinorderterminal", "blockwrongterminalclicks", "itemframeonsealanterns", "ultrasequencer", "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "list"); @@ -324,6 +325,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "SilverfishPuzzle", silverfishToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Silverfish puzzle solver has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + silverfishToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "icewalkpuzzle": + iceWalkToggled = !iceWalkToggled; + ConfigHandler.writeBooleanConfig("toggles", "IceWalkPuzzle", iceWalkToggled); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Ice walk puzzle solver has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + iceWalkToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "watchermessage": watcherReadyToggled = !watcherReadyToggled; ConfigHandler.writeBooleanConfig("toggles", "WatcherReadyMessage", watcherReadyToggled); @@ -416,6 +422,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Tic tac toe puzzle solver: " + DankersSkyblockMod.VALUE_COLOUR + ticTacToeToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Boulder puzzle solver: " + DankersSkyblockMod.VALUE_COLOUR + boulderToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Silverfish puzzle solver: " + DankersSkyblockMod.VALUE_COLOUR + silverfishToggled + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Ice walk puzzle solver: " + DankersSkyblockMod.VALUE_COLOUR + iceWalkToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Watcher ready message: " + DankersSkyblockMod.VALUE_COLOUR + watcherReadyToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Starts with letter terminal solver: " + DankersSkyblockMod.VALUE_COLOUR + startsWithToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Select all color items terminal solver: " + DankersSkyblockMod.VALUE_COLOUR + selectAllToggled + "\n" + diff --git a/src/main/java/me/Danker/features/BlockPlacingFlowers.java b/src/main/java/me/Danker/features/BlockPlacingFlowers.java new file mode 100644 index 0000000..9bfc986 --- /dev/null +++ b/src/main/java/me/Danker/features/BlockPlacingFlowers.java @@ -0,0 +1,44 @@ +package me.Danker.features; + +import me.Danker.commands.ToggleCommand; +import me.Danker.utils.Utils; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.util.ArrayList; +import java.util.Arrays; + +public class BlockPlacingFlowers { + + @SubscribeEvent + public void onInteract(PlayerInteractEvent event) { + if (!Utils.inSkyblock || Minecraft.getMinecraft().thePlayer != event.entityPlayer) return; + ItemStack item = event.entityPlayer.getHeldItem(); + if (item == null) return; + + if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) { + Block block = Minecraft.getMinecraft().theWorld.getBlockState(event.pos).getBlock(); + + ArrayList flowerPlaceable = new ArrayList<>(Arrays.asList( + Blocks.grass, + Blocks.dirt, + Blocks.flower_pot, + Blocks.tallgrass, + Blocks.double_plant + )); + if (flowerPlaceable.contains(block)) { + if (ToggleCommand.flowerWeaponsToggled && item.getDisplayName().contains("Flower of Truth")) { + event.setCanceled(true); + } + if (ToggleCommand.flowerWeaponsToggled && item.getDisplayName().contains("Spirit Sceptre")) { + event.setCanceled(true); + } + } + } + } + +} diff --git a/src/main/java/me/Danker/features/puzzlesolvers/BlockPlacingFlowers.java b/src/main/java/me/Danker/features/puzzlesolvers/BlockPlacingFlowers.java deleted file mode 100644 index fe89fef..0000000 --- a/src/main/java/me/Danker/features/puzzlesolvers/BlockPlacingFlowers.java +++ /dev/null @@ -1,44 +0,0 @@ -package me.Danker.features.puzzlesolvers; - -import me.Danker.commands.ToggleCommand; -import me.Danker.utils.Utils; -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; - -import java.util.ArrayList; -import java.util.Arrays; - -public class BlockPlacingFlowers { - - @SubscribeEvent - public void onInteract(PlayerInteractEvent event) { - if (!Utils.inSkyblock || Minecraft.getMinecraft().thePlayer != event.entityPlayer) return; - ItemStack item = event.entityPlayer.getHeldItem(); - if (item == null) return; - - if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) { - Block block = Minecraft.getMinecraft().theWorld.getBlockState(event.pos).getBlock(); - - ArrayList flowerPlaceable = new ArrayList<>(Arrays.asList( - Blocks.grass, - Blocks.dirt, - Blocks.flower_pot, - Blocks.tallgrass, - Blocks.double_plant - )); - if (flowerPlaceable.contains(block)) { - if (ToggleCommand.flowerWeaponsToggled && item.getDisplayName().contains("Flower of Truth")) { - event.setCanceled(true); - } - if (ToggleCommand.flowerWeaponsToggled && item.getDisplayName().contains("Spirit Sceptre")) { - event.setCanceled(true); - } - } - } - } - -} diff --git a/src/main/java/me/Danker/features/puzzlesolvers/IceWalkSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/IceWalkSolver.java new file mode 100644 index 0000000..eaabf6e --- /dev/null +++ b/src/main/java/me/Danker/features/puzzlesolvers/IceWalkSolver.java @@ -0,0 +1,287 @@ +package me.Danker.features.puzzlesolvers; + +import me.Danker.DankersSkyblockMod; +import me.Danker.commands.ToggleCommand; +import me.Danker.utils.IceWalkUtils; +import me.Danker.utils.Utils; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class IceWalkSolver { + + static boolean prevInIceWalkRoom = false; + static boolean inIceWalkRoom = false; + static BlockPos chest = null; + static EnumFacing silverfishRoomDirection = null; + static List threeByThreeRoute = new ArrayList<>(); + static List fiveByFiveRoute = new ArrayList<>(); + static List sevenBySevenRoute = new ArrayList<>(); + public static int ICE_WALK_LINE_COLOUR; + + @SubscribeEvent + public void onWorldChange(WorldEvent.Load event) { + reset(); + } + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + if (event.phase != TickEvent.Phase.START) return; + + Minecraft mc = Minecraft.getMinecraft(); + EntityPlayerSP player = mc.thePlayer; + World world = mc.theWorld; + if (DankersSkyblockMod.tickAmount % 20 == 0) { + if (ToggleCommand.iceWalkToggled && Utils.inDungeons && world != null && player != null) { + // multi thread block checking + new Thread(() -> { + boolean foundRoom = false; + prevInIceWalkRoom = inIceWalkRoom; + Iterable blocks = BlockPos.getAllInBox(new BlockPos(player.posX - 27, 75, player.posZ - 27), new BlockPos(player.posX + 27, 75, player.posZ + 27)); + for (BlockPos blockPos : blocks) { + Block block = world.getBlockState(blockPos).getBlock(); + if (block == Blocks.chest) { + char[][] threeByThreeBoard = new char[4][3]; + char[][] fiveByFiveBoard = new char[6][5]; + char[][] sevenBySevenBoard = new char[8][7]; + + if (world.getBlockState(blockPos.add(0, 7, 2)).getBlock() == Blocks.iron_bars && world.getBlockState(blockPos.add(0, -3, 2)).getBlock() == Blocks.stone_brick_stairs) { + silverfishRoomDirection = EnumFacing.NORTH; + } else if (world.getBlockState(blockPos.add(-2, 7, 0)).getBlock() == Blocks.iron_bars && world.getBlockState(blockPos.add(-2, -3, 0)).getBlock() == Blocks.stone_brick_stairs) { + silverfishRoomDirection = EnumFacing.EAST; + } else if (world.getBlockState(blockPos.add(0, 7, -2)).getBlock() == Blocks.iron_bars && world.getBlockState(blockPos.add(0, -3, -2)).getBlock() == Blocks.stone_brick_stairs) { + silverfishRoomDirection = EnumFacing.SOUTH; + } else if (world.getBlockState(blockPos.add(2, 7, 0)).getBlock() == Blocks.iron_bars && world.getBlockState(blockPos.add(2, -3, 0)).getBlock() == Blocks.stone_brick_stairs) { + silverfishRoomDirection = EnumFacing.WEST; + } else { + return; + } + + foundRoom = true; + inIceWalkRoom = true; + if (!prevInIceWalkRoom) { + chest = blockPos; + switch (silverfishRoomDirection) { + case NORTH: + for (int row = chest.getZ() + 3, xIteration = 0; xIteration < 8; row++, xIteration++) { + for (int column = chest.getX() - 3, yIteration = 0; yIteration < 7; column++, yIteration++) { + if (world.getBlockState(new BlockPos(column, 72, row)).getBlock() != Blocks.air) { + sevenBySevenBoard[xIteration][yIteration] = 'X'; + } + } + } + for (int row = chest.getZ() + 12, xIteration = 0; xIteration < 6; row++, xIteration++) { + for (int column = chest.getX() - 2, yIteration = 0; yIteration < 5; column++, yIteration++) { + if (world.getBlockState(new BlockPos(column, 71, row)).getBlock() != Blocks.air) { + fiveByFiveBoard[xIteration][yIteration] = 'X'; + } + } + } + for (int row = chest.getZ() + 19, xIteration = 0; xIteration < 4; row++, xIteration++) { + for (int column = chest.getX() - 1, yIteration = 0; yIteration < 3; column++, yIteration++) { + if (world.getBlockState(new BlockPos(column, 70, row)).getBlock() != Blocks.air) { + threeByThreeBoard[xIteration][yIteration] = 'X'; + } + } + } + break; + case EAST: + for (int row = chest.getX() - 3, xIteration = 0; xIteration < 8; row--, xIteration++) { + for (int column = chest.getZ() - 3, yIteration = 0; yIteration < 7; column++, yIteration++) { + if (world.getBlockState(new BlockPos(row, 72, column)).getBlock() != Blocks.air) { + sevenBySevenBoard[xIteration][yIteration] = 'X'; + } + } + } + for (int row = chest.getX() - 12, xIteration = 0; xIteration < 6; row--, xIteration++) { + for (int column = chest.getZ() - 2, yIteration = 0; yIteration < 5; column++, yIteration++) { + if (world.getBlockState(new BlockPos(row, 71, column)).getBlock() != Blocks.air) { + fiveByFiveBoard[xIteration][yIteration] = 'X'; + } + } + } + for (int row = chest.getX() - 19, xIteration = 0; xIteration < 4; row--, xIteration++) { + for (int column = chest.getZ() - 1, yIteration = 0; yIteration < 3; column++, yIteration++) { + if (world.getBlockState(new BlockPos(row, 70, column)).getBlock() != Blocks.air) { + threeByThreeBoard[xIteration][yIteration] = 'X'; + } + } + } + break; + case SOUTH: + for (int row = chest.getZ() - 3, xIteration = 0; xIteration < 8; row--, xIteration++) { + for (int column = chest.getX() + 3, yIteration = 0; yIteration < 7; column--, yIteration++) { + if (world.getBlockState(new BlockPos(column, 72, row)).getBlock() != Blocks.air) { + sevenBySevenBoard[xIteration][yIteration] = 'X'; + } + } + } + for (int row = chest.getZ() - 12, xIteration = 0; xIteration < 6; row--, xIteration++) { + for (int column = chest.getX() + 2, yIteration = 0; yIteration < 5; column--, yIteration++) { + if (world.getBlockState(new BlockPos(column, 71, row)).getBlock() != Blocks.air) { + fiveByFiveBoard[xIteration][yIteration] = 'X'; + } + } + } + for (int row = chest.getZ() - 19, xIteration = 0; xIteration < 4; row--, xIteration++) { + for (int column = chest.getX() + 1, yIteration = 0; yIteration < 3; column--, yIteration++) { + if (world.getBlockState(new BlockPos(column, 70, row)).getBlock() != Blocks.air) { + threeByThreeBoard[xIteration][yIteration] = 'X'; + } + } + } + break; + case WEST: + for (int row = chest.getX() + 3, xIteration = 0; xIteration < 8; row++, xIteration++) { + for (int column = chest.getZ() + 3, yIteration = 0; yIteration < 7; column--, yIteration++) { + if (world.getBlockState(new BlockPos(row, 72, column)).getBlock() != Blocks.air) { + sevenBySevenBoard[xIteration][yIteration] = 'X'; + } + } + } + for (int row = chest.getX() + 12, xIteration = 0; xIteration < 6; row++, xIteration++) { + for (int column = chest.getZ() + 2, yIteration = 0; yIteration < 5; column--, yIteration++) { + if (world.getBlockState(new BlockPos(row, 71, column)).getBlock() != Blocks.air) { + fiveByFiveBoard[xIteration][yIteration] = 'X'; + } + } + } + for (int row = chest.getX() + 19, xIteration = 0; xIteration < 4; row++, xIteration++) { + for (int column = chest.getZ() + 1, yIteration = 0; yIteration < 3; column--, yIteration++) { + if (world.getBlockState(new BlockPos(row, 70, column)).getBlock() != Blocks.air) { + threeByThreeBoard[xIteration][yIteration] = 'X'; + } + } + } + break; + } + System.out.println(Arrays.deepToString(threeByThreeBoard)); + System.out.println(Arrays.deepToString(fiveByFiveBoard)); + System.out.println(Arrays.deepToString(sevenBySevenBoard)); + + threeByThreeRoute = IceWalkUtils.solve(threeByThreeBoard); + fiveByFiveRoute = IceWalkUtils.solve(fiveByFiveBoard); + sevenBySevenRoute = IceWalkUtils.solve(sevenBySevenBoard); + } + } + } + if (!foundRoom) { + inIceWalkRoom = false; + reset(); + } + }).start(); + } + } + } + + @SubscribeEvent + public void onWorldRender(RenderWorldLastEvent event) { + if (ToggleCommand.iceWalkToggled && Utils.inDungeons && chest != null) { + if (threeByThreeRoute != null && threeByThreeRoute.size() > 1) { + for (int i = 0; i < threeByThreeRoute.size() - 1; i++) { + Vec3 pos1; + Vec3 pos2; + switch (silverfishRoomDirection) { + case NORTH: + pos1 = new Vec3(chest.getX() - 0.5 + threeByThreeRoute.get(i).column, 70.5, chest.getZ() + 19.5 + threeByThreeRoute.get(i).row); + pos2 = new Vec3(chest.getX() - 0.5 + threeByThreeRoute.get(i + 1).column, 70.5, chest.getZ() + 19.5 + threeByThreeRoute.get(i + 1).row); + break; + case EAST: + pos1 = new Vec3(chest.getX() - 18.5 - threeByThreeRoute.get(i).row, 70.5, chest.getZ() - 0.5 + threeByThreeRoute.get(i).column); + pos2 = new Vec3(chest.getX() - 18.5 - threeByThreeRoute.get(i + 1).row, 70.5, chest.getZ() - 0.5 + threeByThreeRoute.get(i + 1).column); + break; + case SOUTH: + pos1 = new Vec3(chest.getX() + 1.5 - threeByThreeRoute.get(i).column, 70.5, chest.getZ() - 18.5 - threeByThreeRoute.get(i).row); + pos2 = new Vec3(chest.getX() + 1.5 - threeByThreeRoute.get(i + 1).column, 70.5, chest.getZ() - 18.5 - threeByThreeRoute.get(i + 1).row); + break; + case WEST: + pos1 = new Vec3(chest.getX() + 19.5 + threeByThreeRoute.get(i).row, 70.5, chest.getZ() + 1.5 - threeByThreeRoute.get(i).column); + pos2 = new Vec3(chest.getX() + 19.5 + threeByThreeRoute.get(i + 1).row, 70.5, chest.getZ() + 1.5 - threeByThreeRoute.get(i + 1).column); + break; + default: + return; + } + Utils.draw3DLine(pos1, pos2, ICE_WALK_LINE_COLOUR, 5, true, event.partialTicks); + } + } + + if (fiveByFiveRoute != null && fiveByFiveRoute.size() > 1) { + for (int i = 0; i < fiveByFiveRoute.size() - 1; i++) { + Vec3 pos1; + Vec3 pos2; + switch (silverfishRoomDirection) { + case NORTH: + pos1 = new Vec3(chest.getX() - 1.5 + fiveByFiveRoute.get(i).column, 71.5, chest.getZ() + 12.5 + fiveByFiveRoute.get(i).row); + pos2 = new Vec3(chest.getX() - 1.5 + fiveByFiveRoute.get(i + 1).column, 71.5, chest.getZ() + 12.5 + fiveByFiveRoute.get(i + 1).row); + break; + case EAST: + pos1 = new Vec3(chest.getX() - 11.5 - fiveByFiveRoute.get(i).row, 71.5, chest.getZ() - 1.5 + fiveByFiveRoute.get(i).column); + pos2 = new Vec3(chest.getX() - 11.5 - fiveByFiveRoute.get(i + 1).row, 71.5, chest.getZ() - 1.5 + fiveByFiveRoute.get(i + 1).column); + break; + case SOUTH: + pos1 = new Vec3(chest.getX() + 2.5 - fiveByFiveRoute.get(i).column, 71.5, chest.getZ() - 11.5 - fiveByFiveRoute.get(i).row); + pos2 = new Vec3(chest.getX() + 2.5 - fiveByFiveRoute.get(i + 1).column, 71.5, chest.getZ() - 11.5 - fiveByFiveRoute.get(i + 1).row); + break; + case WEST: + pos1 = new Vec3(chest.getX() + 12.5 + fiveByFiveRoute.get(i).row, 71.5, chest.getZ() + 2.5 - fiveByFiveRoute.get(i).column); + pos2 = new Vec3(chest.getX() + 12.5 + fiveByFiveRoute.get(i + 1).row, 71.5, chest.getZ() + 2.5 - fiveByFiveRoute.get(i + 1).column); + break; + default: + return; + } + Utils.draw3DLine(pos1, pos2, ICE_WALK_LINE_COLOUR, 5, true, event.partialTicks); + } + } + + if (sevenBySevenRoute != null && sevenBySevenRoute.size() > 1) { + for (int i = 0; i < sevenBySevenRoute.size() - 1; i++) { + Vec3 pos1; + Vec3 pos2; + switch (silverfishRoomDirection) { + case NORTH: + pos1 = new Vec3(chest.getX() - 2.5 + sevenBySevenRoute.get(i).column, 72.5, chest.getZ() + 3.5 + sevenBySevenRoute.get(i).row); + pos2 = new Vec3(chest.getX() - 2.5 + sevenBySevenRoute.get(i + 1).column, 72.5, chest.getZ() + 3.5 + sevenBySevenRoute.get(i + 1).row); + break; + case EAST: + pos1 = new Vec3(chest.getX() - 2.5 - sevenBySevenRoute.get(i).row, 72.5, chest.getZ() - 2.5 + sevenBySevenRoute.get(i).column); + pos2 = new Vec3(chest.getX() - 2.5 - sevenBySevenRoute.get(i + 1).row, 72.5, chest.getZ() - 2.5 + sevenBySevenRoute.get(i + 1).column); + break; + case SOUTH: + pos1 = new Vec3(chest.getX() + 3.5 - sevenBySevenRoute.get(i).column, 72.5, chest.getZ() - 2.5 - sevenBySevenRoute.get(i).row); + pos2 = new Vec3(chest.getX() + 3.5 - sevenBySevenRoute.get(i + 1).column, 72.5, chest.getZ() - 2.5 - sevenBySevenRoute.get(i + 1).row); + break; + case WEST: + pos1 = new Vec3(chest.getX() + 3.5 + sevenBySevenRoute.get(i).row, 72.5, chest.getZ() + 3.5 - sevenBySevenRoute.get(i).column); + pos2 = new Vec3(chest.getX() + 3.5 + sevenBySevenRoute.get(i + 1).row, 72.5, chest.getZ() + 3.5 - sevenBySevenRoute.get(i + 1).column); + break; + default: + return; + } + Utils.draw3DLine(pos1, pos2, ICE_WALK_LINE_COLOUR, 5, true, event.partialTicks); + } + } + } + } + + static void reset() { + silverfishRoomDirection = null; + chest = null; + threeByThreeRoute.clear(); + fiveByFiveRoute.clear(); + sevenBySevenRoute.clear(); + } + +} diff --git a/src/main/java/me/Danker/features/puzzlesolvers/SilverfishSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/SilverfishSolver.java index c07524d..575dcd3 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/SilverfishSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/SilverfishSolver.java @@ -12,7 +12,10 @@ import net.minecraft.entity.monster.EntitySilverfish; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.*; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.event.world.WorldEvent; diff --git a/src/main/java/me/Danker/gui/PuzzleSolversGui.java b/src/main/java/me/Danker/gui/PuzzleSolversGui.java index 3864b80..3bb16a0 100644 --- a/src/main/java/me/Danker/gui/PuzzleSolversGui.java +++ b/src/main/java/me/Danker/gui/PuzzleSolversGui.java @@ -24,6 +24,7 @@ public class PuzzleSolversGui extends GuiScreen { private GuiButton ticTacToe; private GuiButton boulder; private GuiButton silverfish; + private GuiButton iceWalk; private GuiButton startsWith; private GuiButton selectAll; private GuiButton clickOrder; @@ -61,11 +62,12 @@ public class PuzzleSolversGui extends GuiScreen { boulder = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Boulder Solver: " + Utils.getColouredBoolean(ToggleCommand.boulderToggled)); // Page 2 silverfish = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Silverfish Solver: " + Utils.getColouredBoolean(ToggleCommand.silverfishToggled)); - startsWith = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Starts With Letter Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.startsWithToggled)); - selectAll = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Select All Color Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.selectAllToggled)); - clickOrder = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Click in Order Terminal Helper: " + Utils.getColouredBoolean(ToggleCommand.clickInOrderToggled)); - blockClicks = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Block Wrong Clicks on Terminals: " + Utils.getColouredBoolean(ToggleCommand.blockWrongTerminalClicksToggled)); - itemFrameOnSeaLanterns = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Ignore Arrows On Sea Lanterns: " + Utils.getColouredBoolean(ToggleCommand.itemFrameOnSeaLanternsToggled)); + iceWalk = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Ice Walk Solver: " + Utils.getColouredBoolean(ToggleCommand.iceWalkToggled)); + startsWith = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Starts With Letter Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.startsWithToggled)); + selectAll = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Select All Color Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.selectAllToggled)); + clickOrder = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Click in Order Terminal Helper: " + Utils.getColouredBoolean(ToggleCommand.clickInOrderToggled)); + blockClicks = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Block Wrong Clicks on Terminals: " + Utils.getColouredBoolean(ToggleCommand.blockWrongTerminalClicksToggled)); + itemFrameOnSeaLanterns = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Ignore Arrows On Sea Lanterns: " + Utils.getColouredBoolean(ToggleCommand.itemFrameOnSeaLanternsToggled)); switch (page) { case 1: @@ -80,6 +82,7 @@ public class PuzzleSolversGui extends GuiScreen { break; case 2: this.buttonList.add(silverfish); + this.buttonList.add(iceWalk); this.buttonList.add(startsWith); this.buttonList.add(selectAll); this.buttonList.add(clickOrder); @@ -137,6 +140,10 @@ public class PuzzleSolversGui extends GuiScreen { ToggleCommand.silverfishToggled = !ToggleCommand.silverfishToggled; ConfigHandler.writeBooleanConfig("toggles", "SilverfishPuzzle", ToggleCommand.silverfishToggled); silverfish.displayString = "Silverfish Solver: " + Utils.getColouredBoolean(ToggleCommand.silverfishToggled); + } else if (button == iceWalk) { + ToggleCommand.iceWalkToggled = !ToggleCommand.iceWalkToggled; + ConfigHandler.writeBooleanConfig("toggles", "IceWalkPuzzle", ToggleCommand.iceWalkToggled); + iceWalk.displayString = "Ice Walk Solver: " + Utils.getColouredBoolean(ToggleCommand.iceWalkToggled); } else if (button == startsWith) { ToggleCommand.startsWithToggled = !ToggleCommand.startsWithToggled; ConfigHandler.writeBooleanConfig("toggles", "StartsWithTerminal", ToggleCommand.startsWithToggled); diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 52b1883..19edeff 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -254,6 +254,7 @@ public class ConfigHandler { ToggleCommand.ticTacToeToggled = initBoolean("toggles", "TicTacToePuzzle", false); ToggleCommand.boulderToggled = initBoolean("toggles", "BoulderPuzzle", false); ToggleCommand.silverfishToggled = initBoolean("toggles", "SilverfishPuzzle", false); + ToggleCommand.iceWalkToggled = initBoolean("toggles", "IceWalkPuzzle", false); ToggleCommand.startsWithToggled = initBoolean("toggles", "StartsWithTerminal", false); ToggleCommand.selectAllToggled = initBoolean("toggles", "SelectAllTerminal", false); ToggleCommand.clickInOrderToggled = initBoolean("toggles", "ClickInOrderTerminal", false); @@ -513,6 +514,7 @@ public class ConfigHandler { BoulderSolver.BOULDER_COLOUR = initInt("colors", "boulder", 0x197F19); BoulderSolver.BOULDER_ARROW_COLOUR = initInt("colors", "boulderArrow", 0x006000); SilverfishSolver.SILVERFISH_LINE_COLOUR = initInt("colors", "silverfishLine", 0x40FF40); + IceWalkSolver.ICE_WALK_LINE_COLOUR = initInt("colors", "iceWalkLine", 0x40FF40); // Commands if (!hasKey("commands", "reparty")) writeBooleanConfig("commands", "reparty", false); diff --git a/src/main/java/me/Danker/utils/IceWalkUtils.java b/src/main/java/me/Danker/utils/IceWalkUtils.java new file mode 100644 index 0000000..8164fe1 --- /dev/null +++ b/src/main/java/me/Danker/utils/IceWalkUtils.java @@ -0,0 +1,99 @@ +package me.Danker.utils; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +public class IceWalkUtils { + + public static List solve(char[][] board) { + Point startPos = new Point(board.length - 1, board[0].length / 2); + Point endPos = new Point(0, board[0].length / 2); + List route = new ArrayList<>(); + route.add(startPos); + return findSolution(board, startPos, endPos, route); + } + + public static List findSolution(char[][] board, Point startPos, Point endPos, List route) { + for (Direction direction : Direction.values()) { + Point nextPoint = move(board, startPos, direction); + if (nextPoint == null || route.contains(nextPoint)) continue; + List newRoute = new ArrayList<>(route); + newRoute.add(nextPoint); + if (nextPoint.equals(endPos) && isComplete(board, newRoute)) return newRoute; + List solution = findSolution(board, nextPoint, endPos, newRoute); + if (solution == null) continue; + return solution; + } + return null; + } + + public static Point move(char[][] board, Point pos, Direction direction) { + switch (direction) { + case UP: + if (pos.row != 0 && board[pos.row - 1][pos.column] != 'X') { + return new Point(pos.row - 1, pos.column); + } + break; + case DOWN: + if (pos.row != board.length - 1 && board[pos.row + 1][pos.column] != 'X') { + return new Point(pos.row + 1, pos.column); + } + break; + case LEFT: + if (pos.column != 0 && board[pos.row][pos.column - 1] != 'X') { + return new Point(pos.row, pos.column - 1); + } + break; + case RIGHT: + if (pos.column != board[0].length - 1 && board[pos.row][pos.column + 1] != 'X') { + return new Point(pos.row, pos.column + 1); + } + break; + } + return null; + } + + public static boolean isComplete(char[][] board, List route) { + for (int row = 0; row < board.length; row++) { + for (int column = 0; column < board[0].length; column++) { + if (board[row][column] != 'X' && !route.contains(new Point(row, column))) return false; + } + } + return true; + } + + public static class Point { + + public int row; + public int column; + + public Point(int row, int column) { + this.row = row; + this.column = column; + } + + @Override + public int hashCode() { + return Objects.hash(row, column); + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof Point) { + Point point = (Point) obj; + return row == point.row && column == point.column; + } + return false; + } + + } + + enum Direction { + UP, + DOWN, + LEFT, + RIGHT + } + +} -- cgit From 42449d4110853d43b40c50f96c2814b865d24f8d Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 18 Mar 2021 18:24:48 -0400 Subject: Add custom dungeon boss music --- README.md | 15 ++- src/main/java/me/Danker/DankersSkyblockMod.java | 59 ++++++----- .../me/Danker/commands/CustomMusicCommand.java | 70 ++++++++++++ src/main/java/me/Danker/commands/DHelpCommand.java | 5 +- .../java/me/Danker/commands/DankerGuiCommand.java | 3 +- .../java/me/Danker/commands/ToggleCommand.java | 25 ++++- src/main/java/me/Danker/features/CustomMusic.java | 117 +++++++++++++++++++++ src/main/java/me/Danker/gui/DankerGui.java | 17 ++- .../java/me/Danker/handlers/ConfigHandler.java | 2 + 9 files changed, 279 insertions(+), 34 deletions(-) create mode 100644 src/main/java/me/Danker/commands/CustomMusicCommand.java create mode 100644 src/main/java/me/Danker/features/CustomMusic.java (limited to 'src/main/java/me/Danker/commands/ToggleCommand.java') diff --git a/README.md b/README.md index b9abb21..dfc8ce4 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ Discord Server: https://discord.gg/QsEkNQS - Watcher ready message - Catacombs F7 Stage 3 solvers (Starts with letter, select all colour, ignore arrows on sea lanterns) - Find correct Livid (with graphic display of HP) +- Use custom music in dungeon boss room - Experimentation solvers (Ultrasequencer, Chronomatron, Superpairs) - Hide tooltips in experiment addons - Pet background colors based on level @@ -54,7 +55,7 @@ Discord Server: https://discord.gg/QsEkNQS ## Commands - /dhelp - Returns this message in-game. - /dsm - Opens the GUI for Danker's Skyblock Mod. -- /toggle - Toggles features. /toggle list returns values of every toggle. +- /toggle - Toggles features. /toggle list returns values of every toggle. - /setkey - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. - /loot [winter/festival/spooky/f(1-7)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. @@ -75,11 +76,23 @@ Discord Server: https://discord.gg/QsEkNQS - /onlyslayer <1/2/3/4/5> - Stops you from starting a slayer quest other than the one specified. - /skilltracker - Text display for skill xp/hour. - /reparty - Disbands and reparties all members in the party +- /dsmmusic - Stops or reloads the custom music. ## Keybinds - Open Maddox menu - M by default. +- Regular Ability - Numpad 4 by default. - Start/Stop Skill Tracker - Numpad 5 by default. +## Custom Music +- Supported audio formats: + - .wav + - .mid + - .aiff + - .au + - .rmf +- For the following custom music, place a supported music file with the given name in the `.minecraft/config/dsmmusic` folder. + - Dungeon boss music: `dungeonboss` + ### Notes - Slayer tracker for token drops and 20% chance drops uses a 12x12x12 bounding box centered on the player to detect the drops. If you are out of the range of the item drop, it will not count on the tracker. - API commands may take a while depending on your internet connection. The API may also go down. diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index ab042d6..4a40a61 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -53,6 +53,9 @@ import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToSe import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; +import javax.sound.sampled.LineUnavailableException; +import javax.sound.sampled.UnsupportedAudioFileException; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -70,6 +73,7 @@ public class DankersSkyblockMod { static boolean OAMWarning = false; public static String guiToOpen = null; public static boolean firstLaunch = false; + public static String configDirectory; public static String MAIN_COLOUR; public static String SECONDARY_COLOUR; @@ -97,6 +101,7 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(new ChronomatronSolver()); MinecraftForge.EVENT_BUS.register(new ClickInOrderSolver()); MinecraftForge.EVENT_BUS.register(new CreeperSolver()); + MinecraftForge.EVENT_BUS.register(new CustomMusic()); MinecraftForge.EVENT_BUS.register(new DungeonTimer()); MinecraftForge.EVENT_BUS.register(new ExpertiseLore()); MinecraftForge.EVENT_BUS.register(new FasterMaddoxCalling()); @@ -145,31 +150,35 @@ public class DankersSkyblockMod { } @EventHandler - public void preInit(final FMLPreInitializationEvent event) { - ClientCommandHandler.instance.registerCommand(new ToggleCommand()); - ClientCommandHandler.instance.registerCommand(new SetkeyCommand()); - ClientCommandHandler.instance.registerCommand(new GetkeyCommand()); - ClientCommandHandler.instance.registerCommand(new LootCommand()); - ClientCommandHandler.instance.registerCommand(new ReloadConfigCommand()); - ClientCommandHandler.instance.registerCommand(new DisplayCommand()); - ClientCommandHandler.instance.registerCommand(new MoveCommand()); - ClientCommandHandler.instance.registerCommand(new SlayerCommand()); - ClientCommandHandler.instance.registerCommand(new SkillsCommand()); - ClientCommandHandler.instance.registerCommand(new GuildOfCommand()); - ClientCommandHandler.instance.registerCommand(new DHelpCommand()); - ClientCommandHandler.instance.registerCommand(new PetsCommand()); - ClientCommandHandler.instance.registerCommand(new BankCommand()); - ClientCommandHandler.instance.registerCommand(new ArmourCommand()); - ClientCommandHandler.instance.registerCommand(new ImportFishingCommand()); - ClientCommandHandler.instance.registerCommand(new ResetLootCommand()); - ClientCommandHandler.instance.registerCommand(new ScaleCommand()); - ClientCommandHandler.instance.registerCommand(new SkyblockPlayersCommand()); - ClientCommandHandler.instance.registerCommand(new BlockSlayerCommand()); - ClientCommandHandler.instance.registerCommand(new DungeonsCommand()); - ClientCommandHandler.instance.registerCommand(new LobbySkillsCommand()); - ClientCommandHandler.instance.registerCommand(new DankerGuiCommand()); - ClientCommandHandler.instance.registerCommand(new SkillTrackerCommand()); - ClientCommandHandler.instance.registerCommand(new FairySoulsCommand()); + public void preInit(final FMLPreInitializationEvent event) throws UnsupportedAudioFileException, IOException, LineUnavailableException { + ClientCommandHandler.instance.registerCommand(new ArmourCommand()); + ClientCommandHandler.instance.registerCommand(new BankCommand()); + ClientCommandHandler.instance.registerCommand(new BlockSlayerCommand()); + ClientCommandHandler.instance.registerCommand(new CustomMusicCommand()); + ClientCommandHandler.instance.registerCommand(new DHelpCommand()); + ClientCommandHandler.instance.registerCommand(new DankerGuiCommand()); + ClientCommandHandler.instance.registerCommand(new DisplayCommand()); + ClientCommandHandler.instance.registerCommand(new DungeonsCommand()); + ClientCommandHandler.instance.registerCommand(new FairySoulsCommand()); + ClientCommandHandler.instance.registerCommand(new GetkeyCommand()); + ClientCommandHandler.instance.registerCommand(new GuildOfCommand()); + ClientCommandHandler.instance.registerCommand(new ImportFishingCommand()); + ClientCommandHandler.instance.registerCommand(new LobbySkillsCommand()); + ClientCommandHandler.instance.registerCommand(new LootCommand()); + ClientCommandHandler.instance.registerCommand(new MoveCommand()); + ClientCommandHandler.instance.registerCommand(new PetsCommand()); + ClientCommandHandler.instance.registerCommand(new ReloadConfigCommand()); + ClientCommandHandler.instance.registerCommand(new ResetLootCommand()); + ClientCommandHandler.instance.registerCommand(new ScaleCommand()); + ClientCommandHandler.instance.registerCommand(new SetkeyCommand()); + ClientCommandHandler.instance.registerCommand(new SkillTrackerCommand()); + ClientCommandHandler.instance.registerCommand(new SkillsCommand()); + ClientCommandHandler.instance.registerCommand(new SkyblockPlayersCommand()); + ClientCommandHandler.instance.registerCommand(new SlayerCommand()); + ClientCommandHandler.instance.registerCommand(new ToggleCommand()); + + configDirectory = event.getModConfigurationDirectory().toString(); + CustomMusic.init(configDirectory); } @EventHandler diff --git a/src/main/java/me/Danker/commands/CustomMusicCommand.java b/src/main/java/me/Danker/commands/CustomMusicCommand.java new file mode 100644 index 0000000..5364930 --- /dev/null +++ b/src/main/java/me/Danker/commands/CustomMusicCommand.java @@ -0,0 +1,70 @@ +package me.Danker.commands; + +import me.Danker.DankersSkyblockMod; +import me.Danker.features.CustomMusic; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; + +import javax.sound.sampled.LineUnavailableException; +import javax.sound.sampled.UnsupportedAudioFileException; +import java.io.IOException; +import java.util.List; + +public class CustomMusicCommand extends CommandBase { + + @Override + public String getCommandName() { + return "dsmmusic"; + } + + @Override + public String getCommandUsage(ICommandSender arg0) { + return "/" + getCommandName() + " "; + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + if (args.length == 1) { + return getListOfStringsMatchingLastWord(args, "stop", "reload"); + } + return null; + } + + @Override + public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { + final EntityPlayer player = (EntityPlayer)arg0; + + if (arg1.length == 0) { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); + return; + } + + switch (arg1[0].toLowerCase()) { + case "stop": + if (CustomMusic.dungeonboss != null) CustomMusic.dungeonboss.stop(); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Stopped custom music.")); + break; + case "reload": + try { + CustomMusic.init(DankersSkyblockMod.configDirectory); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Reloaded custom music.")); + } catch (IOException | LineUnavailableException | UnsupportedAudioFileException e) { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "An error occurred while trying to reload music.")); + e.printStackTrace(); + } + break; + default: + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); + } + } + +} diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index c431123..0348574 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -34,7 +34,7 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + " Commands, " + EnumChatFormatting.GREEN + " Keybinds.\n" + EnumChatFormatting.GOLD + " /dhelp" + EnumChatFormatting.AQUA + " - Returns this message.\n" + EnumChatFormatting.GOLD + " /dsm" + EnumChatFormatting.AQUA + " - Opens the GUI for Danker's Skyblock Mod.\n" + - EnumChatFormatting.GOLD + " /toggle " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + + EnumChatFormatting.GOLD + " /toggle " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + EnumChatFormatting.GOLD + " /setkey " + EnumChatFormatting.AQUA + " - Sets API key.\n" + EnumChatFormatting.GOLD + " /getkey" + EnumChatFormatting.AQUA + " - Returns key set with /setkey and copies it to your clipboard.\n" + EnumChatFormatting.GOLD + " /loot [winter/festival/spooky/f(1-7)/session]" + EnumChatFormatting.AQUA + " - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead.\n" + @@ -54,7 +54,8 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + " /sbplayers" + EnumChatFormatting.AQUA + " - Uses API to find how many players are on each Skyblock island.\n" + EnumChatFormatting.GOLD + " /onlyslayer <1/2/3/4/5>" + EnumChatFormatting.AQUA + " - Stops you from starting a slayer quest other than the one specified.\n" + EnumChatFormatting.GOLD + " /skilltracker " + EnumChatFormatting.AQUA + " - Text display for skill xp/hour.\n" + - EnumChatFormatting.GOLD + " /reparty " + EnumChatFormatting.AQUA + " - Disbands and reparties all members in the party.\n" + + EnumChatFormatting.GOLD + " /reparty" + EnumChatFormatting.AQUA + " - Disbands and reparties all members in the party.\n" + + EnumChatFormatting.GOLD + " /dsmmusic " + EnumChatFormatting.AQUA + " - Stops or reloads the custom music.\n" + EnumChatFormatting.GREEN + " Open Maddox Menu" + EnumChatFormatting.AQUA + " - M by default.\n" + EnumChatFormatting.GREEN + " Start/Stop Skill Tracker" + EnumChatFormatting.AQUA + " - Numpad 5 by default.\n")); } diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index bd92b3e..6774d5a 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -89,6 +89,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[superpairs][").append(ToggleCommand.superpairsToggled).append("]\n"); debug.append("[hidetooltipsinaddons][").append(ToggleCommand.hideTooltipsInExperimentAddonsToggled).append("]\n"); debug.append("[pickblock][").append(ToggleCommand.swapToPickBlockToggled).append("]\n"); + debug.append("[dungeonbossmusic][").append(ToggleCommand.dungeonBossMusic).append("]\n"); debug.append("# Locations\n"); debug.append("[coords][").append(MoveCommand.coordsXY[0]).append(", ").append(MoveCommand.coordsXY[1]).append("]\n"); debug.append("[display][").append(MoveCommand.displayXY[0]).append(", ").append(MoveCommand.displayXY[1]).append("]\n"); @@ -110,7 +111,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("\n"); } else { for (ResourcePackRepository.Entry resource : Minecraft.getMinecraft().getResourcePackRepository().getRepositoryEntries()) { - debug.append("< ").append(StringUtils.stripControlCodes(resource.getResourcePackName())).append(" >\n"); + debug.append("<").append(StringUtils.stripControlCodes(resource.getResourcePackName())).append(">\n"); } } debug.append("```"); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 06619ac..2cc4745 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -1,6 +1,7 @@ package me.Danker.commands; import me.Danker.DankersSkyblockMod; +import me.Danker.features.CustomMusic; import me.Danker.handlers.ConfigHandler; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; @@ -70,7 +71,9 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean chronomatronToggled; public static boolean superpairsToggled; public static boolean hideTooltipsInExperimentAddonsToggled; - + // Custom Music + public static boolean dungeonBossMusic; + @Override public String getCommandName() { return "toggle"; @@ -86,7 +89,8 @@ public class ToggleCommand extends CommandBase implements ICommand { "notifyslayerslain/necronnotifications/bonzotimer/threemanpuzzle/oruopuzzle/blazepuzzle/" + "creeperpuzzle/waterpuzzle/tictactoepuzzle/boulderpuzzle/silverfishpuzzle/icewalkpuzzle/watchermessage/" + "startswithterminal/selectallterminal/clickinorderterminal/blockwrongterminalclicks/" + - "itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>"; + "itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/" + + "pickblock/dungeonbossmusic/list>"; } @Override @@ -109,7 +113,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "silverfishpuzzle", "icewalkpuzzle", "watchermessage", "startswithterminal", "selectallterminal", "clickinorderterminal", "blockwrongterminalclicks", "itemframeonsealanterns", "ultrasequencer", "chronomatron", "superpairs", - "hidetooltipsinaddons", "pickblock", "list"); + "hidetooltipsinaddons", "pickblock", "dungeonbossmusic", "list"); } return null; } @@ -385,6 +389,18 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "PickBlock", swapToPickBlockToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Auto-swap to pick block has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + swapToPickBlockToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "dungeonbossmusic": + dungeonBossMusic = !dungeonBossMusic; + if (CustomMusic.dungeonboss != null) { + if (dungeonBossMusic) { + CustomMusic.start(); + } else { + CustomMusic.dungeonboss.stop(); + } + } + ConfigHandler.writeBooleanConfig("toggles", "DungeonBossMusic", dungeonBossMusic); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom dungeon boss music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + dungeonBossMusic + 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" + @@ -431,7 +447,8 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Chronomatron solver: " + DankersSkyblockMod.VALUE_COLOUR + chronomatronToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Superpairs solver: " + DankersSkyblockMod.VALUE_COLOUR + superpairsToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Hide tooltips in experiment addons: " + DankersSkyblockMod.VALUE_COLOUR + hideTooltipsInExperimentAddonsToggled + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Auto-swap to pick block " + DankersSkyblockMod.VALUE_COLOUR + swapToPickBlockToggled + DankersSkyblockMod.TYPE_COLOUR + " Auto-swap to pick block: " + DankersSkyblockMod.VALUE_COLOUR + swapToPickBlockToggled + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon boss music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonBossMusic )); break; default: diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java new file mode 100644 index 0000000..8617e7b --- /dev/null +++ b/src/main/java/me/Danker/features/CustomMusic.java @@ -0,0 +1,117 @@ +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.client.entity.EntityPlayerSP; +import net.minecraft.util.StringUtils; +import net.minecraft.world.World; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.client.event.sound.PlaySoundEvent; +import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + +import javax.sound.sampled.*; +import java.io.File; +import java.io.IOException; +import java.util.List; + +public class CustomMusic { + + static boolean prevInDungeonBossRoom = false; + static boolean inDungeonBossRoom = false; + public static Clip dungeonboss; + + @SubscribeEvent + public void onWorldChange(WorldEvent.Load event) { + reset(); + } + + @SubscribeEvent(priority = EventPriority.LOW) + public void onTick(TickEvent.ClientTickEvent event) { + if (event.phase != TickEvent.Phase.START) return; + + Minecraft mc = Minecraft.getMinecraft(); + EntityPlayerSP player = mc.thePlayer; + World world = mc.theWorld; + if (DankersSkyblockMod.tickAmount % 10 == 0) { + if (ToggleCommand.dungeonBossMusic && Utils.inDungeons && world != null && player != null) { + prevInDungeonBossRoom = inDungeonBossRoom; + List scoreboard = ScoreboardHandler.getSidebarLines(); + if (scoreboard.size() > 2) { + String firstLine = ScoreboardHandler.cleanSB(scoreboard.get(scoreboard.size() - 1)); + String secondLine = ScoreboardHandler.cleanSB(scoreboard.get(scoreboard.size() - 2)); + if (firstLine.contains("30,30") || // F1 + firstLine.contains("30,125") || // F2 + firstLine.contains("30,225") || // F3 + secondLine.contains("- Healthy") || // F3 + firstLine.contains("30,344") || // F4 + firstLine.contains("livid") || // F5 + firstLine.contains("sadan") || // F6 + firstLine.contains("necron")) { // F7 + + inDungeonBossRoom = true; + if (!prevInDungeonBossRoom && dungeonboss != null) { + start(); + } + } else { + reset(); + } + } + } + } + } + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent event) { + if (!Utils.inDungeons) return; + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + + if (message.contains("EXTRA STATS ")) { + if (dungeonboss != null) dungeonboss.stop(); + } + } + + @SubscribeEvent + public void onSound(PlaySoundEvent event) { + if (ToggleCommand.dungeonBossMusic && Utils.inDungeons && inDungeonBossRoom) { + if (event.name.startsWith("note.")) event.setCanceled(true); + } + } + + public static void init(String configDirectory) throws IOException, LineUnavailableException, UnsupportedAudioFileException { + if (configDirectory == null) return; + File directory = new File(configDirectory + "\\dsmmusic"); + if (!directory.exists()) directory.mkdir(); + + reset(); + + dungeonboss = AudioSystem.getClip(); + File dungeonBossFile = new File(configDirectory + "\\dsmmusic\\dungeonboss.wav"); + if (dungeonBossFile.exists()) { + AudioInputStream ais = AudioSystem.getAudioInputStream(dungeonBossFile); + dungeonboss.open(ais); + + FloatControl volume = (FloatControl) dungeonboss.getControl(FloatControl.Type.MASTER_GAIN); + volume.setValue(-20F); + } + } + + static void reset() { + inDungeonBossRoom = false; + if (dungeonboss != null) dungeonboss.stop(); + } + + public static void start() { + if (dungeonboss != null && inDungeonBossRoom) { + dungeonboss.setMicrosecondPosition(0); + dungeonboss.start(); + dungeonboss.loop(Clip.LOOP_CONTINUOUSLY); + } + } + +} diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index a6d2bb1..2d07f27 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -2,6 +2,7 @@ package me.Danker.gui; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; +import me.Danker.features.CustomMusic; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; @@ -46,6 +47,7 @@ public class DankerGui extends GuiScreen { private GuiButton skill50Display; private GuiButton outlineText; private GuiButton cakeTimer; + private GuiButton dungeonBossMusic; // Chat Messages private GuiButton lividDagger; private GuiButton sceptreMessages; @@ -55,7 +57,7 @@ public class DankerGui extends GuiScreen { private GuiButton cooldownMessages; private GuiButton manaMessages; private GuiButton killComboMessages; - //Dungeons + // Dungeons private GuiButton dungeonTimer; private GuiButton lowHealthNotify; private GuiButton lividSolver; @@ -138,6 +140,7 @@ public class DankerGui extends GuiScreen { necronNotifications = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Necron Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled)); bonzoTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Bonzo's Mask Timer: " + Utils.getColouredBoolean(ToggleCommand.bonzoTimerToggled)); autoSkillTracker = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Auto Start/Stop Skill Tracker: " + Utils.getColouredBoolean(ToggleCommand.autoSkillTrackerToggled)); + dungeonBossMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Custom Dungeon Boss Music: " + Utils.getColouredBoolean(ToggleCommand.dungeonBossMusic)); switch (page) { case 1: @@ -199,6 +202,7 @@ public class DankerGui extends GuiScreen { this.buttonList.add(necronNotifications); this.buttonList.add(bonzoTimer); this.buttonList.add(autoSkillTracker); + this.buttonList.add(dungeonBossMusic); this.buttonList.add(backPage); break; } @@ -386,6 +390,17 @@ 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 == dungeonBossMusic) { + ToggleCommand.dungeonBossMusic = !ToggleCommand.dungeonBossMusic; + if (CustomMusic.dungeonboss != null) { + if (ToggleCommand.dungeonBossMusic) { + CustomMusic.start(); + } else { + CustomMusic.dungeonboss.stop(); + } + } + ConfigHandler.writeBooleanConfig("toggles", "DungeonBossMusic", ToggleCommand.dungeonBossMusic); + dungeonBossMusic.displayString = "Custom Dungeon Boss Music: " + Utils.getColouredBoolean(ToggleCommand.dungeonBossMusic); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index cb04daa..6b17b3c 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -265,6 +265,8 @@ public class ConfigHandler { ToggleCommand.chronomatronToggled = initBoolean("toggles", "Chronomatron", false); ToggleCommand.superpairsToggled = initBoolean("toggles", "Superpairs", false); ToggleCommand.hideTooltipsInExperimentAddonsToggled = initBoolean("toggles", "HideTooltipsInExperimentAddons", false); + // Custom Music + ToggleCommand.dungeonBossMusic = initBoolean("toggles", "DungeonBossMusic", false); // API if (!hasKey("api", "APIKey")) writeStringConfig("api", "APIKey", ""); -- cgit From d500946a0df2da0385f2ec25511f16c6b94fd662 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 18 Mar 2021 18:51:33 -0400 Subject: Fix small issues with merge --- src/main/java/me/Danker/commands/ToggleCommand.java | 2 +- src/main/java/me/Danker/gui/OnlySlayerGui.java | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'src/main/java/me/Danker/commands/ToggleCommand.java') diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index fc6b4f3..05c3458 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -491,7 +491,7 @@ public class ToggleCommand extends CommandBase implements ICommand { 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 + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Highlight Arachne Boss " + DankersSkyblockMod.VALUE_COLOUR + highlightArachne + DankersSkyblockMod.TYPE_COLOUR + " Highlight Arachne Boss " + DankersSkyblockMod.VALUE_COLOUR + highlightArachne + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon boss music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonBossMusic )); break; diff --git a/src/main/java/me/Danker/gui/OnlySlayerGui.java b/src/main/java/me/Danker/gui/OnlySlayerGui.java index 9df0087..762e5e5 100644 --- a/src/main/java/me/Danker/gui/OnlySlayerGui.java +++ b/src/main/java/me/Danker/gui/OnlySlayerGui.java @@ -26,9 +26,8 @@ public class OnlySlayerGui extends GuiScreen { private GuiButton two; private GuiButton three; private GuiButton four; - private GuiButton five; - - private GuiButton highlightSlayers; + private GuiButton five; + private GuiButton highlightSlayers; @Override public boolean doesGuiPauseGame() { @@ -55,13 +54,12 @@ public class OnlySlayerGui extends GuiScreen { onlyNumberInt = 3; break; case "IV": + default: onlyNumberInt = 4; break; case "V": onlyNumberInt = 5; break; - default: - return; } goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); @@ -74,7 +72,7 @@ public class OnlySlayerGui extends GuiScreen { three = new GuiButton(0, width / 2 - 30, (int) (height * 0.6), 60, 20, "III"); four = new GuiButton(0, width / 2 + 50, (int) (height * 0.6), 60, 20, "IV"); five = new GuiButton(0, width / 2 + 130, (int) (height * 0.6), 60, 20, "V"); - highlightSlayers = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Highlight Slayer Bosses: " + Utils.getColouredBoolean(ToggleCommand.highlightSlayers)); + 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); @@ -85,7 +83,7 @@ public class OnlySlayerGui extends GuiScreen { this.buttonList.add(three); this.buttonList.add(four); this.buttonList.add(five); - this.buttonList.add(highlightSlayers); + this.buttonList.add(highlightSlayers); this.buttonList.add(goBack); } @@ -136,8 +134,8 @@ public class OnlySlayerGui extends GuiScreen { ToggleCommand.highlightSlayers = !ToggleCommand.highlightSlayers; ConfigHandler.writeBooleanConfig("toggles", "HighlightSlayers", ToggleCommand.highlightSlayers); highlightSlayers.displayString = "Highlight Slayer Bosses: " + Utils.getColouredBoolean(ToggleCommand.highlightSlayers); - return; - } + return; + } String onlyNumber; switch (onlyNumberInt) { -- cgit From 76d1c2b416c1938c62d9f6c2230dd99a47c38ba1 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 20 Mar 2021 18:28:59 -0400 Subject: Make updating /dhelp easier --- build.gradle | 2 +- src/main/java/me/Danker/DankersSkyblockMod.java | 2 +- .../java/me/Danker/commands/ArmourCommand.java | 6 ++- src/main/java/me/Danker/commands/BankCommand.java | 6 ++- .../me/Danker/commands/BlockSlayerCommand.java | 4 ++ .../me/Danker/commands/CustomMusicCommand.java | 4 ++ src/main/java/me/Danker/commands/DHelpCommand.java | 50 +++++++++++----------- .../java/me/Danker/commands/DankerGuiCommand.java | 6 ++- .../java/me/Danker/commands/DisplayCommand.java | 4 ++ .../java/me/Danker/commands/DungeonsCommand.java | 6 ++- .../java/me/Danker/commands/FairySoulsCommand.java | 4 ++ .../java/me/Danker/commands/GetkeyCommand.java | 6 ++- .../java/me/Danker/commands/GuildOfCommand.java | 4 ++ .../me/Danker/commands/ImportFishingCommand.java | 6 ++- .../java/me/Danker/commands/LobbyBankCommand.java | 4 ++ .../me/Danker/commands/LobbySkillsCommand.java | 6 ++- src/main/java/me/Danker/commands/LootCommand.java | 6 ++- src/main/java/me/Danker/commands/MoveCommand.java | 4 ++ src/main/java/me/Danker/commands/PetsCommand.java | 4 ++ .../me/Danker/commands/ReloadConfigCommand.java | 6 ++- .../java/me/Danker/commands/RepartyCommand.java | 4 ++ .../java/me/Danker/commands/ResetLootCommand.java | 4 ++ src/main/java/me/Danker/commands/ScaleCommand.java | 4 ++ .../java/me/Danker/commands/SetkeyCommand.java | 6 ++- .../me/Danker/commands/SkillTrackerCommand.java | 4 ++ .../java/me/Danker/commands/SkillsCommand.java | 4 ++ .../me/Danker/commands/SkyblockPlayersCommand.java | 6 ++- .../java/me/Danker/commands/SlayerCommand.java | 4 ++ .../java/me/Danker/commands/ToggleCommand.java | 4 ++ 29 files changed, 142 insertions(+), 38 deletions(-) (limited to 'src/main/java/me/Danker/commands/ToggleCommand.java') diff --git a/build.gradle b/build.gradle index bc2b7b6..bbeb080 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ plugins { id "net.minecraftforge.gradle.forge" version "2.0.2" } */ -version = "1.8.6-beta3" +version = "1.8.6-beta4" group= "me.Danker.DankersSkyblockMod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Danker's Skyblock Mod" diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index a7c440b..e3530cd 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -62,7 +62,7 @@ import java.util.Map; @Mod(modid = DankersSkyblockMod.MODID, version = DankersSkyblockMod.VERSION, clientSideOnly = true) public class DankersSkyblockMod { public static final String MODID = "Danker's Skyblock Mod"; - public static final String VERSION = "1.8.6-beta3"; + public static final String VERSION = "1.8.6-beta4"; public static int titleTimer = -1; public static boolean showTitle = false; public static String titleText = ""; diff --git a/src/main/java/me/Danker/commands/ArmourCommand.java b/src/main/java/me/Danker/commands/ArmourCommand.java index 579a413..4597309 100644 --- a/src/main/java/me/Danker/commands/ArmourCommand.java +++ b/src/main/java/me/Danker/commands/ArmourCommand.java @@ -39,7 +39,11 @@ public class ArmourCommand extends CommandBase { public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName() + " [name]"; } - + + public static String usage(ICommandSender arg0) { + return new ArmourCommand().getCommandUsage(arg0); + } + @Override public int getRequiredPermissionLevel() { return 0; diff --git a/src/main/java/me/Danker/commands/BankCommand.java b/src/main/java/me/Danker/commands/BankCommand.java index e1bbdde..ddf9502 100644 --- a/src/main/java/me/Danker/commands/BankCommand.java +++ b/src/main/java/me/Danker/commands/BankCommand.java @@ -34,7 +34,11 @@ public class BankCommand extends CommandBase { public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName() + " [name]"; } - + + public static String usage(ICommandSender arg0) { + return new BankCommand().getCommandUsage(arg0); + } + @Override public int getRequiredPermissionLevel() { return 0; diff --git a/src/main/java/me/Danker/commands/BlockSlayerCommand.java b/src/main/java/me/Danker/commands/BlockSlayerCommand.java index 09da5d6..06fb4ef 100644 --- a/src/main/java/me/Danker/commands/BlockSlayerCommand.java +++ b/src/main/java/me/Danker/commands/BlockSlayerCommand.java @@ -24,6 +24,10 @@ public class BlockSlayerCommand extends CommandBase { return "/" + getCommandName() + " <1/2/3/4/5>"; } + public static String usage(ICommandSender arg0) { + return new BlockSlayerCommand().getCommandUsage(arg0); + } + @Override public int getRequiredPermissionLevel() { return 0; diff --git a/src/main/java/me/Danker/commands/CustomMusicCommand.java b/src/main/java/me/Danker/commands/CustomMusicCommand.java index 5364930..0279ee8 100644 --- a/src/main/java/me/Danker/commands/CustomMusicCommand.java +++ b/src/main/java/me/Danker/commands/CustomMusicCommand.java @@ -26,6 +26,10 @@ public class CustomMusicCommand extends CommandBase { return "/" + getCommandName() + " "; } + public static String usage(ICommandSender arg0) { + return new CustomMusicCommand().getCommandUsage(arg0); + } + @Override public int getRequiredPermissionLevel() { return 0; diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 34f85f3..f6cfb82 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -32,31 +32,31 @@ public class DHelpCommand extends CommandBase { player.addChatMessage(new ChatComponentText("\n" + EnumChatFormatting.GOLD + " " + DankersSkyblockMod.MODID + " Version " + DankersSkyblockMod.VERSION + "\n" + EnumChatFormatting.AQUA + " <> = Mandatory parameter. [] = Optional parameter.\n" + EnumChatFormatting.GOLD + " Commands, " + EnumChatFormatting.GREEN + " Keybinds.\n" + - EnumChatFormatting.GOLD + " /dhelp" + EnumChatFormatting.AQUA + " - Returns this message.\n" + - EnumChatFormatting.GOLD + " /dsm" + EnumChatFormatting.AQUA + " - Opens the GUI for Danker's Skyblock Mod.\n" + - EnumChatFormatting.GOLD + " /toggle " + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + - EnumChatFormatting.GOLD + " /setkey " + EnumChatFormatting.AQUA + " - Sets API key.\n" + - EnumChatFormatting.GOLD + " /getkey" + EnumChatFormatting.AQUA + " - Returns key set with /setkey and copies it to your clipboard.\n" + - EnumChatFormatting.GOLD + " /loot [winter/festival/spooky/f(1-7)/session]" + EnumChatFormatting.AQUA + " - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead.\n" + - EnumChatFormatting.GOLD + " /display [winter/festival/spooky/f(1-7)/session]" + EnumChatFormatting.AQUA + " - 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.\n" + - EnumChatFormatting.GOLD + " /resetloot " + EnumChatFormatting.AQUA + " - Resets loot for trackers. /resetloot confirm confirms the reset.\n" + - EnumChatFormatting.GOLD + " /move " + EnumChatFormatting.AQUA + " - Moves text display to specified X and Y coordinates.\n" + - EnumChatFormatting.GOLD + " /scale " + EnumChatFormatting.AQUA + " - Scales text display to a specified multipler between 0.1x and 10x.\n" + - EnumChatFormatting.GOLD + " /slayer [player]" + EnumChatFormatting.AQUA + " - Uses API to get slayer xp of a person. If no name is provided, it checks yours.\n" + - EnumChatFormatting.GOLD + " /skills [player]" + EnumChatFormatting.AQUA + " - Uses API to get skill levels of a person. If no name is provided, it checks yours.\n" + - EnumChatFormatting.GOLD + " /lobbyskills" + EnumChatFormatting.AQUA + " - Uses API to find the average skills of the lobby, as well the three players with the highest skill average.\n" + - EnumChatFormatting.GOLD + " /guildof [player]" + EnumChatFormatting.AQUA + " - Uses API to get guild name and guild master of a person. If no name is provided, it checks yours.\n" + - EnumChatFormatting.GOLD + " /petsof [player]" + EnumChatFormatting.AQUA + " - Uses API to get pets of a person. If no name is provided, it checks yours.\n" + - EnumChatFormatting.GOLD + " /bank [player]" + EnumChatFormatting.AQUA + " - Uses API to get bank and purse coins of a person. If no name is provided, it checks yours.\n" + - EnumChatFormatting.GOLD + " /armor [player]" + EnumChatFormatting.AQUA + " - Uses API to get armour of a person. If no name is provided, it checks yours.\n" + - EnumChatFormatting.GOLD + " /dungeons [player] " + EnumChatFormatting.AQUA + " - Uses API to get dungeon levels of a person. If no name is provided, it checks yours.\n" + - EnumChatFormatting.GOLD + " /importfishing" + EnumChatFormatting.AQUA + " - Imports your fishing stats from your latest profile to your fishing tracker using the API.\n" + - EnumChatFormatting.GOLD + " /sbplayers" + EnumChatFormatting.AQUA + " - Uses API to find how many players are on each Skyblock island.\n" + - EnumChatFormatting.GOLD + " /onlyslayer <1/2/3/4/5>" + EnumChatFormatting.AQUA + " - Stops you from starting a slayer quest other than the one specified.\n" + - EnumChatFormatting.GOLD + " /skilltracker " + EnumChatFormatting.AQUA + " - Text display for skill xp/hour.\n" + - EnumChatFormatting.GOLD + " /lobbybank " + EnumChatFormatting.AQUA + " - Uses API to find the average bank total of the lobby, as well the three players with the highest total money in the bank(and purse).\n" + - EnumChatFormatting.GOLD + " /reparty" + EnumChatFormatting.AQUA + " - Disbands and reparties all members in the party.\n" + - EnumChatFormatting.GOLD + " /dsmmusic " + EnumChatFormatting.AQUA + " - Stops or reloads the custom music.\n" + + EnumChatFormatting.GOLD + getCommandUsage(arg0) + EnumChatFormatting.AQUA + " - Returns this message.\n" + + EnumChatFormatting.GOLD + DankerGuiCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Opens the GUI for Danker's Skyblock Mod.\n" + + EnumChatFormatting.GOLD + ToggleCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + + EnumChatFormatting.GOLD + SetkeyCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Sets API key.\n" + + EnumChatFormatting.GOLD + GetkeyCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Returns key set with /setkey and copies it to your clipboard.\n" + + EnumChatFormatting.GOLD + LootCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead.\n" + + EnumChatFormatting.GOLD + DisplayCommand.usage(arg0) + EnumChatFormatting.AQUA + " - 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.\n" + + EnumChatFormatting.GOLD + ResetLootCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Resets loot for trackers. /resetloot confirm confirms the reset.\n" + + EnumChatFormatting.GOLD + MoveCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Moves text display to specified X and Y coordinates.\n" + + EnumChatFormatting.GOLD + ScaleCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Scales text display to a specified multipler between 0.1x and 10x.\n" + + EnumChatFormatting.GOLD + SlayerCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to get slayer xp of a person. If no name is provided, it checks yours.\n" + + EnumChatFormatting.GOLD + SkillsCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to get skill levels of a person. If no name is provided, it checks yours.\n" + + EnumChatFormatting.GOLD + LobbySkillsCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find the average skills of the lobby, as well the three players with the highest skill average.\n" + + EnumChatFormatting.GOLD + GuildOfCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to get guild name and guild master of a person. If no name is provided, it checks yours.\n" + + EnumChatFormatting.GOLD + PetsCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to get pets of a person. If no name is provided, it checks yours.\n" + + EnumChatFormatting.GOLD + BankCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to get bank and purse coins of a person. If no name is provided, it checks yours.\n" + + EnumChatFormatting.GOLD + ArmourCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to get armour of a person. If no name is provided, it checks yours.\n" + + EnumChatFormatting.GOLD + DungeonsCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to get dungeon levels of a person. If no name is provided, it checks yours.\n" + + EnumChatFormatting.GOLD + ImportFishingCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Imports your fishing stats from your latest profile to your fishing tracker using the API.\n" + + EnumChatFormatting.GOLD + SkyblockPlayersCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find how many players are on each Skyblock island.\n" + + EnumChatFormatting.GOLD + BlockSlayerCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Stops you from starting a slayer quest other than the one specified.\n" + + EnumChatFormatting.GOLD + SkillTrackerCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Text display for skill xp/hour.\n" + + EnumChatFormatting.GOLD + LobbyBankCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find the average bank total of the lobby, as well the three players with the highest total money in the bank(and purse).\n" + + EnumChatFormatting.GOLD + RepartyCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Disbands and reparties all members in the party.\n" + + EnumChatFormatting.GOLD + CustomMusicCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Stops or reloads the custom music.\n" + EnumChatFormatting.GREEN + " Open Maddox Menu" + EnumChatFormatting.AQUA + " - M by default.\n" + EnumChatFormatting.GREEN + " Start/Stop Skill Tracker" + EnumChatFormatting.AQUA + " - Numpad 5 by default.\n")); } diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index 79ab3e3..97af0df 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -23,7 +23,11 @@ public class DankerGuiCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return null; + return "/" + getCommandName(); + } + + public static String usage(ICommandSender arg0) { + return new DankerGuiCommand().getCommandUsage(arg0); } @Override diff --git a/src/main/java/me/Danker/commands/DisplayCommand.java b/src/main/java/me/Danker/commands/DisplayCommand.java index 7760ec9..990e9d1 100644 --- a/src/main/java/me/Danker/commands/DisplayCommand.java +++ b/src/main/java/me/Danker/commands/DisplayCommand.java @@ -24,6 +24,10 @@ public class DisplayCommand extends CommandBase { return "/" + getCommandName() + " [winter/festival/spooky/session/f(1-7)]"; } + public static String usage(ICommandSender arg0) { + return new DisplayCommand().getCommandUsage(arg0); + } + @Override public int getRequiredPermissionLevel() { return 0; diff --git a/src/main/java/me/Danker/commands/DungeonsCommand.java b/src/main/java/me/Danker/commands/DungeonsCommand.java index f9ad93e..92779dc 100644 --- a/src/main/java/me/Danker/commands/DungeonsCommand.java +++ b/src/main/java/me/Danker/commands/DungeonsCommand.java @@ -27,7 +27,11 @@ public class DungeonsCommand extends CommandBase { public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName() + " [name]"; } - + + public static String usage(ICommandSender arg0) { + return new DungeonsCommand().getCommandUsage(arg0); + } + @Override public int getRequiredPermissionLevel() { return 0; diff --git a/src/main/java/me/Danker/commands/FairySoulsCommand.java b/src/main/java/me/Danker/commands/FairySoulsCommand.java index 478851b..b93d596 100644 --- a/src/main/java/me/Danker/commands/FairySoulsCommand.java +++ b/src/main/java/me/Danker/commands/FairySoulsCommand.java @@ -25,6 +25,10 @@ public class FairySoulsCommand extends CommandBase { return "/" + getCommandName() + " [name]"; } + public static String usage(ICommandSender arg0) { + return new FairySoulsCommand().getCommandUsage(arg0); + } + @Override public int getRequiredPermissionLevel() { return 0; diff --git a/src/main/java/me/Danker/commands/GetkeyCommand.java b/src/main/java/me/Danker/commands/GetkeyCommand.java index 9cbb280..a0c2aa3 100644 --- a/src/main/java/me/Danker/commands/GetkeyCommand.java +++ b/src/main/java/me/Danker/commands/GetkeyCommand.java @@ -24,7 +24,11 @@ public class GetkeyCommand extends CommandBase implements ICommand { public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName(); } - + + public static String usage(ICommandSender arg0) { + return new GetkeyCommand().getCommandUsage(arg0); + } + @Override public int getRequiredPermissionLevel() { return 0; diff --git a/src/main/java/me/Danker/commands/GuildOfCommand.java b/src/main/java/me/Danker/commands/GuildOfCommand.java index eb2a26f..1c9f1c4 100644 --- a/src/main/java/me/Danker/commands/GuildOfCommand.java +++ b/src/main/java/me/Danker/commands/GuildOfCommand.java @@ -29,6 +29,10 @@ public class GuildOfCommand extends CommandBase { return "/" + getCommandName() + " [name]"; } + public static String usage(ICommandSender arg0) { + return new GuildOfCommand().getCommandUsage(arg0); + } + @Override public int getRequiredPermissionLevel() { return 0; diff --git a/src/main/java/me/Danker/commands/ImportFishingCommand.java b/src/main/java/me/Danker/commands/ImportFishingCommand.java index c3007a0..4aeff2c 100644 --- a/src/main/java/me/Danker/commands/ImportFishingCommand.java +++ b/src/main/java/me/Danker/commands/ImportFishingCommand.java @@ -22,7 +22,11 @@ public class ImportFishingCommand extends CommandBase { public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName(); } - + + public static String usage(ICommandSender arg0) { + return new ImportFishingCommand().getCommandUsage(arg0); + } + @Override public int getRequiredPermissionLevel() { return 0; diff --git a/src/main/java/me/Danker/commands/LobbyBankCommand.java b/src/main/java/me/Danker/commands/LobbyBankCommand.java index 35a2ba0..77dce2a 100644 --- a/src/main/java/me/Danker/commands/LobbyBankCommand.java +++ b/src/main/java/me/Danker/commands/LobbyBankCommand.java @@ -31,6 +31,10 @@ public class LobbyBankCommand extends CommandBase { return "/" + getCommandName(); } + public static String usage(ICommandSender arg0) { + return new LobbyBankCommand().getCommandUsage(arg0); + } + @Override public int getRequiredPermissionLevel() { return 0; diff --git a/src/main/java/me/Danker/commands/LobbySkillsCommand.java b/src/main/java/me/Danker/commands/LobbySkillsCommand.java index 3d0c575..b6cd87d 100644 --- a/src/main/java/me/Danker/commands/LobbySkillsCommand.java +++ b/src/main/java/me/Danker/commands/LobbySkillsCommand.java @@ -32,7 +32,11 @@ public class LobbySkillsCommand extends CommandBase { public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName(); } - + + public static String usage(ICommandSender arg0) { + return new LobbySkillsCommand().getCommandUsage(arg0); + } + @Override public int getRequiredPermissionLevel() { return 0; diff --git a/src/main/java/me/Danker/commands/LootCommand.java b/src/main/java/me/Danker/commands/LootCommand.java index 5502068..51347a3 100644 --- a/src/main/java/me/Danker/commands/LootCommand.java +++ b/src/main/java/me/Danker/commands/LootCommand.java @@ -26,7 +26,11 @@ public class LootCommand extends CommandBase { public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName() + " [winter/festival/spooky/f(1-7)/session]"; } - + + public static String usage(ICommandSender arg0) { + return new LootCommand().getCommandUsage(arg0); + } + @Override public int getRequiredPermissionLevel() { return 0; diff --git a/src/main/java/me/Danker/commands/MoveCommand.java b/src/main/java/me/Danker/commands/MoveCommand.java index 55ad695..6dedbaf 100644 --- a/src/main/java/me/Danker/commands/MoveCommand.java +++ b/src/main/java/me/Danker/commands/MoveCommand.java @@ -32,6 +32,10 @@ public class MoveCommand extends CommandBase { public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName() + " "; } + + public static String usage(ICommandSender arg0) { + return new MoveCommand().getCommandUsage(arg0); + } @Override public int getRequiredPermissionLevel() { diff --git a/src/main/java/me/Danker/commands/PetsCommand.java b/src/main/java/me/Danker/commands/PetsCommand.java index fa2d24c..fc2f691 100644 --- a/src/main/java/me/Danker/commands/PetsCommand.java +++ b/src/main/java/me/Danker/commands/PetsCommand.java @@ -128,6 +128,10 @@ public class PetsCommand extends CommandBase { return "/" + getCommandName() + " [name]"; } + public static String usage(ICommandSender arg0) { + return new PetsCommand().getCommandUsage(arg0); + } + @Override public int getRequiredPermissionLevel() { return 0; diff --git a/src/main/java/me/Danker/commands/ReloadConfigCommand.java b/src/main/java/me/Danker/commands/ReloadConfigCommand.java index 393d383..c1f4b55 100644 --- a/src/main/java/me/Danker/commands/ReloadConfigCommand.java +++ b/src/main/java/me/Danker/commands/ReloadConfigCommand.java @@ -19,7 +19,11 @@ public class ReloadConfigCommand extends CommandBase { public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName(); } - + + public static String usage(ICommandSender arg0) { + return new ReloadConfigCommand().getCommandUsage(arg0); + } + @Override public int getRequiredPermissionLevel() { return 0; diff --git a/src/main/java/me/Danker/commands/RepartyCommand.java b/src/main/java/me/Danker/commands/RepartyCommand.java index 26a19c6..39695e6 100644 --- a/src/main/java/me/Danker/commands/RepartyCommand.java +++ b/src/main/java/me/Danker/commands/RepartyCommand.java @@ -36,6 +36,10 @@ public class RepartyCommand extends CommandBase implements ICommand { return "/" + getCommandName(); } + public static String usage(ICommandSender arg0) { + return new RepartyCommand().getCommandUsage(arg0); + } + @Override public List getCommandAliases() { return Collections.singletonList("rp"); diff --git a/src/main/java/me/Danker/commands/ResetLootCommand.java b/src/main/java/me/Danker/commands/ResetLootCommand.java index 00df1b9..eac4c88 100644 --- a/src/main/java/me/Danker/commands/ResetLootCommand.java +++ b/src/main/java/me/Danker/commands/ResetLootCommand.java @@ -28,6 +28,10 @@ public class ResetLootCommand extends CommandBase { return "/" + getCommandName() + ""; } + public static String usage(ICommandSender arg0) { + return new ResetLootCommand().getCommandUsage(arg0); + } + @Override public int getRequiredPermissionLevel() { return 0; diff --git a/src/main/java/me/Danker/commands/ScaleCommand.java b/src/main/java/me/Danker/commands/ScaleCommand.java index 79b3cb1..17fb60f 100644 --- a/src/main/java/me/Danker/commands/ScaleCommand.java +++ b/src/main/java/me/Danker/commands/ScaleCommand.java @@ -32,6 +32,10 @@ public class ScaleCommand extends CommandBase { public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName() + " "; } + + public static String usage(ICommandSender arg0) { + return new ScaleCommand().getCommandUsage(arg0); + } @Override public int getRequiredPermissionLevel() { diff --git a/src/main/java/me/Danker/commands/SetkeyCommand.java b/src/main/java/me/Danker/commands/SetkeyCommand.java index ee4b5a5..cb0cd3f 100644 --- a/src/main/java/me/Danker/commands/SetkeyCommand.java +++ b/src/main/java/me/Danker/commands/SetkeyCommand.java @@ -20,7 +20,11 @@ public class SetkeyCommand extends CommandBase implements ICommand { public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName() + " "; } - + + public static String usage(ICommandSender arg0) { + return new SetkeyCommand().getCommandUsage(arg0); + } + @Override public int getRequiredPermissionLevel() { return 0; diff --git a/src/main/java/me/Danker/commands/SkillTrackerCommand.java b/src/main/java/me/Danker/commands/SkillTrackerCommand.java index 75cd2cc..c13e18c 100644 --- a/src/main/java/me/Danker/commands/SkillTrackerCommand.java +++ b/src/main/java/me/Danker/commands/SkillTrackerCommand.java @@ -26,6 +26,10 @@ public class SkillTrackerCommand extends CommandBase { return "/" + getCommandName() + " "; } + public static String usage(ICommandSender arg0) { + return new SkillTrackerCommand().getCommandUsage(arg0); + } + @Override public int getRequiredPermissionLevel() { return 0; diff --git a/src/main/java/me/Danker/commands/SkillsCommand.java b/src/main/java/me/Danker/commands/SkillsCommand.java index a9ce9d1..a17fedb 100644 --- a/src/main/java/me/Danker/commands/SkillsCommand.java +++ b/src/main/java/me/Danker/commands/SkillsCommand.java @@ -27,6 +27,10 @@ public class SkillsCommand extends CommandBase { return "/" + getCommandName() + " [name]"; } + public static String usage(ICommandSender arg0) { + return new SkillsCommand().getCommandUsage(arg0); + } + @Override public int getRequiredPermissionLevel() { return 0; diff --git a/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java b/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java index c69ae6f..f8db0af 100644 --- a/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java +++ b/src/main/java/me/Danker/commands/SkyblockPlayersCommand.java @@ -33,7 +33,11 @@ public class SkyblockPlayersCommand extends CommandBase { public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName(); } - + + public static String usage(ICommandSender arg0) { + return new SkyblockPlayersCommand().getCommandUsage(arg0); + } + @Override public int getRequiredPermissionLevel() { return 0; diff --git a/src/main/java/me/Danker/commands/SlayerCommand.java b/src/main/java/me/Danker/commands/SlayerCommand.java index e7f78f1..91a1a61 100644 --- a/src/main/java/me/Danker/commands/SlayerCommand.java +++ b/src/main/java/me/Danker/commands/SlayerCommand.java @@ -35,6 +35,10 @@ public class SlayerCommand extends CommandBase { return "/" + getCommandName() + " [name]"; } + public static String usage(ICommandSender arg0) { + return new SlayerCommand().getCommandUsage(arg0); + } + @Override public int getRequiredPermissionLevel() { return 0; diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 05c3458..b8b5845 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -100,6 +100,10 @@ public class ToggleCommand extends CommandBase implements ICommand { "/specialhoe/melodytooltips/highlightslayers/highlightArachne/dungeonbossmusic/list>"; } + public static String usage(ICommandSender arg0) { + return new ToggleCommand().getCommandUsage(arg0); + } + @Override public int getRequiredPermissionLevel() { return 0; -- cgit From e499665f275c324bcbf4c3c78b6ef40c20ba611b Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Wed, 24 Mar 2021 14:59:29 -0400 Subject: Add dungeon and blood room custom music --- README.md | 8 +- src/main/java/me/Danker/DankersSkyblockMod.java | 3 + .../me/Danker/commands/CustomMusicCommand.java | 53 ++++++---- .../java/me/Danker/commands/DankerGuiCommand.java | 2 + .../java/me/Danker/commands/LobbyBankCommand.java | 1 - .../java/me/Danker/commands/ToggleCommand.java | 34 +++++-- src/main/java/me/Danker/features/ArachneESP.java | 10 -- src/main/java/me/Danker/features/CustomMusic.java | 111 ++++++++++++++++----- src/main/java/me/Danker/features/SlayerESP.java | 1 - src/main/java/me/Danker/gui/CustomMusicGui.java | 73 ++++++++++++++ src/main/java/me/Danker/gui/DankerGui.java | 35 ++----- src/main/java/me/Danker/gui/OnlySlayerGui.java | 1 - .../java/me/Danker/handlers/ConfigHandler.java | 5 + 13 files changed, 239 insertions(+), 98 deletions(-) create mode 100644 src/main/java/me/Danker/gui/CustomMusicGui.java (limited to 'src/main/java/me/Danker/commands/ToggleCommand.java') diff --git a/README.md b/README.md index f6c76e6..0bd7c27 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Discord Server: https://discord.gg/QsEkNQS - Watcher ready message - Catacombs F7 Stage 3 solvers (Starts with letter, select all colour, ignore arrows on sea lanterns) - Find correct Livid (with graphic display of HP) -- Use custom music in dungeon boss room +- Use custom music in supported locations - Experimentation solvers (Ultrasequencer, Chronomatron, Superpairs) - Hide tooltips in experiment addons - Hide tooltips in Melody's Harp @@ -85,7 +85,7 @@ Discord Server: https://discord.gg/QsEkNQS - /reparty - Disbands and reparties all members in the party - /fairysouls - Check the fairysouls of a player - /lobbybank - Uses API to find the average bank total of the lobby, as well the three players with the highest total money in the bank (and purse). -- /dsmmusic [dungeonboss] [#] - Stops or reloads the custom music. +- /dsmmusic [dungeonboss/bloodroom/dungeon] [#] - Stops, reloads or changes the volume of custom music. ## Keybinds - Open Maddox menu - M by default. @@ -93,7 +93,9 @@ Discord Server: https://discord.gg/QsEkNQS - Start/Stop Skill Tracker - Numpad 5 by default. ## Custom Music -- To use custom music, place a music file with the given name in the `.minecraft/config/dsmmusic` folder and enable the custom song in /dsm. +- To use custom music, place a music file with the given name in the `.minecraft/config/dsmmusic` folder, either run `/dsmmusic reload` or restart your game, and enable the custom song in `/dsm`. + - Dungeon music: `dungeon.wav` + - Blood room music: `bloodroom.wav` - Dungeon boss music: `dungeonboss.wav` ### Notes diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 0e7000b..17def9a 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -340,6 +340,9 @@ public class DankersSkyblockMod { case "skilltracker": mc.displayGuiScreen(new SkillTrackerGui()); break; + case "custommusic": + mc.displayGuiScreen(new CustomMusicGui()); + break; } } guiToOpen = null; diff --git a/src/main/java/me/Danker/commands/CustomMusicCommand.java b/src/main/java/me/Danker/commands/CustomMusicCommand.java index 8e389ac..6412474 100644 --- a/src/main/java/me/Danker/commands/CustomMusicCommand.java +++ b/src/main/java/me/Danker/commands/CustomMusicCommand.java @@ -10,8 +10,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; -import javax.sound.sampled.Clip; -import javax.sound.sampled.FloatControl; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.UnsupportedAudioFileException; import java.io.IOException; @@ -26,7 +24,7 @@ public class CustomMusicCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " [dungeonboss] [#]"; + return "/" + getCommandName() + " [dungeonboss/bloodroom/dungeon] [#]"; } public static String usage(ICommandSender arg0) { @@ -43,7 +41,7 @@ public class CustomMusicCommand extends CommandBase { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "stop", "reload", "volume"); } else if (args.length == 2) { - return getListOfStringsMatchingLastWord(args, "dungeonboss"); + return getListOfStringsMatchingLastWord(args, "dungeonboss", "bloodroom", "dungeon"); } return null; } @@ -59,7 +57,7 @@ public class CustomMusicCommand extends CommandBase { switch (arg1[0].toLowerCase()) { case "stop": - if (CustomMusic.dungeonboss != null) CustomMusic.dungeonboss.stop(); + CustomMusic.reset(); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Stopped custom music.")); break; case "reload": @@ -77,28 +75,43 @@ public class CustomMusicCommand extends CommandBase { return; } + float volume = Float.parseFloat(arg1[2]); + boolean success; + switch (arg1[1].toLowerCase()) { case "dungeonboss": - try { - float volume = Float.parseFloat(arg1[2]); - - FloatControl bounds = (FloatControl) CustomMusic.dungeonboss.getControl(FloatControl.Type.MASTER_GAIN); - if (volume <= bounds.getMinimum() || volume >= bounds.getMaximum()) { - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Volume can only be set between " + bounds.getMinimum() + " and " + bounds.getMaximum() + ".")); - return; - } - - CustomMusic.dungeonbossDecibels = volume; - ConfigHandler.writeIntConfig("music", "DungeonBossDecibels", (int) volume); - CustomMusic.init(DankersSkyblockMod.configDirectory); - } catch (IOException | LineUnavailableException | UnsupportedAudioFileException e) { - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "An error occurred while trying to reload music.")); - e.printStackTrace(); + success = CustomMusic.dungeonboss.setVolume(volume); + if (!success) { + return; } + + CustomMusic.dungeonbossDecibels = volume; + ConfigHandler.writeIntConfig("music", "DungeonBossDecibels", (int) volume); + break; + case "bloodroom": + success = CustomMusic.bloodroom.setVolume(volume); + if (!success) { + return; + } + + CustomMusic.bloodroomDecibels = volume; + ConfigHandler.writeIntConfig("music", "BloodRoomDecibels", (int) volume); + break; + case "dungeon": + success = CustomMusic.dungeon.setVolume(volume); + if (!success) { + return; + } + + CustomMusic.dungeonDecibels = volume; + ConfigHandler.writeIntConfig("music", "DungeonDecibels", (int) volume); break; default: player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); + return; } + + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.SECONDARY_COLOUR + arg1[1] + DankersSkyblockMod.MAIN_COLOUR + " was set to " + DankersSkyblockMod.SECONDARY_COLOUR + volume + "db")); break; default: player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index 97af0df..40fcb0a 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -97,6 +97,8 @@ public class DankerGuiCommand extends CommandBase { debug.append("[specialhoe][").append(ToggleCommand.specialHoeRightClick).append("]\n"); debug.append("[melodyTooltips][").append(ToggleCommand.melodyTooltips).append("]\n"); debug.append("[dungeonbossmusic][").append(ToggleCommand.dungeonBossMusic).append("]\n"); + debug.append("[bloodroommusic][").append(ToggleCommand.bloodRoomMusic).append("]\n"); + debug.append("[dungeonmusic][").append(ToggleCommand.dungeonMusic).append("]\n"); debug.append("# Locations\n"); debug.append("[coords][").append(MoveCommand.coordsXY[0]).append(", ").append(MoveCommand.coordsXY[1]).append("]\n"); debug.append("[display][").append(MoveCommand.displayXY[0]).append(", ").append(MoveCommand.displayXY[1]).append("]\n"); diff --git a/src/main/java/me/Danker/commands/LobbyBankCommand.java b/src/main/java/me/Danker/commands/LobbyBankCommand.java index 77dce2a..886077c 100644 --- a/src/main/java/me/Danker/commands/LobbyBankCommand.java +++ b/src/main/java/me/Danker/commands/LobbyBankCommand.java @@ -5,7 +5,6 @@ import com.google.gson.JsonObject; import me.Danker.DankersSkyblockMod; import me.Danker.handlers.APIHandler; import me.Danker.handlers.ConfigHandler; -import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.network.NetworkPlayerInfo; import net.minecraft.command.CommandBase; diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index b8b5845..73011ad 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -80,6 +80,8 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean melodyTooltips; // Custom Music public static boolean dungeonBossMusic; + public static boolean bloodRoomMusic; + public static boolean dungeonMusic; @Override public String getCommandName() { @@ -96,8 +98,9 @@ public class ToggleCommand extends CommandBase implements ICommand { "notifyslayerslain/necronnotifications/bonzotimer/threemanpuzzle/oruopuzzle/blazepuzzle/" + "creeperpuzzle/waterpuzzle/tictactoepuzzle/boulderpuzzle/silverfishpuzzle/icewalkpuzzle/watchermessage/" + "startswithterminal/selectallterminal/clickinorderterminal/blockwrongterminalclicks/" + - "itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/ " + - "/specialhoe/melodytooltips/highlightslayers/highlightArachne/dungeonbossmusic/list>"; + "itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/" + + "specialhoe/melodytooltips/highlightslayers/highlightarachne/dungeonbossmusic/bloodroommusic/" + + "dungeonmusic/list>"; } public static String usage(ICommandSender arg0) { @@ -124,7 +127,8 @@ public class ToggleCommand extends CommandBase implements ICommand { "silverfishpuzzle", "icewalkpuzzle", "watchermessage", "startswithterminal", "selectallterminal", "clickinorderterminal", "blockwrongterminalclicks", "itemframeonsealanterns", "ultrasequencer", "chronomatron", "superpairs", - "hidetooltipsinaddons", "pickblock", "specialhoe", "melodytooltips", "highlightslayers", "dungeonbossmusic", "list"); + "hidetooltipsinaddons", "pickblock", "specialhoe", "melodytooltips", "highlightslayers", + "dungeonbossmusic", "bloodroommusic", "dungeonmusic", "list"); } return null; } @@ -436,16 +440,22 @@ public class ToggleCommand extends CommandBase implements ICommand { player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Highlight Arachne " + DankersSkyblockMod.SECONDARY_COLOUR + highlightArachne + DankersSkyblockMod.MAIN_COLOUR + ".")); case "dungeonbossmusic": dungeonBossMusic = !dungeonBossMusic; - if (CustomMusic.dungeonboss != null) { - if (dungeonBossMusic) { - CustomMusic.start(); - } else { - CustomMusic.dungeonboss.stop(); - } - } + CustomMusic.dungeonboss.stop(); ConfigHandler.writeBooleanConfig("toggles", "DungeonBossMusic", dungeonBossMusic); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom dungeon boss music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + dungeonBossMusic + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "bloodroommusic": + bloodRoomMusic = !bloodRoomMusic; + CustomMusic.bloodroom.stop(); + ConfigHandler.writeBooleanConfig("toggles", "BloodRoomMusic", bloodRoomMusic); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom blood room music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + bloodRoomMusic + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "dungeonmusic": + dungeonMusic = !dungeonMusic; + CustomMusic.dungeon.stop(); + ConfigHandler.writeBooleanConfig("toggles", "DungeonMusic", dungeonMusic); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Custom dungeon music has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + dungeonMusic + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "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" + @@ -496,7 +506,9 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Hide tooltips in Melody's Harp " + DankersSkyblockMod.VALUE_COLOUR + melodyTooltips + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Highlight Slayer Bosses " + DankersSkyblockMod.VALUE_COLOUR + highlightSlayers + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Highlight Arachne Boss " + DankersSkyblockMod.VALUE_COLOUR + highlightArachne + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon boss music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonBossMusic + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon boss music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonBossMusic + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Custom blood room music: " + DankersSkyblockMod.VALUE_COLOUR + bloodRoomMusic + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Custom dungeon music: " + DankersSkyblockMod.VALUE_COLOUR + dungeonMusic )); break; default: diff --git a/src/main/java/me/Danker/features/ArachneESP.java b/src/main/java/me/Danker/features/ArachneESP.java index 1a9b0b2..491c42a 100644 --- a/src/main/java/me/Danker/features/ArachneESP.java +++ b/src/main/java/me/Danker/features/ArachneESP.java @@ -1,27 +1,17 @@ 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; diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java index ee0a2cc..342913f 100644 --- a/src/main/java/me/Danker/features/CustomMusic.java +++ b/src/main/java/me/Danker/features/CustomMusic.java @@ -6,6 +6,8 @@ import me.Danker.handlers.ScoreboardHandler; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ChatComponentText; import net.minecraft.util.StringUtils; import net.minecraft.world.World; import net.minecraftforge.client.event.ClientChatReceivedEvent; @@ -22,10 +24,15 @@ import java.util.List; public class CustomMusic { + static boolean cancelNotes; static boolean prevInDungeonBossRoom = false; - static boolean inDungeonBossRoom = false; - public static Clip dungeonboss; + public static boolean inDungeonBossRoom = false; + public static Song dungeonboss; public static float dungeonbossDecibels; + public static Song bloodroom; + public static float bloodroomDecibels; + public static Song dungeon; + public static float dungeonDecibels; @SubscribeEvent public void onWorldChange(WorldEvent.Load event) { @@ -56,30 +63,44 @@ public class CustomMusic { firstLine.contains("necron")) { // F7 inDungeonBossRoom = true; - if (!prevInDungeonBossRoom && dungeonboss != null) { - start(); + if (!prevInDungeonBossRoom) { + dungeonboss.start(); } } else { - reset(); + inDungeonBossRoom = false; + dungeonboss.stop(); } } } } } - @SubscribeEvent + @SubscribeEvent(receiveCanceled = true) public void onChat(ClientChatReceivedEvent event) { - if (!Utils.inDungeons) return; String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); - if (message.contains("EXTRA STATS ")) { - if (dungeonboss != null) dungeonboss.stop(); + if (ToggleCommand.dungeonMusic && Utils.inDungeons) { + if (message.contains("[NPC] Mort: Here, I found this map when I first entered the dungeon.")) { + dungeon.start(); + } + } + + if (message.contains(":")) return; + + if (Utils.inDungeons) { + if (message.contains("EXTRA STATS ")) { + dungeonboss.stop(); + bloodroom.stop(); + dungeon.stop(); + } else if (ToggleCommand.bloodRoomMusic && message.contains("The BLOOD DOOR has been opened!")) { + bloodroom.start(); + } } } @SubscribeEvent public void onSound(PlaySoundEvent event) { - if (ToggleCommand.dungeonBossMusic && Utils.inDungeons && inDungeonBossRoom) { + if (cancelNotes) { if (event.isCancelable() && event.name.startsWith("note.")) event.setCanceled(true); } } @@ -91,29 +112,69 @@ public class CustomMusic { reset(); - dungeonboss = AudioSystem.getClip(); - File dungeonBossFile = new File(configDirectory + "/dsmmusic/dungeonboss.wav"); + File dungeonBossFile = new File(directory + "/dungeonboss.wav"); System.out.println("dungeonboss.wav exists?: " + dungeonBossFile.exists()); - if (dungeonBossFile.exists()) { - AudioInputStream ais = AudioSystem.getAudioInputStream(dungeonBossFile); - dungeonboss.open(ais); + dungeonboss = new Song(dungeonBossFile, dungeonbossDecibels); - FloatControl volume = (FloatControl) dungeonboss.getControl(FloatControl.Type.MASTER_GAIN); - volume.setValue(dungeonbossDecibels); - } + File bloodRoomFile = new File(directory + "/bloodroom.wav"); + System.out.println("bloodroom.wav exists?: " + bloodRoomFile.exists()); + bloodroom = new Song(bloodRoomFile, bloodroomDecibels); + + File dungeonFile = new File(directory + "/dungeon.wav"); + System.out.println("dungeon.wav exists?: " + dungeonFile.exists()); + dungeon = new Song(dungeonFile, dungeonDecibels); } - static void reset() { - inDungeonBossRoom = false; + public static void reset() { + cancelNotes = false; if (dungeonboss != null) dungeonboss.stop(); + if (bloodroom != null) bloodroom.stop(); + if (dungeon != null) dungeon.stop(); } - public static void start() { - if (dungeonboss != null && inDungeonBossRoom) { - dungeonboss.setMicrosecondPosition(0); - dungeonboss.start(); - dungeonboss.loop(Clip.LOOP_CONTINUOUSLY); + public static class Song { + + public Clip music; + + public Song(File file, float decibels) throws IOException, UnsupportedAudioFileException, LineUnavailableException { + if (file.exists()) { + music = AudioSystem.getClip(); + AudioInputStream ais = AudioSystem.getAudioInputStream(file); + music.open(ais); + + setVolume(decibels); + } } + + public void start() { + reset(); + cancelNotes = true; + if (music != null) { + music.setMicrosecondPosition(0); + music.start(); + music.loop(Clip.LOOP_CONTINUOUSLY); + } + } + + public void stop() { + cancelNotes = false; + if (music != null) music.stop(); + } + + public boolean setVolume(float decibels) { + if (music == null) return false; + + FloatControl control = (FloatControl) music.getControl(FloatControl.Type.MASTER_GAIN); + if (decibels <= control.getMinimum() || decibels >= control.getMaximum()) { + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + if (player != null) player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Volume can only be set between " + control.getMinimum() + " and " + control.getMaximum() + ".")); + return false; + } + + control.setValue(decibels); + return true; + } + } } diff --git a/src/main/java/me/Danker/features/SlayerESP.java b/src/main/java/me/Danker/features/SlayerESP.java index 17a1c0e..51537ba 100644 --- a/src/main/java/me/Danker/features/SlayerESP.java +++ b/src/main/java/me/Danker/features/SlayerESP.java @@ -11,7 +11,6 @@ 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.AttachCapabilitiesEvent; import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; diff --git a/src/main/java/me/Danker/gui/CustomMusicGui.java b/src/main/java/me/Danker/gui/CustomMusicGui.java new file mode 100644 index 0000000..505bf34 --- /dev/null +++ b/src/main/java/me/Danker/gui/CustomMusicGui.java @@ -0,0 +1,73 @@ +package me.Danker.gui; + +import me.Danker.DankersSkyblockMod; +import me.Danker.commands.ToggleCommand; +import me.Danker.features.CustomMusic; +import me.Danker.handlers.ConfigHandler; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; + +public class CustomMusicGui extends GuiScreen { + + private GuiButton goBack; + + private GuiButton dungeonBossMusic; + private GuiButton bloodRoomMusic; + private GuiButton dungeonMusic; + + @Override + public boolean doesGuiPauseGame() { + return false; + } + + @Override + public void initGui() { + super.initGui(); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int height = sr.getScaledHeight(); + int width = sr.getScaledWidth(); + + goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); + dungeonMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Custom Dungeon Music: " + Utils.getColouredBoolean(ToggleCommand.dungeonMusic)); + bloodRoomMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Custom Blood Room Music: " + Utils.getColouredBoolean(ToggleCommand.bloodRoomMusic)); + dungeonBossMusic = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Custom Dungeon Boss Music: " + Utils.getColouredBoolean(ToggleCommand.dungeonBossMusic)); + + this.buttonList.add(dungeonMusic); + this.buttonList.add(bloodRoomMusic); + this.buttonList.add(dungeonBossMusic); + this.buttonList.add(goBack); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + @Override + public void actionPerformed(GuiButton button) { + if (button == goBack) { + DankersSkyblockMod.guiToOpen = "dankergui1"; + } else if (button == dungeonBossMusic) { + ToggleCommand.dungeonBossMusic = !ToggleCommand.dungeonBossMusic; + CustomMusic.dungeonboss.stop(); + ConfigHandler.writeBooleanConfig("toggles", "DungeonBossMusic", ToggleCommand.dungeonBossMusic); + dungeonBossMusic.displayString = "Custom Dungeon Boss Music: " + Utils.getColouredBoolean(ToggleCommand.dungeonBossMusic); + } else if (button == bloodRoomMusic) { + ToggleCommand.bloodRoomMusic = !ToggleCommand.bloodRoomMusic; + CustomMusic.bloodroom.stop(); + ConfigHandler.writeBooleanConfig("toggles", "BloodRoomMusic", ToggleCommand.bloodRoomMusic); + bloodRoomMusic.displayString = "Custom Blood Room Music: " + Utils.getColouredBoolean(ToggleCommand.bloodRoomMusic); + } else if (button == dungeonMusic) { + ToggleCommand.dungeonMusic = !ToggleCommand.dungeonMusic; + CustomMusic.dungeon.stop(); + ConfigHandler.writeBooleanConfig("toggles", "DungeonMusic", ToggleCommand.dungeonMusic); + dungeonMusic.displayString = "Custom Dungeon Music: " + Utils.getColouredBoolean(ToggleCommand.dungeonMusic); + } + } + +} diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 307882f..796be2b 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -2,7 +2,6 @@ package me.Danker.gui; import me.Danker.DankersSkyblockMod; import me.Danker.commands.ToggleCommand; -import me.Danker.features.CustomMusic; import me.Danker.handlers.ConfigHandler; import me.Danker.handlers.TextRenderer; import me.Danker.utils.Utils; @@ -40,7 +39,7 @@ public class DankerGui extends GuiScreen { private GuiButton puzzleSolvers; private GuiButton experimentationTableSolvers; private GuiButton skillTracker; - private GuiButton highlightArachne; + private GuiButton customMusic; // Toggles private GuiButton gparty; private GuiButton coords; @@ -57,10 +56,13 @@ public class DankerGui extends GuiScreen { private GuiButton skill50Display; private GuiButton outlineText; private GuiButton cakeTimer; + private GuiButton pickBlock; + private GuiButton notifySlayerSlain; private GuiButton shadowFury; private GuiButton specialHoe; private GuiButton melodyTooltips; - private GuiButton dungeonBossMusic; + private GuiButton autoSkillTracker; + private GuiButton highlightArachne; // Chat Messages private GuiButton lividDagger; private GuiButton sceptreMessages; @@ -77,11 +79,8 @@ public class DankerGui extends GuiScreen { private GuiButton stopSalvageStarred; private GuiButton watcherReadyMessage; private GuiButton flowerWeapons; - private GuiButton pickBlock; - private GuiButton notifySlayerSlain; private GuiButton necronNotifications; private GuiButton bonzoTimer; - private GuiButton autoSkillTracker; public DankerGui(int page, String searchText) { this.page = page; @@ -110,15 +109,14 @@ public class DankerGui extends GuiScreen { editLocations = new GuiButton(0, 2, 5, 100, 20, "Edit Locations"); search = new GuiTextField(0, this.fontRendererObj, width - 202, 5, 200, 20); - // Page 1 changeDisplay = new GuiButton(0, 0, 0, "Change Display Settings"); onlySlayer = new GuiButton(0, 0, 0, "Set Slayer Quest"); puzzleSolvers = new GuiButton(0, 0, 0, "Toggle Dungeons Puzzle Solvers"); experimentationTableSolvers = new GuiButton(0, 0, 0, "Toggle Experimentation Table Solvers"); skillTracker = new GuiButton(0, 0, 0, "Toggle Skill XP/Hour Tracking"); + customMusic = new GuiButton(0, 0, 0, "Custom Music"); outlineText = new GuiButton(0, 0, 0, "Outline Displayed Text: " + Utils.getColouredBoolean(ToggleCommand.outlineTextToggled)); pickBlock = new GuiButton(0, 0, 0, "Auto-Swap to Pick Block: " + Utils.getColouredBoolean(ToggleCommand.swapToPickBlockToggled)); - // Page 2 coords = new GuiButton(0, 0, 0, "Coordinate/Angle Display: " + Utils.getColouredBoolean(ToggleCommand.coordsToggled)); chatMaddox = new GuiButton(0, 0, 0, "Click On-Screen to Open Maddox: " + Utils.getColouredBoolean(ToggleCommand.chatMaddoxToggled)); cakeTimer = new GuiButton(0, 0, 0, "Cake Timer: " + Utils.getColouredBoolean(ToggleCommand.cakeTimerToggled)); @@ -126,7 +124,6 @@ public class DankerGui extends GuiScreen { slayerCount = new GuiButton(0, 0, 0, "Count Total 20% Drops: " + Utils.getColouredBoolean(ToggleCommand.slayerCountTotal)); aotd = new GuiButton(0, 0, 0, "Disable AOTD Ability: " + Utils.getColouredBoolean(ToggleCommand.aotdToggled)); lividDagger = new GuiButton(0, 0, 0, "Disable Livid Dagger Ability: " + Utils.getColouredBoolean(ToggleCommand.lividDaggerToggled)); - // Page 3 spiritBearAlert = new GuiButton(0, 0, 0, "Spirit Bear Spawn Alerts: " + Utils.getColouredBoolean(ToggleCommand.spiritBearAlerts)); sceptreMessages = new GuiButton(0, 0, 0, "Spirit Sceptre Messages: " + Utils.getColouredBoolean(ToggleCommand.sceptreMessages)); midasStaffMessages = new GuiButton(0, 0, 0, "Midas Staff Messages: " + Utils.getColouredBoolean(ToggleCommand.midasStaffMessages)); @@ -134,7 +131,6 @@ public class DankerGui extends GuiScreen { healMessages = new GuiButton(0, 0, 0, "Heal Messages: " + Utils.getColouredBoolean(ToggleCommand.healMessages)); cooldownMessages = new GuiButton(0, 0, 0, "Cooldown Messages: " + Utils.getColouredBoolean(ToggleCommand.cooldownMessages)); manaMessages = new GuiButton(0, 0, 0, "Mana Messages: " + Utils.getColouredBoolean(ToggleCommand.manaMessages)); - // Page 4 killComboMessages = new GuiButton(0, 0, 0, "Kill Combo Messages: " + Utils.getColouredBoolean(ToggleCommand.killComboMessages)); goldenEnch = new GuiButton(0, 0, 0, "Golden T10/T6/T4 Enchantments: " + Utils.getColouredBoolean(ToggleCommand.goldenToggled)); petColours = new GuiButton(0, 0, 0, "Colour Pet Backgrounds: " + Utils.getColouredBoolean(ToggleCommand.petColoursToggled)); @@ -142,7 +138,6 @@ public class DankerGui extends GuiScreen { gparty = new GuiButton(0, 0, 0, "Guild Party Notifications: " + Utils.getColouredBoolean(ToggleCommand.gpartyToggled)); golemAlerts = new GuiButton(0, 0, 0, "Alert When Golem Spawns: " + Utils.getColouredBoolean(ToggleCommand.golemAlertToggled)); rngesusAlert = new GuiButton(0, 0, 0, "RNGesus Alerts: " + Utils.getColouredBoolean(ToggleCommand.rngesusAlerts)); - // Page 5 splitFishing = new GuiButton(0, 0, 0, "Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing)); lowHealthNotify = new GuiButton(0, 0, 0, "Low Health Notifications: " + Utils.getColouredBoolean(ToggleCommand.lowHealthNotifyToggled)); lividSolver = new GuiButton(0, 0, 0, "Find Correct Livid: " + Utils.getColouredBoolean(ToggleCommand.lividSolverToggled)); @@ -150,15 +145,12 @@ public class DankerGui extends GuiScreen { stopSalvageStarred = new GuiButton(0, 0, 0, "Stop Salvaging Starred Items: " + Utils.getColouredBoolean(ToggleCommand.stopSalvageStarredToggled)); watcherReadyMessage = new GuiButton(0, 0, 0, "Display Watcher Ready Message: " + Utils.getColouredBoolean(ToggleCommand.watcherReadyToggled)); flowerWeapons = new GuiButton(0, 0, 0, "Prevent Placing FoT/Spirit Sceptre: " + Utils.getColouredBoolean(ToggleCommand.flowerWeaponsToggled)); - // Page 6 notifySlayerSlain = new GuiButton(0, 0, 0, "Notify when Slayer Slain: " + Utils.getColouredBoolean(ToggleCommand.notifySlayerSlainToggled)); necronNotifications = new GuiButton(0, 0, 0, "Necron Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled)); bonzoTimer = new GuiButton(0, 0, 0, "Bonzo's Mask Timer: " + Utils.getColouredBoolean(ToggleCommand.bonzoTimerToggled)); autoSkillTracker = new GuiButton(0, 0, 0, "Auto Start/Stop Skill Tracker: " + Utils.getColouredBoolean(ToggleCommand.autoSkillTrackerToggled)); - dungeonBossMusic = new GuiButton(0, 0, 0, "Custom Dungeon Boss Music: " + Utils.getColouredBoolean(ToggleCommand.dungeonBossMusic)); shadowFury = new GuiButton(0, 0, 0, "Block Shadow Fury ability: " + Utils.getColouredBoolean(ToggleCommand.shadowFuryToggled)); specialHoe = new GuiButton(0, 0, 0, "Block Special Hoe right click: " + Utils.getColouredBoolean(ToggleCommand.specialHoeRightClick)); - // Page 7 melodyTooltips = new GuiButton(0, 0, 0, "Hide tooltips in Melody's Harp: " + Utils.getColouredBoolean(ToggleCommand.melodyTooltips)); highlightArachne = new GuiButton(0, 0, 0, "Highlight Arachne: " + Utils.getColouredBoolean(ToggleCommand.highlightArachne)); @@ -167,6 +159,7 @@ public class DankerGui extends GuiScreen { allButtons.add(puzzleSolvers); allButtons.add(experimentationTableSolvers); allButtons.add(skillTracker); + allButtons.add(customMusic); allButtons.add(outlineText); allButtons.add(pickBlock); allButtons.add(coords); @@ -201,7 +194,6 @@ public class DankerGui extends GuiScreen { allButtons.add(necronNotifications); allButtons.add(bonzoTimer); allButtons.add(autoSkillTracker); - allButtons.add(dungeonBossMusic); allButtons.add(shadowFury); allButtons.add(specialHoe); allButtons.add(melodyTooltips); @@ -289,6 +281,8 @@ public class DankerGui extends GuiScreen { DankersSkyblockMod.guiToOpen = "experimentsolvers"; } else if (button == skillTracker) { DankersSkyblockMod.guiToOpen = "skilltracker"; + } else if (button == customMusic) { + DankersSkyblockMod.guiToOpen = "custommusic"; } else if (button == outlineText) { ToggleCommand.outlineTextToggled = !ToggleCommand.outlineTextToggled; ConfigHandler.writeBooleanConfig("toggles", "OutlineText", ToggleCommand.outlineTextToggled); @@ -441,17 +435,6 @@ public class DankerGui extends GuiScreen { ToggleCommand.highlightArachne = !ToggleCommand.highlightArachne; ConfigHandler.writeBooleanConfig("toggles", "HighlightArachne", ToggleCommand.highlightArachne); highlightArachne.displayString = "Highlight Arachne: " + Utils.getColouredBoolean(ToggleCommand.highlightArachne); - } else if (button == dungeonBossMusic) { - ToggleCommand.dungeonBossMusic = !ToggleCommand.dungeonBossMusic; - if (CustomMusic.dungeonboss != null) { - if (ToggleCommand.dungeonBossMusic) { - CustomMusic.start(); - } else { - CustomMusic.dungeonboss.stop(); - } - } - ConfigHandler.writeBooleanConfig("toggles", "DungeonBossMusic", ToggleCommand.dungeonBossMusic); - dungeonBossMusic.displayString = "Custom Dungeon Boss Music: " + Utils.getColouredBoolean(ToggleCommand.dungeonBossMusic); } } diff --git a/src/main/java/me/Danker/gui/OnlySlayerGui.java b/src/main/java/me/Danker/gui/OnlySlayerGui.java index 762e5e5..ec26a13 100644 --- a/src/main/java/me/Danker/gui/OnlySlayerGui.java +++ b/src/main/java/me/Danker/gui/OnlySlayerGui.java @@ -7,7 +7,6 @@ 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; diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 8a95ae5..6d474d4 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -274,7 +274,12 @@ public class ConfigHandler { ToggleCommand.hideTooltipsInExperimentAddonsToggled = initBoolean("toggles", "HideTooltipsInExperimentAddons", false); // Custom Music ToggleCommand.dungeonBossMusic = initBoolean("toggles", "DungeonBossMusic", false); + ToggleCommand.bloodRoomMusic = initBoolean("toggles", "BloodRoomMusic", false); + ToggleCommand.dungeonMusic = initBoolean("toggles", "DungeonMusic", false); + // Music Volume CustomMusic.dungeonbossDecibels = (float) initInt("music", "DungeonBossDecibels", -20); + CustomMusic.bloodroomDecibels = (float) initInt("music", "BloodRoomDecibels", -20); + CustomMusic.dungeonDecibels = (float) initInt("music", "DungeonDecibels", -20); // API if (!hasKey("api", "APIKey")) writeStringConfig("api", "APIKey", ""); -- cgit From df1f83cf4ddb80969d2086cf1d7a86df9dc90653 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 2 Apr 2021 17:26:21 -0400 Subject: Remove features Remove blocking starting wrong slayer quest Remove blocking using abilities Remove placing flower weapons Remove blocking misclicks in solvers Remove F7 arrow terminal solver --- README.md | 13 +- src/main/java/me/Danker/DankersSkyblockMod.java | 9 -- .../me/Danker/commands/BlockSlayerCommand.java | 105 ------------- src/main/java/me/Danker/commands/DHelpCommand.java | 1 - .../java/me/Danker/commands/DankerGuiCommand.java | 7 - .../java/me/Danker/commands/ToggleCommand.java | 65 ++------ .../java/me/Danker/features/BlockAbilities.java | 96 ------------ .../me/Danker/features/BlockPlacingFlowers.java | 44 ------ .../java/me/Danker/features/BlockWrongSlayer.java | 42 ------ .../puzzlesolvers/ArrowTerminalSolver.java | 32 ---- .../puzzlesolvers/BlockWrongTerminalClicks.java | 112 -------------- .../features/puzzlesolvers/ChronomatronSolver.java | 15 +- .../puzzlesolvers/UltrasequencerSolver.java | 25 ---- src/main/java/me/Danker/gui/DankerGui.java | 47 +----- src/main/java/me/Danker/gui/OnlySlayerGui.java | 165 --------------------- src/main/java/me/Danker/gui/PuzzleSolversGui.java | 14 -- .../java/me/Danker/handlers/ConfigHandler.java | 15 -- .../java/me/Danker/handlers/PacketHandler.java | 31 ---- 18 files changed, 21 insertions(+), 817 deletions(-) delete mode 100644 src/main/java/me/Danker/commands/BlockSlayerCommand.java delete mode 100644 src/main/java/me/Danker/features/BlockAbilities.java delete mode 100644 src/main/java/me/Danker/features/BlockPlacingFlowers.java delete mode 100644 src/main/java/me/Danker/features/BlockWrongSlayer.java delete mode 100644 src/main/java/me/Danker/features/puzzlesolvers/ArrowTerminalSolver.java delete mode 100644 src/main/java/me/Danker/features/puzzlesolvers/BlockWrongTerminalClicks.java delete mode 100644 src/main/java/me/Danker/gui/OnlySlayerGui.java (limited to 'src/main/java/me/Danker/commands/ToggleCommand.java') diff --git a/README.md b/README.md index 7c922cc..f5f9786 100644 --- a/README.md +++ b/README.md @@ -8,17 +8,12 @@ Discord Server: https://discord.gg/QsEkNQS - Old Animations 2.6.4 - Pet colors does not color slots - Catacombs F7 terminal solvers do not color slots - - Ultrasequencer solver does not color slots + - Enchanting solvers do not color slots ## Current features - Guild party desktop notifications - Coordinate and angle display - Golden T10/T6/T4 enchant display -- Block AOTD ability -- Block Livid Dagger ability -- Block Shadow Fury ability -- Block right click with special hoes -- Block placing Flower of Truth/Spirit Sceptre - Disable Spirit Sceptre messages - Disable Midas Staff messages - Disable Implosion messages @@ -31,7 +26,6 @@ Discord Server: https://discord.gg/QsEkNQS - RNGesus drop alerts - Click anywhere on-screen to open Maddox - Maddox menu keybind -- Block starting other slayer quests - Slayer slain alert - Fishing, jerry fishing, fishing festival, spooky fishing trackers - Expertise kills in fishing rod lore @@ -39,7 +33,7 @@ Discord Server: https://discord.gg/QsEkNQS - Dungeons puzzle solver (Riddle, trivia, blaze, creeper, water, tic tac toe, boulder, silverfish, ice walk) - Dungeons timer (watcher, boss, deaths, and puzzle fails) - Watcher ready message -- Catacombs F7 Stage 3 solvers (Starts with letter, select all colour, ignore arrows on sea lanterns) +- Catacombs F7 Stage 3 solvers (Starts with letter, select all colour) - Find correct Livid (with graphic display of HP) - Use custom music in supported locations - Experimentation solvers (Ultrasequencer, Chronomatron, Superpairs) @@ -62,7 +56,7 @@ Discord Server: https://discord.gg/QsEkNQS ## Commands - /dhelp - Returns this message in-game. - /dsm - Opens the GUI for Danker's Skyblock Mod. -- /toggle - Toggles features. /toggle list returns values of every toggle. +- /toggle - Toggles features. /toggle list returns values of every toggle. - /setkey - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. - /loot [winter/festival/spooky/f(1-7)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. @@ -80,7 +74,6 @@ Discord Server: https://discord.gg/QsEkNQS - /dungeons [player] - Uses API to get dungeon levels of a person. If no name is provided, it checks yours. - /importfishing - Imports your fishing stats from your latest profile to your fishing tracker using the API. - /sbplayers - Uses API to find how many players are on each Skyblock island. -- /onlyslayer <1/2/3/4/5> - Stops you from starting a slayer quest other than the one specified. - /skilltracker - Text display for skill xp/hour. - /reparty - Disbands and reparties all members in the party - /fairysouls - Check the fairysouls of a player diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 0d6dbac..3aeb452 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -88,14 +88,9 @@ public class DankersSkyblockMod { public void init(FMLInitializationEvent event) throws UnsupportedAudioFileException, IOException, LineUnavailableException { MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(new ArachneESP()); - MinecraftForge.EVENT_BUS.register(new 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 BoulderSolver()); MinecraftForge.EVENT_BUS.register(new CakeTimer()); @@ -156,7 +151,6 @@ public class DankersSkyblockMod { public void preInit(final FMLPreInitializationEvent event) { ClientCommandHandler.instance.registerCommand(new ArmourCommand()); ClientCommandHandler.instance.registerCommand(new BankCommand()); - ClientCommandHandler.instance.registerCommand(new BlockSlayerCommand()); ClientCommandHandler.instance.registerCommand(new CustomMusicCommand()); ClientCommandHandler.instance.registerCommand(new DHelpCommand()); ClientCommandHandler.instance.registerCommand(new DankerGuiCommand()); @@ -325,9 +319,6 @@ public class DankersSkyblockMod { case "displaygui": mc.displayGuiScreen(new DisplayGui()); break; - case "onlyslayergui": - mc.displayGuiScreen(new OnlySlayerGui()); - break; case "editlocations": mc.displayGuiScreen(new EditLocationsGui()); break; diff --git a/src/main/java/me/Danker/commands/BlockSlayerCommand.java b/src/main/java/me/Danker/commands/BlockSlayerCommand.java deleted file mode 100644 index 06fb4ef..0000000 --- a/src/main/java/me/Danker/commands/BlockSlayerCommand.java +++ /dev/null @@ -1,105 +0,0 @@ -package me.Danker.commands; - -import me.Danker.DankersSkyblockMod; -import me.Danker.features.BlockWrongSlayer; -import me.Danker.handlers.ConfigHandler; -import net.minecraft.command.CommandBase; -import net.minecraft.command.CommandException; -import net.minecraft.command.ICommandSender; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; -import net.minecraft.util.ChatComponentText; - -import java.util.List; - -public class BlockSlayerCommand extends CommandBase { - - @Override - public String getCommandName() { - return "onlyslayer"; - } - - @Override - public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " <1/2/3/4/5>"; - } - - public static String usage(ICommandSender arg0) { - return new BlockSlayerCommand().getCommandUsage(arg0); - } - - @Override - public int getRequiredPermissionLevel() { - return 0; - } - - @Override - public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { - if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "zombie", "spider", "wolf"); - } else if (args.length == 2) { - return getListOfStringsMatchingLastWord(args, "1", "2", "3", "4", "5"); - } - return null; - } - - @Override - public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { - final EntityPlayer player = (EntityPlayer)arg0; - - if (arg1.length == 0 || (arg1.length == 1 && !arg1[0].equalsIgnoreCase("off"))) { - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); - return; - } - - switch (arg1[0].toLowerCase()) { - case "zombie": - BlockWrongSlayer.onlySlayerName = "Revenant Horror"; - break; - case "spider": - BlockWrongSlayer.onlySlayerName = "Tarantula Broodfather"; - break; - case "wolf": - BlockWrongSlayer.onlySlayerName = "Sven Packmaster"; - break; - case "off": - BlockWrongSlayer.onlySlayerName = ""; - BlockWrongSlayer.onlySlayerNumber = ""; - ConfigHandler.writeStringConfig("toggles", "BlockSlayer", ""); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Slayer blocking turned off.")); - return; - default: - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); - return; - } - - int slayerNumber = Integer.parseInt(arg1[1]); - // Just manually set to roman numeral, I don't wanna put a whole converter in here - switch (slayerNumber) { - case 1: - BlockWrongSlayer.onlySlayerNumber = "I"; - break; - case 2: - BlockWrongSlayer.onlySlayerNumber = "II"; - break; - case 3: - BlockWrongSlayer.onlySlayerNumber = "III"; - break; - case 4: - BlockWrongSlayer.onlySlayerNumber = "IV"; - break; - case 5: - BlockWrongSlayer.onlySlayerNumber = "V"; - break; - default: - BlockWrongSlayer.onlySlayerName = ""; - BlockWrongSlayer.onlySlayerNumber = ""; - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); - return; - } - - ConfigHandler.writeStringConfig("toggles", "BlockSlayer", BlockWrongSlayer.onlySlayerName + " " + BlockWrongSlayer.onlySlayerNumber); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Slayer blocking set to " + DankersSkyblockMod.SECONDARY_COLOUR + BlockWrongSlayer.onlySlayerName + " " + BlockWrongSlayer.onlySlayerNumber)); - } - -} diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index f6cfb82..8d47576 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -52,7 +52,6 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + DungeonsCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to get dungeon levels of a person. If no name is provided, it checks yours.\n" + EnumChatFormatting.GOLD + ImportFishingCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Imports your fishing stats from your latest profile to your fishing tracker using the API.\n" + EnumChatFormatting.GOLD + SkyblockPlayersCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find how many players are on each Skyblock island.\n" + - EnumChatFormatting.GOLD + BlockSlayerCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Stops you from starting a slayer quest other than the one specified.\n" + EnumChatFormatting.GOLD + SkillTrackerCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Text display for skill xp/hour.\n" + EnumChatFormatting.GOLD + LobbyBankCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find the average bank total of the lobby, as well the three players with the highest total money in the bank(and purse).\n" + EnumChatFormatting.GOLD + RepartyCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Disbands and reparties all members in the party.\n" + diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index 40fcb0a..5076ef7 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -49,9 +49,6 @@ public class DankerGuiCommand extends CommandBase { debug.append("[splitfishing][").append(ToggleCommand.splitFishing).append("]\n"); debug.append("[chatmaddox][").append(ToggleCommand.chatMaddoxToggled).append("]\n"); debug.append("[spiritbearalerts][").append(ToggleCommand.spiritBearAlerts).append("]\n"); - debug.append("[aotd][").append(ToggleCommand.aotdToggled).append("]\n"); - debug.append("[lividdagger][").append(ToggleCommand.lividDaggerToggled).append("]\n"); - debug.append("[flowerweapons][").append(ToggleCommand.flowerWeaponsToggled).append("]\n"); debug.append("[sceptremessages][").append(ToggleCommand.sceptreMessages).append("]\n"); debug.append("[petcolors][").append(ToggleCommand.petColoursToggled).append("]\n"); debug.append("[dungeontimer][").append(ToggleCommand.dungeonTimerToggled).append("]\n"); @@ -86,15 +83,11 @@ public class DankerGuiCommand extends CommandBase { debug.append("[startswithterminal][").append(ToggleCommand.startsWithToggled).append("]\n"); debug.append("[selectallterminal][").append(ToggleCommand.selectAllToggled).append("]\n"); debug.append("[clickinorderterminal][").append(ToggleCommand.clickInOrderToggled).append("]\n"); - debug.append("[blockwrongterminalclicks][").append(ToggleCommand.blockWrongTerminalClicksToggled).append("]\n"); - debug.append("[itemframeonsealanterns][").append(ToggleCommand.itemFrameOnSeaLanternsToggled).append("]\n"); debug.append("[ultrasequencer][").append(ToggleCommand.ultrasequencerToggled).append("]\n"); debug.append("[chronomatron][").append(ToggleCommand.chronomatronToggled).append("]\n"); debug.append("[superpairs][").append(ToggleCommand.superpairsToggled).append("]\n"); debug.append("[hidetooltipsinaddons][").append(ToggleCommand.hideTooltipsInExperimentAddonsToggled).append("]\n"); debug.append("[pickblock][").append(ToggleCommand.swapToPickBlockToggled).append("]\n"); - debug.append("[shadowFuryAbility][").append(ToggleCommand.shadowFuryToggled).append("]\n"); - debug.append("[specialhoe][").append(ToggleCommand.specialHoeRightClick).append("]\n"); debug.append("[melodyTooltips][").append(ToggleCommand.melodyTooltips).append("]\n"); debug.append("[dungeonbossmusic][").append(ToggleCommand.dungeonBossMusic).append("]\n"); debug.append("[bloodroommusic][").append(ToggleCommand.bloodRoomMusic).append("]\n"); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 73011ad..a6f20fc 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -23,9 +23,6 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean splitFishing; public static boolean chatMaddoxToggled; public static boolean spiritBearAlerts; - public static boolean aotdToggled; - public static boolean lividDaggerToggled; - public static boolean shadowFuryToggled; public static boolean petColoursToggled; public static boolean dungeonTimerToggled; public static boolean ghostTimerToggled; @@ -50,7 +47,6 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean stopSalvageStarredToggled; public static boolean watcherReadyToggled; public static boolean swapToPickBlockToggled; - public static boolean flowerWeaponsToggled; public static boolean notifySlayerSlainToggled; public static boolean necronNotificationsToggled; public static boolean bonzoTimerToggled; @@ -69,14 +65,11 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean startsWithToggled; public static boolean selectAllToggled; public static boolean clickInOrderToggled; - public static boolean blockWrongTerminalClicksToggled; - public static boolean itemFrameOnSeaLanternsToggled; // Experiments public static boolean ultrasequencerToggled; public static boolean chronomatronToggled; public static boolean superpairsToggled; public static boolean hideTooltipsInExperimentAddonsToggled; - public static boolean specialHoeRightClick; public static boolean melodyTooltips; // Custom Music public static boolean dungeonBossMusic; @@ -92,14 +85,14 @@ public class ToggleCommand extends CommandBase implements ICommand { public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName() + " "; } @@ -116,8 +109,8 @@ public class ToggleCommand extends CommandBase implements ICommand { public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", "highlightArachne", - "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "lividdagger", "shadowfury", - "flowerweapons", "sceptremessages", "petcolors", "dungeontimer", "golemalerts", + "splitfishing", "chatmaddox", "spiritbearalerts", + "sceptremessages", "petcolors", "dungeontimer", "golemalerts", "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", "implosionmessages", "healmessages", "cooldownmessages", "manamessages", "killcombomessages", "caketimer", "lowhealthnotify", "autoskilltracker", "lividsolver", @@ -125,9 +118,9 @@ public class ToggleCommand extends CommandBase implements ICommand { "bonzotimer", "threemanpuzzle", "oruopuzzle", "blazepuzzle", "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "boulderpuzzle", "silverfishpuzzle", "icewalkpuzzle", "watchermessage", "startswithterminal", - "selectallterminal", "clickinorderterminal", "blockwrongterminalclicks", - "itemframeonsealanterns", "ultrasequencer", "chronomatron", "superpairs", - "hidetooltipsinaddons", "pickblock", "specialhoe", "melodytooltips", "highlightslayers", + "selectallterminal", "clickinorderterminal", + "ultrasequencer", "chronomatron", "superpairs", + "hidetooltipsinaddons", "pickblock", "melodytooltips", "highlightslayers", "dungeonbossmusic", "bloodroommusic", "dungeonmusic", "list"); } return null; @@ -188,26 +181,6 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "SpiritBearAlerts", spiritBearAlerts); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Spirit Bear alerts have been set to " + DankersSkyblockMod.SECONDARY_COLOUR + spiritBearAlerts + DankersSkyblockMod.MAIN_COLOUR + ".")); break; - case "aotd": - aotdToggled = !aotdToggled; - ConfigHandler.writeBooleanConfig("toggles", "AOTD", aotdToggled); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Block AOTD ability been set to " + DankersSkyblockMod.SECONDARY_COLOUR + aotdToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); - break; - case "lividdagger": - lividDaggerToggled = !lividDaggerToggled; - ConfigHandler.writeBooleanConfig("toggles", "LividDagger", lividDaggerToggled); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Block Shadow Fury ability been set to " + DankersSkyblockMod.SECONDARY_COLOUR + shadowFuryToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); - break; - case "shadowfury": - shadowFuryToggled = !shadowFuryToggled; - ConfigHandler.writeBooleanConfig("toggles", "ShadowFury", shadowFuryToggled); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Block Livid Dagger ability been set to " + DankersSkyblockMod.SECONDARY_COLOUR + lividDaggerToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); - break; - case "flowerweapons": - flowerWeaponsToggled = !flowerWeaponsToggled; - ConfigHandler.writeBooleanConfig("toggles", "FlowerWeapons", flowerWeaponsToggled); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Prevent Placing FoT/Spirit Sceptre been set to " + DankersSkyblockMod.SECONDARY_COLOUR + flowerWeaponsToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); - break; case "sceptremessages": sceptreMessages = !sceptreMessages; ConfigHandler.writeBooleanConfig("toggles", "SceptreMessages", sceptreMessages); @@ -384,16 +357,6 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "ClickInOrderTerminal", clickInOrderToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Click in order terminal helper has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + selectAllToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; - case "blockwrongterminalclicks": - blockWrongTerminalClicksToggled = !blockWrongTerminalClicksToggled; - ConfigHandler.writeBooleanConfig("toggles", "BlockWrongTerminalClicks", blockWrongTerminalClicksToggled); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Block wrong clicks on terminals has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + blockWrongTerminalClicksToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); - break; - case "itemframeonsealanterns": - itemFrameOnSeaLanternsToggled = !itemFrameOnSeaLanternsToggled; - ConfigHandler.writeBooleanConfig("toggles", "IgnoreItemFrameOnSeaLanterns", itemFrameOnSeaLanternsToggled); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Ignore item frames on sea lanterns has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + itemFrameOnSeaLanternsToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); - break; case "ultrasequencer": ultrasequencerToggled = !ultrasequencerToggled; ConfigHandler.writeBooleanConfig("toggles", "UltraSequencer", ultrasequencerToggled); @@ -419,11 +382,6 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "PickBlock", swapToPickBlockToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Auto-swap to pick block has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + swapToPickBlockToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; - case "specialhoe": - specialHoeRightClick = !specialHoeRightClick; - ConfigHandler.writeBooleanConfig("toggles", "SpecialHoe", specialHoeRightClick); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Block right click ability of special hoes " + DankersSkyblockMod.SECONDARY_COLOUR + specialHoeRightClick + DankersSkyblockMod.MAIN_COLOUR + ".")); - break; case "melodytooltips": melodyTooltips = !melodyTooltips; ConfigHandler.writeBooleanConfig("toggles", "MelodyTooltips", melodyTooltips); @@ -465,9 +423,6 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Split fishing display: " + DankersSkyblockMod.VALUE_COLOUR + splitFishing + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Chat Maddox menu: " + DankersSkyblockMod.VALUE_COLOUR + chatMaddoxToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Spirit Bear alerts: " + DankersSkyblockMod.VALUE_COLOUR + spiritBearAlerts + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Block AOTD ability: " + DankersSkyblockMod.VALUE_COLOUR + aotdToggled + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Block Livid Dagger ability: " + DankersSkyblockMod.VALUE_COLOUR + lividDaggerToggled + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Prevent Placing FoT/Spirit Sceptre: " + DankersSkyblockMod.VALUE_COLOUR + flowerWeaponsToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Spirit Sceptre messages: " + DankersSkyblockMod.VALUE_COLOUR + sceptreMessages + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Midas Staff messages: " + DankersSkyblockMod.VALUE_COLOUR + midasStaffMessages + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Implosion messages: " + DankersSkyblockMod.VALUE_COLOUR + implosionMessages + "\n" + @@ -496,13 +451,11 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Watcher ready message: " + DankersSkyblockMod.VALUE_COLOUR + watcherReadyToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Starts with letter terminal solver: " + DankersSkyblockMod.VALUE_COLOUR + startsWithToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Select all color items terminal solver: " + DankersSkyblockMod.VALUE_COLOUR + selectAllToggled + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Ignore item frames on sea lanterns: " + DankersSkyblockMod.VALUE_COLOUR + itemFrameOnSeaLanternsToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Ultra sequencer solver: " + DankersSkyblockMod.VALUE_COLOUR + ultrasequencerToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Chronomatron solver: " + DankersSkyblockMod.VALUE_COLOUR + chronomatronToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Superpairs solver: " + DankersSkyblockMod.VALUE_COLOUR + superpairsToggled + "\n" + 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 + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Highlight Slayer Bosses " + DankersSkyblockMod.VALUE_COLOUR + highlightSlayers + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Highlight Arachne Boss " + DankersSkyblockMod.VALUE_COLOUR + highlightArachne + "\n" + diff --git a/src/main/java/me/Danker/features/BlockAbilities.java b/src/main/java/me/Danker/features/BlockAbilities.java deleted file mode 100644 index 814fd65..0000000 --- a/src/main/java/me/Danker/features/BlockAbilities.java +++ /dev/null @@ -1,96 +0,0 @@ -package me.Danker.features; - -import me.Danker.commands.ToggleCommand; -import me.Danker.utils.Utils; -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; - -import java.util.ArrayList; -import java.util.Arrays; - -public class BlockAbilities { - - @SubscribeEvent - public void onInteract(PlayerInteractEvent event) { - if (!Utils.inSkyblock || Minecraft.getMinecraft().thePlayer != event.entityPlayer) return; - ItemStack item = event.entityPlayer.getHeldItem(); - if (item == null) return; - - if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_AIR) { - if (ToggleCommand.aotdToggled && item.getDisplayName().contains("Aspect of the Dragons")) { - event.setCanceled(true); - } - 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(); - - ArrayList interactables = new ArrayList<>(Arrays.asList( - Blocks.acacia_door, - Blocks.anvil, - Blocks.beacon, - Blocks.bed, - Blocks.birch_door, - Blocks.brewing_stand, - Blocks.command_block, - Blocks.crafting_table, - Blocks.chest, - Blocks.dark_oak_door, - Blocks.daylight_detector, - Blocks.daylight_detector_inverted, - Blocks.dispenser, - Blocks.dropper, - Blocks.enchanting_table, - Blocks.ender_chest, - Blocks.furnace, - Blocks.hopper, - Blocks.jungle_door, - Blocks.lever, - Blocks.noteblock, - Blocks.powered_comparator, - Blocks.unpowered_comparator, - Blocks.powered_repeater, - Blocks.unpowered_repeater, - Blocks.standing_sign, - Blocks.wall_sign, - Blocks.trapdoor, - Blocks.trapped_chest, - Blocks.wooden_button, - Blocks.stone_button, - Blocks.oak_door, - Blocks.skull - )); - if (Utils.inDungeons) { - interactables.add(Blocks.coal_block); - interactables.add(Blocks.stained_hardened_clay); - } - - if (!interactables.contains(block)) { - if (ToggleCommand.aotdToggled && item.getDisplayName().contains("Aspect of the Dragons")) { - event.setCanceled(true); - } - 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/BlockPlacingFlowers.java b/src/main/java/me/Danker/features/BlockPlacingFlowers.java deleted file mode 100644 index 9bfc986..0000000 --- a/src/main/java/me/Danker/features/BlockPlacingFlowers.java +++ /dev/null @@ -1,44 +0,0 @@ -package me.Danker.features; - -import me.Danker.commands.ToggleCommand; -import me.Danker.utils.Utils; -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; - -import java.util.ArrayList; -import java.util.Arrays; - -public class BlockPlacingFlowers { - - @SubscribeEvent - public void onInteract(PlayerInteractEvent event) { - if (!Utils.inSkyblock || Minecraft.getMinecraft().thePlayer != event.entityPlayer) return; - ItemStack item = event.entityPlayer.getHeldItem(); - if (item == null) return; - - if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) { - Block block = Minecraft.getMinecraft().theWorld.getBlockState(event.pos).getBlock(); - - ArrayList flowerPlaceable = new ArrayList<>(Arrays.asList( - Blocks.grass, - Blocks.dirt, - Blocks.flower_pot, - Blocks.tallgrass, - Blocks.double_plant - )); - if (flowerPlaceable.contains(block)) { - if (ToggleCommand.flowerWeaponsToggled && item.getDisplayName().contains("Flower of Truth")) { - event.setCanceled(true); - } - if (ToggleCommand.flowerWeaponsToggled && item.getDisplayName().contains("Spirit Sceptre")) { - event.setCanceled(true); - } - } - } - } - -} diff --git a/src/main/java/me/Danker/features/BlockWrongSlayer.java b/src/main/java/me/Danker/features/BlockWrongSlayer.java deleted file mode 100644 index 6da4798..0000000 --- a/src/main/java/me/Danker/features/BlockWrongSlayer.java +++ /dev/null @@ -1,42 +0,0 @@ -package me.Danker.features; - -import me.Danker.DankersSkyblockMod; -import me.Danker.events.ChestSlotClickedEvent; -import net.minecraft.client.Minecraft; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChatComponentText; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; - -public class BlockWrongSlayer { - - public static String onlySlayerName = ""; - public static String onlySlayerNumber = ""; - - @SubscribeEvent - public void onSlotClick(ChestSlotClickedEvent event) { - String inventoryName = event.inventoryName; - ItemStack item = event.item; - if (!onlySlayerName.equals("") && item != null) { - if (inventoryName.equals("Slayer")) { - if (!item.getDisplayName().contains("Revenant Horror") && !item.getDisplayName().contains("Tarantula Broodfather") && !item.getDisplayName().contains("Sven Packmaster")) - return; - if (!item.getDisplayName().contains(onlySlayerName)) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Danker's Skyblock Mod has stopped you from starting this quest (Set to " + onlySlayerName + " " + onlySlayerNumber + ")")); - Minecraft.getMinecraft().thePlayer.playSound("note.bass", 1, (float) 0.5); - event.setCanceled(true); - } - } else if (inventoryName.equals("Revenant Horror") || inventoryName.equals("Tarantula Broodfather") || inventoryName.equals("Sven Packmaster")) { - if (item.getDisplayName().contains("Revenant Horror") || item.getDisplayName().contains("Tarantula Broodfather") || item.getDisplayName().contains("Sven Packmaster")) { - // Only check number as they passed the above check - String slayerNumber = item.getDisplayName().substring(item.getDisplayName().lastIndexOf(" ") + 1); - if (!slayerNumber.equals(onlySlayerNumber)) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Danker's Skyblock Mod has stopped you from starting this quest (Set to " + onlySlayerName + " " + onlySlayerNumber + ")")); - Minecraft.getMinecraft().thePlayer.playSound("note.bass", 1, (float) 0.5); - event.setCanceled(true); - } - } - } - } - } - -} diff --git a/src/main/java/me/Danker/features/puzzlesolvers/ArrowTerminalSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/ArrowTerminalSolver.java deleted file mode 100644 index 35458f3..0000000 --- a/src/main/java/me/Danker/features/puzzlesolvers/ArrowTerminalSolver.java +++ /dev/null @@ -1,32 +0,0 @@ -package me.Danker.features.puzzlesolvers; - -import me.Danker.commands.ToggleCommand; -import me.Danker.utils.Utils; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.item.EntityItemFrame; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; -import net.minecraftforge.event.entity.player.EntityInteractEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; - -public class ArrowTerminalSolver { - - @SubscribeEvent - public void onEntityInteract(EntityInteractEvent event) { - Minecraft mc = Minecraft.getMinecraft(); - if (mc.thePlayer != event.entityPlayer) return; - - if (ToggleCommand.itemFrameOnSeaLanternsToggled && Utils.inDungeons && event.target instanceof EntityItemFrame) { - EntityItemFrame itemFrame = (EntityItemFrame) event.target; - ItemStack item = itemFrame.getDisplayedItem(); - if (item == null || item.getItem() != Items.arrow) return; - BlockPos blockPos = Utils.getBlockUnderItemFrame(itemFrame); - if (mc.theWorld.getBlockState(blockPos).getBlock() == Blocks.sea_lantern) { - event.setCanceled(true); - } - } - } - -} diff --git a/src/main/java/me/Danker/features/puzzlesolvers/BlockWrongTerminalClicks.java b/src/main/java/me/Danker/features/puzzlesolvers/BlockWrongTerminalClicks.java deleted file mode 100644 index 5176e8b..0000000 --- a/src/main/java/me/Danker/features/puzzlesolvers/BlockWrongTerminalClicks.java +++ /dev/null @@ -1,112 +0,0 @@ -package me.Danker.features.puzzlesolvers; - -import me.Danker.commands.ToggleCommand; -import me.Danker.events.ChestSlotClickedEvent; -import me.Danker.utils.Utils; -import net.minecraft.init.Blocks; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StringUtils; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import org.lwjgl.input.Keyboard; - -public class BlockWrongTerminalClicks { - - @SubscribeEvent - public void onSlotClick(ChestSlotClickedEvent event) { - if (ToggleCommand.blockWrongTerminalClicksToggled && Utils.inDungeons) { - IInventory inventory = event.inventory; - String inventoryName = event.inventoryName; - Slot slot = event.slot; - ItemStack item = event.item; - boolean shouldCancel = false; - - if (item == null) return; - - //most of these are extra but who cares - - switch (inventoryName) { - case "Correct all the panes!": - shouldCancel = !StringUtils.stripControlCodes(item.getDisplayName()).startsWith("Off"); - break; - case "Navigate the maze!": - if (item.getItem() != Item.getItemFromBlock(Blocks.stained_glass_pane)) { - shouldCancel = true; - break; - } - - if (item.getItemDamage() != 0) { - shouldCancel = true; - break; - } - - boolean isValid = false; - - int slotIndex = slot.getSlotIndex(); - - if (slotIndex % 9 != 8 && slotIndex != 53) { - ItemStack itemStack = inventory.getStackInSlot(slotIndex + 1); - if (itemStack != null && itemStack.getItemDamage() == 5) isValid = true; - } - - if (!isValid && slotIndex % 9 != 0 && slotIndex != 0) { - ItemStack itemStack = inventory.getStackInSlot(slotIndex - 1); - if (itemStack != null && itemStack.getItemDamage() == 5) isValid = true; - } - - if (!isValid && slotIndex <= 44) { - ItemStack itemStack = inventory.getStackInSlot(slotIndex + 9); - if (itemStack != null && itemStack.getItemDamage() == 5) isValid = true; - } - - if (!isValid && slotIndex >= 9) { - ItemStack itemStack = inventory.getStackInSlot(slotIndex - 9); - if (itemStack != null && itemStack.getItemDamage() == 5) isValid = true; - } - - shouldCancel = !isValid; - - break; - case "Click in order!": - - if (slot.getSlotIndex() > 35) { - break; - } - - if ((item.getItem() != Item.getItemFromBlock(Blocks.stained_glass_pane))) { - shouldCancel = true; - break; - } - if (item.getItemDamage() != 14) { - shouldCancel = true; - break; - } - int needed = ClickInOrderSolver.terminalNumberNeeded[0]; - if (needed == 0) break; - shouldCancel = needed != -1 && item.stackSize != needed; - break; - } - - if (!shouldCancel) { - if (inventoryName.startsWith("What starts with:")) { - char letter = inventoryName.charAt(inventoryName.indexOf("'") + 1); - shouldCancel = !(StringUtils.stripControlCodes(item.getDisplayName()).charAt(0) == letter); - } else if (inventoryName.startsWith("Select all the")) { - if (SelectAllColourSolver.terminalColorNeeded == null) return; - String itemName = StringUtils.stripControlCodes(item.getDisplayName()).toUpperCase(); - shouldCancel = !(itemName.contains(SelectAllColourSolver.terminalColorNeeded) || - (SelectAllColourSolver.terminalColorNeeded.equals("SILVER") && itemName.contains("LIGHT GRAY")) || - (SelectAllColourSolver.terminalColorNeeded.equals("WHITE") && (itemName.equals("WOOL") || itemName.equals("BONE MEAL"))) || - (SelectAllColourSolver.terminalColorNeeded.equals("BLACK") && itemName.equals("INK SACK")) || - (SelectAllColourSolver.terminalColorNeeded.equals("BLUE") && itemName.equals("LAPIS LAZULI")) || - (SelectAllColourSolver.terminalColorNeeded.equals("BROWN") && itemName.equals("COCOA BEAN"))); - } - } - - event.setCanceled(shouldCancel && !Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && !Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)); - } - } - -} diff --git a/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java index 7bbd25a..208cf9b 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java @@ -15,7 +15,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.StringUtils; import net.minecraftforge.client.event.GuiOpenEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import org.lwjgl.input.Keyboard; import java.util.ArrayList; import java.util.List; @@ -33,20 +32,10 @@ public class ChronomatronSolver { if (ToggleCommand.chronomatronToggled && event.inventoryName.startsWith("Chronomatron (")) { IInventory inventory = event.inventory; ItemStack item = event.item; - if (item == null) { - if (event.isCancelable() && !Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && !Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)) - event.setCanceled(true); - return; - } + if (item == null) return; + if (inventory.getStackInSlot(49).getDisplayName().startsWith("§7Timer: §a") && (item.getItem() == Item.getItemFromBlock(Blocks.stained_glass) || item.getItem() == Item.getItemFromBlock(Blocks.stained_hardened_clay))) { - if (chronomatronPattern.size() > chronomatronMouseClicks && !item.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks))) { - if (event.isCancelable() && !Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && !Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)) - event.setCanceled(true); - return; - } chronomatronMouseClicks++; - } else if (inventory.getStackInSlot(49).getDisplayName().startsWith("§aRemember the pattern!")) { - if (event.isCancelable()) event.setCanceled(true); } } } diff --git a/src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java index 87309fe..3df6fc4 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java @@ -1,20 +1,17 @@ package me.Danker.features.puzzlesolvers; import me.Danker.commands.ToggleCommand; -import me.Danker.events.ChestSlotClickedEvent; import me.Danker.events.GuiChestBackgroundDrawnEvent; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.inventory.ContainerChest; -import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.util.StringUtils; import net.minecraftforge.client.event.GuiOpenEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; -import org.lwjgl.input.Keyboard; import java.util.List; @@ -52,28 +49,6 @@ public class UltrasequencerSolver { } } - @SubscribeEvent - public void onSlotClick(ChestSlotClickedEvent event) { - if (ToggleCommand.ultrasequencerToggled && event.inventoryName.startsWith("Ultrasequencer (")) { - IInventory inventory = event.inventory; - if (event.item == null) { - if (event.isCancelable() && !Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && !Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)) - event.setCanceled(true); - return; - } - if (inventory.getStackInSlot(49).getDisplayName().equals("§aRemember the pattern!")) { - if (event.isCancelable()) event.setCanceled(true); - return; - } else if (inventory.getStackInSlot(49).getDisplayName().startsWith("§7Timer: §a")) { - if (clickInOrderSlots[lastUltraSequencerClicked] != null && event.slot.getSlotIndex() != clickInOrderSlots[lastUltraSequencerClicked].getSlotIndex()) { - if (event.isCancelable() && !Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && !Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)) - event.setCanceled(true); - return; - } - } - } - } - @SubscribeEvent public void onGuiRender(GuiChestBackgroundDrawnEvent event) { if (ToggleCommand.ultrasequencerToggled && event.displayName.startsWith("Ultrasequencer (")) { diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index d8100b5..569f4d1 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -35,7 +35,6 @@ public class DankerGui extends GuiScreen { private GuiTextField search; private GuiButton changeDisplay; - private GuiButton onlySlayer; private GuiButton puzzleSolvers; private GuiButton experimentationTableSolvers; private GuiButton skillTracker; @@ -49,7 +48,6 @@ public class DankerGui extends GuiScreen { private GuiButton splitFishing; private GuiButton chatMaddox; private GuiButton spiritBearAlert; - private GuiButton aotd; private GuiButton petColours; private GuiButton golemAlerts; private GuiButton expertiseLore; @@ -58,13 +56,11 @@ public class DankerGui extends GuiScreen { private GuiButton cakeTimer; private GuiButton pickBlock; private GuiButton notifySlayerSlain; - private GuiButton shadowFury; - private GuiButton specialHoe; private GuiButton melodyTooltips; private GuiButton autoSkillTracker; private GuiButton highlightArachne; + private GuiButton highlightSlayer; // Chat Messages - private GuiButton lividDagger; private GuiButton sceptreMessages; private GuiButton midasStaffMessages; private GuiButton implosionMessages; @@ -78,7 +74,6 @@ public class DankerGui extends GuiScreen { private GuiButton lividSolver; private GuiButton stopSalvageStarred; private GuiButton watcherReadyMessage; - private GuiButton flowerWeapons; private GuiButton necronNotifications; private GuiButton bonzoTimer; @@ -110,7 +105,6 @@ public class DankerGui extends GuiScreen { search = new GuiTextField(0, this.fontRendererObj, width - 202, 5, 200, 20); changeDisplay = new GuiButton(0, 0, 0, "Change Display Settings"); - onlySlayer = new GuiButton(0, 0, 0, "Set Slayer Quest"); puzzleSolvers = new GuiButton(0, 0, 0, "Toggle Dungeons Puzzle Solvers"); experimentationTableSolvers = new GuiButton(0, 0, 0, "Toggle Experimentation Table Solvers"); skillTracker = new GuiButton(0, 0, 0, "Toggle Skill XP/Hour Tracking"); @@ -122,8 +116,6 @@ public class DankerGui extends GuiScreen { cakeTimer = new GuiButton(0, 0, 0, "Cake Timer: " + Utils.getColouredBoolean(ToggleCommand.cakeTimerToggled)); skill50Display = new GuiButton(0, 0, 0, "Display Progress To Skill Level 50: " + Utils.getColouredBoolean(ToggleCommand.skill50DisplayToggled)); slayerCount = new GuiButton(0, 0, 0, "Count Total 20% Drops: " + Utils.getColouredBoolean(ToggleCommand.slayerCountTotal)); - aotd = new GuiButton(0, 0, 0, "Disable AOTD Ability: " + Utils.getColouredBoolean(ToggleCommand.aotdToggled)); - lividDagger = new GuiButton(0, 0, 0, "Disable Livid Dagger Ability: " + Utils.getColouredBoolean(ToggleCommand.lividDaggerToggled)); spiritBearAlert = new GuiButton(0, 0, 0, "Spirit Bear Spawn Alerts: " + Utils.getColouredBoolean(ToggleCommand.spiritBearAlerts)); sceptreMessages = new GuiButton(0, 0, 0, "Spirit Sceptre Messages: " + Utils.getColouredBoolean(ToggleCommand.sceptreMessages)); midasStaffMessages = new GuiButton(0, 0, 0, "Midas Staff Messages: " + Utils.getColouredBoolean(ToggleCommand.midasStaffMessages)); @@ -144,18 +136,15 @@ public class DankerGui extends GuiScreen { dungeonTimer = new GuiButton(0, 0, 0, "Display Dungeon Timers: " + Utils.getColouredBoolean(ToggleCommand.dungeonTimerToggled)); stopSalvageStarred = new GuiButton(0, 0, 0, "Stop Salvaging Starred Items: " + Utils.getColouredBoolean(ToggleCommand.stopSalvageStarredToggled)); watcherReadyMessage = new GuiButton(0, 0, 0, "Display Watcher Ready Message: " + Utils.getColouredBoolean(ToggleCommand.watcherReadyToggled)); - flowerWeapons = new GuiButton(0, 0, 0, "Prevent Placing FoT/Spirit Sceptre: " + Utils.getColouredBoolean(ToggleCommand.flowerWeaponsToggled)); notifySlayerSlain = new GuiButton(0, 0, 0, "Notify when Slayer Slain: " + Utils.getColouredBoolean(ToggleCommand.notifySlayerSlainToggled)); necronNotifications = new GuiButton(0, 0, 0, "Necron Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled)); bonzoTimer = new GuiButton(0, 0, 0, "Bonzo's Mask Timer: " + Utils.getColouredBoolean(ToggleCommand.bonzoTimerToggled)); autoSkillTracker = new GuiButton(0, 0, 0, "Auto Start/Stop Skill Tracker: " + Utils.getColouredBoolean(ToggleCommand.autoSkillTrackerToggled)); - shadowFury = new GuiButton(0, 0, 0, "Block Shadow Fury ability: " + Utils.getColouredBoolean(ToggleCommand.shadowFuryToggled)); - specialHoe = new GuiButton(0, 0, 0, "Block Special Hoe right click: " + Utils.getColouredBoolean(ToggleCommand.specialHoeRightClick)); melodyTooltips = new GuiButton(0, 0, 0, "Hide tooltips in Melody's Harp: " + Utils.getColouredBoolean(ToggleCommand.melodyTooltips)); highlightArachne = new GuiButton(0, 0, 0, "Highlight Arachne: " + Utils.getColouredBoolean(ToggleCommand.highlightArachne)); + highlightSlayer = new GuiButton(0, 0, 0, "Highlight Slayer: " + Utils.getColouredBoolean(ToggleCommand.highlightSlayers)); allButtons.add(changeDisplay); - allButtons.add(onlySlayer); allButtons.add(puzzleSolvers); allButtons.add(experimentationTableSolvers); allButtons.add(skillTracker); @@ -167,8 +156,6 @@ public class DankerGui extends GuiScreen { allButtons.add(cakeTimer); allButtons.add(skill50Display); allButtons.add(slayerCount); - allButtons.add(aotd); - allButtons.add(lividDagger); allButtons.add(spiritBearAlert); allButtons.add(sceptreMessages); allButtons.add(midasStaffMessages); @@ -189,15 +176,13 @@ public class DankerGui extends GuiScreen { allButtons.add(dungeonTimer); allButtons.add(stopSalvageStarred); allButtons.add(watcherReadyMessage); - allButtons.add(flowerWeapons); allButtons.add(notifySlayerSlain); allButtons.add(necronNotifications); allButtons.add(bonzoTimer); allButtons.add(autoSkillTracker); - allButtons.add(shadowFury); - allButtons.add(specialHoe); allButtons.add(melodyTooltips); allButtons.add(highlightArachne); + allButtons.add(highlightSlayer); search.setText(initSearchText); search.setVisible(true); @@ -273,8 +258,6 @@ public class DankerGui extends GuiScreen { } } else if (button == changeDisplay) { DankersSkyblockMod.guiToOpen = "displaygui"; - } else if (button == onlySlayer) { - DankersSkyblockMod.guiToOpen = "onlyslayergui"; } else if (button == puzzleSolvers) { DankersSkyblockMod.guiToOpen = "puzzlesolvers"; } else if (button == experimentationTableSolvers) { @@ -303,14 +286,6 @@ public class DankerGui extends GuiScreen { ToggleCommand.slayerCountTotal = !ToggleCommand.slayerCountTotal; ConfigHandler.writeBooleanConfig("toggles", "SlayerCount", ToggleCommand.slayerCountTotal); slayerCount.displayString = "Count Total 20% Drops: " + Utils.getColouredBoolean(ToggleCommand.slayerCountTotal); - } else if (button == aotd) { - ToggleCommand.aotdToggled = !ToggleCommand.aotdToggled; - ConfigHandler.writeBooleanConfig("toggles", "AOTD", ToggleCommand.aotdToggled); - aotd.displayString = "Disable AOTD Ability: " + Utils.getColouredBoolean(ToggleCommand.aotdToggled); - } else if (button == lividDagger) { - ToggleCommand.lividDaggerToggled = !ToggleCommand.lividDaggerToggled; - ConfigHandler.writeBooleanConfig("toggles", "LividDagger", ToggleCommand.lividDaggerToggled); - lividDagger.displayString = "Disable Livid Dagger Ability: " + Utils.getColouredBoolean(ToggleCommand.lividDaggerToggled); } else if (button == sceptreMessages) { ToggleCommand.sceptreMessages = !ToggleCommand.sceptreMessages; ConfigHandler.writeBooleanConfig("toggles", "SceptreMessages", ToggleCommand.sceptreMessages); @@ -407,22 +382,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.swapToPickBlockToggled = !ToggleCommand.swapToPickBlockToggled; ConfigHandler.writeBooleanConfig("toggles", "PickBlock", ToggleCommand.swapToPickBlockToggled); pickBlock.displayString = "Auto-Swap to Pick Block: " + Utils.getColouredBoolean(ToggleCommand.swapToPickBlockToggled); - } else if (button == flowerWeapons) { - ToggleCommand.flowerWeaponsToggled = !ToggleCommand.flowerWeaponsToggled; - ConfigHandler.writeBooleanConfig("toggles", "FlowerWeapons", ToggleCommand.flowerWeaponsToggled); - flowerWeapons.displayString = "Prevent Placing FoT/Spirit Sceptre: " + Utils.getColouredBoolean(ToggleCommand.flowerWeaponsToggled); } else if (button == autoSkillTracker) { ToggleCommand.autoSkillTrackerToggled = !ToggleCommand.autoSkillTrackerToggled; ConfigHandler.writeBooleanConfig("toggles", "AutoSkillTracker", ToggleCommand.autoSkillTrackerToggled); autoSkillTracker.displayString = "Auto Start/Stop Skill Tracker: " + Utils.getColouredBoolean(ToggleCommand.autoSkillTrackerToggled); - } else if (button == shadowFury) { - ToggleCommand.shadowFuryToggled = !ToggleCommand.shadowFuryToggled; - ConfigHandler.writeBooleanConfig("toggles", "ShadowFury", ToggleCommand.shadowFuryToggled); - shadowFury.displayString = "Block Shadow Fury ability: " + Utils.getColouredBoolean(ToggleCommand.shadowFuryToggled); - } else if (button == specialHoe) { - ToggleCommand.specialHoeRightClick = !ToggleCommand.specialHoeRightClick; - ConfigHandler.writeBooleanConfig("toggles", "SpecialHoe", ToggleCommand.specialHoeRightClick); - specialHoe.displayString = "Block Special Hoe right click: " + Utils.getColouredBoolean(ToggleCommand.specialHoeRightClick); } else if (button == melodyTooltips) { ToggleCommand.melodyTooltips = !ToggleCommand.melodyTooltips; ConfigHandler.writeBooleanConfig("toggles", "MelodyTooltips", ToggleCommand.melodyTooltips); @@ -435,6 +398,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.highlightArachne = !ToggleCommand.highlightArachne; ConfigHandler.writeBooleanConfig("toggles", "HighlightArachne", ToggleCommand.highlightArachne); highlightArachne.displayString = "Highlight Arachne: " + Utils.getColouredBoolean(ToggleCommand.highlightArachne); + } else if (button == highlightSlayer) { + ToggleCommand.highlightSlayers = !ToggleCommand.highlightSlayers; + ConfigHandler.writeBooleanConfig("toggles", "HighlightSlayers", ToggleCommand.highlightSlayers); + highlightSlayer.displayString = "Highlight Slayer: " + Utils.getColouredBoolean(ToggleCommand.highlightSlayers); } } diff --git a/src/main/java/me/Danker/gui/OnlySlayerGui.java b/src/main/java/me/Danker/gui/OnlySlayerGui.java deleted file mode 100644 index ec26a13..0000000 --- a/src/main/java/me/Danker/gui/OnlySlayerGui.java +++ /dev/null @@ -1,165 +0,0 @@ -package me.Danker.gui; - -import me.Danker.DankersSkyblockMod; -import me.Danker.commands.ToggleCommand; -import me.Danker.features.BlockWrongSlayer; -import me.Danker.handlers.ConfigHandler; -import me.Danker.handlers.TextRenderer; -import me.Danker.utils.Utils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.ScaledResolution; - -public class OnlySlayerGui extends GuiScreen { - - private int onlyNumberInt = 4; - private String onlyName = "Revenant Horror"; - - private GuiButton goBack; - private GuiButton off; - private GuiButton zombie; - private GuiButton spider; - private GuiButton wolf; - private GuiButton one; - private GuiButton two; - private GuiButton three; - private GuiButton four; - private GuiButton five; - private GuiButton highlightSlayers; - - @Override - public boolean doesGuiPauseGame() { - return false; - } - - @Override - public void initGui() { - super.initGui(); - - ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); - int height = sr.getScaledHeight(); - int width = sr.getScaledWidth(); - - onlyName = BlockWrongSlayer.onlySlayerName; - switch (BlockWrongSlayer.onlySlayerNumber) { - case "I": - onlyNumberInt = 1; - break; - case "II": - onlyNumberInt = 2; - break; - case "III": - onlyNumberInt = 3; - break; - case "IV": - default: - onlyNumberInt = 4; - break; - case "V": - onlyNumberInt = 5; - break; - } - - goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); - off = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Off"); - zombie = new GuiButton(0, width / 2 - 200, (int) (height * 0.4), 120, 20, "Zombie"); - spider = new GuiButton(0, width / 2 - 60, (int) (height * 0.4), 120, 20, "Spider"); - wolf = new GuiButton(0, width / 2 + 80, (int) (height * 0.4), 120, 20, "Wolf"); - one = new GuiButton(0, width / 2 - 190, (int) (height * 0.6), 60, 20, "I"); - two = new GuiButton(0, width / 2 - 110, (int) (height * 0.6), 60, 20, "II"); - three = new GuiButton(0, width / 2 - 30, (int) (height * 0.6), 60, 20, "III"); - four = new GuiButton(0, width / 2 + 50, (int) (height * 0.6), 60, 20, "IV"); - five = new GuiButton(0, width / 2 + 130, (int) (height * 0.6), 60, 20, "V"); - 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); - this.buttonList.add(spider); - this.buttonList.add(wolf); - this.buttonList.add(one); - this.buttonList.add(two); - this.buttonList.add(three); - this.buttonList.add(four); - this.buttonList.add(five); - this.buttonList.add(highlightSlayers); - this.buttonList.add(goBack); - } - - @Override - public void drawScreen(int mouseX, int mouseY, float partialTicks) { - this.drawDefaultBackground(); - Minecraft mc = Minecraft.getMinecraft(); - - String displayText; - if (BlockWrongSlayer.onlySlayerName.equals("")) { - displayText = "Only Allow Slayer: Off"; - } else { - displayText = "Only Allow Slayer: " + BlockWrongSlayer.onlySlayerName + " " + BlockWrongSlayer.onlySlayerNumber; - } - int displayWidth = mc.fontRendererObj.getStringWidth(displayText); - new TextRenderer(mc, displayText, width / 2 - displayWidth / 2, 10, 1D); - - super.drawScreen(mouseX, mouseY, partialTicks); - } - - @Override - public void actionPerformed(GuiButton button) { - if (button == goBack) { - DankersSkyblockMod.guiToOpen = "dankergui1"; - return; - } else if (button == off) { - BlockWrongSlayer.onlySlayerName = ""; - BlockWrongSlayer.onlySlayerNumber = ""; - ConfigHandler.writeStringConfig("toggles", "BlockSlayer", ""); - return; - } else if (button == zombie) { - onlyName = "Revenant Horror"; - } else if (button == spider) { - onlyName = "Tarantula Broodfather"; - } else if (button == wolf) { - onlyName = "Sven Packmaster"; - } else if (button == one) { - onlyNumberInt = 1; - } else if (button == two) { - onlyNumberInt = 2; - } else if (button == three) { - onlyNumberInt = 3; - } else if (button == four) { - onlyNumberInt = 4; - } else if (button == five) { - onlyNumberInt = 5; - } else if (button == highlightSlayers) { - ToggleCommand.highlightSlayers = !ToggleCommand.highlightSlayers; - ConfigHandler.writeBooleanConfig("toggles", "HighlightSlayers", ToggleCommand.highlightSlayers); - highlightSlayers.displayString = "Highlight Slayer Bosses: " + Utils.getColouredBoolean(ToggleCommand.highlightSlayers); - return; - } - - String onlyNumber; - switch (onlyNumberInt) { - case 1: - onlyNumber = "I"; - break; - case 2: - onlyNumber = "II"; - break; - case 3: - onlyNumber = "III"; - break; - case 4: - onlyNumber = "IV"; - break; - case 5: - onlyNumber = "V"; - break; - default: - onlyNumber = "IV"; - } - - BlockWrongSlayer.onlySlayerName = onlyName; - BlockWrongSlayer.onlySlayerNumber = onlyNumber; - ConfigHandler.writeStringConfig("toggles", "BlockSlayer", BlockWrongSlayer.onlySlayerName + " " + BlockWrongSlayer.onlySlayerNumber); - } - -} diff --git a/src/main/java/me/Danker/gui/PuzzleSolversGui.java b/src/main/java/me/Danker/gui/PuzzleSolversGui.java index 3bb16a0..70cd982 100644 --- a/src/main/java/me/Danker/gui/PuzzleSolversGui.java +++ b/src/main/java/me/Danker/gui/PuzzleSolversGui.java @@ -28,8 +28,6 @@ public class PuzzleSolversGui extends GuiScreen { private GuiButton startsWith; private GuiButton selectAll; private GuiButton clickOrder; - private GuiButton blockClicks; - private GuiButton itemFrameOnSeaLanterns; public PuzzleSolversGui(int page) { this.page = page; @@ -66,8 +64,6 @@ public class PuzzleSolversGui extends GuiScreen { startsWith = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Starts With Letter Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.startsWithToggled)); selectAll = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Select All Color Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.selectAllToggled)); clickOrder = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Click in Order Terminal Helper: " + Utils.getColouredBoolean(ToggleCommand.clickInOrderToggled)); - blockClicks = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Block Wrong Clicks on Terminals: " + Utils.getColouredBoolean(ToggleCommand.blockWrongTerminalClicksToggled)); - itemFrameOnSeaLanterns = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Ignore Arrows On Sea Lanterns: " + Utils.getColouredBoolean(ToggleCommand.itemFrameOnSeaLanternsToggled)); switch (page) { case 1: @@ -86,8 +82,6 @@ public class PuzzleSolversGui extends GuiScreen { this.buttonList.add(startsWith); this.buttonList.add(selectAll); this.buttonList.add(clickOrder); - this.buttonList.add(blockClicks); - this.buttonList.add(itemFrameOnSeaLanterns); this.buttonList.add(backPage); break; } @@ -156,14 +150,6 @@ public class PuzzleSolversGui extends GuiScreen { ToggleCommand.clickInOrderToggled = !ToggleCommand.clickInOrderToggled; ConfigHandler.writeBooleanConfig("toggles", "ClickInOrderTerminal", ToggleCommand.clickInOrderToggled); clickOrder.displayString = "Click in Order Terminal Helper: " + Utils.getColouredBoolean(ToggleCommand.clickInOrderToggled); - } else if (button == blockClicks) { - ToggleCommand.blockWrongTerminalClicksToggled = !ToggleCommand.blockWrongTerminalClicksToggled; - ConfigHandler.writeBooleanConfig("toggles", "BlockWrongTerminalClicks", ToggleCommand.blockWrongTerminalClicksToggled); - blockClicks.displayString = "Block Wrong Clicks on Terminals: " + Utils.getColouredBoolean(ToggleCommand.blockWrongTerminalClicksToggled); - } else if (button == itemFrameOnSeaLanterns) { - ToggleCommand.itemFrameOnSeaLanternsToggled = !ToggleCommand.itemFrameOnSeaLanternsToggled; - ConfigHandler.writeBooleanConfig("toggles", "IgnoreItemFrameOnSeaLanterns", ToggleCommand.itemFrameOnSeaLanternsToggled); - itemFrameOnSeaLanterns.displayString = "Ignore Arrows On Sea Lanterns: " + Utils.getColouredBoolean(ToggleCommand.itemFrameOnSeaLanternsToggled); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 04f4ccd..d3b7464 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -219,16 +219,12 @@ public class ConfigHandler { ToggleCommand.splitFishing = initBoolean("toggles", "SplitFishing", true); ToggleCommand.chatMaddoxToggled = initBoolean("toggles", "ChatMaddox", false); ToggleCommand.spiritBearAlerts = initBoolean("toggles", "SpiritBearAlerts", false); - ToggleCommand.aotdToggled = initBoolean("toggles", "AOTD", false); - ToggleCommand.lividDaggerToggled = initBoolean("toggles", "LividDagger", false); - ToggleCommand.shadowFuryToggled = initBoolean("toggles", "Shadow Fury", false); ToggleCommand.petColoursToggled = initBoolean("toggles", "PetColors", false); ToggleCommand.golemAlertToggled = initBoolean("toggles", "GolemAlerts", false); ToggleCommand.expertiseLoreToggled = initBoolean("toggles", "ExpertiseLore", false); ToggleCommand.skill50DisplayToggled = initBoolean("toggles", "Skill50Display", false); ToggleCommand.outlineTextToggled = initBoolean("toggles", "OutlineText", false); ToggleCommand.cakeTimerToggled = initBoolean("toggles", "CakeTimer", false); - ToggleCommand.specialHoeRightClick = initBoolean("toggles", "SpecialHoe", false); ToggleCommand.melodyTooltips = initBoolean("toggles", "MelodyTooltips", false); ToggleCommand.highlightSlayers = initBoolean("toggles", "HighlightSlayers", false); ToggleCommand.highlightArachne = initBoolean("toggles", "HighlightArachne", false); @@ -250,7 +246,6 @@ public class ConfigHandler { ToggleCommand.necronNotificationsToggled = initBoolean("toggles", "NecronNotifications", false); ToggleCommand.bonzoTimerToggled = initBoolean("toggles", "BonzoTimer", false); ToggleCommand.swapToPickBlockToggled = initBoolean("toggles", "PickBlock", false); - ToggleCommand.flowerWeaponsToggled = initBoolean("toggles", "FlowerWeapons", false); ToggleCommand.autoSkillTrackerToggled = initBoolean("toggles", "AutoSkillTracker", false); // Puzzle Solvers ToggleCommand.threeManToggled = initBoolean("toggles", "ThreeManPuzzle", false); @@ -265,8 +260,6 @@ public class ConfigHandler { ToggleCommand.startsWithToggled = initBoolean("toggles", "StartsWithTerminal", false); ToggleCommand.selectAllToggled = initBoolean("toggles", "SelectAllTerminal", false); ToggleCommand.clickInOrderToggled = initBoolean("toggles", "ClickInOrderTerminal", false); - ToggleCommand.blockWrongTerminalClicksToggled = initBoolean("toggles", "BlockWrongTerminalClicks", false); - ToggleCommand.itemFrameOnSeaLanternsToggled = initBoolean("toggles", "IgnoreItemFrameOnSeaLanterns", false); // Experiment Solvers ToggleCommand.ultrasequencerToggled = initBoolean("toggles", "UltraSequencer", false); ToggleCommand.chronomatronToggled = initBoolean("toggles", "Chronomatron", false); @@ -283,14 +276,6 @@ public class ConfigHandler { // API if (!hasKey("api", "APIKey")) writeStringConfig("api", "APIKey", ""); - - // Block Wrong Slayer - if (!hasKey("toggles", "BlockSlayer")) writeStringConfig("toggles", "BlockSlayer", ""); - String onlySlayer = getString("toggles", "BlockSlayer"); - if (!onlySlayer.equals("")) { - BlockWrongSlayer.onlySlayerName = onlySlayer.substring(0, onlySlayer.lastIndexOf(" ")); - BlockWrongSlayer.onlySlayerNumber = onlySlayer.substring(onlySlayer.lastIndexOf(" ") + 1); - } // Wolf LootTracker.wolfSvens = initInt("wolf", "svens", 0); diff --git a/src/main/java/me/Danker/handlers/PacketHandler.java b/src/main/java/me/Danker/handlers/PacketHandler.java index da7900a..a4fd85e 100644 --- a/src/main/java/me/Danker/handlers/PacketHandler.java +++ b/src/main/java/me/Danker/handlers/PacketHandler.java @@ -2,19 +2,10 @@ package me.Danker.handlers; import io.netty.channel.ChannelDuplexHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelPromise; -import me.Danker.commands.ToggleCommand; import me.Danker.utils.Utils; import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItemFrame; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; import net.minecraft.network.Packet; -import net.minecraft.network.play.client.C02PacketUseEntity; import net.minecraft.network.play.server.S04PacketEntityEquipment; -import net.minecraft.util.BlockPos; import java.lang.reflect.Field; @@ -36,26 +27,4 @@ public class PacketHandler extends ChannelDuplexHandler { super.channelRead(ctx, msg); } - // Ignore item frames with arrows on sea lanterns - @Override - public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { - if (ToggleCommand.itemFrameOnSeaLanternsToggled && Utils.inDungeons && msg instanceof Packet && msg.getClass().getName().endsWith("C02PacketUseEntity")) { - Minecraft mc = Minecraft.getMinecraft(); - C02PacketUseEntity packet = (C02PacketUseEntity) msg; - Entity entityHit = packet.getEntityFromWorld(mc.theWorld); - if (entityHit instanceof EntityItemFrame) { - EntityItemFrame itemFrame = (EntityItemFrame) entityHit; - ItemStack item = itemFrame.getDisplayedItem(); - if (item != null && item.getItem() == Items.arrow) { - BlockPos blockPos = Utils.getBlockUnderItemFrame(itemFrame); - if (mc.theWorld.getBlockState(blockPos).getBlock() == Blocks.sea_lantern) { - return; - } - } - } - } - - super.write(ctx, msg, promise); - } - } -- cgit