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/gui/PuzzleSolversGui.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/main/java/me/Danker/gui/PuzzleSolversGui.java') diff --git a/src/main/java/me/Danker/gui/PuzzleSolversGui.java b/src/main/java/me/Danker/gui/PuzzleSolversGui.java index 17eb433..f502df9 100644 --- a/src/main/java/me/Danker/gui/PuzzleSolversGui.java +++ b/src/main/java/me/Danker/gui/PuzzleSolversGui.java @@ -22,6 +22,7 @@ public class PuzzleSolversGui extends GuiScreen { private GuiButton creeper; private GuiButton water; private GuiButton ticTacToe; + private GuiButton boulder; private GuiButton startsWith; private GuiButton selectAll; private GuiButton clickOrder; @@ -56,12 +57,13 @@ public class PuzzleSolversGui extends GuiScreen { creeper = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Creeper Solver: " + Utils.getColouredBoolean(ToggleCommand.creeperToggled)); water = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Water Solver: " + Utils.getColouredBoolean(ToggleCommand.waterToggled)); ticTacToe = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Tic Tac Toe Solver: " + Utils.getColouredBoolean(ToggleCommand.ticTacToeToggled)); - startsWith = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Starts With Letter Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.startsWithToggled)); + boulder = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Boulder Solver: " + Utils.getColouredBoolean(ToggleCommand.boulderToggled)); // Page 2 - selectAll = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Select All Color Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.selectAllToggled)); - clickOrder = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Click in Order Terminal Helper: " + Utils.getColouredBoolean(ToggleCommand.clickInOrderToggled)); - blockClicks = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Block Wrong Clicks on Terminals: " + Utils.getColouredBoolean(ToggleCommand.blockWrongTerminalClicksToggled)); - itemFrameOnSeaLanterns = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Ignore Arrows On Sea Lanterns: " + Utils.getColouredBoolean(ToggleCommand.itemFrameOnSeaLanternsToggled)); + 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)); switch (page) { case 1: @@ -71,10 +73,11 @@ public class PuzzleSolversGui extends GuiScreen { this.buttonList.add(creeper); this.buttonList.add(water); this.buttonList.add(ticTacToe); - this.buttonList.add(startsWith); + this.buttonList.add(boulder); this.buttonList.add(nextPage); break; case 2: + this.buttonList.add(startsWith); this.buttonList.add(selectAll); this.buttonList.add(clickOrder); this.buttonList.add(blockClicks); @@ -123,6 +126,10 @@ public class PuzzleSolversGui extends GuiScreen { ToggleCommand.ticTacToeToggled = !ToggleCommand.ticTacToeToggled; ConfigHandler.writeBooleanConfig("toggles", "TicTacToePuzzle", ToggleCommand.ticTacToeToggled); ticTacToe.displayString = "Tic Tac Toe Solver: " + Utils.getColouredBoolean(ToggleCommand.ticTacToeToggled); + } else if (button == boulder) { + ToggleCommand.boulderToggled = !ToggleCommand.boulderToggled; + ConfigHandler.writeBooleanConfig("toggles", "BoulderPuzzle", ToggleCommand.boulderToggled); + boulder.displayString = "Boulder Solver: " + Utils.getColouredBoolean(ToggleCommand.boulderToggled); } else if (button == startsWith) { ToggleCommand.startsWithToggled = !ToggleCommand.startsWithToggled; ConfigHandler.writeBooleanConfig("toggles", "StartsWithTerminal", ToggleCommand.startsWithToggled); -- 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/gui/PuzzleSolversGui.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 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/gui/PuzzleSolversGui.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 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/gui/PuzzleSolversGui.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