From 092b53e100506ffa70e2bd01596b9891acf28dbf Mon Sep 17 00:00:00 2001 From: Kal Draganov Date: Tue, 8 Dec 2020 12:55:44 -0500 Subject: Watcher Ready Message Displays a message stating the Watcher has finished spawning mobs as a title --- src/main/java/me/Danker/handlers/ConfigHandler.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 23bd6c4..336e7c1 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -192,6 +192,7 @@ public class ConfigHandler { if (!hasKey("toggles", "LowHealthNotify")) writeBooleanConfig("toggles", "LowHealthNotify", false); if (!hasKey("toggles", "LividSolver")) writeBooleanConfig("toggles", "LividSolver", false); if (!hasKey("toggles", "StopSalvageStarred")) writeBooleanConfig("toggles", "StopSalvageStarred", false); + if (!hasKey("toggles", "WatcherReadyMessage")) writeBooleanConfig("toggles", "WatcherReadyMessage", false); // Puzzle Solvers if (!hasKey("toggles", "ThreeManPuzzle")) writeBooleanConfig("toggles", "ThreeManPuzzle", false); if (!hasKey("toggles", "OruoPuzzle")) writeBooleanConfig("toggles", "OruoPuzzle", false); @@ -442,6 +443,7 @@ public class ConfigHandler { ToggleCommand.lowHealthNotifyToggled = getBoolean("toggles", "LowHealthNotify"); ToggleCommand.lividSolverToggled = getBoolean("toggles", "LividSolver"); ToggleCommand.stopSalvageStarredToggled = getBoolean("toggles", "StopSalvageStarred"); + ToggleCommand.watcherReadyToggled = getBoolean("toggles", "WatcherReadyMessage"); // Puzzle Solvers ToggleCommand.threeManToggled = getBoolean("toggles", "ThreeManPuzzle"); ToggleCommand.oruoToggled = getBoolean("toggles", "OruoPuzzle"); -- cgit From 978c058d05aa25da9c5e5c0ab8a85a63ed3b1c58 Mon Sep 17 00:00:00 2001 From: Kal Draganov Date: Thu, 10 Dec 2020 13:50:54 -0500 Subject: Additional Features to Experiment Solvers Displays the next item in the sequence for ultrasequencer and chronomatron in blue. Also adds the feature to disable tooltips in the addons (chronomatron and ultrasequencer) --- src/main/java/me/Danker/DankersSkyblockMod.java | 30 ++++++++++++++++++++-- src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- .../java/me/Danker/commands/ToggleCommand.java | 14 +++++++--- src/main/java/me/Danker/gui/ExperimentsGui.java | 8 +++++- .../java/me/Danker/handlers/ConfigHandler.java | 2 ++ src/main/java/me/Danker/utils/Utils.java | 2 +- 6 files changed, 50 insertions(+), 8 deletions(-) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index de10626..2362ddb 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -2256,12 +2256,17 @@ public class DankersSkyblockMod } } } - } + } if (mc.currentScreen instanceof GuiChest) { ContainerChest chest = (ContainerChest) player.openContainer; IInventory inv = chest.getLowerChestInventory(); String chestName = inv.getDisplayName().getUnformattedText(); + + if (ToggleCommand.hideTooltipsInExperimentAddonsToggled && (chestName.startsWith("Ultrasequencer (") || chestName.startsWith("Chronomatron ("))) { + event.toolTip.clear(); + } + if (ToggleCommand.superpairsToggled && chestName.contains("Superpairs (")) { if (Item.getIdFromItem(item.getItem()) != 95) return; if (item.getDisplayName().contains("Click any button") || item.getDisplayName().contains("Click a second button") || item.getDisplayName().contains("Next button is instantly rewarded") || item.getDisplayName().contains("Stained Glass")) { @@ -3159,6 +3164,12 @@ public class DankersSkyblockMod Slot nextSlot = clickInOrderSlots[lastUltraSequencerClicked]; Utils.drawOnSlot(chestSize, nextSlot.xDisplayPosition, nextSlot.yDisplayPosition, 0xE540FF40); } + if (lastUltraSequencerClicked + 1 < clickInOrderSlots.length) { + if (clickInOrderSlots[lastUltraSequencerClicked + 1] != null) { + Slot nextSlot = clickInOrderSlots[lastUltraSequencerClicked + 1]; + Utils.drawOnSlot(chestSize, nextSlot.xDisplayPosition, nextSlot.yDisplayPosition, 0xD740DAE6); + } + } } } } @@ -3183,8 +3194,23 @@ public class DankersSkyblockMod for (int i = 10; i <= 43; i++) { ItemStack glass = invSlots.get(i).getStack(); if (glass == null) continue; + Slot glassSlot = invSlots.get(i); - if (glass.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks))) { + + if (chronomatronMouseClicks + 1 < chronomatronPattern.size()) { + if (chronomatronPattern.get(chronomatronMouseClicks).equals(chronomatronPattern.get(chronomatronMouseClicks + 1))) { + if (glass.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks))) { + Utils.drawOnSlot(chestSize, glassSlot.xDisplayPosition, glassSlot.yDisplayPosition, 0xE540FF40); + } + } + else if (glass.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks))) { + Utils.drawOnSlot(chestSize, glassSlot.xDisplayPosition, glassSlot.yDisplayPosition, 0xE540FF40); + } + else if (glass.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks + 1))) { + Utils.drawOnSlot(chestSize, glassSlot.xDisplayPosition, glassSlot.yDisplayPosition, 0xBE40DAE6); + } + } + else if (glass.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks))) { Utils.drawOnSlot(chestSize, glassSlot.xDisplayPosition, glassSlot.yDisplayPosition, 0xE540FF40); } } diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 5ffc23d..9d435fb 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/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 1e2c824..7e9b2ea 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -54,6 +54,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean chronomatronToggled; public static boolean superpairsToggled; public static boolean swapToPickBlockInExperimentsToggled; + public static boolean hideTooltipsInExperimentAddonsToggled; @Override public String getCommandName() { @@ -66,7 +67,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "aotd/lividdagger/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/" + "outlinetext/midasstaffmessages/implosionmessages/healmessages/caketimer/lowhealthnotify/" + "lividsolver/stopsalvagestarred/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/waterpuzzle/tictactoepuzzle/" + - "startswithterminal/selectallterminal/itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/pickblockinexperiments/watchermessage/list>"; + "startswithterminal/selectallterminal/itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/pickblockinexperiments/hidetooltipsinaddons/watchermessage/list>"; } @Override @@ -85,7 +86,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "lividsolver", "stopsalvagestarred", "threemanpuzzle", "oruopuzzle", "blazepuzzle", "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "startswithterminal", "selectallterminal", "itemframeonsealanterns", "ultrasequencer", - "chronomatron", "superpairs", "pickblockinexperiments", "watchermessage", "list"); + "chronomatron", "superpairs", "pickblockinexperiments", "hidetooltipsinaddons", "watchermessage", "list"); } return null; } @@ -283,9 +284,14 @@ public class ToggleCommand extends CommandBase implements ICommand { break; case "pickblockinexperiments": swapToPickBlockInExperimentsToggled = !swapToPickBlockInExperimentsToggled; - ConfigHandler.writeBooleanConfig("toggles", "PickBlockInExperiments", superpairsToggled); + ConfigHandler.writeBooleanConfig("toggles", "PickBlockInExperiments", swapToPickBlockInExperimentsToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Auto-swap to pick block in experiments has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + swapToPickBlockInExperimentsToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "hidetooltipsinaddons": + hideTooltipsInExperimentAddonsToggled = !hideTooltipsInExperimentAddonsToggled; + ConfigHandler.writeBooleanConfig("toggles", "HideTooltipsInExperimentAddons", hideTooltipsInExperimentAddonsToggled); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Hide tooltips in ultrasequencer and chronomatron has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + hideTooltipsInExperimentAddonsToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "watchermessage": watcherReadyToggled = !watcherReadyToggled; ConfigHandler.writeBooleanConfig("toggles", "WatcherReadyMessage", watcherReadyToggled); @@ -327,6 +333,8 @@ public class ToggleCommand extends CommandBase implements ICommand { 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 + " Auto-swap to pick block in experiments: " + DankersSkyblockMod.VALUE_COLOUR + swapToPickBlockInExperimentsToggled + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Hide tooltips in experiment addons: " + DankersSkyblockMod.VALUE_COLOUR + hideTooltipsInExperimentAddonsToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Watcher ready message: " + DankersSkyblockMod.VALUE_COLOUR + watcherReadyToggled )); break; diff --git a/src/main/java/me/Danker/gui/ExperimentsGui.java b/src/main/java/me/Danker/gui/ExperimentsGui.java index b27ff16..a363c5d 100644 --- a/src/main/java/me/Danker/gui/ExperimentsGui.java +++ b/src/main/java/me/Danker/gui/ExperimentsGui.java @@ -16,6 +16,7 @@ public class ExperimentsGui extends GuiScreen { private GuiButton chronomatron; private GuiButton superpairs; private GuiButton pickBlock; + private GuiButton hideTooltips; @Override public boolean doesGuiPauseGame() { @@ -35,13 +36,14 @@ public class ExperimentsGui extends GuiScreen { chronomatron = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Chronomatron Solver: " + Utils.getColouredBoolean(ToggleCommand.chronomatronToggled)); superpairs = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Superpairs Solver: " + Utils.getColouredBoolean(ToggleCommand.superpairsToggled)); pickBlock = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Auto-Swap to Pick Block: " + Utils.getColouredBoolean(ToggleCommand.swapToPickBlockInExperimentsToggled)); - + hideTooltips = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Hide Tooltips in Addons: " + Utils.getColouredBoolean(ToggleCommand.hideTooltipsInExperimentAddonsToggled)); this.buttonList.add(goBack); this.buttonList.add(ultrasequencer); this.buttonList.add(chronomatron); this.buttonList.add(superpairs); this.buttonList.add(pickBlock); + this.buttonList.add(hideTooltips); } @Override @@ -70,6 +72,10 @@ public class ExperimentsGui extends GuiScreen { ToggleCommand.swapToPickBlockInExperimentsToggled = !ToggleCommand.swapToPickBlockInExperimentsToggled; ConfigHandler.writeBooleanConfig("toggles", "PickBlockInExperiments", ToggleCommand.swapToPickBlockInExperimentsToggled); pickBlock.displayString = "Auto-Swap to Pick Block: " + Utils.getColouredBoolean(ToggleCommand.swapToPickBlockInExperimentsToggled); + } else if (button == hideTooltips) { + ToggleCommand.hideTooltipsInExperimentAddonsToggled = !ToggleCommand.hideTooltipsInExperimentAddonsToggled; + ConfigHandler.writeBooleanConfig("toggles", "HideTooltipsInExperimentAddons", ToggleCommand.hideTooltipsInExperimentAddonsToggled); + hideTooltips.displayString = "Hide Tooltips in Addons: " + Utils.getColouredBoolean(ToggleCommand.hideTooltipsInExperimentAddonsToggled); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 336e7c1..38c7d12 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -207,6 +207,7 @@ public class ConfigHandler { if (!hasKey("toggles", "Chronomatron")) writeBooleanConfig("toggles", "Chronomatron", false); if (!hasKey("toggles", "Superpairs")) writeBooleanConfig("toggles", "Superpairs", false); if (!hasKey("toggles", "PickBlockInExperiments")) writeBooleanConfig("toggles", "PickBlockInExperiments", false); + if (!hasKey("toggles", "HideTooltipsInExperimentAddons")) writeBooleanConfig("toggles", "HideTooltipsInExperimentAddons", false); if (!hasKey("api", "APIKey")) writeStringConfig("api", "APIKey", ""); @@ -458,6 +459,7 @@ public class ConfigHandler { ToggleCommand.chronomatronToggled = getBoolean("toggles", "Chronomatron"); ToggleCommand.superpairsToggled = getBoolean("toggles", "Superpairs"); ToggleCommand.swapToPickBlockInExperimentsToggled = getBoolean("toggles", "PickBlockInExperiments"); + ToggleCommand.hideTooltipsInExperimentAddonsToggled = getBoolean("toggles", "HideTooltipsInExperimentAddons"); String onlySlayer = getString("toggles", "BlockSlayer"); if (!onlySlayer.equals("")) { diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index fbd8e4c..0f0a70b 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -280,7 +280,7 @@ public class Utils { GlStateManager.disableAlpha(); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); GL11.glLineWidth(2); - GlStateManager.color(colour.getRed() / 255f, colour.getGreen() / 255f, colour.getBlue()/ 255f, colour.getAlpha() / 255f); + GlStateManager.color(colour.getRed() / 255f, colour.getGreen() / 255f, colour.getBlue() / 255f, colour.getAlpha() / 255f); worldRenderer.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION); worldRenderer.pos(pos1.xCoord, pos1.yCoord, pos1.zCoord).endVertex(); -- cgit From 82afdeaa57625b554850c9e0a9b06ab06bb8097d Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 10 Dec 2020 15:07:49 -0500 Subject: Add pet colors to config --- src/main/java/me/Danker/DankersSkyblockMod.java | 35 ++++++++++++++-------- .../java/me/Danker/handlers/ConfigHandler.java | 22 ++++++++++++++ 2 files changed, 45 insertions(+), 12 deletions(-) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index e7bc30d..3fe283c 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -166,6 +166,17 @@ public class DankersSkyblockMod public static String TRIVIA_WRONG_ANSWER_COLOUR; public static int LOWEST_BLAZE_COLOUR; public static int HIGHEST_BLAZE_COLOUR; + public static int PET_1_TO_9; + public static int PET_10_TO_19; + public static int PET_20_TO_29; + public static int PET_30_TO_39; + public static int PET_40_TO_49; + public static int PET_50_TO_59; + public static int PET_60_TO_69; + public static int PET_70_TO_79; + public static int PET_80_TO_89; + public static int PET_90_TO_99; + public static int PET_100; @EventHandler public void init(FMLInitializationEvent event) { @@ -3091,29 +3102,29 @@ public class DankersSkyblockMod int colour; int petLevel = Integer.parseInt(item.getDisplayName().substring(item.getDisplayName().indexOf(" ") + 1, item.getDisplayName().indexOf("]"))); if (petLevel == 100) { - colour = 0xBFF2D249; // Gold + colour = PET_100; } else if (petLevel >= 90) { - colour = 0xBF9E794E; // Brown + colour = PET_90_TO_99; } else if (petLevel >= 80) { - colour = 0xBF5C1F35; // idk weird magenta + colour = PET_80_TO_89; } else if (petLevel >= 70) { - colour = 0xBFD64FC8; // Pink + colour = PET_70_TO_79; } else if (petLevel >= 60) { - colour = 0xBF7E4FC6; // Purple + colour = PET_60_TO_69; } else if (petLevel >= 50) { - colour = 0xBF008AD8; // Light Blue + colour = PET_50_TO_59; } else if (petLevel >= 40) { - colour = 0xBF0EAC35; // Green + colour = PET_40_TO_49; } else if (petLevel >= 30) { - colour = 0xBFFFC400; // Yellow + colour = PET_30_TO_39; } else if (petLevel >= 20) { - colour = 0xBFEF5230; // Orange + colour = PET_20_TO_29; } else if (petLevel >= 10) { - colour = 0xBFD62440; // Red + colour = PET_10_TO_19; } else { - colour = 0xBF999999; // Gray + colour = PET_1_TO_9; } - Utils.drawOnSlot(chestSize, slot.xDisplayPosition, slot.yDisplayPosition, colour); + Utils.drawOnSlot(chestSize, slot.xDisplayPosition, slot.yDisplayPosition, colour + 0xBF000000); } } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 23bd6c4..b2880a9 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -417,6 +417,17 @@ public class ConfigHandler { if (!hasKey("colors", "triviaWrongAnswer")) writeStringConfig("colors", "triviaWrongAnswer", EnumChatFormatting.RED.toString()); if (!hasKey("colors", "blazeLowest")) writeIntConfig("colors", "blazeLowest", 0xFF0000); if (!hasKey("colors", "blazeHighest")) writeIntConfig("colors", "blazeHighest", 0x40FF40); + if (!hasKey("colors", "pet1To9")) writeIntConfig("colors", "pet1To9", 0x999999); // Gray + if (!hasKey("colors", "pet10To19")) writeIntConfig("colors", "pet10To19", 0xD62440); // Red + if (!hasKey("colors", "pet20To29")) writeIntConfig("colors", "pet20To29", 0xEF5230); // Orange + if (!hasKey("colors", "pet30To39")) writeIntConfig("colors", "pet30To39", 0xFFC400); // Yellow + if (!hasKey("colors", "pet40To49")) writeIntConfig("colors", "pet40To49", 0x0EAC35); // Green + if (!hasKey("colors", "pet50To59")) writeIntConfig("colors", "pet50To59", 0x008AD8); // Light Blue + if (!hasKey("colors", "pet60To69")) writeIntConfig("colors", "pet60To69", 0x7E4FC6); // Purple + if (!hasKey("colors", "pet70To79")) writeIntConfig("colors", "pet70To79", 0xD64FC8); // Pink + if (!hasKey("colors", "pet80To89")) writeIntConfig("colors", "pet80To89", 0x5C1F35); // idk weird magenta + if (!hasKey("colors", "pet90To99")) writeIntConfig("colors", "pet90To99", 0x9E794E); // Brown + if (!hasKey("colors", "pet100")) writeIntConfig("colors", "pet100", 0xF2D249); // Gold ToggleCommand.gpartyToggled = getBoolean("toggles", "GParty"); ToggleCommand.coordsToggled = getBoolean("toggles", "Coords"); @@ -670,6 +681,17 @@ public class ConfigHandler { DankersSkyblockMod.TRIVIA_WRONG_ANSWER_COLOUR = getString("colors", "triviaWrongAnswer"); DankersSkyblockMod.LOWEST_BLAZE_COLOUR = getInt("colors", "blazeLowest"); DankersSkyblockMod.HIGHEST_BLAZE_COLOUR = getInt("colors", "blazeHighest"); + DankersSkyblockMod.PET_1_TO_9 = getInt("colors", "pet1To9"); + DankersSkyblockMod.PET_10_TO_19 = getInt("colors", "pet10To19"); + DankersSkyblockMod.PET_20_TO_29 = getInt("colors", "pet20To29"); + DankersSkyblockMod.PET_30_TO_39 = getInt("colors", "pet30To39"); + DankersSkyblockMod.PET_40_TO_49 = getInt("colors", "pet40To49"); + DankersSkyblockMod.PET_50_TO_59 = getInt("colors", "pet50To59"); + DankersSkyblockMod.PET_60_TO_69 = getInt("colors", "pet60To69"); + DankersSkyblockMod.PET_70_TO_79 = getInt("colors", "pet70To79"); + DankersSkyblockMod.PET_80_TO_89 = getInt("colors", "pet80To89"); + DankersSkyblockMod.PET_90_TO_99 = getInt("colors", "pet90To99"); + DankersSkyblockMod.PET_100 = getInt("colors", "pet100"); } } -- cgit From 1af555fd7191f99052da64c044be1059d4777b8f Mon Sep 17 00:00:00 2001 From: Sychic Date: Fri, 11 Dec 2020 12:01:38 -0500 Subject: minor rearrangement and addition of out of mana and ability cooldown message toggles --- src/main/java/me/Danker/DankersSkyblockMod.java | 10 +++++ .../java/me/Danker/commands/ToggleCommand.java | 48 ++++++++++++++-------- .../java/me/Danker/handlers/ConfigHandler.java | 25 +++++++---- 3 files changed, 60 insertions(+), 23 deletions(-) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 2c75a0e..7e67d6c 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -464,6 +464,16 @@ public class DankersSkyblockMod event.setCanceled(true); return; } + // Ability Cooldown + if (!ToggleCommand.cooldownMessages && message.contains("This ability is currently on cooldown for") && message.contains("more second")) { + event.setCanceled(true); + return; + } + // Out of mana messages + if (!ToggleCommand.manaMessages && message.contains("You do not have enough mana to do this!")) { + event.setCanceled(true); + return; + } if (!ToggleCommand.implosionMessages) { if (message.contains("Your Implosion hit ") || message.contains("There are blocks in the way")) { diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 5c473e5..b94bc16 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -23,17 +23,21 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean spiritBearAlerts; public static boolean aotdToggled; public static boolean lividDaggerToggled; - public static boolean sceptreMessages; public static boolean petColoursToggled; public static boolean dungeonTimerToggled; public static boolean golemAlertToggled; public static boolean expertiseLoreToggled; public static boolean skill50DisplayToggled; public static boolean outlineTextToggled; + public static boolean cakeTimerToggled; + // Chat Messages + public static boolean sceptreMessages; public static boolean midasStaffMessages; public static boolean implosionMessages; public static boolean healMessages; - public static boolean cakeTimerToggled; + public static boolean cooldownMessages; + public static boolean manaMessages; + // Dungeons Messages public static boolean lowHealthNotifyToggled; public static boolean lividSolverToggled; public static boolean stopSalvageStarredToggled; @@ -61,30 +65,30 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " "; + return "/" + getCommandName() + " "; } @Override public int getRequiredPermissionLevel() { return 0; } - + @Override public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", - "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "lividdagger", - "sceptremessages", "petcolors", "dungeontimer", "golemalerts", - "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", - "implosionmessages", "healmessages", "caketimer", "lowhealthnotify", - "lividsolver", "stopsalvagestarred", "threemanpuzzle", "oruopuzzle", "blazepuzzle", - "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "startswithterminal", - "selectallterminal", "itemframeonsealanterns", "ultrasequencer", - "chronomatron", "superpairs", "pickblockinexperiments", "list"); + "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "lividdagger", + "petcolors", "dungeontimer", "golemalerts", "expertiselore", + "skill50display", "outlinetext","sceptremessages", "midasstaffmessages", + "implosionmessages", "healmessages", "manamessages", "cooldownmessages","caketimer", + "lowhealthnotify", "lividsolver", "stopsalvagestarred", "threemanpuzzle", "oruopuzzle", "blazepuzzle", + "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "startswithterminal", + "selectallterminal", "itemframeonsealanterns", "ultrasequencer", + "chronomatron", "superpairs", "pickblockinexperiments", "list"); } return null; } @@ -169,6 +173,16 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "HealMessages", healMessages); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Heal messages have been set to " + DankersSkyblockMod.SECONDARY_COLOUR + healMessages + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "cooldownmessages": + cooldownMessages = !cooldownMessages; + ConfigHandler.writeBooleanConfig("toggles", "CooldownMessages", cooldownMessages); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Ability cooldown messages has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + cooldownMessages + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "manamessages": + manaMessages = !manaMessages; + ConfigHandler.writeBooleanConfig("toggles", "ManaMessages", manaMessages); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Out of mana messages has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + manaMessages + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "petcolors": case "petcolours": petColoursToggled = !petColoursToggled; @@ -300,6 +314,8 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Midas Staff messages: " + DankersSkyblockMod.VALUE_COLOUR + midasStaffMessages + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Implosion messages: " + DankersSkyblockMod.VALUE_COLOUR + implosionMessages + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Heal messages: " + DankersSkyblockMod.VALUE_COLOUR + healMessages + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Ability cooldown messages: " + DankersSkyblockMod.VALUE_COLOUR + cooldownMessages + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Out of mana messages: " + DankersSkyblockMod.VALUE_COLOUR + manaMessages + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Pet colours: " + DankersSkyblockMod.VALUE_COLOUR + petColoursToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Dungeon timer: " + DankersSkyblockMod.VALUE_COLOUR + dungeonTimerToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Golem spawn alerts: " + DankersSkyblockMod.VALUE_COLOUR + golemAlertToggled + "\n" + diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 23bd6c4..2e4b43e 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -177,18 +177,25 @@ public class ConfigHandler { if (!hasKey("toggles", "SpiritBearAlerts")) writeBooleanConfig("toggles", "SpiritBearAlerts", true); if (!hasKey("toggles", "AOTD")) writeBooleanConfig("toggles", "AOTD", false); if (!hasKey("toggles", "LividDagger")) writeBooleanConfig("toggles", "LividDagger", false); - if (!hasKey("toggles", "SceptreMessages")) writeBooleanConfig("toggles", "SceptreMessages", true); if (!hasKey("toggles", "MidasStaffMessages")) writeBooleanConfig("toggles", "MidasStaffMessages", true); if (!hasKey("toggles", "ImplosionMessages")) writeBooleanConfig("toggles", "ImplosionMessages", true); if (!hasKey("toggles", "HealMessages")) writeBooleanConfig("toggles", "HealMessages", true); if (!hasKey("toggles", "PetColors")) writeBooleanConfig("toggles", "PetColors", false); - if (!hasKey("toggles", "DungeonTimer")) writeBooleanConfig("toggles", "DungeonTimer", false); if (!hasKey("toggles", "BlockSlayer")) writeStringConfig("toggles", "BlockSlayer", ""); if (!hasKey("toggles", "GolemAlerts")) writeBooleanConfig("toggles", "GolemAlerts", false); if (!hasKey("toggles", "ExpertiseLore")) writeBooleanConfig("toggles", "ExpertiseLore", true); if (!hasKey("toggles", "Skill50Display")) writeBooleanConfig("toggles", "Skill50Display", false); if (!hasKey("toggles", "OutlineText")) writeBooleanConfig("toggles", "OutlineText", false); if (!hasKey("toggles", "CakeTimer")) writeBooleanConfig("toggles", "CakeTimer", false); + // Chat Messages + if (!hasKey("toggles", "SceptreMessages")) writeBooleanConfig("toggles", "SceptreMessages", true); + if (!hasKey("toggles", "MidasStaffMessages")) writeBooleanConfig("toggles", "MidasStaffMessages", true); + if (!hasKey("toggles", "ImplosionMessages")) writeBooleanConfig("toggles", "ImplosionMessages", true); + if (!hasKey("toggles", "HealMessages")) writeBooleanConfig("toggles", "HealMessages", true); + if (!hasKey("toggles", "CooldownMessages")) writeBooleanConfig("toggles","CooldownMessages",true); + if (!hasKey("toggles", "ManaMessages")) writeBooleanConfig("toggles","ManaMessages",true); + // Dungeons + if (!hasKey("toggles", "DungeonTimer")) writeBooleanConfig("toggles", "DungeonTimer", false); if (!hasKey("toggles", "LowHealthNotify")) writeBooleanConfig("toggles", "LowHealthNotify", false); if (!hasKey("toggles", "LividSolver")) writeBooleanConfig("toggles", "LividSolver", false); if (!hasKey("toggles", "StopSalvageStarred")) writeBooleanConfig("toggles", "StopSalvageStarred", false); @@ -428,17 +435,21 @@ public class ConfigHandler { ToggleCommand.spiritBearAlerts = getBoolean("toggles", "SpiritBearAlerts"); ToggleCommand.aotdToggled = getBoolean("toggles", "AOTD"); ToggleCommand.lividDaggerToggled = getBoolean("toggles", "LividDagger"); - ToggleCommand.sceptreMessages = getBoolean("toggles", "SceptreMessages"); - ToggleCommand.midasStaffMessages = getBoolean("toggles", "MidasStaffMessages"); - ToggleCommand.implosionMessages = getBoolean("toggles", "ImplosionMessages"); - ToggleCommand.healMessages = getBoolean("toggles", "HealMessages"); ToggleCommand.petColoursToggled = getBoolean("toggles", "PetColors"); - ToggleCommand.dungeonTimerToggled = getBoolean("toggles", "DungeonTimer"); ToggleCommand.golemAlertToggled = getBoolean("toggles", "GolemAlerts"); ToggleCommand.expertiseLoreToggled = getBoolean("toggles", "ExpertiseLore"); ToggleCommand.skill50DisplayToggled = getBoolean("toggles", "Skill50Display"); ToggleCommand.outlineTextToggled = getBoolean("toggles", "OutlineText"); ToggleCommand.cakeTimerToggled = getBoolean("toggles", "CakeTimer"); + // Chat Messages + ToggleCommand.sceptreMessages = getBoolean("toggles", "SceptreMessages"); + ToggleCommand.midasStaffMessages = getBoolean("toggles", "MidasStaffMessages"); + ToggleCommand.implosionMessages = getBoolean("toggles", "ImplosionMessages"); + ToggleCommand.healMessages = getBoolean("toggles", "HealMessages"); + ToggleCommand.cooldownMessages = getBoolean("toggles", "CooldownMessages"); + ToggleCommand.manaMessages = getBoolean("toggles", "ManaMessages"); + //Dungeons + ToggleCommand.dungeonTimerToggled = getBoolean("toggles", "DungeonTimer"); ToggleCommand.lowHealthNotifyToggled = getBoolean("toggles", "LowHealthNotify"); ToggleCommand.lividSolverToggled = getBoolean("toggles", "LividSolver"); ToggleCommand.stopSalvageStarredToggled = getBoolean("toggles", "StopSalvageStarred"); -- cgit From c91677bc9c6aeeed2eb52ae2e5477aba1a3be853 Mon Sep 17 00:00:00 2001 From: Kal Draganov Date: Fri, 11 Dec 2020 16:03:57 -0500 Subject: Extend Auto-Swap to Pick Block Extended the auto-swap to pick block feature to F7 terminals and Melody's Harp; consolidated it all into one button. --- src/main/java/me/Danker/DankersSkyblockMod.java | 18 +++++++------ src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- .../java/me/Danker/commands/ToggleCommand.java | 30 +++++++++++----------- src/main/java/me/Danker/gui/DankerGui.java | 12 ++++++--- src/main/java/me/Danker/gui/ExperimentsGui.java | 9 +------ .../java/me/Danker/handlers/ConfigHandler.java | 6 +++-- 6 files changed, 40 insertions(+), 37 deletions(-) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 2362ddb..f8781c3 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -68,6 +68,7 @@ import java.text.NumberFormat; import java.util.List; import java.util.*; import java.util.regex.Pattern; +import java.util.regex.Matcher; @Mod(modid = DankersSkyblockMod.MODID, version = DankersSkyblockMod.VERSION, clientSideOnly = true) public class DankersSkyblockMod @@ -443,8 +444,8 @@ public class DankersSkyblockMod if (message.contains("[BOSS] The Watcher: You have proven yourself. You may pass.")) { watcherClearTime = System.currentTimeMillis() / 1000; } - if (message.contains("[BOSS] The Watcher: That will be enough for now.") && ToggleCommand.watcherReadyToggled && Utils.inDungeons) { - Utils.createTitle(EnumChatFormatting.RED + "WATCHER READY", 2); + if (message.contains("[BOSS] The Watcher: That will be enough for now.")) { + if (ToggleCommand.watcherReadyToggled) Utils.createTitle(EnumChatFormatting.RED + "WATCHER READY", 2); } if (message.contains("PUZZLE FAIL! ") || message.contains("chose the wrong answer! I shall never forget this moment")) { puzzleFails++; @@ -467,7 +468,7 @@ public class DankersSkyblockMod event.setCanceled(true); return; } - + // Implosion if (!ToggleCommand.implosionMessages) { if (message.contains("Your Implosion hit ") || message.contains("There are blocks in the way")) { event.setCanceled(true); @@ -3049,8 +3050,8 @@ public class DankersSkyblockMod GuiChest chest = (GuiChest) event.gui; IInventory inventory = ((ContainerChest) containerChest).getLowerChestInventory(); String inventoryName = inventory.getDisplayName().getUnformattedText(); - if (ToggleCommand.swapToPickBlockInExperimentsToggled) { - if (inventoryName.startsWith("Chronomatron (") || inventoryName.startsWith("Superpairs (") || inventoryName.startsWith("Ultrasequencer (")) { + if (ToggleCommand.swapToPickBlockToggled) { + if (inventoryName.startsWith("Chronomatron (") || inventoryName.startsWith("Superpairs (") || inventoryName.startsWith("Ultrasequencer (") || inventoryName.startsWith("What starts with:") || inventoryName.startsWith("Select all the") || inventoryName.startsWith("Harp -")) { if (!pickBlockBindSwapped) { pickBlockBind = gameSettings.keyBindPickBlock.getKeyCode(); gameSettings.keyBindPickBlock.setKeyCode(-100); @@ -3138,14 +3139,15 @@ public class DankersSkyblockMod } if (ToggleCommand.selectAllToggled && Utils.inDungeons && displayName.startsWith("Select all the")) { - String colour = displayName.split(" ")[3]; + String colour = displayName.split(" ")[3]; + for (Slot slot : invSlots) { ItemStack item = slot.getStack(); if (item == null) continue; if (item.getDisplayName().toUpperCase().contains(colour)) { Utils.drawOnSlot(chestSize, slot.xDisplayPosition, slot.yDisplayPosition, 0xBF40FF40); - } - } + } + } } if (ToggleCommand.ultrasequencerToggled && displayName.startsWith("Ultrasequencer (")) { diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 9d435fb..395f40d 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/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 7e9b2ea..172411c 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -38,6 +38,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean lividSolverToggled; public static boolean stopSalvageStarredToggled; public static boolean watcherReadyToggled; + public static boolean swapToPickBlockToggled; // Puzzle Solvers public static boolean threeManToggled; public static boolean oruoToggled; @@ -53,7 +54,6 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean ultrasequencerToggled; public static boolean chronomatronToggled; public static boolean superpairsToggled; - public static boolean swapToPickBlockInExperimentsToggled; public static boolean hideTooltipsInExperimentAddonsToggled; @Override @@ -67,7 +67,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "aotd/lividdagger/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/" + "outlinetext/midasstaffmessages/implosionmessages/healmessages/caketimer/lowhealthnotify/" + "lividsolver/stopsalvagestarred/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/waterpuzzle/tictactoepuzzle/" + - "startswithterminal/selectallterminal/itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/pickblockinexperiments/hidetooltipsinaddons/watchermessage/list>"; + "watchermessage/startswithterminal/selectallterminal/itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>"; } @Override @@ -84,9 +84,9 @@ public class ToggleCommand extends CommandBase implements ICommand { "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", "implosionmessages", "healmessages", "caketimer", "lowhealthnotify", "lividsolver", "stopsalvagestarred", "threemanpuzzle", "oruopuzzle", "blazepuzzle", - "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "startswithterminal", + "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "watchermessage", "startswithterminal", "selectallterminal", "itemframeonsealanterns", "ultrasequencer", - "chronomatron", "superpairs", "pickblockinexperiments", "hidetooltipsinaddons", "watchermessage", "list"); + "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "list"); } return null; } @@ -252,6 +252,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "TicTacToePuzzle", ticTacToeToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Tic tac toe puzzle solver has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + ticTacToeToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "watchermessage": + watcherReadyToggled = !watcherReadyToggled; + ConfigHandler.writeBooleanConfig("toggles", "WatcherReadyMessage", watcherReadyToggled); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Display Watcher ready message has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + watcherReadyToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "startswithterminal": startsWithToggled = !startsWithToggled; ConfigHandler.writeBooleanConfig("toggles", "StartsWithTerminal", startsWithToggled); @@ -282,20 +287,15 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "Superpairs", superpairsToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Superpairs solver has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + superpairsToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; - case "pickblockinexperiments": - swapToPickBlockInExperimentsToggled = !swapToPickBlockInExperimentsToggled; - ConfigHandler.writeBooleanConfig("toggles", "PickBlockInExperiments", swapToPickBlockInExperimentsToggled); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Auto-swap to pick block in experiments has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + swapToPickBlockInExperimentsToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); - break; case "hidetooltipsinaddons": hideTooltipsInExperimentAddonsToggled = !hideTooltipsInExperimentAddonsToggled; ConfigHandler.writeBooleanConfig("toggles", "HideTooltipsInExperimentAddons", hideTooltipsInExperimentAddonsToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Hide tooltips in ultrasequencer and chronomatron has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + hideTooltipsInExperimentAddonsToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; - case "watchermessage": - watcherReadyToggled = !watcherReadyToggled; - ConfigHandler.writeBooleanConfig("toggles", "WatcherReadyMessage", watcherReadyToggled); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Display Watcher ready message has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + watcherReadyToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); + case "pickblock": + swapToPickBlockToggled = !swapToPickBlockToggled; + 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 "list": player.addChatMessage(new ChatComponentText(DankersSkyblockMod.TYPE_COLOUR + "Guild party notifications: " + DankersSkyblockMod.VALUE_COLOUR + gpartyToggled + "\n" + @@ -327,15 +327,15 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Creeper puzzle solver: " + DankersSkyblockMod.VALUE_COLOUR + creeperToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Water puzzle solver: " + DankersSkyblockMod.VALUE_COLOUR + waterToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Tic tac toe puzzle solver: " + DankersSkyblockMod.VALUE_COLOUR + ticTacToeToggled + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " 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 + " Auto-swap to pick block in experiments: " + DankersSkyblockMod.VALUE_COLOUR + swapToPickBlockInExperimentsToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Hide tooltips in experiment addons: " + DankersSkyblockMod.VALUE_COLOUR + hideTooltipsInExperimentAddonsToggled + "\n" + - DankersSkyblockMod.TYPE_COLOUR + " Watcher ready message: " + DankersSkyblockMod.VALUE_COLOUR + watcherReadyToggled + DankersSkyblockMod.TYPE_COLOUR + " Auto-swap to pick block " + DankersSkyblockMod.VALUE_COLOUR + swapToPickBlockToggled )); break; default: diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index c676d5c..613e968 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -55,6 +55,7 @@ public class DankerGui extends GuiScreen { private GuiButton lividSolver; private GuiButton stopSalvageStarred; private GuiButton watcherReadyMessage; + private GuiButton pickBlock; public DankerGui(int page) { this.page = page; @@ -87,7 +88,7 @@ public class DankerGui extends GuiScreen { experimentationTableSolvers = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Toggle Experimentation Table Solvers"); skillTracker = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Toggle Skill XP/Hour Tracking"); outlineText = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Outline Displayed Text: " + Utils.getColouredBoolean(ToggleCommand.outlineTextToggled)); - splitFishing = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing)); + pickBlock = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Auto-Swap to Pick Block: " + Utils.getColouredBoolean(ToggleCommand.swapToPickBlockToggled)); // Page 2 coords = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Coordinate/Angle Display: " + Utils.getColouredBoolean(ToggleCommand.coordsToggled)); dungeonTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Display Dungeon Timers: " + Utils.getColouredBoolean(ToggleCommand.dungeonTimerToggled)); @@ -115,7 +116,7 @@ public class DankerGui extends GuiScreen { // Page 5 stopSalvageStarred = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Stop Salvaging Starred Items: " + Utils.getColouredBoolean(ToggleCommand.stopSalvageStarredToggled)); watcherReadyMessage = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Display Watcher Ready Message: " + Utils.getColouredBoolean(ToggleCommand.watcherReadyToggled)); - + splitFishing = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing)); switch (page) { case 1: this.buttonList.add(changeDisplay); @@ -124,7 +125,7 @@ public class DankerGui extends GuiScreen { this.buttonList.add(experimentationTableSolvers); this.buttonList.add(skillTracker); this.buttonList.add(outlineText); - this.buttonList.add(splitFishing); + this.buttonList.add(pickBlock); this.buttonList.add(nextPage); break; case 2: @@ -163,6 +164,7 @@ public class DankerGui extends GuiScreen { case 5: this.buttonList.add(stopSalvageStarred); this.buttonList.add(watcherReadyMessage); + this.buttonList.add(splitFishing); this.buttonList.add(backPage); break; } @@ -311,6 +313,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.watcherReadyToggled = !ToggleCommand.watcherReadyToggled; ConfigHandler.writeBooleanConfig("toggles", "WatcherReadyMessage", ToggleCommand.watcherReadyToggled); watcherReadyMessage.displayString = "Display Watcher Ready Message: " + Utils.getColouredBoolean(ToggleCommand.watcherReadyToggled); + } else if (button == pickBlock) { + ToggleCommand.swapToPickBlockToggled = !ToggleCommand.swapToPickBlockToggled; + ConfigHandler.writeBooleanConfig("toggles", "PickBlock", ToggleCommand.swapToPickBlockToggled); + pickBlock.displayString = "Auto-Swap to Pick Block: " + Utils.getColouredBoolean(ToggleCommand.swapToPickBlockToggled); } } diff --git a/src/main/java/me/Danker/gui/ExperimentsGui.java b/src/main/java/me/Danker/gui/ExperimentsGui.java index a363c5d..c3f4f47 100644 --- a/src/main/java/me/Danker/gui/ExperimentsGui.java +++ b/src/main/java/me/Danker/gui/ExperimentsGui.java @@ -15,7 +15,6 @@ public class ExperimentsGui extends GuiScreen { private GuiButton ultrasequencer; private GuiButton chronomatron; private GuiButton superpairs; - private GuiButton pickBlock; private GuiButton hideTooltips; @Override @@ -35,14 +34,12 @@ public class ExperimentsGui extends GuiScreen { ultrasequencer = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Ultrasequencer Solver: " + Utils.getColouredBoolean(ToggleCommand.ultrasequencerToggled)); chronomatron = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Chronomatron Solver: " + Utils.getColouredBoolean(ToggleCommand.chronomatronToggled)); superpairs = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Superpairs Solver: " + Utils.getColouredBoolean(ToggleCommand.superpairsToggled)); - pickBlock = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Auto-Swap to Pick Block: " + Utils.getColouredBoolean(ToggleCommand.swapToPickBlockInExperimentsToggled)); - hideTooltips = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Hide Tooltips in Addons: " + Utils.getColouredBoolean(ToggleCommand.hideTooltipsInExperimentAddonsToggled)); + hideTooltips = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Hide Tooltips in Addons: " + Utils.getColouredBoolean(ToggleCommand.hideTooltipsInExperimentAddonsToggled)); this.buttonList.add(goBack); this.buttonList.add(ultrasequencer); this.buttonList.add(chronomatron); this.buttonList.add(superpairs); - this.buttonList.add(pickBlock); this.buttonList.add(hideTooltips); } @@ -68,10 +65,6 @@ public class ExperimentsGui extends GuiScreen { ToggleCommand.superpairsToggled = !ToggleCommand.superpairsToggled; ConfigHandler.writeBooleanConfig("toggles", "Superpairs", ToggleCommand.superpairsToggled); superpairs.displayString = "Superpairs Solver: " + Utils.getColouredBoolean(ToggleCommand.superpairsToggled); - } else if (button == pickBlock) { - ToggleCommand.swapToPickBlockInExperimentsToggled = !ToggleCommand.swapToPickBlockInExperimentsToggled; - ConfigHandler.writeBooleanConfig("toggles", "PickBlockInExperiments", ToggleCommand.swapToPickBlockInExperimentsToggled); - pickBlock.displayString = "Auto-Swap to Pick Block: " + Utils.getColouredBoolean(ToggleCommand.swapToPickBlockInExperimentsToggled); } else if (button == hideTooltips) { ToggleCommand.hideTooltipsInExperimentAddonsToggled = !ToggleCommand.hideTooltipsInExperimentAddonsToggled; ConfigHandler.writeBooleanConfig("toggles", "HideTooltipsInExperimentAddons", ToggleCommand.hideTooltipsInExperimentAddonsToggled); diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 38c7d12..e8322ea 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -193,6 +193,7 @@ public class ConfigHandler { if (!hasKey("toggles", "LividSolver")) writeBooleanConfig("toggles", "LividSolver", false); if (!hasKey("toggles", "StopSalvageStarred")) writeBooleanConfig("toggles", "StopSalvageStarred", false); if (!hasKey("toggles", "WatcherReadyMessage")) writeBooleanConfig("toggles", "WatcherReadyMessage", false); + if (!hasKey("toggles", "PickBlock")) writeBooleanConfig("toggles", "PickBlock", false); // Puzzle Solvers if (!hasKey("toggles", "ThreeManPuzzle")) writeBooleanConfig("toggles", "ThreeManPuzzle", false); if (!hasKey("toggles", "OruoPuzzle")) writeBooleanConfig("toggles", "OruoPuzzle", false); @@ -203,10 +204,10 @@ public class ConfigHandler { if (!hasKey("toggles", "StartsWithTerminal")) writeBooleanConfig("toggles", "StartsWithTerminal", false); if (!hasKey("toggles", "SelectAllTerminal")) writeBooleanConfig("toggles", "SelectAllTerminal", false); if (!hasKey("toggles", "IgnoreItemFrameOnSeaLanterns")) writeBooleanConfig("toggles", "IgnoreItemFrameOnSeaLanterns", false); + // Experiment Solvers if (!hasKey("toggles", "UltraSequencer")) writeBooleanConfig("toggles", "UltraSequencer", false); if (!hasKey("toggles", "Chronomatron")) writeBooleanConfig("toggles", "Chronomatron", false); if (!hasKey("toggles", "Superpairs")) writeBooleanConfig("toggles", "Superpairs", false); - if (!hasKey("toggles", "PickBlockInExperiments")) writeBooleanConfig("toggles", "PickBlockInExperiments", false); if (!hasKey("toggles", "HideTooltipsInExperimentAddons")) writeBooleanConfig("toggles", "HideTooltipsInExperimentAddons", false); @@ -445,6 +446,7 @@ public class ConfigHandler { ToggleCommand.lividSolverToggled = getBoolean("toggles", "LividSolver"); ToggleCommand.stopSalvageStarredToggled = getBoolean("toggles", "StopSalvageStarred"); ToggleCommand.watcherReadyToggled = getBoolean("toggles", "WatcherReadyMessage"); + ToggleCommand.swapToPickBlockToggled = getBoolean("toggles", "PickBlock"); // Puzzle Solvers ToggleCommand.threeManToggled = getBoolean("toggles", "ThreeManPuzzle"); ToggleCommand.oruoToggled = getBoolean("toggles", "OruoPuzzle"); @@ -455,10 +457,10 @@ public class ConfigHandler { ToggleCommand.startsWithToggled = getBoolean("toggles", "StartsWithTerminal"); ToggleCommand.selectAllToggled = getBoolean("toggles", "SelectAllTerminal"); ToggleCommand.itemFrameOnSeaLanternsToggled = getBoolean("toggles", "IgnoreItemFrameOnSeaLanterns"); + // Experiment Solvers ToggleCommand.ultrasequencerToggled = getBoolean("toggles", "UltraSequencer"); ToggleCommand.chronomatronToggled = getBoolean("toggles", "Chronomatron"); ToggleCommand.superpairsToggled = getBoolean("toggles", "Superpairs"); - ToggleCommand.swapToPickBlockInExperimentsToggled = getBoolean("toggles", "PickBlockInExperiments"); ToggleCommand.hideTooltipsInExperimentAddonsToggled = getBoolean("toggles", "HideTooltipsInExperimentAddons"); String onlySlayer = getString("toggles", "BlockSlayer"); -- cgit From 1b49ec8892a8a158c2dea99d705ae39ff7dd0a8d Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Sat, 12 Dec 2020 18:18:21 -0500 Subject: Block Wrong Terminal Clicks + Fixes Blocks wrong terminal clicks Fixes bug where bind isn't swapped back after terminal --- src/main/java/me/Danker/DankersSkyblockMod.java | 98 +++++++++++++++++++++- .../java/me/Danker/commands/ToggleCommand.java | 10 ++- src/main/java/me/Danker/gui/PuzzleSolversGui.java | 9 +- .../java/me/Danker/handlers/ConfigHandler.java | 2 + 4 files changed, 115 insertions(+), 4 deletions(-) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 64a1f5b..98a97af 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -7,6 +7,7 @@ import me.Danker.handlers.*; import me.Danker.utils.TicTacToeUtils; import me.Danker.utils.Utils; import net.minecraft.block.Block; +import net.minecraft.block.BlockColored; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.Gui; @@ -3033,6 +3034,96 @@ public class DankersSkyblockMod } } + if (ToggleCommand.blockWrongTerminalClicksToggled && Utils.inDungeons) { + 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 = mouseSlot.getSlotIndex(); + + if(slotIndex % 9 != 0 && slotIndex != 53) { + ItemStack itemStack = inventory.getStackInSlot(slotIndex + 1); + if(itemStack.getItemDamage() == 5) isValid = true; + } + + if(!isValid && slotIndex % 9 != 8 && slotIndex != 0) { + ItemStack itemStack = inventory.getStackInSlot(slotIndex - 1); + if(itemStack.getItemDamage() == 5) isValid = true; + } + + if(!isValid && slotIndex <= 44) { + ItemStack itemStack = inventory.getStackInSlot(slotIndex + 9); + if(itemStack.getItemDamage() == 5) isValid = true; + } + + if(!isValid && slotIndex >= 9) { + ItemStack itemStack = inventory.getStackInSlot(slotIndex - 9); + if(itemStack.getItemDamage() == 5) isValid = true; + } + + shouldCancel = !isValid; + + break; + case "Click in order!": + if((item.getItem() != Item.getItemFromBlock(Blocks.stained_glass_pane))) { + shouldCancel = true; + break; + } + if(item.getItemDamage() != 14) { + shouldCancel = true; + break; + } + int needed = 0; + for(int i = 10; i <= 25; i++) { + if(i == 17 || i == 18) continue; + ItemStack itemStack = inventory.getStackInSlot(i); + if(!itemStack.getDisplayName().contains(EnumChatFormatting.GREEN.toString())) continue; + if(itemStack.stackSize > needed) needed = itemStack.stackSize; + } + shouldCancel = 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")) { + String colour; + List colourParts = new ArrayList<>(); + Matcher colourMatcher = startsWithTerminalPattern.matcher(inventoryName); + while (colourMatcher.find()) { + colourParts.add(colourMatcher.group()); + } + colour = String.join(" ", colourParts); + + String itemName = StringUtils.stripControlCodes(item.getDisplayName()).toUpperCase(); + shouldCancel = !(itemName.contains(colour) || (colour.equals("SILVER") && itemName.contains("LIGHT GRAY")) || (colour.equals("WHITE") && itemName.equals("WOOL"))); + } + } + + event.setCanceled(shouldCancel && !Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && !Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)); + } + if (!BlockSlayerCommand.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; @@ -3078,7 +3169,7 @@ public class DankersSkyblockMod IInventory inventory = ((ContainerChest) containerChest).getLowerChestInventory(); String inventoryName = inventory.getDisplayName().getUnformattedText(); if (ToggleCommand.swapToPickBlockToggled) { - if (inventoryName.startsWith("Chronomatron (") || inventoryName.startsWith("Superpairs (") || inventoryName.startsWith("Ultrasequencer (") || inventoryName.startsWith("What starts with:") || inventoryName.startsWith("Select all the") || inventoryName.startsWith("Harp -")) { + if (inventoryName.startsWith("Chronomatron (") || inventoryName.startsWith("Superpairs (") || inventoryName.startsWith("Ultrasequencer (") || inventoryName.startsWith("What starts with:") || inventoryName.startsWith("Select all the") || inventoryName.startsWith("Navigate the maze!") || inventoryName.startsWith("Correct all the panes!") || inventoryName.startsWith("Click in order!") || inventoryName.startsWith("Harp -")) { if (!pickBlockBindSwapped) { pickBlockBind = gameSettings.keyBindPickBlock.getKeyCode(); gameSettings.keyBindPickBlock.setKeyCode(-100); @@ -3092,6 +3183,11 @@ public class DankersSkyblockMod } } } + } else { + if (pickBlockBindSwapped) { + gameSettings.keyBindPickBlock.setKeyCode(pickBlockBind); + pickBlockBindSwapped = false; + } } clickInOrderSlots = new Slot[36]; lastChronomatronRound = 0; diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 172411c..7612a4d 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -49,6 +49,7 @@ public class ToggleCommand extends CommandBase implements ICommand { // Terminal Helpers public static boolean startsWithToggled; public static boolean selectAllToggled; + public static boolean blockWrongTerminalClicksToggled; public static boolean itemFrameOnSeaLanternsToggled; // Experiments public static boolean ultrasequencerToggled; @@ -67,7 +68,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "aotd/lividdagger/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/" + "outlinetext/midasstaffmessages/implosionmessages/healmessages/caketimer/lowhealthnotify/" + "lividsolver/stopsalvagestarred/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/waterpuzzle/tictactoepuzzle/" + - "watchermessage/startswithterminal/selectallterminal/itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>"; + "watchermessage/startswithterminal/selectallterminal/blockterminalclicks/itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>"; } @Override @@ -85,7 +86,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "implosionmessages", "healmessages", "caketimer", "lowhealthnotify", "lividsolver", "stopsalvagestarred", "threemanpuzzle", "oruopuzzle", "blazepuzzle", "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "watchermessage", "startswithterminal", - "selectallterminal", "itemframeonsealanterns", "ultrasequencer", + "selectallterminal", "blockterminalclicks", "itemframeonsealanterns", "ultrasequencer", "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "list"); } return null; @@ -267,6 +268,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "SelectAllTerminal", selectAllToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Select all color items terminal solver has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + selectAllToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "blockterminalclicks": + blockWrongTerminalClicksToggled = !blockWrongTerminalClicksToggled; + ConfigHandler.writeBooleanConfig("toggles", "BlockTerminalClicks", 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); diff --git a/src/main/java/me/Danker/gui/PuzzleSolversGui.java b/src/main/java/me/Danker/gui/PuzzleSolversGui.java index 8701563..1e0da7f 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 startsWith; private GuiButton selectAll; + private GuiButton blockClicks; private GuiButton itemFrameOnSeaLanterns; public PuzzleSolversGui(int page) { @@ -57,7 +58,8 @@ public class PuzzleSolversGui extends GuiScreen { startsWith = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Starts With Letter Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.startsWithToggled)); // Page 2 selectAll = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Select All Color Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.selectAllToggled)); - itemFrameOnSeaLanterns = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Ignore Arrows On Sea Lanterns: " + Utils.getColouredBoolean(ToggleCommand.itemFrameOnSeaLanternsToggled)); + blockClicks = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Block Wrong Clicks on Terminals: " + Utils.getColouredBoolean(ToggleCommand.blockWrongTerminalClicksToggled)); + itemFrameOnSeaLanterns = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Ignore Arrows On Sea Lanterns: " + Utils.getColouredBoolean(ToggleCommand.itemFrameOnSeaLanternsToggled)); switch (page) { case 1: @@ -72,6 +74,7 @@ public class PuzzleSolversGui extends GuiScreen { break; case 2: this.buttonList.add(selectAll); + this.buttonList.add(blockClicks); this.buttonList.add(itemFrameOnSeaLanterns); this.buttonList.add(backPage); break; @@ -125,6 +128,10 @@ public class PuzzleSolversGui extends GuiScreen { ToggleCommand.selectAllToggled = !ToggleCommand.selectAllToggled; ConfigHandler.writeBooleanConfig("toggles", "SelectAllTerminal", ToggleCommand.selectAllToggled); selectAll.displayString = "Select All Color Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.selectAllToggled); + } else if (button == blockClicks) { + ToggleCommand.blockWrongTerminalClicksToggled = !ToggleCommand.blockWrongTerminalClicksToggled; + ConfigHandler.writeBooleanConfig("toggles", "BlockTerminalClicks", 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); diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index a0e446f..a447632 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -203,6 +203,7 @@ public class ConfigHandler { if (!hasKey("toggles", "TicTacToePuzzle")) writeBooleanConfig("toggles", "TicTacToePuzzle", false); if (!hasKey("toggles", "StartsWithTerminal")) writeBooleanConfig("toggles", "StartsWithTerminal", false); if (!hasKey("toggles", "SelectAllTerminal")) writeBooleanConfig("toggles", "SelectAllTerminal", false); + if (!hasKey("toggles", "BlockTerminalClicks")) writeBooleanConfig("toggles", "BlockTerminalClicks", false); if (!hasKey("toggles", "IgnoreItemFrameOnSeaLanterns")) writeBooleanConfig("toggles", "IgnoreItemFrameOnSeaLanterns", false); // Experiment Solvers if (!hasKey("toggles", "UltraSequencer")) writeBooleanConfig("toggles", "UltraSequencer", false); @@ -467,6 +468,7 @@ public class ConfigHandler { ToggleCommand.ticTacToeToggled = getBoolean("toggles", "TicTacToePuzzle"); ToggleCommand.startsWithToggled = getBoolean("toggles", "StartsWithTerminal"); ToggleCommand.selectAllToggled = getBoolean("toggles", "SelectAllTerminal"); + ToggleCommand.blockWrongTerminalClicksToggled = getBoolean("toggles", "BlockTerminalClicks"); ToggleCommand.itemFrameOnSeaLanternsToggled = getBoolean("toggles", "IgnoreItemFrameOnSeaLanterns"); // Experiment Solvers ToggleCommand.ultrasequencerToggled = getBoolean("toggles", "UltraSequencer"); -- cgit From d2b60152ae3a0a4e63732e231e49373f29cce1f9 Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Sat, 12 Dec 2020 18:41:06 -0500 Subject: Update Wording --- src/main/java/me/Danker/commands/ToggleCommand.java | 8 ++++---- src/main/java/me/Danker/gui/PuzzleSolversGui.java | 2 +- src/main/java/me/Danker/handlers/ConfigHandler.java | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 7612a4d..e4a7f02 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -68,7 +68,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "aotd/lividdagger/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/" + "outlinetext/midasstaffmessages/implosionmessages/healmessages/caketimer/lowhealthnotify/" + "lividsolver/stopsalvagestarred/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/waterpuzzle/tictactoepuzzle/" + - "watchermessage/startswithterminal/selectallterminal/blockterminalclicks/itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>"; + "watchermessage/startswithterminal/selectallterminal/blockwrongterminalclicks/itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>"; } @Override @@ -86,7 +86,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "implosionmessages", "healmessages", "caketimer", "lowhealthnotify", "lividsolver", "stopsalvagestarred", "threemanpuzzle", "oruopuzzle", "blazepuzzle", "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "watchermessage", "startswithterminal", - "selectallterminal", "blockterminalclicks", "itemframeonsealanterns", "ultrasequencer", + "selectallterminal", "blockwrongterminalclicks", "itemframeonsealanterns", "ultrasequencer", "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "list"); } return null; @@ -268,9 +268,9 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "SelectAllTerminal", selectAllToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Select all color items terminal solver has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + selectAllToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; - case "blockterminalclicks": + case "blockwrongterminalclicks": blockWrongTerminalClicksToggled = !blockWrongTerminalClicksToggled; - ConfigHandler.writeBooleanConfig("toggles", "BlockTerminalClicks", 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": diff --git a/src/main/java/me/Danker/gui/PuzzleSolversGui.java b/src/main/java/me/Danker/gui/PuzzleSolversGui.java index 1e0da7f..0e9da2f 100644 --- a/src/main/java/me/Danker/gui/PuzzleSolversGui.java +++ b/src/main/java/me/Danker/gui/PuzzleSolversGui.java @@ -130,7 +130,7 @@ public class PuzzleSolversGui extends GuiScreen { selectAll.displayString = "Select All Color Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.selectAllToggled); } else if (button == blockClicks) { ToggleCommand.blockWrongTerminalClicksToggled = !ToggleCommand.blockWrongTerminalClicksToggled; - ConfigHandler.writeBooleanConfig("toggles", "BlockTerminalClicks", 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; diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index a447632..93da3e8 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -203,7 +203,7 @@ public class ConfigHandler { if (!hasKey("toggles", "TicTacToePuzzle")) writeBooleanConfig("toggles", "TicTacToePuzzle", false); if (!hasKey("toggles", "StartsWithTerminal")) writeBooleanConfig("toggles", "StartsWithTerminal", false); if (!hasKey("toggles", "SelectAllTerminal")) writeBooleanConfig("toggles", "SelectAllTerminal", false); - if (!hasKey("toggles", "BlockTerminalClicks")) writeBooleanConfig("toggles", "BlockTerminalClicks", false); + if (!hasKey("toggles", "BlockWrongTerminalClicks")) writeBooleanConfig("toggles", "BlockWrongTerminalClicks", false); if (!hasKey("toggles", "IgnoreItemFrameOnSeaLanterns")) writeBooleanConfig("toggles", "IgnoreItemFrameOnSeaLanterns", false); // Experiment Solvers if (!hasKey("toggles", "UltraSequencer")) writeBooleanConfig("toggles", "UltraSequencer", false); @@ -468,7 +468,7 @@ public class ConfigHandler { ToggleCommand.ticTacToeToggled = getBoolean("toggles", "TicTacToePuzzle"); ToggleCommand.startsWithToggled = getBoolean("toggles", "StartsWithTerminal"); ToggleCommand.selectAllToggled = getBoolean("toggles", "SelectAllTerminal"); - ToggleCommand.blockWrongTerminalClicksToggled = getBoolean("toggles", "BlockTerminalClicks"); + ToggleCommand.blockWrongTerminalClicksToggled = getBoolean("toggles", "BlockWrongTerminalClicks"); ToggleCommand.itemFrameOnSeaLanternsToggled = getBoolean("toggles", "IgnoreItemFrameOnSeaLanterns"); // Experiment Solvers ToggleCommand.ultrasequencerToggled = getBoolean("toggles", "UltraSequencer"); -- cgit From 831ca8ac1c4cc2a1303e981dc8c8b54107b3a3d0 Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Sun, 13 Dec 2020 15:11:47 -0500 Subject: Add highlighter for click in order terminal --- src/main/java/me/Danker/DankersSkyblockMod.java | 45 +++++++++++++--------- .../java/me/Danker/commands/ToggleCommand.java | 12 ++++-- src/main/java/me/Danker/gui/PuzzleSolversGui.java | 11 +++++- .../java/me/Danker/handlers/ConfigHandler.java | 3 ++ 4 files changed, 47 insertions(+), 24 deletions(-) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 409b4d5..6355835 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -7,7 +7,6 @@ import me.Danker.handlers.*; import me.Danker.utils.TicTacToeUtils; import me.Danker.utils.Utils; import net.minecraft.block.Block; -import net.minecraft.block.BlockColored; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.Gui; @@ -127,6 +126,8 @@ public class DankersSkyblockMod static ItemStack[] experimentTableSlots = new ItemStack[54]; static int pickBlockBind; static boolean pickBlockBindSwapped = false; + static String terminalColorNeeded; + static int[] terminalNumberNeeded = new int[2]; static double dungeonStartTime = 0; static double bloodOpenTime = 0; @@ -3092,15 +3093,8 @@ public class DankersSkyblockMod shouldCancel = true; break; } - int needed = -1; - for(int i = 10; i <= 25; i++) { - if (i == 17 || i == 18) continue; - ItemStack itemStack = inventory.getStackInSlot(i); - if (itemStack == null) continue; - if (itemStack.getItem() != Item.getItemFromBlock(Blocks.stained_glass_pane)) continue; - if (itemStack.getItemDamage() != 14) continue; - if (itemStack.stackSize > needed) needed = itemStack.stackSize; - } + int needed = terminalNumberNeeded[1]; + if(needed == 0) break; shouldCancel = needed != -1 && item.stackSize != needed ; break; } @@ -3110,16 +3104,9 @@ public class DankersSkyblockMod char letter = inventoryName.charAt(inventoryName.indexOf("'") + 1); shouldCancel = !(StringUtils.stripControlCodes(item.getDisplayName()).charAt(0) == letter); } else if (inventoryName.startsWith("Select all the")) { - String colour; - List colourParts = new ArrayList<>(); - Matcher colourMatcher = startsWithTerminalPattern.matcher(inventoryName); - while (colourMatcher.find()) { - colourParts.add(colourMatcher.group()); - } - colour = String.join(" ", colourParts); - + if(terminalColorNeeded == null) return; String itemName = StringUtils.stripControlCodes(item.getDisplayName()).toUpperCase(); - shouldCancel = !(itemName.contains(colour) || (colour.equals("SILVER") && itemName.contains("LIGHT GRAY")) || (colour.equals("WHITE") && itemName.equals("WOOL"))); + shouldCancel = !(itemName.contains(terminalColorNeeded) || (terminalColorNeeded.equals("SILVER") && itemName.contains("LIGHT GRAY")) || (terminalColorNeeded.equals("WHITE") && itemName.equals("WOOL"))); } } @@ -3196,6 +3183,8 @@ public class DankersSkyblockMod chronomatronPattern.clear(); chronomatronMouseClicks = 0; experimentTableSlots = new ItemStack[54]; + terminalColorNeeded = null; + terminalNumberNeeded = new int[2]; } @SubscribeEvent @@ -3270,6 +3259,7 @@ public class DankersSkyblockMod colourParts.add(colourMatcher.group()); } colour = String.join(" ", colourParts); + terminalColorNeeded = colour; for (Slot slot : invSlots) { ItemStack item = slot.getStack(); @@ -3281,6 +3271,23 @@ public class DankersSkyblockMod } } + if(ToggleCommand.clickInOrderToggled && displayName.equals("Click in order!")) { + for(int i = 10; i <= 25; i++) { + if (i == 17 || i == 18) continue; + ItemStack itemStack = invSlots.get(i).getStack(); + if (itemStack == null) continue; + if (itemStack.getItem() != Item.getItemFromBlock(Blocks.stained_glass_pane)) continue; + if (itemStack.getItemDamage() != 14) continue; + if (itemStack.stackSize > terminalNumberNeeded[0]) { + terminalNumberNeeded[0] = itemStack.stackSize; + terminalNumberNeeded[1] = i; + } + } + if(terminalNumberNeeded[0] == 0) return; + Slot slot = invSlots.get(terminalNumberNeeded[0]); + Utils.drawOnSlot(chestSize, slot.xDisplayPosition, slot.yDisplayPosition, 0xBF40FF40); + } + if (ToggleCommand.ultrasequencerToggled && displayName.startsWith("Ultrasequencer (")) { if (invSlots.size() > 48 && invSlots.get(49).getStack() != null) { if (invSlots.get(49).getStack().getDisplayName().startsWith("§7Timer: §a")) { diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index e4a7f02..8cad486 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -49,7 +49,8 @@ public class ToggleCommand extends CommandBase implements ICommand { // Terminal Helpers public static boolean startsWithToggled; public static boolean selectAllToggled; - public static boolean blockWrongTerminalClicksToggled; + public static boolean clickInOrderToggled; + public static boolean blockWrongTerminalClicksToggled; public static boolean itemFrameOnSeaLanternsToggled; // Experiments public static boolean ultrasequencerToggled; @@ -68,7 +69,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "aotd/lividdagger/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/" + "outlinetext/midasstaffmessages/implosionmessages/healmessages/caketimer/lowhealthnotify/" + "lividsolver/stopsalvagestarred/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/waterpuzzle/tictactoepuzzle/" + - "watchermessage/startswithterminal/selectallterminal/blockwrongterminalclicks/itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>"; + "watchermessage/startswithterminal/selectallterminal/clickinorderterminal/blockwrongterminalclicks/itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>"; } @Override @@ -86,7 +87,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "implosionmessages", "healmessages", "caketimer", "lowhealthnotify", "lividsolver", "stopsalvagestarred", "threemanpuzzle", "oruopuzzle", "blazepuzzle", "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "watchermessage", "startswithterminal", - "selectallterminal", "blockwrongterminalclicks", "itemframeonsealanterns", "ultrasequencer", + "selectallterminal", "clickinorderterminal", "blockwrongterminalclicks", "itemframeonsealanterns", "ultrasequencer", "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "list"); } return null; @@ -268,6 +269,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "SelectAllTerminal", selectAllToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Select all color items terminal solver has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + selectAllToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "clickinorderterminal": + clickInOrderToggled = !clickInOrderToggled; + ConfigHandler.writeBooleanConfig("toggles", "ClickInOrderTerminal", clickInOrderToggled); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Click in order terminal solver has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + selectAllToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "blockwrongterminalclicks": blockWrongTerminalClicksToggled = !blockWrongTerminalClicksToggled; ConfigHandler.writeBooleanConfig("toggles", "BlockWrongTerminalClicks", blockWrongTerminalClicksToggled); diff --git a/src/main/java/me/Danker/gui/PuzzleSolversGui.java b/src/main/java/me/Danker/gui/PuzzleSolversGui.java index 0e9da2f..b7b24a3 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 startsWith; private GuiButton selectAll; + private GuiButton clickOrder; private GuiButton blockClicks; private GuiButton itemFrameOnSeaLanterns; @@ -58,8 +59,9 @@ public class PuzzleSolversGui extends GuiScreen { startsWith = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Starts With Letter Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.startsWithToggled)); // Page 2 selectAll = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Select All Color Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.selectAllToggled)); - blockClicks = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Block Wrong Clicks on Terminals: " + Utils.getColouredBoolean(ToggleCommand.blockWrongTerminalClicksToggled)); - itemFrameOnSeaLanterns = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Ignore Arrows On Sea Lanterns: " + Utils.getColouredBoolean(ToggleCommand.itemFrameOnSeaLanternsToggled)); + clickOrder = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Click in Order Terminal Solver: " + 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)); switch (page) { case 1: @@ -74,6 +76,7 @@ public class PuzzleSolversGui extends GuiScreen { break; case 2: this.buttonList.add(selectAll); + this.buttonList.add(clickOrder); this.buttonList.add(blockClicks); this.buttonList.add(itemFrameOnSeaLanterns); this.buttonList.add(backPage); @@ -128,6 +131,10 @@ public class PuzzleSolversGui extends GuiScreen { ToggleCommand.selectAllToggled = !ToggleCommand.selectAllToggled; ConfigHandler.writeBooleanConfig("toggles", "SelectAllTerminal", ToggleCommand.selectAllToggled); selectAll.displayString = "Select All Color Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.selectAllToggled); + } else if (button == clickOrder) { + ToggleCommand.clickInOrderToggled = !ToggleCommand.clickInOrderToggled; + ConfigHandler.writeBooleanConfig("toggles", "ClickInOrderTerminal", ToggleCommand.clickInOrderToggled); + clickOrder.displayString = "Click in Order Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.clickInOrderToggled); } else if (button == blockClicks) { ToggleCommand.blockWrongTerminalClicksToggled = !ToggleCommand.blockWrongTerminalClicksToggled; ConfigHandler.writeBooleanConfig("toggles", "BlockWrongTerminalClicks", ToggleCommand.blockWrongTerminalClicksToggled); diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 93da3e8..1955ba4 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -203,6 +203,7 @@ public class ConfigHandler { if (!hasKey("toggles", "TicTacToePuzzle")) writeBooleanConfig("toggles", "TicTacToePuzzle", false); if (!hasKey("toggles", "StartsWithTerminal")) writeBooleanConfig("toggles", "StartsWithTerminal", false); if (!hasKey("toggles", "SelectAllTerminal")) writeBooleanConfig("toggles", "SelectAllTerminal", false); + if (!hasKey("toggles", "ClickInOrderTerminal")) writeBooleanConfig("toggles", "ClickInOrderTerminal", false); if (!hasKey("toggles", "BlockWrongTerminalClicks")) writeBooleanConfig("toggles", "BlockWrongTerminalClicks", false); if (!hasKey("toggles", "IgnoreItemFrameOnSeaLanterns")) writeBooleanConfig("toggles", "IgnoreItemFrameOnSeaLanterns", false); // Experiment Solvers @@ -468,6 +469,8 @@ public class ConfigHandler { ToggleCommand.ticTacToeToggled = getBoolean("toggles", "TicTacToePuzzle"); ToggleCommand.startsWithToggled = getBoolean("toggles", "StartsWithTerminal"); ToggleCommand.selectAllToggled = getBoolean("toggles", "SelectAllTerminal"); + ToggleCommand.clickInOrderToggled = getBoolean("toggles", "ClickInOrderTerminal"); + ToggleCommand.blockWrongTerminalClicksToggled = getBoolean("toggles", "BlockWrongTerminalClicks"); ToggleCommand.itemFrameOnSeaLanternsToggled = getBoolean("toggles", "IgnoreItemFrameOnSeaLanterns"); // Experiment Solvers -- cgit From e8bb59a78708fe82893fb49dc4e5acd7a96c2979 Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Sun, 13 Dec 2020 18:29:50 -0500 Subject: Notify when Slayer Slain --- src/main/java/me/Danker/DankersSkyblockMod.java | 19 +++++++++++++++++++ src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- .../java/me/Danker/commands/DankerGuiCommand.java | 1 + src/main/java/me/Danker/commands/ToggleCommand.java | 10 ++++++++-- src/main/java/me/Danker/gui/DankerGui.java | 8 ++++++++ src/main/java/me/Danker/handlers/ConfigHandler.java | 2 ++ 6 files changed, 39 insertions(+), 3 deletions(-) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 0dec910..fa06360 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -18,6 +18,9 @@ import net.minecraft.client.settings.KeyBinding; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItemFrame; import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityWolf; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.event.ClickEvent; import net.minecraft.event.ClickEvent.Action; @@ -40,6 +43,7 @@ import net.minecraftforge.client.event.*; import net.minecraftforge.client.event.sound.PlaySoundEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.event.entity.player.AttackEntityEvent; import net.minecraftforge.event.entity.player.EntityInteractEvent; import net.minecraftforge.event.entity.player.ItemTooltipEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; @@ -2878,6 +2882,21 @@ public class DankersSkyblockMod } } + @SubscribeEvent + public void onAttackingEntity(AttackEntityEvent event) { + if (ToggleCommand.notifySlayerSlainToggled && (event.target instanceof EntityZombie || event.target instanceof EntitySpider || event.target instanceof EntityWolf)) { + List scoreboard = ScoreboardHandler.getSidebarLines(); + + for (String line : scoreboard) { + String cleanedLine = ScoreboardHandler.cleanSB(line); + if (cleanedLine.contains("Boss slain!")) { + Utils.createTitle(EnumChatFormatting.RED + "Boss slain!", 2); + break; + } + } + } + } + @SubscribeEvent public void onEntityInteract(EntityInteractEvent event) { Minecraft mc = Minecraft.getMinecraft(); diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 66d8bd8..b2f6824 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 1281dd3..7c9c2f0 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -58,6 +58,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[lowhealthnotify][").append(ToggleCommand.lowHealthNotifyToggled).append("]\n"); debug.append("[lividsolver][").append(ToggleCommand.lividSolverToggled).append("]\n"); debug.append("[stopsalvagestarred][").append(ToggleCommand.stopSalvageStarredToggled).append("]\n"); + debug.append("[notifyslayerslain][").append(ToggleCommand.notifySlayerSlainToggled).append("]\n"); debug.append("[threemanpuzzle][").append(ToggleCommand.threeManToggled).append("]\n"); debug.append("[oruopuzzle][").append(ToggleCommand.oruoToggled).append("]\n"); debug.append("[blazepuzzle][").append(ToggleCommand.blazeToggled).append("]\n"); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 2e43ba8..3b1c04d 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -39,6 +39,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean stopSalvageStarredToggled; public static boolean watcherReadyToggled; public static boolean swapToPickBlockToggled; + public static boolean notifySlayerSlainToggled; // Puzzle Solvers public static boolean threeManToggled; public static boolean oruoToggled; @@ -68,7 +69,7 @@ public class ToggleCommand extends CommandBase implements ICommand { return "/" + getCommandName() + " "; } @@ -85,7 +86,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "sceptremessages", "petcolors", "dungeontimer", "golemalerts", "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", "implosionmessages", "healmessages", "caketimer", "lowhealthnotify", - "lividsolver", "stopsalvagestarred", "threemanpuzzle", "oruopuzzle", "blazepuzzle", + "lividsolver", "stopsalvagestarred", "notifyslayerslain", "threemanpuzzle", "oruopuzzle", "blazepuzzle", "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "watchermessage", "startswithterminal", "selectallterminal", "clickinorderterminal", "blockwrongterminalclicks", "itemframeonsealanterns", "ultrasequencer", "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "list"); @@ -224,6 +225,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "StopSalvageStarred", stopSalvageStarredToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Stop salvaging starred items has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + stopSalvageStarredToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "notifyslayerslain": + notifySlayerSlainToggled = !notifySlayerSlainToggled; + ConfigHandler.writeBooleanConfig("toggles", "NotifySlayerSlain", notifySlayerSlainToggled); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Notify when slayer slain has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + notifySlayerSlainToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "threemanpuzzle": threeManToggled = !threeManToggled; ConfigHandler.writeBooleanConfig("toggles", "ThreeManPuzzle", threeManToggled); diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 613e968..32c387b 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -56,6 +56,7 @@ public class DankerGui extends GuiScreen { private GuiButton stopSalvageStarred; private GuiButton watcherReadyMessage; private GuiButton pickBlock; + private GuiButton notifySlayerSlain; public DankerGui(int page) { this.page = page; @@ -117,6 +118,8 @@ public class DankerGui extends GuiScreen { stopSalvageStarred = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Stop Salvaging Starred Items: " + Utils.getColouredBoolean(ToggleCommand.stopSalvageStarredToggled)); watcherReadyMessage = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Display Watcher Ready Message: " + Utils.getColouredBoolean(ToggleCommand.watcherReadyToggled)); splitFishing = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing)); + notifySlayerSlain = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Notify when Slayer Slain: " + Utils.getColouredBoolean(ToggleCommand.notifySlayerSlainToggled)); + switch (page) { case 1: this.buttonList.add(changeDisplay); @@ -165,6 +168,7 @@ public class DankerGui extends GuiScreen { this.buttonList.add(stopSalvageStarred); this.buttonList.add(watcherReadyMessage); this.buttonList.add(splitFishing); + this.buttonList.add(notifySlayerSlain); this.buttonList.add(backPage); break; } @@ -313,6 +317,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.watcherReadyToggled = !ToggleCommand.watcherReadyToggled; ConfigHandler.writeBooleanConfig("toggles", "WatcherReadyMessage", ToggleCommand.watcherReadyToggled); watcherReadyMessage.displayString = "Display Watcher Ready Message: " + Utils.getColouredBoolean(ToggleCommand.watcherReadyToggled); + } else if (button == notifySlayerSlain) { + ToggleCommand.notifySlayerSlainToggled = !ToggleCommand.notifySlayerSlainToggled; + ConfigHandler.writeBooleanConfig("toggles", "NotifySlayerSlain", ToggleCommand.notifySlayerSlainToggled); + watcherReadyMessage.displayString = "Notify when Slayer Slain: " + Utils.getColouredBoolean(ToggleCommand.notifySlayerSlainToggled); } else if (button == pickBlock) { ToggleCommand.swapToPickBlockToggled = !ToggleCommand.swapToPickBlockToggled; ConfigHandler.writeBooleanConfig("toggles", "PickBlock", ToggleCommand.swapToPickBlockToggled); diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 1955ba4..531d631 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -194,6 +194,7 @@ public class ConfigHandler { if (!hasKey("toggles", "StopSalvageStarred")) writeBooleanConfig("toggles", "StopSalvageStarred", false); if (!hasKey("toggles", "WatcherReadyMessage")) writeBooleanConfig("toggles", "WatcherReadyMessage", false); if (!hasKey("toggles", "PickBlock")) writeBooleanConfig("toggles", "PickBlock", false); + if (!hasKey("toggles", "NotifySlayerSlain")) writeBooleanConfig("toggles", "NotifySlayerSlain", false); // Puzzle Solvers if (!hasKey("toggles", "ThreeManPuzzle")) writeBooleanConfig("toggles", "ThreeManPuzzle", false); if (!hasKey("toggles", "OruoPuzzle")) writeBooleanConfig("toggles", "OruoPuzzle", false); @@ -459,6 +460,7 @@ public class ConfigHandler { ToggleCommand.lividSolverToggled = getBoolean("toggles", "LividSolver"); ToggleCommand.stopSalvageStarredToggled = getBoolean("toggles", "StopSalvageStarred"); ToggleCommand.watcherReadyToggled = getBoolean("toggles", "WatcherReadyMessage"); + ToggleCommand.notifySlayerSlainToggled = getBoolean("toggles", "NotifySlayerSlain"); ToggleCommand.swapToPickBlockToggled = getBoolean("toggles", "PickBlock"); // Puzzle Solvers ToggleCommand.threeManToggled = getBoolean("toggles", "ThreeManPuzzle"); -- cgit From 98a0f0b734727697c9e8072ee08842175ddbf539 Mon Sep 17 00:00:00 2001 From: Quantizr Date: Sun, 13 Dec 2020 23:21:43 -0800 Subject: Added Prevent Placing FoT/Spirit Sceptre on grass/dirt --- src/main/java/me/Danker/DankersSkyblockMod.java | 13 +++++++++++++ src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- src/main/java/me/Danker/commands/ToggleCommand.java | 11 +++++++++-- src/main/java/me/Danker/gui/DankerGui.java | 8 ++++++++ src/main/java/me/Danker/handlers/ConfigHandler.java | 2 ++ 5 files changed, 33 insertions(+), 3 deletions(-) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 64a1f5b..a148574 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -2861,6 +2861,11 @@ public class DankersSkyblockMod Blocks.oak_door, Blocks.skull )); + ArrayList flowerPlaceable = new ArrayList<>(Arrays.asList( + Blocks.grass, + Blocks.dirt, + Blocks.flower_pot + )); if (Utils.inDungeons) { interactables.add(Blocks.coal_block); interactables.add(Blocks.stained_hardened_clay); @@ -2873,6 +2878,14 @@ public class DankersSkyblockMod event.setCanceled(true); } } + 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/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 395f40d..aea4921 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/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 172411c..bd56cc3 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -39,6 +39,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean stopSalvageStarredToggled; public static boolean watcherReadyToggled; public static boolean swapToPickBlockToggled; + public static boolean flowerWeaponsToggled; // Puzzle Solvers public static boolean threeManToggled; public static boolean oruoToggled; @@ -64,7 +65,7 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName() + " "; @@ -80,7 +81,7 @@ public class ToggleCommand extends CommandBase implements ICommand { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "lividdagger", - "sceptremessages", "petcolors", "dungeontimer", "golemalerts", + "flowerweapons", "sceptremessages", "petcolors", "dungeontimer", "golemalerts", "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", "implosionmessages", "healmessages", "caketimer", "lowhealthnotify", "lividsolver", "stopsalvagestarred", "threemanpuzzle", "oruopuzzle", "blazepuzzle", @@ -151,6 +152,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "LividDagger", lividDaggerToggled); 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); @@ -308,6 +314,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Spirit Bear alerts: " + DankersSkyblockMod.VALUE_COLOUR + spiritBearAlerts + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Block AOTD ability: " + DankersSkyblockMod.VALUE_COLOUR + aotdToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Block Livid Dagger ability: " + DankersSkyblockMod.VALUE_COLOUR + lividDaggerToggled + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " 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" + diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 613e968..90815ad 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -55,6 +55,7 @@ public class DankerGui extends GuiScreen { private GuiButton lividSolver; private GuiButton stopSalvageStarred; private GuiButton watcherReadyMessage; + private GuiButton flowerWeapons; private GuiButton pickBlock; public DankerGui(int page) { @@ -117,6 +118,8 @@ public class DankerGui extends GuiScreen { stopSalvageStarred = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Stop Salvaging Starred Items: " + Utils.getColouredBoolean(ToggleCommand.stopSalvageStarredToggled)); watcherReadyMessage = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Display Watcher Ready Message: " + Utils.getColouredBoolean(ToggleCommand.watcherReadyToggled)); splitFishing = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing)); + flowerWeapons = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Prevent Placing FoT/Spirit Sceptre: " + Utils.getColouredBoolean(ToggleCommand.flowerWeaponsToggled)); + switch (page) { case 1: this.buttonList.add(changeDisplay); @@ -165,6 +168,7 @@ public class DankerGui extends GuiScreen { this.buttonList.add(stopSalvageStarred); this.buttonList.add(watcherReadyMessage); this.buttonList.add(splitFishing); + this.buttonList.add(flowerWeapons); this.buttonList.add(backPage); break; } @@ -317,6 +321,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); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index a0e446f..bc62b4b 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -194,6 +194,7 @@ public class ConfigHandler { if (!hasKey("toggles", "StopSalvageStarred")) writeBooleanConfig("toggles", "StopSalvageStarred", false); if (!hasKey("toggles", "WatcherReadyMessage")) writeBooleanConfig("toggles", "WatcherReadyMessage", false); if (!hasKey("toggles", "PickBlock")) writeBooleanConfig("toggles", "PickBlock", false); + if (!hasKey("toggles", "FlowerWeapons")) writeBooleanConfig("toggles", "FlowerWeapons", false); // Puzzle Solvers if (!hasKey("toggles", "ThreeManPuzzle")) writeBooleanConfig("toggles", "ThreeManPuzzle", false); if (!hasKey("toggles", "OruoPuzzle")) writeBooleanConfig("toggles", "OruoPuzzle", false); @@ -458,6 +459,7 @@ public class ConfigHandler { ToggleCommand.stopSalvageStarredToggled = getBoolean("toggles", "StopSalvageStarred"); ToggleCommand.watcherReadyToggled = getBoolean("toggles", "WatcherReadyMessage"); ToggleCommand.swapToPickBlockToggled = getBoolean("toggles", "PickBlock"); + ToggleCommand.flowerWeaponsToggled = getBoolean("toggles", "FlowerWeapons"); // Puzzle Solvers ToggleCommand.threeManToggled = getBoolean("toggles", "ThreeManPuzzle"); ToggleCommand.oruoToggled = getBoolean("toggles", "OruoPuzzle"); -- cgit From 12ff5bebbe431924e5c13f8a0f88843ce9709eae Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Mon, 14 Dec 2020 12:17:50 -0500 Subject: Add feature trace inactive terminals --- src/main/java/me/Danker/DankersSkyblockMod.java | 81 +++++++++++++++++++ src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- .../java/me/Danker/commands/DankerGuiCommand.java | 1 + .../java/me/Danker/commands/ToggleCommand.java | 12 ++- src/main/java/me/Danker/gui/PuzzleSolversGui.java | 20 +++-- .../java/me/Danker/handlers/ConfigHandler.java | 2 + src/main/java/me/Danker/utils/Utils.java | 93 +++++++++++++++++++++- 7 files changed, 200 insertions(+), 11 deletions(-) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 69f54cf..6665604 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -13,9 +13,14 @@ import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiChat; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.gui.inventory.GuiChest; +import net.minecraft.client.renderer.EntityRenderer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.settings.GameSettings; import net.minecraft.client.settings.KeyBinding; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.entity.item.EntityItemFrame; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntitySpider; @@ -52,6 +57,8 @@ import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; +import net.minecraftforge.fml.common.ObfuscationReflectionHelper; +import net.minecraftforge.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; @@ -62,12 +69,16 @@ import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent; import net.minecraftforge.fml.common.versioning.DefaultArtifactVersion; +import net.minecraftforge.fml.relauncher.ReflectionHelper; import org.apache.commons.lang3.time.StopWatch; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; import java.awt.*; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.text.NumberFormat; import java.util.List; import java.util.*; @@ -2812,6 +2823,9 @@ public class DankersSkyblockMod @SubscribeEvent public void onWorldRender(RenderWorldLastEvent event) { + + Minecraft mc = Minecraft.getMinecraft(); + if (ToggleCommand.blazeToggled) { if (lowestBlaze != null) { BlockPos stringPos = new BlockPos(lowestBlaze.posX, lowestBlaze.posY + 1, lowestBlaze.posZ); @@ -2834,6 +2848,73 @@ public class DankersSkyblockMod if (ToggleCommand.ticTacToeToggled && correctTicTacToeButton != null) { Utils.draw3DBox(correctTicTacToeButton, 0x40FF40, event.partialTicks); } + + if(ToggleCommand.traceInactiveTerminalsToggled && Utils.inDungeons && ScoreboardHandler.getSidebarLines().stream().anyMatch(l->ScoreboardHandler.cleanSB(l).contains("The Catacombs (F7)"))) { + for (Entity e : mc.theWorld.getLoadedEntityList()) { + if (e instanceof EntityArmorStand) { + EntityArmorStand entity = (EntityArmorStand) e; + if(!e.hasCustomName()) continue; + if(!e.getCustomNameTag().contains("Inactive")) continue; + + float distance = mc.thePlayer.getDistanceToEntity(entity); + + float[] fractions = new float[]{0.0F, 0.5F, 1.0F}; + Color[] colors = new Color[]{Color.RED, Color.YELLOW, Color.GREEN}; + float progress = distance * 1.25F * 0.01F; + + Color color = Utils.blendColors(fractions, colors, progress).brighter(); + float width = 1.0f; + float partialTicks = event.partialTicks; + + float r = ((float) 1 / 255) * color.getRed(); + float g = ((float) 1 / 255) * color.getGreen(); + float b = ((float) 1 / 255) * color.getBlue(); + GL11.glPushMatrix(); + + GL11.glLoadIdentity(); + + Method orientCamera = ReflectionHelper.findMethod(EntityRenderer.class, mc.entityRenderer, new String[]{"orientCamera"}, float.class); + try { + //mc.entityRenderer.orientCamera(partialTicks); + orientCamera.invoke(mc.entityRenderer, partialTicks); + } catch (IllegalAccessException illegalAccessException) { + illegalAccessException.printStackTrace(); + } catch (InvocationTargetException invocationTargetException) { + invocationTargetException.printStackTrace(); + } + + GL11.glDisable(2929); + GL11.glDisable(3553); + GL11.glEnable(3042); + GL11.glBlendFunc(770, 771); + + GL11.glEnable(GL11.GL_LINE_SMOOTH); + + double x = Utils.interpolate(entity.posX, entity.lastTickPosX, partialTicks) - mc.getRenderManager().viewerPosX; + double y = Utils.interpolate(entity.posY + entity.getEyeHeight(), entity.lastTickPosY + entity.getEyeHeight(), partialTicks) - mc.getRenderManager().viewerPosY; + double z = Utils.interpolate(entity.posZ, entity.lastTickPosZ, partialTicks) - mc.getRenderManager().viewerPosZ; + + GL11.glLineWidth(width); + + GL11.glBegin(GL11.GL_LINE_STRIP); + { + GL11.glColor3d(r, g, b); + GL11.glVertex3d(x, y, z); + GL11.glVertex3d(0.0, mc.thePlayer.getEyeHeight(), 0.0); + GL11.glEnd(); + GL11.glDisable(GL11.GL_LINE_SMOOTH); + + GL11.glDisable(3042); + GL11.glEnable(3553); + GL11.glEnable(2929); + + GL11.glPopMatrix(); + } + + } + } + } + } @SubscribeEvent diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index b2f6824..8e998f2 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 7c9c2f0..a003762 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -65,6 +65,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[creeperpuzzle][").append(ToggleCommand.creeperToggled).append("]\n"); debug.append("[waterpuzzle][").append(ToggleCommand.waterToggled).append("]\n"); debug.append("[tictactoepuzzle][").append(ToggleCommand.ticTacToeToggled).append("]\n"); + debug.append("[traceinactiveterminals][").append(ToggleCommand.traceInactiveTerminalsToggled).append("]\n"); debug.append("[startswithterminal][").append(ToggleCommand.startsWithToggled).append("]\n"); debug.append("[selectallterminal][").append(ToggleCommand.selectAllToggled).append("]\n"); debug.append("[clickinorderterminal][").append(ToggleCommand.clickInOrderToggled).append("]\n"); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 3b1c04d..d9d7024 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -48,6 +48,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean waterToggled; public static boolean ticTacToeToggled; // Terminal Helpers + public static boolean traceInactiveTerminalsToggled; public static boolean startsWithToggled; public static boolean selectAllToggled; public static boolean clickInOrderToggled; @@ -70,7 +71,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "aotd/lividdagger/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/" + "outlinetext/midasstaffmessages/implosionmessages/healmessages/caketimer/lowhealthnotify/" + "lividsolver/stopsalvagestarred/notifyslayerslain/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/waterpuzzle/tictactoepuzzle/" + - "watchermessage/startswithterminal/selectallterminal/clickinorderterminal/blockwrongterminalclicks/itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>"; + "watchermessage/traceinactiveterminals/startswithterminal/selectallterminal/clickinorderterminal/blockwrongterminalclicks/itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>"; } @Override @@ -87,7 +88,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", "implosionmessages", "healmessages", "caketimer", "lowhealthnotify", "lividsolver", "stopsalvagestarred", "notifyslayerslain", "threemanpuzzle", "oruopuzzle", "blazepuzzle", - "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "watchermessage", "startswithterminal", + "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "watchermessage", "traceinactiveterminals", "startswithterminal", "selectallterminal", "clickinorderterminal", "blockwrongterminalclicks", "itemframeonsealanterns", "ultrasequencer", "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "list"); } @@ -264,7 +265,12 @@ public class ToggleCommand extends CommandBase implements ICommand { watcherReadyToggled = !watcherReadyToggled; ConfigHandler.writeBooleanConfig("toggles", "WatcherReadyMessage", watcherReadyToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Display Watcher ready message has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + watcherReadyToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); - break; + break; + case "traceinactiveterminals": + traceInactiveTerminalsToggled = !traceInactiveTerminalsToggled; + ConfigHandler.writeBooleanConfig("toggles", "TraceInactiveTerminals", traceInactiveTerminalsToggled); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Trace inactive terminals has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + traceInactiveTerminalsToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "startswithterminal": startsWithToggled = !startsWithToggled; ConfigHandler.writeBooleanConfig("toggles", "StartsWithTerminal", startsWithToggled); diff --git a/src/main/java/me/Danker/gui/PuzzleSolversGui.java b/src/main/java/me/Danker/gui/PuzzleSolversGui.java index 17eb433..693e6c4 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 traceInactive; private GuiButton startsWith; private GuiButton selectAll; private GuiButton clickOrder; @@ -56,12 +57,14 @@ 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)); + traceInactive = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Trace Inactive Terminals: " + Utils.getColouredBoolean(ToggleCommand.traceInactiveTerminalsToggled)); + // 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 +74,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(traceInactive); 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 +127,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 == traceInactive) { + ToggleCommand.traceInactiveTerminalsToggled = !ToggleCommand.traceInactiveTerminalsToggled; + ConfigHandler.writeBooleanConfig("toggles", "TraceInactiveTerminals", ToggleCommand.traceInactiveTerminalsToggled); + traceInactive.displayString = "Trace Inactive Terminals: " + Utils.getColouredBoolean(ToggleCommand.traceInactiveTerminalsToggled); } 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 531d631..aae3f59 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -202,6 +202,7 @@ public class ConfigHandler { if (!hasKey("toggles", "CreeperPuzzle")) writeBooleanConfig("toggles", "CreeperPuzzle", false); if (!hasKey("toggles", "WaterPuzzle")) writeBooleanConfig("toggles", "WaterPuzzle", false); if (!hasKey("toggles", "TicTacToePuzzle")) writeBooleanConfig("toggles", "TicTacToePuzzle", false); + if (!hasKey("toggles", "TraceInactiveTerminals")) writeBooleanConfig("toggles", "TraceInactiveTerminals", false); if (!hasKey("toggles", "StartsWithTerminal")) writeBooleanConfig("toggles", "StartsWithTerminal", false); if (!hasKey("toggles", "SelectAllTerminal")) writeBooleanConfig("toggles", "SelectAllTerminal", false); if (!hasKey("toggles", "ClickInOrderTerminal")) writeBooleanConfig("toggles", "ClickInOrderTerminal", false); @@ -469,6 +470,7 @@ public class ConfigHandler { ToggleCommand.creeperToggled = getBoolean("toggles", "CreeperPuzzle"); ToggleCommand.waterToggled = getBoolean("toggles", "WaterPuzzle"); ToggleCommand.ticTacToeToggled = getBoolean("toggles", "TicTacToePuzzle"); + ToggleCommand.traceInactiveTerminalsToggled = getBoolean("toggles", "TraceInactiveTerminals"); ToggleCommand.startsWithToggled = getBoolean("toggles", "StartsWithTerminal"); ToggleCommand.selectAllToggled = getBoolean("toggles", "SelectAllTerminal"); ToggleCommand.clickInOrderToggled = getBoolean("toggles", "ClickInOrderTerminal"); diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index e4f7873..6c1fadb 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -25,6 +25,7 @@ import net.minecraft.util.*; import org.lwjgl.opengl.GL11; import java.awt.*; +import java.text.NumberFormat; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -386,6 +387,96 @@ public class Utils { RenderHelper.disableStandardItemLighting(); GlStateManager.disableRescaleNormal(); } + + public static double interpolate(double current, double old, double scale) { + return old + (current - old) * scale; + } + + // Yoink! https://stackoverflow.com/a/51780112 + public static Color blendColors(float[] fractions, Color[] colors, float progress) { + Color color; + if (fractions != null) { + if (colors != null) { + if (fractions.length == colors.length) { + int[] indices = getFractionIndices(fractions, progress); + if (indices[0] >= 0 && indices[0] < fractions.length && indices[1] >= 0 && indices[1] < fractions.length) { + float[] range = new float[]{fractions[indices[0]], fractions[indices[1]]}; + Color[] colorRange = new Color[]{colors[indices[0]], colors[indices[1]]}; + float max = range[1] - range[0]; + float value = progress - range[0]; + float weight = value / max; + color = blend(colorRange[0], colorRange[1], 1.0F - weight); + return color; + } else { + return colors[0]; + } + } else { + throw new IllegalArgumentException("Fractions and colours must have equal number of elements"); + } + } else { + throw new IllegalArgumentException("Colors can't be null"); + } + } else { + throw new IllegalArgumentException("Fractions can't be null"); + } + } + + public static int[] getFractionIndices(float[] fractions, float progress) { + int[] range = new int[2]; + + int startPoint; + for (startPoint = 0; startPoint < fractions.length && fractions[startPoint] <= progress; ++startPoint) { + } + + if (startPoint >= fractions.length) { + startPoint = fractions.length - 1; + } + + range[0] = startPoint - 1; + range[1] = startPoint; + return range; + } + + public static Color blend(Color color1, Color color2, double ratio) { + float r = (float) ratio; + float ir = 1.0F - r; + float[] rgb1 = new float[3]; + float[] rgb2 = new float[3]; + color1.getColorComponents(rgb1); + color2.getColorComponents(rgb2); + float red = rgb1[0] * r + rgb2[0] * ir; + float green = rgb1[1] * r + rgb2[1] * ir; + float blue = rgb1[2] * r + rgb2[2] * ir; + if (red < 0.0F) { + red = 0.0F; + } else if (red > 255.0F) { + red = 255.0F; + } + + if (green < 0.0F) { + green = 0.0F; + } else if (green > 255.0F) { + green = 255.0F; + } + + if (blue < 0.0F) { + blue = 0.0F; + } else if (blue > 255.0F) { + blue = 255.0F; + } + + Color color = null; + + try { + color = new Color(red, green, blue); + } catch (IllegalArgumentException var14) { + NumberFormat nf = NumberFormat.getNumberInstance(); + System.out.println(nf.format(red) + "; " + nf.format(green) + "; " + nf.format(blue)); + var14.printStackTrace(); + } + + return color; + } public static BlockPos getFirstBlockPosAfterVectors(Minecraft mc, Vec3 pos1, Vec3 pos2, int strength, int distance) { double x = pos2.xCoord - pos1.xCoord; @@ -441,5 +532,5 @@ public class Utils { return null; } } - + } -- cgit From 3deb21c90e4d66b669c123d170c36d1a93d8243c Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Mon, 14 Dec 2020 13:25:26 -0500 Subject: Revert "Add feature trace inactive terminals" This reverts commit 12ff5bebbe431924e5c13f8a0f88843ce9709eae. --- src/main/java/me/Danker/DankersSkyblockMod.java | 81 ------------------- src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- .../java/me/Danker/commands/DankerGuiCommand.java | 1 - .../java/me/Danker/commands/ToggleCommand.java | 12 +-- src/main/java/me/Danker/gui/PuzzleSolversGui.java | 20 ++--- .../java/me/Danker/handlers/ConfigHandler.java | 2 - src/main/java/me/Danker/utils/Utils.java | 93 +--------------------- 7 files changed, 11 insertions(+), 200 deletions(-) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 6665604..69f54cf 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -13,14 +13,9 @@ import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiChat; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.gui.inventory.GuiChest; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.settings.GameSettings; import net.minecraft.client.settings.KeyBinding; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.entity.item.EntityItemFrame; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntitySpider; @@ -57,8 +52,6 @@ import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; -import net.minecraftforge.fml.common.ObfuscationReflectionHelper; -import net.minecraftforge.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; @@ -69,16 +62,12 @@ import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent; import net.minecraftforge.fml.common.versioning.DefaultArtifactVersion; -import net.minecraftforge.fml.relauncher.ReflectionHelper; import org.apache.commons.lang3.time.StopWatch; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; import java.awt.*; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.text.NumberFormat; import java.util.List; import java.util.*; @@ -2823,9 +2812,6 @@ public class DankersSkyblockMod @SubscribeEvent public void onWorldRender(RenderWorldLastEvent event) { - - Minecraft mc = Minecraft.getMinecraft(); - if (ToggleCommand.blazeToggled) { if (lowestBlaze != null) { BlockPos stringPos = new BlockPos(lowestBlaze.posX, lowestBlaze.posY + 1, lowestBlaze.posZ); @@ -2848,73 +2834,6 @@ public class DankersSkyblockMod if (ToggleCommand.ticTacToeToggled && correctTicTacToeButton != null) { Utils.draw3DBox(correctTicTacToeButton, 0x40FF40, event.partialTicks); } - - if(ToggleCommand.traceInactiveTerminalsToggled && Utils.inDungeons && ScoreboardHandler.getSidebarLines().stream().anyMatch(l->ScoreboardHandler.cleanSB(l).contains("The Catacombs (F7)"))) { - for (Entity e : mc.theWorld.getLoadedEntityList()) { - if (e instanceof EntityArmorStand) { - EntityArmorStand entity = (EntityArmorStand) e; - if(!e.hasCustomName()) continue; - if(!e.getCustomNameTag().contains("Inactive")) continue; - - float distance = mc.thePlayer.getDistanceToEntity(entity); - - float[] fractions = new float[]{0.0F, 0.5F, 1.0F}; - Color[] colors = new Color[]{Color.RED, Color.YELLOW, Color.GREEN}; - float progress = distance * 1.25F * 0.01F; - - Color color = Utils.blendColors(fractions, colors, progress).brighter(); - float width = 1.0f; - float partialTicks = event.partialTicks; - - float r = ((float) 1 / 255) * color.getRed(); - float g = ((float) 1 / 255) * color.getGreen(); - float b = ((float) 1 / 255) * color.getBlue(); - GL11.glPushMatrix(); - - GL11.glLoadIdentity(); - - Method orientCamera = ReflectionHelper.findMethod(EntityRenderer.class, mc.entityRenderer, new String[]{"orientCamera"}, float.class); - try { - //mc.entityRenderer.orientCamera(partialTicks); - orientCamera.invoke(mc.entityRenderer, partialTicks); - } catch (IllegalAccessException illegalAccessException) { - illegalAccessException.printStackTrace(); - } catch (InvocationTargetException invocationTargetException) { - invocationTargetException.printStackTrace(); - } - - GL11.glDisable(2929); - GL11.glDisable(3553); - GL11.glEnable(3042); - GL11.glBlendFunc(770, 771); - - GL11.glEnable(GL11.GL_LINE_SMOOTH); - - double x = Utils.interpolate(entity.posX, entity.lastTickPosX, partialTicks) - mc.getRenderManager().viewerPosX; - double y = Utils.interpolate(entity.posY + entity.getEyeHeight(), entity.lastTickPosY + entity.getEyeHeight(), partialTicks) - mc.getRenderManager().viewerPosY; - double z = Utils.interpolate(entity.posZ, entity.lastTickPosZ, partialTicks) - mc.getRenderManager().viewerPosZ; - - GL11.glLineWidth(width); - - GL11.glBegin(GL11.GL_LINE_STRIP); - { - GL11.glColor3d(r, g, b); - GL11.glVertex3d(x, y, z); - GL11.glVertex3d(0.0, mc.thePlayer.getEyeHeight(), 0.0); - GL11.glEnd(); - GL11.glDisable(GL11.GL_LINE_SMOOTH); - - GL11.glDisable(3042); - GL11.glEnable(3553); - GL11.glEnable(2929); - - GL11.glPopMatrix(); - } - - } - } - } - } @SubscribeEvent diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 8e998f2..b2f6824 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 a003762..7c9c2f0 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -65,7 +65,6 @@ public class DankerGuiCommand extends CommandBase { debug.append("[creeperpuzzle][").append(ToggleCommand.creeperToggled).append("]\n"); debug.append("[waterpuzzle][").append(ToggleCommand.waterToggled).append("]\n"); debug.append("[tictactoepuzzle][").append(ToggleCommand.ticTacToeToggled).append("]\n"); - debug.append("[traceinactiveterminals][").append(ToggleCommand.traceInactiveTerminalsToggled).append("]\n"); debug.append("[startswithterminal][").append(ToggleCommand.startsWithToggled).append("]\n"); debug.append("[selectallterminal][").append(ToggleCommand.selectAllToggled).append("]\n"); debug.append("[clickinorderterminal][").append(ToggleCommand.clickInOrderToggled).append("]\n"); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index d9d7024..3b1c04d 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -48,7 +48,6 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean waterToggled; public static boolean ticTacToeToggled; // Terminal Helpers - public static boolean traceInactiveTerminalsToggled; public static boolean startsWithToggled; public static boolean selectAllToggled; public static boolean clickInOrderToggled; @@ -71,7 +70,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "aotd/lividdagger/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/" + "outlinetext/midasstaffmessages/implosionmessages/healmessages/caketimer/lowhealthnotify/" + "lividsolver/stopsalvagestarred/notifyslayerslain/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/waterpuzzle/tictactoepuzzle/" + - "watchermessage/traceinactiveterminals/startswithterminal/selectallterminal/clickinorderterminal/blockwrongterminalclicks/itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>"; + "watchermessage/startswithterminal/selectallterminal/clickinorderterminal/blockwrongterminalclicks/itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>"; } @Override @@ -88,7 +87,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", "implosionmessages", "healmessages", "caketimer", "lowhealthnotify", "lividsolver", "stopsalvagestarred", "notifyslayerslain", "threemanpuzzle", "oruopuzzle", "blazepuzzle", - "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "watchermessage", "traceinactiveterminals", "startswithterminal", + "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "watchermessage", "startswithterminal", "selectallterminal", "clickinorderterminal", "blockwrongterminalclicks", "itemframeonsealanterns", "ultrasequencer", "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "list"); } @@ -265,12 +264,7 @@ public class ToggleCommand extends CommandBase implements ICommand { watcherReadyToggled = !watcherReadyToggled; ConfigHandler.writeBooleanConfig("toggles", "WatcherReadyMessage", watcherReadyToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Display Watcher ready message has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + watcherReadyToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); - break; - case "traceinactiveterminals": - traceInactiveTerminalsToggled = !traceInactiveTerminalsToggled; - ConfigHandler.writeBooleanConfig("toggles", "TraceInactiveTerminals", traceInactiveTerminalsToggled); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Trace inactive terminals has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + traceInactiveTerminalsToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); - break; + break; case "startswithterminal": startsWithToggled = !startsWithToggled; ConfigHandler.writeBooleanConfig("toggles", "StartsWithTerminal", startsWithToggled); diff --git a/src/main/java/me/Danker/gui/PuzzleSolversGui.java b/src/main/java/me/Danker/gui/PuzzleSolversGui.java index 693e6c4..17eb433 100644 --- a/src/main/java/me/Danker/gui/PuzzleSolversGui.java +++ b/src/main/java/me/Danker/gui/PuzzleSolversGui.java @@ -22,7 +22,6 @@ public class PuzzleSolversGui extends GuiScreen { private GuiButton creeper; private GuiButton water; private GuiButton ticTacToe; - private GuiButton traceInactive; private GuiButton startsWith; private GuiButton selectAll; private GuiButton clickOrder; @@ -57,14 +56,12 @@ 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)); - traceInactive = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Trace Inactive Terminals: " + Utils.getColouredBoolean(ToggleCommand.traceInactiveTerminalsToggled)); - + startsWith = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Starts With Letter Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.startsWithToggled)); // 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)); + 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)); switch (page) { case 1: @@ -74,11 +71,10 @@ public class PuzzleSolversGui extends GuiScreen { this.buttonList.add(creeper); this.buttonList.add(water); this.buttonList.add(ticTacToe); - this.buttonList.add(traceInactive); + this.buttonList.add(startsWith); this.buttonList.add(nextPage); break; case 2: - this.buttonList.add(startsWith); this.buttonList.add(selectAll); this.buttonList.add(clickOrder); this.buttonList.add(blockClicks); @@ -127,10 +123,6 @@ 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 == traceInactive) { - ToggleCommand.traceInactiveTerminalsToggled = !ToggleCommand.traceInactiveTerminalsToggled; - ConfigHandler.writeBooleanConfig("toggles", "TraceInactiveTerminals", ToggleCommand.traceInactiveTerminalsToggled); - traceInactive.displayString = "Trace Inactive Terminals: " + Utils.getColouredBoolean(ToggleCommand.traceInactiveTerminalsToggled); } 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 aae3f59..531d631 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -202,7 +202,6 @@ public class ConfigHandler { if (!hasKey("toggles", "CreeperPuzzle")) writeBooleanConfig("toggles", "CreeperPuzzle", false); if (!hasKey("toggles", "WaterPuzzle")) writeBooleanConfig("toggles", "WaterPuzzle", false); if (!hasKey("toggles", "TicTacToePuzzle")) writeBooleanConfig("toggles", "TicTacToePuzzle", false); - if (!hasKey("toggles", "TraceInactiveTerminals")) writeBooleanConfig("toggles", "TraceInactiveTerminals", false); if (!hasKey("toggles", "StartsWithTerminal")) writeBooleanConfig("toggles", "StartsWithTerminal", false); if (!hasKey("toggles", "SelectAllTerminal")) writeBooleanConfig("toggles", "SelectAllTerminal", false); if (!hasKey("toggles", "ClickInOrderTerminal")) writeBooleanConfig("toggles", "ClickInOrderTerminal", false); @@ -470,7 +469,6 @@ public class ConfigHandler { ToggleCommand.creeperToggled = getBoolean("toggles", "CreeperPuzzle"); ToggleCommand.waterToggled = getBoolean("toggles", "WaterPuzzle"); ToggleCommand.ticTacToeToggled = getBoolean("toggles", "TicTacToePuzzle"); - ToggleCommand.traceInactiveTerminalsToggled = getBoolean("toggles", "TraceInactiveTerminals"); ToggleCommand.startsWithToggled = getBoolean("toggles", "StartsWithTerminal"); ToggleCommand.selectAllToggled = getBoolean("toggles", "SelectAllTerminal"); ToggleCommand.clickInOrderToggled = getBoolean("toggles", "ClickInOrderTerminal"); diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 6c1fadb..e4f7873 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -25,7 +25,6 @@ import net.minecraft.util.*; import org.lwjgl.opengl.GL11; import java.awt.*; -import java.text.NumberFormat; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -387,96 +386,6 @@ public class Utils { RenderHelper.disableStandardItemLighting(); GlStateManager.disableRescaleNormal(); } - - public static double interpolate(double current, double old, double scale) { - return old + (current - old) * scale; - } - - // Yoink! https://stackoverflow.com/a/51780112 - public static Color blendColors(float[] fractions, Color[] colors, float progress) { - Color color; - if (fractions != null) { - if (colors != null) { - if (fractions.length == colors.length) { - int[] indices = getFractionIndices(fractions, progress); - if (indices[0] >= 0 && indices[0] < fractions.length && indices[1] >= 0 && indices[1] < fractions.length) { - float[] range = new float[]{fractions[indices[0]], fractions[indices[1]]}; - Color[] colorRange = new Color[]{colors[indices[0]], colors[indices[1]]}; - float max = range[1] - range[0]; - float value = progress - range[0]; - float weight = value / max; - color = blend(colorRange[0], colorRange[1], 1.0F - weight); - return color; - } else { - return colors[0]; - } - } else { - throw new IllegalArgumentException("Fractions and colours must have equal number of elements"); - } - } else { - throw new IllegalArgumentException("Colors can't be null"); - } - } else { - throw new IllegalArgumentException("Fractions can't be null"); - } - } - - public static int[] getFractionIndices(float[] fractions, float progress) { - int[] range = new int[2]; - - int startPoint; - for (startPoint = 0; startPoint < fractions.length && fractions[startPoint] <= progress; ++startPoint) { - } - - if (startPoint >= fractions.length) { - startPoint = fractions.length - 1; - } - - range[0] = startPoint - 1; - range[1] = startPoint; - return range; - } - - public static Color blend(Color color1, Color color2, double ratio) { - float r = (float) ratio; - float ir = 1.0F - r; - float[] rgb1 = new float[3]; - float[] rgb2 = new float[3]; - color1.getColorComponents(rgb1); - color2.getColorComponents(rgb2); - float red = rgb1[0] * r + rgb2[0] * ir; - float green = rgb1[1] * r + rgb2[1] * ir; - float blue = rgb1[2] * r + rgb2[2] * ir; - if (red < 0.0F) { - red = 0.0F; - } else if (red > 255.0F) { - red = 255.0F; - } - - if (green < 0.0F) { - green = 0.0F; - } else if (green > 255.0F) { - green = 255.0F; - } - - if (blue < 0.0F) { - blue = 0.0F; - } else if (blue > 255.0F) { - blue = 255.0F; - } - - Color color = null; - - try { - color = new Color(red, green, blue); - } catch (IllegalArgumentException var14) { - NumberFormat nf = NumberFormat.getNumberInstance(); - System.out.println(nf.format(red) + "; " + nf.format(green) + "; " + nf.format(blue)); - var14.printStackTrace(); - } - - return color; - } public static BlockPos getFirstBlockPosAfterVectors(Minecraft mc, Vec3 pos1, Vec3 pos2, int strength, int distance) { double x = pos2.xCoord - pos1.xCoord; @@ -532,5 +441,5 @@ public class Utils { return null; } } - + } -- cgit From 31a53cbc4933c2a3b8ec11d4f55a67e42a4942ce Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Tue, 15 Dec 2020 20:51:11 -0500 Subject: Feature: Necron Notifications --- src/main/java/me/Danker/DankersSkyblockMod.java | 52 ++++++++++++++++++++++ src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- .../java/me/Danker/commands/DankerGuiCommand.java | 1 + .../java/me/Danker/commands/ToggleCommand.java | 9 +++- src/main/java/me/Danker/gui/DankerGui.java | 7 +++ .../java/me/Danker/handlers/ConfigHandler.java | 2 + 6 files changed, 70 insertions(+), 3 deletions(-) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 77102bc..87fdd23 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -7,6 +7,8 @@ import me.Danker.handlers.*; import me.Danker.utils.TicTacToeUtils; import me.Danker.utils.Utils; import net.minecraft.block.Block; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.Gui; @@ -16,6 +18,7 @@ import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.client.settings.GameSettings; import net.minecraft.client.settings.KeyBinding; import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.entity.item.EntityItemFrame; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntitySpider; @@ -459,6 +462,55 @@ public class DankersSkyblockMod } } } + + if (ToggleCommand.necronNotificationsToggled && Utils.inDungeons && message.contains("[BOSS] Necron:")) { + Minecraft mc = Minecraft.getMinecraft(); + World world = mc.theWorld; + if (message.contains("You tricked me!") || message.contains("That beam, it hurts! IT HURTS!!")) { + Utils.createTitle(EnumChatFormatting.RED + "NECRON STUCK!", 2); + } else if (message.contains("STOP USING MY FACTORY AGAINST ME!") || message.contains("OOF") || message.contains("ANOTHER TRAP!! YOUR TRICKS ARE FUTILE!") || message.contains("SERIOUSLY? AGAIN?!") || message.contains("STOP!!!!!")) { + List necronLabels = world.getEntities(EntityArmorStand.class, (entity->{ + if (!entity.hasCustomName()) return false; + if (!entity.getCustomNameTag().contains("Necron")) return false; + return true; + })); + if(necronLabels.size() == 0) { + Utils.createTitle(EnumChatFormatting.WHITE + "NECRON STUNNED!", 2); + } else { + EntityArmorStand necron = necronLabels.get(0); + double x = necron.posX; + double z = necron.posZ; + + BlockPos blockPos = new BlockPos(x, 168, z); + + IBlockState blockState = world.getBlockState(blockPos); + Block block = blockState.getBlock(); + + if (block != Blocks.stained_hardened_clay) { + Utils.createTitle(EnumChatFormatting.WHITE + "NECRON STUNNED!", 2); + } else { + switch (block.getDamageValue(world, blockPos)) { + case 4: + Utils.createTitle(EnumChatFormatting.YELLOW + "YELLOW PILLAR!", 2); + break; + case 5: + Utils.createTitle(EnumChatFormatting.GREEN + "LIME PILLAR!", 2); + break; + case 11: + Utils.createTitle(EnumChatFormatting.BLUE + "BLUE PILLAR!", 2); + break; + default: + Utils.createTitle(EnumChatFormatting.WHITE + "NECRON STUNNED!", 2); + } + } + + } + } else if (message.contains("I'VE HAD ENOUGH! YOU'RE NOT HITTING ME WITH ANY MORE PILLARS!")) { + Utils.createTitle(EnumChatFormatting.RED + "RED PILLAR!", 2); + } else if (message.contains("ARGH!")) { + Utils.createTitle(EnumChatFormatting.RED + "EXPLOSION OVER!", 2); + } + } if (message.contains("[BOSS] The Watcher: You have proven yourself. You may pass.")) { watcherClearTime = System.currentTimeMillis() / 1000; diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index b2f6824..e4e7037 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 7c9c2f0..813624e 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -59,6 +59,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[lividsolver][").append(ToggleCommand.lividSolverToggled).append("]\n"); debug.append("[stopsalvagestarred][").append(ToggleCommand.stopSalvageStarredToggled).append("]\n"); debug.append("[notifyslayerslain][").append(ToggleCommand.notifySlayerSlainToggled).append("]\n"); + debug.append("[necronnotifications][").append(ToggleCommand.necronNotificationsToggled).append("]\n"); debug.append("[threemanpuzzle][").append(ToggleCommand.threeManToggled).append("]\n"); debug.append("[oruopuzzle][").append(ToggleCommand.oruoToggled).append("]\n"); debug.append("[blazepuzzle][").append(ToggleCommand.blazeToggled).append("]\n"); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 3b1c04d..30cbcc5 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -40,6 +40,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean watcherReadyToggled; public static boolean swapToPickBlockToggled; public static boolean notifySlayerSlainToggled; + public static boolean necronNotificationsToggled; // Puzzle Solvers public static boolean threeManToggled; public static boolean oruoToggled; @@ -69,7 +70,7 @@ public class ToggleCommand extends CommandBase implements ICommand { return "/" + getCommandName() + " "; } @@ -86,7 +87,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "sceptremessages", "petcolors", "dungeontimer", "golemalerts", "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", "implosionmessages", "healmessages", "caketimer", "lowhealthnotify", - "lividsolver", "stopsalvagestarred", "notifyslayerslain", "threemanpuzzle", "oruopuzzle", "blazepuzzle", + "lividsolver", "stopsalvagestarred", "notifyslayerslain", "necronnotifications", "threemanpuzzle", "oruopuzzle", "blazepuzzle", "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "watchermessage", "startswithterminal", "selectallterminal", "clickinorderterminal", "blockwrongterminalclicks", "itemframeonsealanterns", "ultrasequencer", "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "list"); @@ -230,6 +231,10 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "NotifySlayerSlain", notifySlayerSlainToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Notify when slayer slain has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + notifySlayerSlainToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "necronnotifications": + necronNotificationsToggled = !necronNotificationsToggled; + ConfigHandler.writeBooleanConfig("toggles", "NecronNotifications", necronNotificationsToggled); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Necron phase notifications has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + necronNotificationsToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); case "threemanpuzzle": threeManToggled = !threeManToggled; ConfigHandler.writeBooleanConfig("toggles", "ThreeManPuzzle", threeManToggled); diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index ff6d5d0..86ab1aa 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -57,6 +57,7 @@ public class DankerGui extends GuiScreen { private GuiButton watcherReadyMessage; private GuiButton pickBlock; private GuiButton notifySlayerSlain; + private GuiButton necronNotifications; public DankerGui(int page) { this.page = page; @@ -119,6 +120,7 @@ public class DankerGui extends GuiScreen { watcherReadyMessage = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Display Watcher Ready Message: " + Utils.getColouredBoolean(ToggleCommand.watcherReadyToggled)); splitFishing = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing)); notifySlayerSlain = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Notify when Slayer Slain: " + Utils.getColouredBoolean(ToggleCommand.notifySlayerSlainToggled)); + necronNotifications = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Necron Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled)); switch (page) { case 1: @@ -169,6 +171,7 @@ public class DankerGui extends GuiScreen { this.buttonList.add(watcherReadyMessage); this.buttonList.add(splitFishing); this.buttonList.add(notifySlayerSlain); + this.buttonList.add(necronNotifications); this.buttonList.add(backPage); break; } @@ -321,6 +324,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.notifySlayerSlainToggled = !ToggleCommand.notifySlayerSlainToggled; ConfigHandler.writeBooleanConfig("toggles", "NotifySlayerSlain", ToggleCommand.notifySlayerSlainToggled); notifySlayerSlain.displayString = "Notify when Slayer Slain: " + Utils.getColouredBoolean(ToggleCommand.notifySlayerSlainToggled); + } else if (button == necronNotifications) { + ToggleCommand.necronNotificationsToggled = !ToggleCommand.necronNotificationsToggled; + ConfigHandler.writeBooleanConfig("toggles", "NecronNotifications", ToggleCommand.necronNotificationsToggled); + necronNotifications.displayString = "Necron Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled); } else if (button == pickBlock) { ToggleCommand.swapToPickBlockToggled = !ToggleCommand.swapToPickBlockToggled; ConfigHandler.writeBooleanConfig("toggles", "PickBlock", ToggleCommand.swapToPickBlockToggled); diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 531d631..ce34b39 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -195,6 +195,8 @@ public class ConfigHandler { if (!hasKey("toggles", "WatcherReadyMessage")) writeBooleanConfig("toggles", "WatcherReadyMessage", false); if (!hasKey("toggles", "PickBlock")) writeBooleanConfig("toggles", "PickBlock", false); if (!hasKey("toggles", "NotifySlayerSlain")) writeBooleanConfig("toggles", "NotifySlayerSlain", false); + if (!hasKey("toggles", "NecronNotifications")) writeBooleanConfig("toggles", "NecronNotifications", false); + // Puzzle Solvers if (!hasKey("toggles", "ThreeManPuzzle")) writeBooleanConfig("toggles", "ThreeManPuzzle", false); if (!hasKey("toggles", "OruoPuzzle")) writeBooleanConfig("toggles", "OruoPuzzle", false); -- cgit From 930a7e51b12ccc005dc3bb19c34846c70084224b Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Wed, 16 Dec 2020 13:43:42 -0500 Subject: Config for Necron Notifications --- src/main/java/me/Danker/handlers/ConfigHandler.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index ce34b39..383dabf 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -463,7 +463,9 @@ public class ConfigHandler { ToggleCommand.stopSalvageStarredToggled = getBoolean("toggles", "StopSalvageStarred"); ToggleCommand.watcherReadyToggled = getBoolean("toggles", "WatcherReadyMessage"); ToggleCommand.notifySlayerSlainToggled = getBoolean("toggles", "NotifySlayerSlain"); + ToggleCommand.necronNotificationsToggled = getBoolean("toggles", "NecronNotifications"); ToggleCommand.swapToPickBlockToggled = getBoolean("toggles", "PickBlock"); + // Puzzle Solvers ToggleCommand.threeManToggled = getBoolean("toggles", "ThreeManPuzzle"); ToggleCommand.oruoToggled = getBoolean("toggles", "OruoPuzzle"); -- cgit From b453d6a47f45d677d7c55b5e8ccc5981b7b90c5b Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Thu, 17 Dec 2020 09:51:36 -0500 Subject: Update ScoreboardHandler.java add a null check --- src/main/java/me/Danker/handlers/ScoreboardHandler.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/handlers/ScoreboardHandler.java b/src/main/java/me/Danker/handlers/ScoreboardHandler.java index b81689c..c8bc7c7 100644 --- a/src/main/java/me/Danker/handlers/ScoreboardHandler.java +++ b/src/main/java/me/Danker/handlers/ScoreboardHandler.java @@ -31,6 +31,7 @@ public class ScoreboardHandler { public static List getSidebarLines() { List lines = new ArrayList<>(); + if (Minecraft.getMinecraft().theWorld == null) return lines; Scoreboard scoreboard = Minecraft.getMinecraft().theWorld.getScoreboard(); if (scoreboard == null) return lines; -- cgit From b161c4dec6ee6a05c769d407bbd51a43bff4b4d6 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 17 Dec 2020 11:00:09 -0500 Subject: Fix icons rendering with tints --- README.md | 4 +++- build.gradle | 2 +- src/main/java/me/Danker/DankersSkyblockMod.java | 2 +- src/main/java/me/Danker/commands/ToggleCommand.java | 3 ++- src/main/java/me/Danker/handlers/TextRenderer.java | 2 ++ 5 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src/main/java/me/Danker/handlers') diff --git a/README.md b/README.md index bbf50bd..e251a76 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Discord Server: https://discord.gg/QsEkNQS - Golden T10/T6/T4 enchant display - Block AOTD ability - Block Livid Dagger ability +- Block placing Flower of Truth/Spirit Sceptre on dirt/grass - Disable Spirit Sceptre messages - Disable Midas Staff messages - Disable Implosion messages @@ -34,6 +35,7 @@ Discord Server: https://discord.gg/QsEkNQS - Catacombs F7 Stage 3 solvers (Starts with letter, select all colour, ignore arrows on sea lanterns) - Find correct Livid (with graphic display of HP) - Experimentation solvers (Ultrasequencer, Chronomatron, Superpairs) +- Hide tooltips in experiment addons - Pet background colors based on level - Golem spawning alerts - Skill xp/hour tracker @@ -47,7 +49,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/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 d046b38..441a4db 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ plugins { id "net.minecraftforge.gradle.forge" version "2.0.2" } */ -version = "1.8.5-beta4" +version = "1.8.5-beta5" 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 86d2087..563e466 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -78,7 +78,7 @@ import java.util.regex.Pattern; public class DankersSkyblockMod { public static final String MODID = "Danker's Skyblock Mod"; - public static final String VERSION = "1.8.5-beta3"; + public static final String VERSION = "1.8.5-beta5"; static double checkItemsNow = 0; static double itemsChecked = 0; diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index dab4ce2..15693ef 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -71,7 +71,8 @@ public class ToggleCommand extends CommandBase implements ICommand { "aotd/lividdagger/flowerweapons/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/" + "outlinetext/midasstaffmessages/implosionmessages/healmessages/caketimer/lowhealthnotify/" + "lividsolver/stopsalvagestarred/notifyslayerslain/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/waterpuzzle/tictactoepuzzle/" + - "watchermessage/startswithterminal/selectallterminal/clickinorderterminal/blockwrongterminalclicks/itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>"; + "watchermessage/startswithterminal/selectallterminal/clickinorderterminal/blockwrongterminalclicks/" + + "itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>"; } @Override diff --git a/src/main/java/me/Danker/handlers/TextRenderer.java b/src/main/java/me/Danker/handlers/TextRenderer.java index cbf196b..769d164 100644 --- a/src/main/java/me/Danker/handlers/TextRenderer.java +++ b/src/main/java/me/Danker/handlers/TextRenderer.java @@ -3,6 +3,7 @@ package me.Danker.handlers; import me.Danker.commands.ToggleCommand; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.util.StringUtils; import org.lwjgl.opengl.GL11; @@ -26,5 +27,6 @@ public class TextRenderer extends Gui { } } GL11.glScaled(scaleReset, scaleReset, scaleReset); + GlStateManager.color(1, 1, 1, 1); } } -- cgit From 98ad455efd1cad0dffb6dfa0c0b688322ac83ede Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Thu, 17 Dec 2020 18:16:33 -0500 Subject: Add Bonzo Mask Timer --- src/main/java/me/Danker/DankersSkyblockMod.java | 62 +++++++++++++++++---- src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- .../java/me/Danker/commands/DankerGuiCommand.java | 1 + src/main/java/me/Danker/commands/MoveCommand.java | 14 ++++- src/main/java/me/Danker/commands/ScaleCommand.java | 10 +++- .../java/me/Danker/commands/ToggleCommand.java | 11 +++- src/main/java/me/Danker/gui/DankerGui.java | 7 +++ src/main/java/me/Danker/gui/EditLocationsGui.java | 32 +++++++++-- .../java/me/Danker/handlers/ConfigHandler.java | 17 +++++- src/main/resources/assets/dsm/icons/bonzo.png | Bin 0 -> 10809 bytes 10 files changed, 131 insertions(+), 25 deletions(-) create mode 100644 src/main/resources/assets/dsm/icons/bonzo.png (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 7a836ef..153a6ca 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -103,10 +103,12 @@ public class DankersSkyblockMod static boolean foundLivid = false; static Entity livid = null; public static double cakeTime; + public static double nextBonzoUse = 0; public static final ResourceLocation CAKE_ICON = new ResourceLocation("dsm", "icons/cake.png"); - - static String[] riddleSolutions = {"The reward is not in my chest!", "At least one of them is lying, and the reward is not in", + public static final ResourceLocation BONZO_ICON = new ResourceLocation("dsm", "icons/bonzo.png"); + + static String[] riddleSolutions = {"The reward is not in my chest!", "At least one of them is lying, and the reward is not in", "My chest doesn't have the reward. We are all telling the truth", "My chest has the reward and I'm telling the truth", "The reward isn't in any of our chests", "Both of them are telling the truth."}; static Map triviaSolutions = new HashMap<>(); @@ -174,6 +176,7 @@ public class DankersSkyblockMod public static String CAKE_COLOUR; public static String SKILL_TRACKER_COLOUR; public static String TRIVIA_WRONG_ANSWER_COLOUR; + public static String BONZO_COLOR; public static int LOWEST_BLAZE_COLOUR; public static int HIGHEST_BLAZE_COLOUR; public static int PET_1_TO_9; @@ -375,6 +378,7 @@ public class DankersSkyblockMod public void onWorldChange(WorldEvent.Load event) { foundLivid = false; livid = null; + nextBonzoUse = 0; } // It randomly broke, so I had to make it the highest priority @@ -476,17 +480,35 @@ public class DankersSkyblockMod } return; } + + if (ToggleCommand.bonzoTimerToggled && Utils.inDungeons && message.contains("Bonzo's Mask") && message.contains("saved your life!")) { + double usedTime = System.currentTimeMillis() / 1000; + Minecraft mc = Minecraft.getMinecraft(); + EntityPlayerSP player = mc.thePlayer; + ItemStack bonzoMask = player.getCurrentArmor(3); + if (bonzoMask != null && bonzoMask.getItem() == Items.skull) { + int cooldownSeconds = 0; + for(String line : Utils.getItemLore(bonzoMask)) { + String stripped = StringUtils.stripControlCodes(line); + if (stripped.startsWith("Cooldown: ")) + cooldownSeconds = Integer.parseInt(stripped.replaceAll("[^\\d]", "")); + } + System.out.println("Parsed Bonzo Mask Cooldown: " + cooldownSeconds); + if (cooldownSeconds > 0) + nextBonzoUse = usedTime + cooldownSeconds; + } + } // Dungeon chat spoken by an NPC, containing : if (ToggleCommand.threeManToggled && Utils.inDungeons && message.contains("[NPC]")) { - for (String solution : riddleSolutions) { - if (message.contains(solution)) { - String npcName = message.substring(message.indexOf("]") + 2, message.indexOf(":")); - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(ANSWER_COLOUR + EnumChatFormatting.BOLD + StringUtils.stripControlCodes(npcName) + MAIN_COLOUR + " has the blessing.")); - break; - } - } - } + for (String solution : riddleSolutions) { + if (message.contains(solution)) { + String npcName = message.substring(message.indexOf("]") + 2, message.indexOf(":")); + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(ANSWER_COLOUR + EnumChatFormatting.BOLD + StringUtils.stripControlCodes(npcName) + MAIN_COLOUR + " has the blessing.")); + break; + } + } + } if (ToggleCommand.necronNotificationsToggled && Utils.inDungeons && message.contains("[BOSS] Necron:")) { Minecraft mc = Minecraft.getMinecraft(); @@ -1338,6 +1360,26 @@ public class DankersSkyblockMod GL11.glScaled(scaleReset, scaleReset, scaleReset); } + + if (ToggleCommand.bonzoTimerToggled && Utils.inDungeons) { + double scale = ScaleCommand.bonzoTimerScale; + double scaleReset = Math.pow(scale, -1); + GL11.glScaled(scale, scale, scale); + + double timeNow = System.currentTimeMillis() / 1000; + mc.getTextureManager().bindTexture(BONZO_ICON); + Gui.drawModalRectWithCustomSizedTexture(MoveCommand.bonzoTimerXY[0], MoveCommand.bonzoTimerXY[1], 0, 0, 16, 16, 16, 16); + + String bonzoText; + if (nextBonzoUse - timeNow < 0) { + bonzoText = EnumChatFormatting.GREEN + "READY"; + } else { + bonzoText = BONZO_COLOR + Utils.getTimeBetween(timeNow, nextBonzoUse); + } + new TextRenderer(mc, bonzoText, MoveCommand.bonzoTimerXY[0] + 20, MoveCommand.bonzoTimerXY[1] + 5, 1); + + GL11.glScaled(scaleReset, scaleReset, scaleReset); + } if (showSkillTracker && Utils.inSkyblock) { int xpPerHour; diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index e4e7037..9e29f5f 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 813624e..720a34c 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -60,6 +60,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[stopsalvagestarred][").append(ToggleCommand.stopSalvageStarredToggled).append("]\n"); debug.append("[notifyslayerslain][").append(ToggleCommand.notifySlayerSlainToggled).append("]\n"); debug.append("[necronnotifications][").append(ToggleCommand.necronNotificationsToggled).append("]\n"); + debug.append("[bonzotimer][").append(ToggleCommand.bonzoTimerToggled).append("]\n"); debug.append("[threemanpuzzle][").append(ToggleCommand.threeManToggled).append("]\n"); debug.append("[oruopuzzle][").append(ToggleCommand.oruoToggled).append("]\n"); debug.append("[blazepuzzle][").append(ToggleCommand.blazeToggled).append("]\n"); diff --git a/src/main/java/me/Danker/commands/MoveCommand.java b/src/main/java/me/Danker/commands/MoveCommand.java index e9bfe61..55ad695 100644 --- a/src/main/java/me/Danker/commands/MoveCommand.java +++ b/src/main/java/me/Danker/commands/MoveCommand.java @@ -21,7 +21,8 @@ public class MoveCommand extends CommandBase { public static int[] cakeTimerXY = {0, 0}; public static int[] skillTrackerXY = {0, 0}; public static int[] waterAnswerXY = {0, 0}; - + public static int[] bonzoTimerXY = {0, 0}; + @Override public String getCommandName() { return "move"; @@ -29,7 +30,7 @@ public class MoveCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " "; + return "/" + getCommandName() + " "; } @Override @@ -40,7 +41,7 @@ public class MoveCommand extends CommandBase { @Override public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", "skilltracker", "wateranswer"); + return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", "skilltracker", "wateranswer", "bonzotimer"); } return null; } @@ -111,6 +112,13 @@ public class MoveCommand extends CommandBase { ConfigHandler.writeIntConfig("locations", "waterAnswerY", waterAnswerXY[1]); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Water solver answer has been moved to " + DankersSkyblockMod.SECONDARY_COLOUR + arg1[1] + ", " + arg1[2])); break; + case "bonzotimer": + bonzoTimerXY[0] = Integer.parseInt(arg1[1]); + bonzoTimerXY[1] = Integer.parseInt(arg1[2]); + ConfigHandler.writeIntConfig("locations", "bonzoTimerX", bonzoTimerXY[0]); + ConfigHandler.writeIntConfig("locations", "bonzoTimerX", bonzoTimerXY[1]); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Bonzo's Mask timer has been moved to " + DankersSkyblockMod.SECONDARY_COLOUR + arg1[1] + ", " + arg1[2])); + break; default: player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); } diff --git a/src/main/java/me/Danker/commands/ScaleCommand.java b/src/main/java/me/Danker/commands/ScaleCommand.java index 1c0843d..79b3cb1 100644 --- a/src/main/java/me/Danker/commands/ScaleCommand.java +++ b/src/main/java/me/Danker/commands/ScaleCommand.java @@ -21,6 +21,7 @@ public class ScaleCommand extends CommandBase { public static double cakeTimerScale; public static double skillTrackerScale; public static double waterAnswerScale; + public static double bonzoTimerScale; @Override public String getCommandName() { @@ -29,7 +30,7 @@ public class ScaleCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " "; + return "/" + getCommandName() + " "; } @Override @@ -40,7 +41,7 @@ public class ScaleCommand extends CommandBase { @Override public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", "skilltracker", "wateranswer"); + return getListOfStringsMatchingLastWord(args, "coords", "display", "dungeontimer", "skill50", "lividhp", "caketimer", "skilltracker", "wateranswer", "bonzotimer"); } return null; } @@ -101,6 +102,11 @@ public class ScaleCommand extends CommandBase { ConfigHandler.writeDoubleConfig("scales", "waterAnswerScale", waterAnswerScale); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Water solver answer has been scaled to " + DankersSkyblockMod.SECONDARY_COLOUR + waterAnswerScale + "x")); break; + case "bonzotimer": + bonzoTimerScale = scaleAmount; + ConfigHandler.writeDoubleConfig("scales", "bonzoTimerScale", bonzoTimerScale); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Bonzo's Mask timer has been scaled to " + DankersSkyblockMod.SECONDARY_COLOUR + bonzoTimerScale + "x")); + break; default: player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); } diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 30cbcc5..b0ad194 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -41,6 +41,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean swapToPickBlockToggled; public static boolean notifySlayerSlainToggled; public static boolean necronNotificationsToggled; + public static boolean bonzoTimerToggled; // Puzzle Solvers public static boolean threeManToggled; public static boolean oruoToggled; @@ -70,7 +71,7 @@ public class ToggleCommand extends CommandBase implements ICommand { return "/" + getCommandName() + " "; } @@ -87,7 +88,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "sceptremessages", "petcolors", "dungeontimer", "golemalerts", "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", "implosionmessages", "healmessages", "caketimer", "lowhealthnotify", - "lividsolver", "stopsalvagestarred", "notifyslayerslain", "necronnotifications", "threemanpuzzle", "oruopuzzle", "blazepuzzle", + "lividsolver", "stopsalvagestarred", "notifyslayerslain", "necronnotifications", "bonzotimer", "threemanpuzzle", "oruopuzzle", "blazepuzzle", "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "watchermessage", "startswithterminal", "selectallterminal", "clickinorderterminal", "blockwrongterminalclicks", "itemframeonsealanterns", "ultrasequencer", "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "list"); @@ -235,6 +236,12 @@ public class ToggleCommand extends CommandBase implements ICommand { necronNotificationsToggled = !necronNotificationsToggled; ConfigHandler.writeBooleanConfig("toggles", "NecronNotifications", necronNotificationsToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Necron phase notifications has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + necronNotificationsToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "bonzotimer": + bonzoTimerToggled = !bonzoTimerToggled; + ConfigHandler.writeBooleanConfig("toggles", "BonzoTimer", bonzoTimerToggled); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Bonzo's Mask timer has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + necronNotificationsToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "threemanpuzzle": threeManToggled = !threeManToggled; ConfigHandler.writeBooleanConfig("toggles", "ThreeManPuzzle", threeManToggled); diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 86ab1aa..fa19a30 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -58,6 +58,7 @@ public class DankerGui extends GuiScreen { private GuiButton pickBlock; private GuiButton notifySlayerSlain; private GuiButton necronNotifications; + private GuiButton bonzoTimer; public DankerGui(int page) { this.page = page; @@ -121,6 +122,7 @@ public class DankerGui extends GuiScreen { splitFishing = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing)); notifySlayerSlain = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Notify when Slayer Slain: " + Utils.getColouredBoolean(ToggleCommand.notifySlayerSlainToggled)); necronNotifications = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Necron Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled)); + bonzoTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Bonzo's Mask Timer: " + Utils.getColouredBoolean(ToggleCommand.bonzoTimerToggled)); switch (page) { case 1: @@ -172,6 +174,7 @@ public class DankerGui extends GuiScreen { this.buttonList.add(splitFishing); this.buttonList.add(notifySlayerSlain); this.buttonList.add(necronNotifications); + this.buttonList.add(bonzoTimer); this.buttonList.add(backPage); break; } @@ -328,6 +331,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.necronNotificationsToggled = !ToggleCommand.necronNotificationsToggled; ConfigHandler.writeBooleanConfig("toggles", "NecronNotifications", ToggleCommand.necronNotificationsToggled); necronNotifications.displayString = "Necron Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled); + } else if (button == bonzoTimer) { + ToggleCommand.bonzoTimerToggled = !ToggleCommand.bonzoTimerToggled; + ConfigHandler.writeBooleanConfig("toggles", "BonzoTimer", ToggleCommand.bonzoTimerToggled); + bonzoTimer.displayString = "Bonzo's Mask Timer: " + Utils.getColouredBoolean(ToggleCommand.bonzoTimerToggled); } else if (button == pickBlock) { ToggleCommand.swapToPickBlockToggled = !ToggleCommand.swapToPickBlockToggled; ConfigHandler.writeBooleanConfig("toggles", "PickBlock", ToggleCommand.swapToPickBlockToggled); diff --git a/src/main/java/me/Danker/gui/EditLocationsGui.java b/src/main/java/me/Danker/gui/EditLocationsGui.java index b610ae0..e3d6b73 100644 --- a/src/main/java/me/Danker/gui/EditLocationsGui.java +++ b/src/main/java/me/Danker/gui/EditLocationsGui.java @@ -26,6 +26,7 @@ public class EditLocationsGui extends GuiScreen { private LocationButton cakeTimer; private LocationButton skillTracker; private LocationButton waterAnswer; + private LocationButton bonzoTimer; @Override public boolean doesGuiPauseGame() { @@ -91,6 +92,8 @@ public class EditLocationsGui extends GuiScreen { cakeTimer = new LocationButton(0, MoveCommand.cakeTimerXY[0], MoveCommand.cakeTimerXY[1] + 5, 85 * ScaleCommand.cakeTimerScale, 18 * ScaleCommand.cakeTimerScale, ScaleCommand.cakeTimerScale, DankersSkyblockMod.CAKE_COLOUR + " 11h16m", null, null); skillTracker = new LocationButton(0, MoveCommand.skillTrackerXY[0], MoveCommand.skillTrackerXY[1], 150 * ScaleCommand.skillTrackerScale, 28 * ScaleCommand.skillTrackerScale, ScaleCommand.skillTrackerScale, skillTrackerText, null, null); waterAnswer = new LocationButton(0, MoveCommand.waterAnswerXY[0], MoveCommand.waterAnswerXY[1], 190 * ScaleCommand.waterAnswerScale, 54 * ScaleCommand.waterAnswerScale, ScaleCommand.waterAnswerScale, waterAnswerText, null, null); + bonzoTimer = new LocationButton(0, MoveCommand.bonzoTimerXY[0], MoveCommand.bonzoTimerXY[1] + 5, 85 * ScaleCommand.bonzoTimerScale, 18 * ScaleCommand.bonzoTimerScale, ScaleCommand.bonzoTimerScale, DankersSkyblockMod.BONZO_COLOR + " 3m30s", null, null); + this.buttonList.add(coords); this.buttonList.add(dungeonTimer); @@ -98,6 +101,7 @@ public class EditLocationsGui extends GuiScreen { this.buttonList.add(cakeTimer); this.buttonList.add(skillTracker); this.buttonList.add(waterAnswer); + this.buttonList.add(bonzoTimer); this.buttonList.add(display); this.buttonList.add(skill50); } @@ -107,13 +111,21 @@ public class EditLocationsGui extends GuiScreen { this.drawDefaultBackground(); mouseMoved(mouseX, mouseY); - double scale = ScaleCommand.cakeTimerScale; - double scaleReset = Math.pow(scale, -1); - GL11.glScaled(scale, scale, scale); + double cakeTimerScale = ScaleCommand.cakeTimerScale; + double cakeTimerScaleReset = Math.pow(cakeTimerScale, -1); + GL11.glScaled(cakeTimerScale, cakeTimerScale, cakeTimerScale); mc.getTextureManager().bindTexture(DankersSkyblockMod.CAKE_ICON); Gui.drawModalRectWithCustomSizedTexture(MoveCommand.cakeTimerXY[0], MoveCommand.cakeTimerXY[1], 0, 0, 16, 16, 16, 16); - GL11.glScaled(scaleReset, scaleReset, scaleReset); - + GL11.glScaled(cakeTimerScaleReset, cakeTimerScaleReset, cakeTimerScaleReset); + + double bonzoTimerScale = ScaleCommand.bonzoTimerScale; + double bonzoTimerScaleReset = Math.pow(bonzoTimerScale, -1); + GL11.glScaled(bonzoTimerScale, bonzoTimerScale, bonzoTimerScale); + mc.getTextureManager().bindTexture(DankersSkyblockMod.BONZO_ICON); + Gui.drawModalRectWithCustomSizedTexture(MoveCommand.bonzoTimerXY[0], MoveCommand.bonzoTimerXY[1], 0, 0, 16, 16, 16, 16); + GL11.glScaled(bonzoTimerScaleReset, bonzoTimerScaleReset, bonzoTimerScaleReset); + + super.drawScreen(mouseX, mouseY, partialTicks); } @@ -171,6 +183,12 @@ public class EditLocationsGui extends GuiScreen { waterAnswer.xPosition = MoveCommand.waterAnswerXY[0]; waterAnswer.yPosition = MoveCommand.waterAnswerXY[1]; break; + case "bonzoTimer": + MoveCommand.bonzoTimerXY[0] += xMoved; + MoveCommand.bonzoTimerXY[1] += yMoved; + bonzoTimer.xPosition = MoveCommand.bonzoTimerXY[0]; + bonzoTimer.yPosition = MoveCommand.bonzoTimerXY[1]; + break; } this.buttonList.clear(); initGui(); @@ -199,6 +217,8 @@ public class EditLocationsGui extends GuiScreen { moving = "skillTracker"; } else if (button == waterAnswer) { moving = "waterAnswer"; + } else if (button == bonzoTimer) { + moving = "bonzoTimer"; } } } @@ -223,6 +243,8 @@ public class EditLocationsGui extends GuiScreen { ConfigHandler.writeIntConfig("locations", "skillTrackerY", MoveCommand.skillTrackerXY[1]); ConfigHandler.writeIntConfig("locations", "waterAnswerX", MoveCommand.waterAnswerXY[0]); ConfigHandler.writeIntConfig("locations", "waterAnswerY", MoveCommand.waterAnswerXY[1]); + ConfigHandler.writeIntConfig("locations", "bonzoTimerX", MoveCommand.bonzoTimerXY[0]); + ConfigHandler.writeIntConfig("locations", "bonzoTimerY", MoveCommand.bonzoTimerXY[1]); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 383dabf..b1cf0c2 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -196,6 +196,8 @@ public class ConfigHandler { if (!hasKey("toggles", "PickBlock")) writeBooleanConfig("toggles", "PickBlock", false); if (!hasKey("toggles", "NotifySlayerSlain")) writeBooleanConfig("toggles", "NotifySlayerSlain", false); if (!hasKey("toggles", "NecronNotifications")) writeBooleanConfig("toggles", "NecronNotifications", false); + if (!hasKey("toggles", "BonzoTimer")) writeBooleanConfig("toggles", "BonzoTimer", false); + // Puzzle Solvers if (!hasKey("toggles", "ThreeManPuzzle")) writeBooleanConfig("toggles", "ThreeManPuzzle", false); @@ -401,6 +403,8 @@ public class ConfigHandler { if (!hasKey("locations", "skillTrackerY")) writeIntConfig("locations", "skillTrackerY", 50); if (!hasKey("locations", "waterAnswerX")) writeIntConfig("locations", "waterAnswerX", 100); if (!hasKey("locations", "waterAnswerY")) writeIntConfig("locations", "waterAnswerY", 100); + if (!hasKey("locations", "bonzoTimerX")) writeIntConfig("locations", "bonzoTimerX", 40); + if (!hasKey("locations", "bonzoTimerY")) writeIntConfig("locations", "bonzoTimerY", 80); if (!hasKey("scales", "coordsScale")) writeDoubleConfig("scales", "coordsScale", 1); if (!hasKey("scales", "displayScale")) writeDoubleConfig("scales", "displayScale", 1); if (!hasKey("scales", "dungeonTimerScale")) writeDoubleConfig("scales", "dungeonTimerScale", 1); @@ -409,7 +413,9 @@ public class ConfigHandler { if (!hasKey("scales", "cakeTimerScale")) writeDoubleConfig("scales", "cakeTimerScale", 1); if (!hasKey("scales", "skillTrackerScale")) writeDoubleConfig("scales", "skillTrackerScale", 1); if (!hasKey("scales", "waterAnswerScale")) writeDoubleConfig("scales", "waterAnswerScale", 1); - + if (!hasKey("scales", "bonzoTimerScale")) writeDoubleConfig("scales", "bonzoTimerScale", 1); + + if (!hasKey("colors", "main")) writeStringConfig("colors", "main", EnumChatFormatting.GREEN.toString()); if (!hasKey("colors", "secondary")) writeStringConfig("colors", "secondary", EnumChatFormatting.DARK_GREEN.toString()); if (!hasKey("colors", "delimiter")) writeStringConfig("colors", "delimiter", EnumChatFormatting.AQUA.toString()); @@ -423,6 +429,7 @@ public class ConfigHandler { if (!hasKey("colors", "cakeDisplay")) writeStringConfig("colors", "cakeDisplay", EnumChatFormatting.GOLD.toString()); if (!hasKey("colors", "skillTracker")) writeStringConfig("colors", "skillTracker", EnumChatFormatting.AQUA.toString()); if (!hasKey("colors", "triviaWrongAnswer")) writeStringConfig("colors", "triviaWrongAnswer", EnumChatFormatting.RED.toString()); + if (!hasKey("colors", "bonzoDisplay")) writeStringConfig("colors", "bonzoDisplay", EnumChatFormatting.RED.toString()); if (!hasKey("colors", "blazeLowest")) writeIntConfig("colors", "blazeLowest", 0xFF0000); if (!hasKey("colors", "blazeHighest")) writeIntConfig("colors", "blazeHighest", 0x40FF40); if (!hasKey("colors", "pet1To9")) writeIntConfig("colors", "pet1To9", 0x999999); // Gray @@ -464,6 +471,7 @@ public class ConfigHandler { ToggleCommand.watcherReadyToggled = getBoolean("toggles", "WatcherReadyMessage"); ToggleCommand.notifySlayerSlainToggled = getBoolean("toggles", "NotifySlayerSlain"); ToggleCommand.necronNotificationsToggled = getBoolean("toggles", "NecronNotifications"); + ToggleCommand.bonzoTimerToggled = getBoolean("toggles", "BonzoTimer"); ToggleCommand.swapToPickBlockToggled = getBoolean("toggles", "PickBlock"); // Puzzle Solvers @@ -673,7 +681,10 @@ public class ConfigHandler { MoveCommand.skillTrackerXY[1] = getInt("locations", "skillTrackerY"); MoveCommand.waterAnswerXY[0] = getInt("locations", "waterAnswerX"); MoveCommand.waterAnswerXY[1] = getInt("locations", "waterAnswerY"); - + MoveCommand.bonzoTimerXY[0] = getInt("locations", "bonzoTimerX"); + MoveCommand.bonzoTimerXY[1] = getInt("locations", "bonzoTimerY"); + + ScaleCommand.coordsScale = getDouble("scales", "coordsScale"); ScaleCommand.displayScale = getDouble("scales", "displayScale"); ScaleCommand.dungeonTimerScale = getDouble("scales", "dungeonTimerScale"); @@ -682,6 +693,7 @@ public class ConfigHandler { ScaleCommand.cakeTimerScale = getDouble("scales", "cakeTimerScale"); ScaleCommand.skillTrackerScale = getDouble("scales", "skillTrackerScale"); ScaleCommand.waterAnswerScale = getDouble("scales", "waterAnswerScale"); + ScaleCommand.bonzoTimerScale = getDouble("scales", "bonzoTimerScale"); DankersSkyblockMod.MAIN_COLOUR = getString("colors", "main"); DankersSkyblockMod.SECONDARY_COLOUR = getString("colors", "secondary"); @@ -696,6 +708,7 @@ public class ConfigHandler { DankersSkyblockMod.CAKE_COLOUR = getString("colors", "cakeDisplay"); DankersSkyblockMod.SKILL_TRACKER_COLOUR = getString("colors", "skillTracker"); DankersSkyblockMod.TRIVIA_WRONG_ANSWER_COLOUR = getString("colors", "triviaWrongAnswer"); + DankersSkyblockMod.BONZO_COLOR = getString("colors", "bonzoDisplay"); DankersSkyblockMod.LOWEST_BLAZE_COLOUR = getInt("colors", "blazeLowest"); DankersSkyblockMod.HIGHEST_BLAZE_COLOUR = getInt("colors", "blazeHighest"); DankersSkyblockMod.PET_1_TO_9 = getInt("colors", "pet1To9"); diff --git a/src/main/resources/assets/dsm/icons/bonzo.png b/src/main/resources/assets/dsm/icons/bonzo.png new file mode 100644 index 0000000..e9537b4 Binary files /dev/null and b/src/main/resources/assets/dsm/icons/bonzo.png differ -- cgit From 676ee2ca5ad1de111d3fb68e2db19f9d6ea720db Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Thu, 17 Dec 2020 19:16:40 -0500 Subject: Manually merge changes from development --- src/main/java/me/Danker/DankersSkyblockMod.java | 19 +++++++++++++++++-- src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- .../java/me/Danker/commands/DankerGuiCommand.java | 5 +++-- src/main/java/me/Danker/commands/ToggleCommand.java | 14 +++++++++++--- src/main/java/me/Danker/gui/DankerGui.java | 11 +++++++++-- src/main/java/me/Danker/handlers/ConfigHandler.java | 2 ++ 6 files changed, 43 insertions(+), 10 deletions(-) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 7acf51d..7f9d57c 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -78,7 +78,7 @@ import java.util.regex.Pattern; public class DankersSkyblockMod { public static final String MODID = "Danker's Skyblock Mod"; - public static final String VERSION = "1.8.5-beta3"; + public static final String VERSION = "1.8.5-beta5"; static double checkItemsNow = 0; static double itemsChecked = 0; @@ -1305,7 +1305,7 @@ public class DankersSkyblockMod public void renderEverything() { if (Minecraft.getMinecraft().currentScreen instanceof EditLocationsGui) return; - + Minecraft mc = Minecraft.getMinecraft(); if (ToggleCommand.coordsToggled) { @@ -3041,10 +3041,25 @@ public class DankersSkyblockMod Blocks.oak_door, Blocks.skull )); + ArrayList flowerPlaceable = new ArrayList<>(Arrays.asList( + Blocks.grass, + Blocks.dirt, + Blocks.flower_pot, + Blocks.tallgrass, + Blocks.double_plant + )); if (Utils.inDungeons) { interactables.add(Blocks.coal_block); interactables.add(Blocks.stained_hardened_clay); } + 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); + } + } if (!interactables.contains(block)) { if (ToggleCommand.aotdToggled && item.getDisplayName().contains("Aspect of the Dragons")) { event.setCanceled(true); diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index 9e29f5f..a9632b9 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 720a34c..3e599f5 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -7,6 +7,7 @@ import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; import net.minecraft.util.ChatComponentText; +import net.minecraft.util.StringUtils; import java.awt.*; import java.awt.datatransfer.StringSelection; @@ -75,6 +76,7 @@ public class DankerGuiCommand extends CommandBase { 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("[watchermessage][").append(ToggleCommand.watcherReadyToggled).append("]\n"); debug.append("# Locations\n"); @@ -95,8 +97,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("\n"); } else { for (ResourcePackRepository.Entry resource : Minecraft.getMinecraft().getResourcePackRepository().getRepositoryEntries()) { - debug.append("< ").append(resource.getResourcePackName()).append(" >\n"); - } + debug.append("< ").append(StringUtils.stripControlCodes(resource.getResourcePackName())).append(" >\n"); } } debug.append("```"); StringSelection clipboard = new StringSelection(debug.toString()); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index b0ad194..2b9bbd7 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -39,6 +39,7 @@ 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,10 +70,11 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName() + " "; + "watchermessage/startswithterminal/selectallterminal/clickinorderterminal/blockwrongterminalclicks/" + + "itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>"; } @Override @@ -85,7 +87,7 @@ public class ToggleCommand extends CommandBase implements ICommand { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "lividdagger", - "sceptremessages", "petcolors", "dungeontimer", "golemalerts", + "flowerweapons", "sceptremessages", "petcolors", "dungeontimer", "golemalerts", "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", "implosionmessages", "healmessages", "caketimer", "lowhealthnotify", "lividsolver", "stopsalvagestarred", "notifyslayerslain", "necronnotifications", "bonzotimer", "threemanpuzzle", "oruopuzzle", "blazepuzzle", @@ -156,6 +158,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "LividDagger", lividDaggerToggled); 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); @@ -338,6 +345,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Spirit Bear alerts: " + DankersSkyblockMod.VALUE_COLOUR + spiritBearAlerts + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Block AOTD ability: " + DankersSkyblockMod.VALUE_COLOUR + aotdToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Block Livid Dagger ability: " + DankersSkyblockMod.VALUE_COLOUR + lividDaggerToggled + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " 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" + diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index fa19a30..03937a8 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -55,6 +55,7 @@ public class DankerGui extends GuiScreen { private GuiButton lividSolver; private GuiButton stopSalvageStarred; private GuiButton watcherReadyMessage; + private GuiButton flowerWeapons; private GuiButton pickBlock; private GuiButton notifySlayerSlain; private GuiButton necronNotifications; @@ -121,8 +122,9 @@ public class DankerGui extends GuiScreen { watcherReadyMessage = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Display Watcher Ready Message: " + Utils.getColouredBoolean(ToggleCommand.watcherReadyToggled)); splitFishing = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing)); notifySlayerSlain = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Notify when Slayer Slain: " + Utils.getColouredBoolean(ToggleCommand.notifySlayerSlainToggled)); - necronNotifications = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Necron Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled)); - bonzoTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Bonzo's Mask Timer: " + Utils.getColouredBoolean(ToggleCommand.bonzoTimerToggled)); + flowerWeapons = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Prevent Placing FoT/Spirit Sceptre: " + Utils.getColouredBoolean(ToggleCommand.flowerWeaponsToggled)); + necronNotifications = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Necron Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled)); + bonzoTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Bonzo's Mask Timer: " + Utils.getColouredBoolean(ToggleCommand.bonzoTimerToggled)); switch (page) { case 1: @@ -173,6 +175,7 @@ public class DankerGui extends GuiScreen { this.buttonList.add(watcherReadyMessage); this.buttonList.add(splitFishing); this.buttonList.add(notifySlayerSlain); + this.buttonList.add(flowerWeapons); this.buttonList.add(necronNotifications); this.buttonList.add(bonzoTimer); this.buttonList.add(backPage); @@ -339,6 +342,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); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index b1cf0c2..e09ccba 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -194,6 +194,7 @@ public class ConfigHandler { if (!hasKey("toggles", "StopSalvageStarred")) writeBooleanConfig("toggles", "StopSalvageStarred", false); if (!hasKey("toggles", "WatcherReadyMessage")) writeBooleanConfig("toggles", "WatcherReadyMessage", false); if (!hasKey("toggles", "PickBlock")) writeBooleanConfig("toggles", "PickBlock", false); + if (!hasKey("toggles", "FlowerWeapons")) writeBooleanConfig("toggles", "FlowerWeapons", false); if (!hasKey("toggles", "NotifySlayerSlain")) writeBooleanConfig("toggles", "NotifySlayerSlain", false); if (!hasKey("toggles", "NecronNotifications")) writeBooleanConfig("toggles", "NecronNotifications", false); if (!hasKey("toggles", "BonzoTimer")) writeBooleanConfig("toggles", "BonzoTimer", false); @@ -473,6 +474,7 @@ public class ConfigHandler { ToggleCommand.necronNotificationsToggled = getBoolean("toggles", "NecronNotifications"); ToggleCommand.bonzoTimerToggled = getBoolean("toggles", "BonzoTimer"); ToggleCommand.swapToPickBlockToggled = getBoolean("toggles", "PickBlock"); + ToggleCommand.flowerWeaponsToggled = getBoolean("toggles", "FlowerWeapons"); // Puzzle Solvers ToggleCommand.threeManToggled = getBoolean("toggles", "ThreeManPuzzle"); -- cgit From 5805888e0c1dea9602122595cf74b35bf90d696d Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Fri, 18 Dec 2020 11:20:18 -0500 Subject: Add a first launch message --- src/main/java/me/Danker/DankersSkyblockMod.java | 29 ++++++++++++++++++++++ .../java/me/Danker/handlers/ConfigHandler.java | 7 ++++-- 2 files changed, 34 insertions(+), 2 deletions(-) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 529c392..2035784 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -26,6 +26,7 @@ import net.minecraft.entity.passive.EntityWolf; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.event.ClickEvent; import net.minecraft.event.ClickEvent.Action; +import net.minecraft.event.HoverEvent; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.inventory.Container; @@ -104,6 +105,7 @@ public class DankersSkyblockMod static Entity livid = null; public static double cakeTime; public static double nextBonzoUse = 0; + public static boolean firstLaunch = false; public static final ResourceLocation CAKE_ICON = new ResourceLocation("dsm", "icons/cake.png"); public static final ResourceLocation BONZO_ICON = new ResourceLocation("dsm", "icons/bonzo.png"); @@ -323,6 +325,33 @@ public class DankersSkyblockMod // Update checker @SubscribeEvent public void onJoin(EntityJoinWorldEvent event) { + + if (firstLaunch) { + firstLaunch = false; + ConfigHandler.writeBooleanConfig("misc", "firstLaunch", false); + + IChatComponent chatComponent = new ChatComponentText( + EnumChatFormatting.GOLD + "Thank you for downloading Danker's Skyblock Mod.\n" + + "To get started, run the command " + EnumChatFormatting.GOLD + "/dsm" + EnumChatFormatting.RESET + " to view all the mod features." + ); + chatComponent.setChatStyle(chatComponent.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText("Click to open the DSM menu."))).setChatClickEvent(new ClickEvent(Action.RUN_COMMAND, "/dsm"))); + + new Thread(()->{ + while (true) { + if (Minecraft.getMinecraft().thePlayer == null) { + try { + Thread.sleep(500); + } catch (InterruptedException e) { + e.printStackTrace(); + } + continue; + } + Minecraft.getMinecraft().thePlayer.addChatMessage(chatComponent); + break; + } + }).start(); + } + if (!updateChecked) { updateChecked = true; diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index e09ccba..2822738 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -385,7 +385,9 @@ public class ConfigHandler { if (!hasKey("misc", "skill50Time")) writeIntConfig("misc", "skill50Time", 3); if (!hasKey("misc", "cakeTime")) writeDoubleConfig("misc", "cakeTime", 0); if (!hasKey("misc", "showSkillTracker")) writeBooleanConfig("misc", "showSkillTracker", false); - + if (!hasKey("misc", "firstLaunch")) writeBooleanConfig("misc", "firstLaunch", true); + + ScaledResolution scaled = new ScaledResolution(Minecraft.getMinecraft()); int height = scaled.getScaledHeight(); if (!hasKey("locations", "coordsX")) writeIntConfig("locations", "coordsX", 5); @@ -666,7 +668,8 @@ public class ConfigHandler { DankersSkyblockMod.SKILL_TIME = getInt("misc", "skill50Time") * 20; DankersSkyblockMod.cakeTime = getDouble("misc", "cakeTime"); DankersSkyblockMod.showSkillTracker = getBoolean("misc", "showSkillTracker"); - + DankersSkyblockMod.firstLaunch = getBoolean("misc", "firstLaunch"); + MoveCommand.coordsXY[0] = getInt("locations", "coordsX"); MoveCommand.coordsXY[1] = getInt("locations", "coordsY"); MoveCommand.displayXY[0] = getInt("locations", "displayX"); -- cgit From 2ea0943f42c428aa946f5163083a891529657f41 Mon Sep 17 00:00:00 2001 From: Sychic Date: Fri, 18 Dec 2020 23:35:22 -0500 Subject: Werewolf fishing writes to correct value --- src/main/java/me/Danker/handlers/ConfigHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index af61cfe..f295c38 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -577,7 +577,7 @@ public class ConfigHandler { // Spooky Fishing LootCommand.scarecrows = getInt("fishing", "scarecrow"); LootCommand.nightmares = getInt("fishing", "nightmare"); - LootCommand.werewolfs = getInt("fishing", "nightmare"); + LootCommand.werewolfs = getInt("fishing", "werewolf"); LootCommand.phantomFishers = getInt("fishing", "phantomFisher"); LootCommand.grimReapers = getInt("fishing", "grimReaper"); -- cgit From 6143fa32651bebd85afa46d8f8a4eeaea9fee595 Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Sat, 19 Dec 2020 11:22:32 -0500 Subject: Feat: Prevent Breaking Farms --- src/main/java/me/Danker/DankersSkyblockMod.java | 37 ++++++++++++++++++++-- src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- .../java/me/Danker/commands/DankerGuiCommand.java | 1 + .../java/me/Danker/commands/ToggleCommand.java | 11 +++++-- src/main/java/me/Danker/gui/DankerGui.java | 14 +++++++- .../java/me/Danker/handlers/ConfigHandler.java | 2 ++ 6 files changed, 60 insertions(+), 7 deletions(-) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 2035784..da82fdb 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -3003,8 +3003,9 @@ public class DankersSkyblockMod if (!Utils.inSkyblock || Minecraft.getMinecraft().thePlayer != event.entityPlayer) return; ItemStack item = event.entityPlayer.getHeldItem(); if (item == null) return; + Block block = Minecraft.getMinecraft().theWorld.getBlockState(event.pos).getBlock(); - if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_AIR) { + if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_AIR) { if (ToggleCommand.aotdToggled && item.getDisplayName().contains("Aspect of the Dragons")) { event.setCanceled(true); } @@ -3037,8 +3038,7 @@ public class DankersSkyblockMod } } - if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) { - Block block = Minecraft.getMinecraft().theWorld.getBlockState(event.pos).getBlock(); + else if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) { ArrayList interactables = new ArrayList<>(Arrays.asList( Blocks.acacia_door, Blocks.anvil, @@ -3102,6 +3102,37 @@ public class DankersSkyblockMod } } } + + else if (event.action == PlayerInteractEvent.Action.LEFT_CLICK_BLOCK) { + if (ToggleCommand.blockBreakingFarmsToggled) { + ArrayList tools = new ArrayList(Arrays.asList( + Items.wooden_hoe, + Items.stone_hoe, + Items.iron_hoe, + Items.golden_hoe, + Items.diamond_hoe, + Items.wooden_axe, + Items.stone_axe, + Items.iron_axe, + Items.golden_axe, + Items.diamond_axe + )); + + ArrayList farmBlocks = new ArrayList(Arrays.asList( + Blocks.dirt, + Blocks.farmland, + Blocks.carpet, + Blocks.glowstone, + Blocks.sea_lantern + )); + + if (tools.contains(item) && farmBlocks.contains(block)) { + event.setCanceled(true); + } + + } + } + } @SubscribeEvent diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index a9632b9..699374d 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 3e599f5..dea6859 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -62,6 +62,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[notifyslayerslain][").append(ToggleCommand.notifySlayerSlainToggled).append("]\n"); debug.append("[necronnotifications][").append(ToggleCommand.necronNotificationsToggled).append("]\n"); debug.append("[bonzotimer][").append(ToggleCommand.bonzoTimerToggled).append("]\n"); + debug.append("[blockbreakingfarms][").append(ToggleCommand.blockBreakingFarmsToggled).append("]\n"); debug.append("[threemanpuzzle][").append(ToggleCommand.threeManToggled).append("]\n"); debug.append("[oruopuzzle][").append(ToggleCommand.oruoToggled).append("]\n"); debug.append("[blazepuzzle][").append(ToggleCommand.blazeToggled).append("]\n"); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 2b9bbd7..81e3f9c 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -43,6 +43,8 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean notifySlayerSlainToggled; public static boolean necronNotificationsToggled; public static boolean bonzoTimerToggled; + public static boolean blockBreakingFarmsToggled; + // Puzzle Solvers public static boolean threeManToggled; public static boolean oruoToggled; @@ -72,7 +74,7 @@ public class ToggleCommand extends CommandBase implements ICommand { return "/" + getCommandName() + " "; } @@ -90,7 +92,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "flowerweapons", "sceptremessages", "petcolors", "dungeontimer", "golemalerts", "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", "implosionmessages", "healmessages", "caketimer", "lowhealthnotify", - "lividsolver", "stopsalvagestarred", "notifyslayerslain", "necronnotifications", "bonzotimer", "threemanpuzzle", "oruopuzzle", "blazepuzzle", + "lividsolver", "stopsalvagestarred", "notifyslayerslain", "necronnotifications", "bonzotimer", "blockbreakingfarms", "threemanpuzzle", "oruopuzzle", "blazepuzzle", "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "watchermessage", "startswithterminal", "selectallterminal", "clickinorderterminal", "blockwrongterminalclicks", "itemframeonsealanterns", "ultrasequencer", "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "list"); @@ -249,6 +251,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "BonzoTimer", bonzoTimerToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Bonzo's Mask timer has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + necronNotificationsToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "blockbreakingfarms": + blockBreakingFarmsToggled = !blockBreakingFarmsToggled; + ConfigHandler.writeBooleanConfig("toggles", "BlockBreakingFarms", blockBreakingFarmsToggled); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Prevent breaking farms has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + necronNotificationsToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "threemanpuzzle": threeManToggled = !threeManToggled; ConfigHandler.writeBooleanConfig("toggles", "ThreeManPuzzle", threeManToggled); diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 03937a8..2860997 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -60,6 +60,7 @@ public class DankerGui extends GuiScreen { private GuiButton notifySlayerSlain; private GuiButton necronNotifications; private GuiButton bonzoTimer; + private GuiButton blockBreakingFarms; public DankerGui(int page) { this.page = page; @@ -125,6 +126,8 @@ public class DankerGui extends GuiScreen { flowerWeapons = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Prevent Placing FoT/Spirit Sceptre: " + Utils.getColouredBoolean(ToggleCommand.flowerWeaponsToggled)); necronNotifications = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Necron Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled)); bonzoTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Bonzo's Mask Timer: " + Utils.getColouredBoolean(ToggleCommand.bonzoTimerToggled)); + //Page 6 + blockBreakingFarms = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Prevent Breaking Farms: " + Utils.getColouredBoolean(ToggleCommand.blockBreakingFarmsToggled)); switch (page) { case 1: @@ -178,6 +181,11 @@ public class DankerGui extends GuiScreen { this.buttonList.add(flowerWeapons); this.buttonList.add(necronNotifications); this.buttonList.add(bonzoTimer); + this.buttonList.add(nextPage); + this.buttonList.add(backPage); + break; + case 6: + this.buttonList.add(blockBreakingFarms); this.buttonList.add(backPage); break; } @@ -190,7 +198,7 @@ public class DankerGui extends GuiScreen { @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); - String pageText = "Page: " + page + "/5"; + String pageText = "Page: " + page + "/6"; int pageWidth = mc.fontRendererObj.getStringWidth(pageText); new TextRenderer(mc, pageText, width / 2 - pageWidth / 2, 10, 1D); super.drawScreen(mouseX, mouseY, partialTicks); @@ -338,6 +346,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.bonzoTimerToggled = !ToggleCommand.bonzoTimerToggled; ConfigHandler.writeBooleanConfig("toggles", "BonzoTimer", ToggleCommand.bonzoTimerToggled); bonzoTimer.displayString = "Bonzo's Mask Timer: " + Utils.getColouredBoolean(ToggleCommand.bonzoTimerToggled); + } else if (button == blockBreakingFarms) { + ToggleCommand.blockBreakingFarmsToggled = !ToggleCommand.blockBreakingFarmsToggled; + ConfigHandler.writeBooleanConfig("toggles", "BlockBreakingFarms", ToggleCommand.blockBreakingFarmsToggled); + blockBreakingFarms.displayString = "Prevent Breaking Farms: " + Utils.getColouredBoolean(ToggleCommand.blockBreakingFarmsToggled); } else if (button == pickBlock) { ToggleCommand.swapToPickBlockToggled = !ToggleCommand.swapToPickBlockToggled; ConfigHandler.writeBooleanConfig("toggles", "PickBlock", ToggleCommand.swapToPickBlockToggled); diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 2822738..3d1855e 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -198,6 +198,7 @@ public class ConfigHandler { if (!hasKey("toggles", "NotifySlayerSlain")) writeBooleanConfig("toggles", "NotifySlayerSlain", false); if (!hasKey("toggles", "NecronNotifications")) writeBooleanConfig("toggles", "NecronNotifications", false); if (!hasKey("toggles", "BonzoTimer")) writeBooleanConfig("toggles", "BonzoTimer", false); + if (!hasKey("toggles", "BlockBreakingFarms")) writeBooleanConfig("toggles", "BlockBreakingFarms", true); // Puzzle Solvers @@ -475,6 +476,7 @@ public class ConfigHandler { ToggleCommand.notifySlayerSlainToggled = getBoolean("toggles", "NotifySlayerSlain"); ToggleCommand.necronNotificationsToggled = getBoolean("toggles", "NecronNotifications"); ToggleCommand.bonzoTimerToggled = getBoolean("toggles", "BonzoTimer"); + ToggleCommand.blockBreakingFarmsToggled = getBoolean("toggles", "BlockBreakingFarms"); ToggleCommand.swapToPickBlockToggled = getBoolean("toggles", "PickBlock"); ToggleCommand.flowerWeaponsToggled = getBoolean("toggles", "FlowerWeapons"); -- cgit From dbef82994f3e437a2e674fb34f5e989944f53290 Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Sat, 19 Dec 2020 19:46:29 -0500 Subject: Change default for prevent breaking farms to false --- src/main/java/me/Danker/handlers/ConfigHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 3d1855e..199936f 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -198,7 +198,7 @@ public class ConfigHandler { if (!hasKey("toggles", "NotifySlayerSlain")) writeBooleanConfig("toggles", "NotifySlayerSlain", false); if (!hasKey("toggles", "NecronNotifications")) writeBooleanConfig("toggles", "NecronNotifications", false); if (!hasKey("toggles", "BonzoTimer")) writeBooleanConfig("toggles", "BonzoTimer", false); - if (!hasKey("toggles", "BlockBreakingFarms")) writeBooleanConfig("toggles", "BlockBreakingFarms", true); + if (!hasKey("toggles", "BlockBreakingFarms")) writeBooleanConfig("toggles", "BlockBreakingFarms", false); // Puzzle Solvers -- cgit From 1b24fe5548a52a9416efc91284ffb4256c6c5610 Mon Sep 17 00:00:00 2001 From: Kaloyan Draganov Date: Sun, 20 Dec 2020 22:42:27 -0500 Subject: Reparty Command --- src/main/java/me/Danker/DankersSkyblockMod.java | 46 +++++++++++-- .../java/me/Danker/commands/RepartyCommand.java | 78 ++++++++++++++++++++++ .../java/me/Danker/handlers/ConfigHandler.java | 3 +- 3 files changed, 122 insertions(+), 5 deletions(-) create mode 100644 src/main/java/me/Danker/commands/RepartyCommand.java (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index bfd776d..8688bee 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -185,7 +185,9 @@ public class DankersSkyblockMod public static int PET_70_TO_79; public static int PET_80_TO_89; public static int PET_90_TO_99; - public static int PET_100; + public static int PET_100; + + public static List partyList = new ArrayList<>(); @EventHandler public void init(FMLInitializationEvent event) { @@ -300,7 +302,8 @@ public class DankersSkyblockMod ClientCommandHandler.instance.registerCommand(new DungeonsCommand()); ClientCommandHandler.instance.registerCommand(new LobbySkillsCommand()); ClientCommandHandler.instance.registerCommand(new DankerGuiCommand()); - ClientCommandHandler.instance.registerCommand(new SkillTrackerCommand()); + ClientCommandHandler.instance.registerCommand(new SkillTrackerCommand()); + ClientCommandHandler.instance.registerCommand(new RepartyCommand()); } @EventHandler @@ -353,7 +356,42 @@ public class DankersSkyblockMod @SubscribeEvent(priority = EventPriority.HIGHEST) public void onChat(ClientChatReceivedEvent event) { String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); - + + // Reparty command + if (System.currentTimeMillis() / 1000 - RepartyCommand.callTime <= 1.5) { + if (!(message.contains("----") || message.contains("disbanded") || message.contains("seconds to accept") || message.contains("●") || message.contains("Party Members"))) { + return; + } + + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + + Pattern party_start_pattern = Pattern.compile("^Party Members \\((\\d+)\\)$"); + Pattern leader_pattern = Pattern.compile("^Party Leader: (?:\\[.+?] )?(\\w+) ●$"); + Pattern members_pattern = Pattern.compile(" (?:\\[.+?] )?(\\w+) ●"); + + Matcher party_start = party_start_pattern.matcher(message); + Matcher leader = leader_pattern.matcher(message); + Matcher members = members_pattern.matcher(message); + + + if (party_start.matches() && Integer.parseInt(party_start.group(1)) == 1) { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "You cannot reparty yourself.")); + } + else if (leader.matches() && !(leader.group(1).equals(player.getName()))) { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "You are not party leader.")); + } + else { + while (members.find()) { + String partyMember = members.group(1); + if (!partyMember.equals(player.getName())) { + partyList.add(partyMember); + } + } + } + + event.setCanceled(true); + } + if (!Utils.inSkyblock) return; // Action Bar @@ -540,7 +578,7 @@ public class DankersSkyblockMod } } } - + if (ToggleCommand.golemAlertToggled) { if (message.contains("The ground begins to shake as an Endstone Protector rises from below!")) { Utils.createTitle(EnumChatFormatting.RED + "GOLEM SPAWNING!", 3); diff --git a/src/main/java/me/Danker/commands/RepartyCommand.java b/src/main/java/me/Danker/commands/RepartyCommand.java new file mode 100644 index 0000000..3ade5e9 --- /dev/null +++ b/src/main/java/me/Danker/commands/RepartyCommand.java @@ -0,0 +1,78 @@ +package me.Danker.commands; + +import me.Danker.DankersSkyblockMod; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommand; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.*; +import net.minecraft.util.ChatComponentText; +import net.minecraftforge.client.event.*; +import net.minecraftforge.fml.common.Mod.EventHandler; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.util.*; +import java.text.NumberFormat; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + + +public class RepartyCommand extends CommandBase implements ICommand { + public static double callTime = 0; + + @Override + public String getCommandName() { return "reparty"; } + + @Override + public String getCommandUsage(ICommandSender sender) { return "/" + getCommandName(); } + + @Override + public int getRequiredPermissionLevel() { return 0; } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + // MULTI THREAD DRIFTING + new Thread(() -> { + final EntityPlayer player_unused = (EntityPlayer) sender; + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + callTime = System.currentTimeMillis() / 1000; + + try { + player.sendChatMessage("/p list"); + Thread.sleep(700); + + List party = DankersSkyblockMod.partyList; + if (party.size() == 0) { + DankersSkyblockMod.partyList.clear(); + return; + } + + player.sendChatMessage("/p disband"); + Thread.sleep(250); + + String members = String.join(DankersSkyblockMod.SECONDARY_COLOUR + "\n- " + EnumChatFormatting.GOLD, party); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------\n" + + DankersSkyblockMod.MAIN_COLOUR + "Repartying:" + DankersSkyblockMod.SECONDARY_COLOUR + "\n- " + + EnumChatFormatting.GOLD + members + "\n" + + DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------\n")); + Thread.sleep(250); + + for (int i = 0; i < party.size(); i++) { + player.sendChatMessage("/p " + party.get(i)); + Thread.sleep(250); + } + + DankersSkyblockMod.partyList.clear(); + } + catch (InterruptedException e) { + e.printStackTrace(); + } + }).start(); + } +} \ No newline at end of file diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 7bf6ce2..f7ca598 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -411,7 +411,8 @@ public class ConfigHandler { if (!hasKey("colors", "main")) writeStringConfig("colors", "main", EnumChatFormatting.GREEN.toString()); if (!hasKey("colors", "secondary")) writeStringConfig("colors", "secondary", EnumChatFormatting.DARK_GREEN.toString()); - if (!hasKey("colors", "delimiter")) writeStringConfig("colors", "delimiter", EnumChatFormatting.AQUA.toString()); + if (!hasKey("colors", "delimiter")) writeStringConfig("colors", "delimiter", EnumChatFormatting.AQUA.toString() + EnumChatFormatting.STRIKETHROUGH.toString()); + if (!getString("colors", "delimiter").contains(EnumChatFormatting.STRIKETHROUGH.toString())) writeStringConfig("colors", "delimiter", getString("colors", "delimiter") + EnumChatFormatting.STRIKETHROUGH.toString()); if (!hasKey("colors", "error")) writeStringConfig("colors", "error", EnumChatFormatting.RED.toString()); if (!hasKey("colors", "type")) writeStringConfig("colors", "type", EnumChatFormatting.GREEN.toString()); if (!hasKey("colors", "value")) writeStringConfig("colors", "value", EnumChatFormatting.DARK_GREEN.toString()); -- cgit From 87217e662d02187730e1b5209e21f5e1ac970826 Mon Sep 17 00:00:00 2001 From: Kaloyan Draganov Date: Mon, 21 Dec 2020 08:16:05 -0500 Subject: Update ConfigHandler.java --- src/main/java/me/Danker/handlers/ConfigHandler.java | 1 - 1 file changed, 1 deletion(-) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index f7ca598..93425e5 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -412,7 +412,6 @@ public class ConfigHandler { if (!hasKey("colors", "main")) writeStringConfig("colors", "main", EnumChatFormatting.GREEN.toString()); if (!hasKey("colors", "secondary")) writeStringConfig("colors", "secondary", EnumChatFormatting.DARK_GREEN.toString()); if (!hasKey("colors", "delimiter")) writeStringConfig("colors", "delimiter", EnumChatFormatting.AQUA.toString() + EnumChatFormatting.STRIKETHROUGH.toString()); - if (!getString("colors", "delimiter").contains(EnumChatFormatting.STRIKETHROUGH.toString())) writeStringConfig("colors", "delimiter", getString("colors", "delimiter") + EnumChatFormatting.STRIKETHROUGH.toString()); if (!hasKey("colors", "error")) writeStringConfig("colors", "error", EnumChatFormatting.RED.toString()); if (!hasKey("colors", "type")) writeStringConfig("colors", "type", EnumChatFormatting.GREEN.toString()); if (!hasKey("colors", "value")) writeStringConfig("colors", "value", EnumChatFormatting.DARK_GREEN.toString()); -- cgit From 25dd122d60da623fb79073c7d3f9cabf178b7cc3 Mon Sep 17 00:00:00 2001 From: Kaloyan Draganov Date: Wed, 23 Dec 2020 10:34:43 -0500 Subject: Auto Start/Stop Skill Tracker --- src/main/java/me/Danker/DankersSkyblockMod.java | 47 ++++++--- src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- .../java/me/Danker/commands/DankerGuiCommand.java | 1 + .../me/Danker/commands/SkillTrackerCommand.java | 107 +++++++++++---------- .../java/me/Danker/commands/ToggleCommand.java | 11 ++- src/main/java/me/Danker/gui/DankerGui.java | 11 ++- .../java/me/Danker/handlers/ConfigHandler.java | 2 + 7 files changed, 116 insertions(+), 65 deletions(-) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 8688bee..d239e3e 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -103,6 +103,9 @@ public class DankersSkyblockMod static Entity livid = null; public static double cakeTime; + public static List partyList = new ArrayList<>(); + public static List repartyFailList = new ArrayList<>(); + public static final ResourceLocation CAKE_ICON = new ResourceLocation("dsm", "icons/cake.png"); static String[] riddleSolutions = {"The reward is not in my chest!", "At least one of them is lying, and the reward is not in", @@ -159,6 +162,7 @@ public class DankersSkyblockMod static double alchemyXP = 0; public static double alchemyXPGained = 0; static double xpLeft = 0; + static double timeSinceGained = 0; public static String MAIN_COLOUR; public static String SECONDARY_COLOUR; @@ -186,8 +190,6 @@ public class DankersSkyblockMod public static int PET_80_TO_89; public static int PET_90_TO_99; public static int PET_100; - - public static List partyList = new ArrayList<>(); @EventHandler public void init(FMLInitializationEvent event) { @@ -358,7 +360,7 @@ public class DankersSkyblockMod String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); // Reparty command - if (System.currentTimeMillis() / 1000 - RepartyCommand.callTime <= 1.5) { + if (System.currentTimeMillis() / 1000 - RepartyCommand.callTime <= 3) { if (!(message.contains("----") || message.contains("disbanded") || message.contains("seconds to accept") || message.contains("●") || message.contains("Party Members"))) { return; } @@ -367,7 +369,7 @@ public class DankersSkyblockMod Pattern party_start_pattern = Pattern.compile("^Party Members \\((\\d+)\\)$"); Pattern leader_pattern = Pattern.compile("^Party Leader: (?:\\[.+?] )?(\\w+) ●$"); - Pattern members_pattern = Pattern.compile(" (?:\\[.+?] )?(\\w+) ●"); + Pattern members_pattern = Pattern.compile(" (?:\\[.+?] )?(\\w+) ●"); Matcher party_start = party_start_pattern.matcher(message); Matcher leader = leader_pattern.matcher(message); @@ -396,16 +398,30 @@ public class DankersSkyblockMod // Action Bar if (event.type == 2) { - String[] actionBarSections = event.message.getUnformattedText().split(" {3,}"); - for (String section : actionBarSections) { + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + String[] actionBarSections = event.message.getUnformattedText().split(" {3,}"); + + for (String section : actionBarSections) { if (section.contains("+") && section.contains("/") && section.contains("(")) { if (!section.contains("Runecrafting") && !section.contains("Carpentry")) { - int limit = section.contains("Farming") || section.contains("Enchanting") ? 60 : 50; - double currentXP = Double.parseDouble(section.substring(section.indexOf("(") + 1, section.indexOf("/")).replace(",", "")); + if (ToggleCommand.autoSkillTrackerToggled && System.currentTimeMillis() / 1000 - timeSinceGained <= 2) { + if (skillStopwatch.isStarted() && skillStopwatch.isSuspended()) { + skillStopwatch.resume(); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Skill tracker started.")); + } else if (!skillStopwatch.isStarted()) { + skillStopwatch.start(); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Skill tracker started.")); + } + } + timeSinceGained = System.currentTimeMillis() / 1000; + + int limit = section.contains("Farming") || section.contains("Enchanting") ? 60 : 50; + double currentXP = Double.parseDouble(section.substring(section.indexOf("(") + 1, section.indexOf("/")).replace(",", "")); int xpToLevelUp = Integer.parseInt(section.substring(section.indexOf("/") + 1, section.indexOf(")")).replaceAll(",", "")); xpLeft = xpToLevelUp - currentXP; int previousXP = Utils.getPastXpEarned(xpToLevelUp, limit); - double totalXP = currentXP + previousXP; + double totalXP = currentXP + previousXP; + String skill = section.substring(section.indexOf(" ") + 1, section.lastIndexOf(" ")); switch (skill) { case "Farming": @@ -2377,7 +2393,7 @@ public class DankersSkyblockMod Utils.checkForSkyblock(); Utils.checkForDungeons(); } - + if (DisplayCommand.auto && world != null && player != null) { List scoreboard = ScoreboardHandler.getSidebarLines(); boolean found = false; @@ -2691,7 +2707,7 @@ public class DankersSkyblockMod correctTicTacToeButton = new AxisAlignedBB(drawX, drawY, drawZ, drawX + 1, drawY + 1, drawZ + 1); } } - } + } tickAmount = 0; } @@ -3250,6 +3266,7 @@ public class DankersSkyblockMod GuiChest chest = (GuiChest) event.gui; IInventory inventory = ((ContainerChest) containerChest).getLowerChestInventory(); String inventoryName = inventory.getDisplayName().getUnformattedText(); + if (ToggleCommand.swapToPickBlockToggled) { if (inventoryName.startsWith("Chronomatron (") || inventoryName.startsWith("Superpairs (") || inventoryName.startsWith("Ultrasequencer (") || inventoryName.startsWith("What starts with:") || inventoryName.startsWith("Select all the") || inventoryName.startsWith("Navigate the maze!") || inventoryName.startsWith("Correct all the panes!") || inventoryName.startsWith("Click in order!") || inventoryName.startsWith("Harp -")) { if (!pickBlockBindSwapped) { @@ -3271,6 +3288,14 @@ public class DankersSkyblockMod pickBlockBindSwapped = false; } } + + if (ToggleCommand.autoSkillTrackerToggled) { + if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) { + skillStopwatch.suspend(); + mc.thePlayer.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Skill tracker paused.")); + } + } + clickInOrderSlots = new Slot[36]; lastChronomatronRound = 0; chronomatronPattern.clear(); diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index f16f598..d6ce908 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 380086a..d596d65 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -61,6 +61,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[lividsolver][").append(ToggleCommand.lividSolverToggled).append("]\n"); debug.append("[stopsalvagestarred][").append(ToggleCommand.stopSalvageStarredToggled).append("]\n"); debug.append("[notifyslayerslain][").append(ToggleCommand.notifySlayerSlainToggled).append("]\n"); + debug.append("[autoskilltracker][").append(ToggleCommand.autoSkillTrackerToggled).append("]\n"); debug.append("[threemanpuzzle][").append(ToggleCommand.threeManToggled).append("]\n"); debug.append("[oruopuzzle][").append(ToggleCommand.oruoToggled).append("]\n"); debug.append("[blazepuzzle][").append(ToggleCommand.blazeToggled).append("]\n"); diff --git a/src/main/java/me/Danker/commands/SkillTrackerCommand.java b/src/main/java/me/Danker/commands/SkillTrackerCommand.java index 7642070..e341f43 100644 --- a/src/main/java/me/Danker/commands/SkillTrackerCommand.java +++ b/src/main/java/me/Danker/commands/SkillTrackerCommand.java @@ -13,6 +13,7 @@ import org.apache.commons.lang3.time.StopWatch; import java.util.List; public class SkillTrackerCommand extends CommandBase { + public static boolean running = false; @Override public String getCommandName() { @@ -39,55 +40,63 @@ public class SkillTrackerCommand extends CommandBase { @Override public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { - EntityPlayer player = (EntityPlayer) arg0; - - if (arg1.length < 1) { - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); - return; - } - - switch (arg1[0].toLowerCase()) { - case "start": - case "resume": - if (DankersSkyblockMod.skillStopwatch.isStarted() && DankersSkyblockMod.skillStopwatch.isSuspended()) { - DankersSkyblockMod.skillStopwatch.resume(); - } else if (!DankersSkyblockMod.skillStopwatch.isStarted()) { - DankersSkyblockMod.skillStopwatch.start(); - } - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Skill tracker started.")); - break; - case "pause": - case "stop": - if (DankersSkyblockMod.skillStopwatch.isStarted() && !DankersSkyblockMod.skillStopwatch.isSuspended()) { - DankersSkyblockMod.skillStopwatch.suspend(); - } else { - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Skill tracker paused.")); - } - break; - case "reset": - DankersSkyblockMod.skillStopwatch = new StopWatch(); - DankersSkyblockMod.farmingXPGained = 0; - DankersSkyblockMod.miningXPGained = 0; - DankersSkyblockMod.combatXPGained = 0; - DankersSkyblockMod.foragingXPGained = 0; - DankersSkyblockMod.fishingXPGained = 0; - DankersSkyblockMod.enchantingXPGained = 0; - DankersSkyblockMod.alchemyXPGained = 0; - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Skill tracker reset.")); - break; - case "hide": - DankersSkyblockMod.showSkillTracker = false; - ConfigHandler.writeBooleanConfig("misc", "showSkillTracker", false); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Skill tracker hidden.")); - break; - case "show": - DankersSkyblockMod.showSkillTracker = true; - ConfigHandler.writeBooleanConfig("misc", "showSkillTracker", true); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Skill tracker shown.")); - break; - default: + // MULTI THREAD DRIFTING + new Thread(() -> { + EntityPlayer player = (EntityPlayer) arg0; + + if (arg1.length < 1) { player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); - } - } + return; + } + + try { + Thread.sleep(200); + switch (arg1[0].toLowerCase()) { + case "start": + case "resume": + if (DankersSkyblockMod.skillStopwatch.isStarted() && DankersSkyblockMod.skillStopwatch.isSuspended()) { + DankersSkyblockMod.skillStopwatch.resume(); + } else if (!DankersSkyblockMod.skillStopwatch.isStarted()) { + DankersSkyblockMod.skillStopwatch.start(); + } + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Skill tracker started.")); + break; + case "pause": + case "stop": + if (DankersSkyblockMod.skillStopwatch.isStarted() && !DankersSkyblockMod.skillStopwatch.isSuspended()) { + DankersSkyblockMod.skillStopwatch.suspend(); + } else { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Skill tracker paused.")); + } + break; + case "reset": + DankersSkyblockMod.skillStopwatch = new StopWatch(); + DankersSkyblockMod.farmingXPGained = 0; + DankersSkyblockMod.miningXPGained = 0; + DankersSkyblockMod.combatXPGained = 0; + DankersSkyblockMod.foragingXPGained = 0; + DankersSkyblockMod.fishingXPGained = 0; + DankersSkyblockMod.enchantingXPGained = 0; + DankersSkyblockMod.alchemyXPGained = 0; + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Skill tracker reset.")); + break; + case "hide": + DankersSkyblockMod.showSkillTracker = false; + ConfigHandler.writeBooleanConfig("misc", "showSkillTracker", false); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Skill tracker hidden.")); + break; + case "show": + DankersSkyblockMod.showSkillTracker = true; + ConfigHandler.writeBooleanConfig("misc", "showSkillTracker", true); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Skill tracker shown.")); + break; + default: + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); + } + } catch (InterruptedException e) { + e.printStackTrace(); + } + }).start(); + } } diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 15693ef..0054c10 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -41,6 +41,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean swapToPickBlockToggled; public static boolean flowerWeaponsToggled; public static boolean notifySlayerSlainToggled; + public static boolean autoSkillTrackerToggled; // Puzzle Solvers public static boolean threeManToggled; public static boolean oruoToggled; @@ -70,7 +71,7 @@ public class ToggleCommand extends CommandBase implements ICommand { return "/" + getCommandName() + " "; } @@ -88,7 +89,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "flowerweapons", "sceptremessages", "petcolors", "dungeontimer", "golemalerts", "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", "implosionmessages", "healmessages", "caketimer", "lowhealthnotify", - "lividsolver", "stopsalvagestarred", "notifyslayerslain", "threemanpuzzle", "oruopuzzle", "blazepuzzle", + "lividsolver", "stopsalvagestarred", "notifyslayerslain", "autoskilltracker", "threemanpuzzle", "oruopuzzle", "blazepuzzle", "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "watchermessage", "startswithterminal", "selectallterminal", "clickinorderterminal", "blockwrongterminalclicks", "itemframeonsealanterns", "ultrasequencer", "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "list"); @@ -237,6 +238,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "NotifySlayerSlain", notifySlayerSlainToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Notify when slayer slain has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + notifySlayerSlainToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "autoskilltracker": + autoSkillTrackerToggled = !autoSkillTrackerToggled; + ConfigHandler.writeBooleanConfig("toggles", "AutoSkillTracker", autoSkillTrackerToggled); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Auto start/stop skill tracker has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + autoSkillTrackerToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "threemanpuzzle": threeManToggled = !threeManToggled; ConfigHandler.writeBooleanConfig("toggles", "ThreeManPuzzle", threeManToggled); @@ -346,6 +352,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Outline displayed text: " + DankersSkyblockMod.VALUE_COLOUR + outlineTextToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Cake timer: " + DankersSkyblockMod.VALUE_COLOUR + cakeTimerToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Low health notify: " + DankersSkyblockMod.VALUE_COLOUR + lowHealthNotifyToggled + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Auto start/stop skill tracker: " + DankersSkyblockMod.VALUE_COLOUR + autoSkillTrackerToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Livid solver: " + DankersSkyblockMod.VALUE_COLOUR + lividSolverToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Three man puzzle solver: " + DankersSkyblockMod.VALUE_COLOUR + threeManToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Oruo trivia solver: " + DankersSkyblockMod.VALUE_COLOUR + oruoToggled + "\n" + diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 69ccbe4..85780bd 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -59,6 +59,7 @@ public class DankerGui extends GuiScreen { private GuiButton flowerWeapons; private GuiButton pickBlock; private GuiButton notifySlayerSlain; + private GuiButton autoSkillTracker; public DankerGui(int page) { this.page = page; @@ -122,7 +123,8 @@ public class DankerGui extends GuiScreen { watcherReadyMessage = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Display Watcher Ready Message: " + Utils.getColouredBoolean(ToggleCommand.watcherReadyToggled)); splitFishing = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing)); notifySlayerSlain = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Notify when Slayer Slain: " + Utils.getColouredBoolean(ToggleCommand.notifySlayerSlainToggled)); - flowerWeapons = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Prevent Placing FoT/Spirit Sceptre: " + Utils.getColouredBoolean(ToggleCommand.flowerWeaponsToggled)); + flowerWeapons = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Prevent Placing FoT/Spirit Sceptre: " + Utils.getColouredBoolean(ToggleCommand.flowerWeaponsToggled)); + autoSkillTracker = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Auto Start/Stop Skill Tracker: " + Utils.getColouredBoolean(ToggleCommand.autoSkillTrackerToggled)); switch (page) { case 1: @@ -173,7 +175,8 @@ public class DankerGui extends GuiScreen { this.buttonList.add(watcherReadyMessage); this.buttonList.add(splitFishing); this.buttonList.add(notifySlayerSlain); - this.buttonList.add(flowerWeapons); + this.buttonList.add(flowerWeapons); + this.buttonList.add(autoSkillTracker); this.buttonList.add(backPage); break; } @@ -337,6 +340,10 @@ public class DankerGui extends GuiScreen { 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); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 93425e5..1ee1414 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -196,6 +196,7 @@ public class ConfigHandler { if (!hasKey("toggles", "PickBlock")) writeBooleanConfig("toggles", "PickBlock", false); if (!hasKey("toggles", "FlowerWeapons")) writeBooleanConfig("toggles", "FlowerWeapons", false); if (!hasKey("toggles", "NotifySlayerSlain")) writeBooleanConfig("toggles", "NotifySlayerSlain", false); + if (!hasKey("toggles", "AutoSkillTracker")) writeBooleanConfig("toggles", "AutoSkillTracker", false); // Puzzle Solvers if (!hasKey("toggles", "ThreeManPuzzle")) writeBooleanConfig("toggles", "ThreeManPuzzle", false); if (!hasKey("toggles", "OruoPuzzle")) writeBooleanConfig("toggles", "OruoPuzzle", false); @@ -464,6 +465,7 @@ public class ConfigHandler { ToggleCommand.notifySlayerSlainToggled = getBoolean("toggles", "NotifySlayerSlain"); ToggleCommand.swapToPickBlockToggled = getBoolean("toggles", "PickBlock"); ToggleCommand.flowerWeaponsToggled = getBoolean("toggles", "FlowerWeapons"); + ToggleCommand.autoSkillTrackerToggled = getBoolean("toggles", "AutoSkillTracker"); // Puzzle Solvers ToggleCommand.threeManToggled = getBoolean("toggles", "ThreeManPuzzle"); ToggleCommand.oruoToggled = getBoolean("toggles", "OruoPuzzle"); -- cgit From 1d7a5d903a91c87291b5b13d275465e6d00fc13f Mon Sep 17 00:00:00 2001 From: Sychic Date: Sun, 24 Jan 2021 20:47:01 -0500 Subject: Add compatibilty to yield for other reparty commands --- src/main/java/me/Danker/DankersSkyblockMod.java | 62 ++++++++++++---------- .../java/me/Danker/commands/RepartyCommand.java | 34 ++++++------ .../java/me/Danker/handlers/ConfigHandler.java | 3 ++ 3 files changed, 56 insertions(+), 43 deletions(-) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 8285bec..019ffe6 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -15,6 +15,7 @@ import net.minecraft.client.gui.*; import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.client.settings.GameSettings; import net.minecraft.client.settings.KeyBinding; +import net.minecraft.command.ICommand; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.entity.item.EntityItemFrame; @@ -312,36 +313,39 @@ public class DankersSkyblockMod { ClientCommandHandler.instance.registerCommand(new LobbySkillsCommand()); ClientCommandHandler.instance.registerCommand(new DankerGuiCommand()); ClientCommandHandler.instance.registerCommand(new SkillTrackerCommand()); - ClientCommandHandler.instance.registerCommand(new RepartyCommand()); } @EventHandler public void postInit(final FMLPostInitializationEvent event) { Package[] packages = Package.getPackages(); for(Package p : packages){ - DSMLogger.info(p); if(p.getName().startsWith("com.spiderfrog.gadgets") || p.getName().startsWith("com.spiderfrog.oldanimations")){ usingOAM = true; - break; } } System.out.println("OAM detection: " + usingOAM); - usingLabymod = Loader.isModLoaded("labymod"); System.out.println("LabyMod detection: " + usingLabymod); + + if(!ClientCommandHandler.instance.getCommands().containsKey("reparty")) { + ClientCommandHandler.instance.registerCommand(new RepartyCommand()); + } else if (ConfigHandler.getBoolean("commands", "reparty")) { + for(Map.Entry entry : ClientCommandHandler.instance.getCommands().entrySet()) { + if (entry.getKey().equals("reparty") || entry.getKey().equals("rp")) { + entry.setValue(new RepartyCommand()); + } + } + } + } @SubscribeEvent public void onGuiOpenEvent(GuiOpenEvent event){ if(event.gui instanceof GuiMainMenu && usingOAM && !OAMWarning){ - System.out.println("Gui opened: Instance of GuiMainMenu."); if(!(event.gui instanceof WarningGui)){ - System.out.println("No instance of WarningGui"); event.gui = new WarningGuiRedirect(new WarningGui()); OAMWarning = true; - }else{ - System.out.println("Instance of WarningGui"); } } } @@ -500,16 +504,17 @@ public class DankersSkyblockMod { // Inviting if (RepartyCommand.inviting) { if (message.contains("-----")) { - if (RepartyCommand.Delimiter >= RepartyCommand.party.size() * 2 - 1) { - event.setCanceled(true); - RepartyCommand.Delimiter = 0; - System.out.println("Done Inviting!"); - RepartyCommand.inviting = false; - return; - } else { - RepartyCommand.Delimiter++; - event.setCanceled(true); - return; + switch (RepartyCommand.Delimiter) { + case 1: + event.setCanceled(true); + RepartyCommand.Delimiter = 0; + System.out.println("Player Invited!"); + RepartyCommand.inviting = false; + return; + case 0: + RepartyCommand.Delimiter++; + event.setCanceled(true); + return; } } else if (message.endsWith(" to the party! They have 60 seconds to accept.")) { Pattern invitePattern = Pattern.compile("(?:(?:\\[.+?] )?(?:\\w+) invited )(?:\\[.+?] )?(\\w+)"); @@ -527,16 +532,17 @@ public class DankersSkyblockMod { // Fail Inviting if (RepartyCommand.failInviting) { if (message.contains("-----")) { - if (RepartyCommand.Delimiter >= RepartyCommand.repartyFailList.size() * 2 - 1) { - event.setCanceled(true); - RepartyCommand.Delimiter = 0; - System.out.println("Done Inviting!"); - RepartyCommand.inviting = false; - return; - } else { - RepartyCommand.Delimiter++; - event.setCanceled(true); - return; + switch (RepartyCommand.Delimiter) { + case 1: + event.setCanceled(true); + RepartyCommand.Delimiter = 0; + System.out.println("Player Invited!"); + RepartyCommand.inviting = false; + return; + case 0: + RepartyCommand.Delimiter++; + event.setCanceled(true); + return; } } else if (message.endsWith(" to the party! They have 60 seconds to accept.")) { Pattern invitePattern = Pattern.compile("(?:(?:\\[.+?] )?(?:\\w+) invited )(?:\\[.+?] )?(\\w+)"); diff --git a/src/main/java/me/Danker/commands/RepartyCommand.java b/src/main/java/me/Danker/commands/RepartyCommand.java index fd63f39..d436f90 100644 --- a/src/main/java/me/Danker/commands/RepartyCommand.java +++ b/src/main/java/me/Danker/commands/RepartyCommand.java @@ -32,7 +32,6 @@ public class RepartyCommand extends CommandBase implements ICommand { public static boolean failInviting = false; public static List party = new ArrayList<>(); public static List repartyFailList = new ArrayList<>(); - public static List joinList = new ArrayList<>(); public static Thread partyThread = null; @Override @@ -57,6 +56,9 @@ public class RepartyCommand extends CommandBase implements ICommand { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { + if (args.length > 0 && args[0].startsWith("sbe")) { + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("ew imagine using sbe which breaks mojang tos")); + } if (args.length > 0 && (args[0].startsWith("fail") || args[0].equals("f"))) { partyThread = new Thread(() -> { EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; @@ -91,12 +93,8 @@ public class RepartyCommand extends CommandBase implements ICommand { return; } - boolean ghost = args.length > 0 && (args[0].toLowerCase().equals("g") || args[0].toLowerCase().equals("ghost")); - - if(ghost){ - party.clear(); - repartyFailList.clear(); - } + party.clear(); + repartyFailList.clear(); // MULTI THREAD DRIFTING partyThread = new Thread(() -> { @@ -104,12 +102,10 @@ public class RepartyCommand extends CommandBase implements ICommand { try { - if(ghost){ - player.sendChatMessage("/pl"); - gettingParty = true; - while (gettingParty) { - Thread.sleep(10); - } + player.sendChatMessage("/pl"); + gettingParty = true; + while (gettingParty) { + Thread.sleep(10); } if (party.size() == 0) return; player.sendChatMessage("/p disband"); @@ -117,14 +113,22 @@ public class RepartyCommand extends CommandBase implements ICommand { while (disbanding) { Thread.sleep(10); } - player.sendChatMessage("/p " + String.join(" ", party)); +// player.sendChatMessage("/p " + String.join(" ", party)); String members = String.join(EnumChatFormatting.WHITE + "\n- " + EnumChatFormatting.YELLOW, RepartyCommand.party); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------\n" + DankersSkyblockMod.MAIN_COLOUR + "Repartying:" + EnumChatFormatting.WHITE + "\n- " + EnumChatFormatting.YELLOW + members + "\n" + DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------")); - inviting = true; repartyFailList = new ArrayList<>(party); + for (String invitee : party) { + player.sendChatMessage("/p " + invitee); + inviting = true; + while (inviting) { + Thread.sleep(10); + } + Thread.sleep(100); + } +// inviting = true; while (inviting) { Thread.sleep(10); } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 9f11aac..9038218 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -452,6 +452,9 @@ public class ConfigHandler { if (!hasKey("colors", "pet80To89")) writeIntConfig("colors", "pet80To89", 0x5C1F35); // idk weird magenta if (!hasKey("colors", "pet90To99")) writeIntConfig("colors", "pet90To99", 0x9E794E); // Brown if (!hasKey("colors", "pet100")) writeIntConfig("colors", "pet100", 0xF2D249); // Gold + + //Commands + if (!hasKey("commands", "reparty")) writeBooleanConfig("commands", "reparty", false); ToggleCommand.gpartyToggled = getBoolean("toggles", "GParty"); ToggleCommand.coordsToggled = getBoolean("toggles", "Coords"); -- cgit From 50783f6024e876436380303b53dcea7d58d9a1bc Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Mon, 15 Feb 2021 22:27:01 -0500 Subject: Add ultrasequencer, chronomatron, click in order solver colours to config --- src/main/java/me/Danker/DankersSkyblockMod.java | 22 ++++++++++++++-------- .../java/me/Danker/handlers/ConfigHandler.java | 15 +++++++++++++-- 2 files changed, 27 insertions(+), 10 deletions(-) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index c1d3e7f..671b6ab 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -191,6 +191,12 @@ public class DankersSkyblockMod { public static int PET_80_TO_89; public static int PET_90_TO_99; public static int PET_100; + public static int ULTRASEQUENCER_NEXT; + public static int ULTRASEQUENCER_NEXT_TO_NEXT; + public static int CHRONOMATRON_NEXT; + public static int CHRONOMATRON_NEXT_TO_NEXT; + public static int CLICK_IN_ORDER_NEXT; + public static int CLICK_IN_ORDER_NEXT_TO_NEXT; @EventHandler public void init(FMLInitializationEvent event) { @@ -3796,10 +3802,10 @@ public class DankersSkyblockMod { if (ToggleCommand.clickInOrderToggled && displayName.equals("Click in order!")) { Slot slot = invSlots.get(terminalNumberNeeded[1]); - Utils.drawOnSlot(chestSize, slot.xDisplayPosition, slot.yDisplayPosition, new Color(255, 0, 221, 255).getRGB()); + Utils.drawOnSlot(chestSize, slot.xDisplayPosition, slot.yDisplayPosition, CLICK_IN_ORDER_NEXT + 0xFF000000); Slot nextSlot = invSlots.get(terminalNumberNeeded[3]); if (nextSlot != slot && nextSlot.getSlotIndex() != 0) { - Utils.drawOnSlot(chestSize, nextSlot.xDisplayPosition, nextSlot.yDisplayPosition, new Color(11, 239, 231, 255).getRGB()); + Utils.drawOnSlot(chestSize, nextSlot.xDisplayPosition, nextSlot.yDisplayPosition, CLICK_IN_ORDER_NEXT_TO_NEXT + 0xFF000000); } } @@ -3817,12 +3823,12 @@ public class DankersSkyblockMod { } if (clickInOrderSlots[lastUltraSequencerClicked] != null) { Slot nextSlot = clickInOrderSlots[lastUltraSequencerClicked]; - Utils.drawOnSlot(chestSize, nextSlot.xDisplayPosition, nextSlot.yDisplayPosition, 0xE540FF40); + Utils.drawOnSlot(chestSize, nextSlot.xDisplayPosition, nextSlot.yDisplayPosition, ULTRASEQUENCER_NEXT + 0xE5000000); } if (lastUltraSequencerClicked + 1 < clickInOrderSlots.length) { if (clickInOrderSlots[lastUltraSequencerClicked + 1] != null) { Slot nextSlot = clickInOrderSlots[lastUltraSequencerClicked + 1]; - Utils.drawOnSlot(chestSize, nextSlot.xDisplayPosition, nextSlot.yDisplayPosition, 0xD740DAE6); + Utils.drawOnSlot(chestSize, nextSlot.xDisplayPosition, nextSlot.yDisplayPosition, ULTRASEQUENCER_NEXT_TO_NEXT + 0xD7000000); } } } @@ -3855,15 +3861,15 @@ public class DankersSkyblockMod { if (chronomatronMouseClicks + 1 < chronomatronPattern.size()) { if (chronomatronPattern.get(chronomatronMouseClicks).equals(chronomatronPattern.get(chronomatronMouseClicks + 1))) { if (glass.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks))) { - Utils.drawOnSlot(chestSize, glassSlot.xDisplayPosition, glassSlot.yDisplayPosition, 0xE540FF40); + Utils.drawOnSlot(chestSize, glassSlot.xDisplayPosition, glassSlot.yDisplayPosition, CHRONOMATRON_NEXT + 0xE5000000); } } else if (glass.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks))) { - Utils.drawOnSlot(chestSize, glassSlot.xDisplayPosition, glassSlot.yDisplayPosition, 0xE540FF40); + Utils.drawOnSlot(chestSize, glassSlot.xDisplayPosition, glassSlot.yDisplayPosition, CHRONOMATRON_NEXT + 0xE5000000); } else if (glass.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks + 1))) { - Utils.drawOnSlot(chestSize, glassSlot.xDisplayPosition, glassSlot.yDisplayPosition, 0xBE40DAE6); + Utils.drawOnSlot(chestSize, glassSlot.xDisplayPosition, glassSlot.yDisplayPosition, CHRONOMATRON_NEXT_TO_NEXT + 0XBE000000); } } else if (glass.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks))) { - Utils.drawOnSlot(chestSize, glassSlot.xDisplayPosition, glassSlot.yDisplayPosition, 0xE540FF40); + Utils.drawOnSlot(chestSize, glassSlot.xDisplayPosition, glassSlot.yDisplayPosition, CHRONOMATRON_NEXT + 0xE5000000); } } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 9038218..05c6804 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -394,7 +394,6 @@ public class ConfigHandler { if (!hasKey("misc", "showSkillTracker")) writeBooleanConfig("misc", "showSkillTracker", false); if (!hasKey("misc", "firstLaunch")) writeBooleanConfig("misc", "firstLaunch", true); - ScaledResolution scaled = new ScaledResolution(Minecraft.getMinecraft()); int height = scaled.getScaledHeight(); if (!hasKey("locations", "coordsX")) writeIntConfig("locations", "coordsX", 5); @@ -452,8 +451,14 @@ public class ConfigHandler { if (!hasKey("colors", "pet80To89")) writeIntConfig("colors", "pet80To89", 0x5C1F35); // idk weird magenta if (!hasKey("colors", "pet90To99")) writeIntConfig("colors", "pet90To99", 0x9E794E); // Brown if (!hasKey("colors", "pet100")) writeIntConfig("colors", "pet100", 0xF2D249); // Gold + if (!hasKey("colors", "ultrasequencerNext")) writeIntConfig("colors", "ultrasequencerNext", 0x40FF40); + if (!hasKey("colors", "ultrasequencerNextToNext")) writeIntConfig("colors", "ultrasequencerNextToNext", 0x40DAE6); + if (!hasKey("colors", "chronomatronNext")) writeIntConfig("colors", "chronomatronNext", 0x40FF40); + if (!hasKey("colors", "chronomatronNextToNext")) writeIntConfig("colors", "chronomatronNextToNext", 0x40DAE6); + if (!hasKey("colors", "clickInOrderNext")) writeIntConfig("colors", "clickInOrderNext", 0xFF00DD); + if (!hasKey("colors", "clickInOrderNextToNext")) writeIntConfig("colors", "clickInOrderNextToNext", 0x0BEFE7); - //Commands + // Commands if (!hasKey("commands", "reparty")) writeBooleanConfig("commands", "reparty", false); ToggleCommand.gpartyToggled = getBoolean("toggles", "GParty"); @@ -740,6 +745,12 @@ public class ConfigHandler { DankersSkyblockMod.PET_80_TO_89 = getInt("colors", "pet80To89"); DankersSkyblockMod.PET_90_TO_99 = getInt("colors", "pet90To99"); DankersSkyblockMod.PET_100 = getInt("colors", "pet100"); + DankersSkyblockMod.ULTRASEQUENCER_NEXT = getInt("colors", "ultrasequencerNext"); + DankersSkyblockMod.ULTRASEQUENCER_NEXT_TO_NEXT = getInt("colors", "ultrasequencerNextToNext"); + DankersSkyblockMod.CHRONOMATRON_NEXT = getInt("colors", "chronomatronNext"); + DankersSkyblockMod.CHRONOMATRON_NEXT_TO_NEXT = getInt("colors", "chronomatronNextToNext"); + DankersSkyblockMod.CLICK_IN_ORDER_NEXT = getInt("colors", "clickInOrderNext"); + DankersSkyblockMod.CLICK_IN_ORDER_NEXT_TO_NEXT = getInt("colors", "clickInOrderNextToNext"); } } -- cgit From e5867ce13151e6689b5b4097fef610fe30650607 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Mon, 22 Feb 2021 18:03:59 -0500 Subject: Remove broken feature --- src/main/java/me/Danker/DankersSkyblockMod.java | 33 ---------------------- src/main/java/me/Danker/commands/DHelpCommand.java | 2 +- .../java/me/Danker/commands/DankerGuiCommand.java | 1 - .../java/me/Danker/commands/ToggleCommand.java | 9 ++---- src/main/java/me/Danker/gui/DankerGui.java | 11 ++------ .../java/me/Danker/handlers/ConfigHandler.java | 3 -- 6 files changed, 5 insertions(+), 54 deletions(-) (limited to 'src/main/java/me/Danker/handlers') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 69dc6ee..183736b 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -3217,39 +3217,6 @@ public class DankersSkyblockMod { ItemStack item = event.entityPlayer.getHeldItem(); if (item == null) return; - if (event.action == PlayerInteractEvent.Action.LEFT_CLICK_BLOCK) { - - Block block = Minecraft.getMinecraft().theWorld.getBlockState(event.pos).getBlock(); - - if (ToggleCommand.blockBreakingFarmsToggled) { - ArrayList tools = new ArrayList<>(Arrays.asList( - Items.wooden_hoe, - Items.stone_hoe, - Items.iron_hoe, - Items.golden_hoe, - Items.diamond_hoe, - Items.wooden_axe, - Items.stone_axe, - Items.iron_axe, - Items.golden_axe, - Items.diamond_axe - )); - - ArrayList farmBlocks = new ArrayList<>(Arrays.asList( - Blocks.dirt, - Blocks.farmland, - Blocks.carpet, - Blocks.glowstone, - Blocks.sea_lantern - )); - - if (tools.contains(item.getItem()) && farmBlocks.contains(block)) { - event.setCanceled(true); - } - - } - } - if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_AIR) { if (ToggleCommand.aotdToggled && item.getDisplayName().contains("Aspect of the Dragons")) { event.setCanceled(true); diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index dd5395c..bcaf8b0 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 119bed8..a6b200f 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -63,7 +63,6 @@ public class DankerGuiCommand extends CommandBase { debug.append("[notifyslayerslain][").append(ToggleCommand.notifySlayerSlainToggled).append("]\n"); debug.append("[necronnotifications][").append(ToggleCommand.necronNotificationsToggled).append("]\n"); debug.append("[bonzotimer][").append(ToggleCommand.bonzoTimerToggled).append("]\n"); - debug.append("[blockbreakingfarms][").append(ToggleCommand.blockBreakingFarmsToggled).append("]\n"); debug.append("[autoskilltracker][").append(ToggleCommand.autoSkillTrackerToggled).append("]\n"); debug.append("[threemanpuzzle][").append(ToggleCommand.threeManToggled).append("]\n"); debug.append("[oruopuzzle][").append(ToggleCommand.oruoToggled).append("]\n"); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 0aafe1b..b632abc 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -47,7 +47,6 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean notifySlayerSlainToggled; public static boolean necronNotificationsToggled; public static boolean bonzoTimerToggled; - public static boolean blockBreakingFarmsToggled; public static boolean autoSkillTrackerToggled; // Puzzle Solvers public static boolean threeManToggled; @@ -79,7 +78,7 @@ public class ToggleCommand extends CommandBase implements ICommand { return "/" + getCommandName() + " "; } @@ -98,7 +97,7 @@ public class ToggleCommand extends CommandBase implements ICommand { "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", "implosionmessages", "healmessages", "cooldownmessages", "manamessages", "caketimer", "lowhealthnotify", "autoskilltracker", "lividsolver", "stopsalvagestarred", "notifyslayerslain", "necronnotifications", - "bonzotimer", "blockbreakingfarms", "threemanpuzzle", "oruopuzzle", "blazepuzzle", + "bonzotimer", "threemanpuzzle", "oruopuzzle", "blazepuzzle", "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "watchermessage", "startswithterminal", "selectallterminal", "clickinorderterminal", "blockwrongterminalclicks", "itemframeonsealanterns", "ultrasequencer", "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "list"); @@ -267,10 +266,6 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "BonzoTimer", bonzoTimerToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Bonzo's Mask timer has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + necronNotificationsToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; - case "blockbreakingfarms": - blockBreakingFarmsToggled = !blockBreakingFarmsToggled; - ConfigHandler.writeBooleanConfig("toggles", "BlockBreakingFarms", blockBreakingFarmsToggled); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Prevent breaking farms has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + necronNotificationsToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); case "autoskilltracker": autoSkillTrackerToggled = !autoSkillTrackerToggled; ConfigHandler.writeBooleanConfig("toggles", "AutoSkillTracker", autoSkillTrackerToggled); diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 57d0292..90aa5e5 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -65,7 +65,6 @@ public class DankerGui extends GuiScreen { private GuiButton notifySlayerSlain; private GuiButton necronNotifications; private GuiButton bonzoTimer; - private GuiButton blockBreakingFarms; private GuiButton autoSkillTracker; public DankerGui(int page) { @@ -136,8 +135,7 @@ public class DankerGui extends GuiScreen { //Page 6 necronNotifications = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Necron Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled)); bonzoTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Bonzo's Mask Timer: " + Utils.getColouredBoolean(ToggleCommand.bonzoTimerToggled)); - blockBreakingFarms = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Prevent Breaking Farms: " + Utils.getColouredBoolean(ToggleCommand.blockBreakingFarmsToggled)); - autoSkillTracker = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Auto Start/Stop Skill Tracker: " + Utils.getColouredBoolean(ToggleCommand.autoSkillTrackerToggled)); + autoSkillTracker = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Auto Start/Stop Skill Tracker: " + Utils.getColouredBoolean(ToggleCommand.autoSkillTrackerToggled)); switch (page) { case 1: @@ -195,9 +193,8 @@ public class DankerGui extends GuiScreen { this.buttonList.add(backPage); break; case 6: - this.buttonList.add(necronNotifications); + this.buttonList.add(necronNotifications); this.buttonList.add(bonzoTimer); - this.buttonList.add(blockBreakingFarms); this.buttonList.add(autoSkillTracker); this.buttonList.add(backPage); break; @@ -370,10 +367,6 @@ public class DankerGui extends GuiScreen { ToggleCommand.bonzoTimerToggled = !ToggleCommand.bonzoTimerToggled; ConfigHandler.writeBooleanConfig("toggles", "BonzoTimer", ToggleCommand.bonzoTimerToggled); bonzoTimer.displayString = "Bonzo's Mask Timer: " + Utils.getColouredBoolean(ToggleCommand.bonzoTimerToggled); - } else if (button == blockBreakingFarms) { - ToggleCommand.blockBreakingFarmsToggled = !ToggleCommand.blockBreakingFarmsToggled; - ConfigHandler.writeBooleanConfig("toggles", "BlockBreakingFarms", ToggleCommand.blockBreakingFarmsToggled); - blockBreakingFarms.displayString = "Prevent Breaking Farms: " + Utils.getColouredBoolean(ToggleCommand.blockBreakingFarmsToggled); } else if (button == pickBlock) { ToggleCommand.swapToPickBlockToggled = !ToggleCommand.swapToPickBlockToggled; ConfigHandler.writeBooleanConfig("toggles", "PickBlock", ToggleCommand.swapToPickBlockToggled); diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 05c6804..d5ab40b 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -205,7 +205,6 @@ public class ConfigHandler { if (!hasKey("toggles", "NotifySlayerSlain")) writeBooleanConfig("toggles", "NotifySlayerSlain", false); if (!hasKey("toggles", "NecronNotifications")) writeBooleanConfig("toggles", "NecronNotifications", false); if (!hasKey("toggles", "BonzoTimer")) writeBooleanConfig("toggles", "BonzoTimer", false); - if (!hasKey("toggles", "BlockBreakingFarms")) writeBooleanConfig("toggles", "BlockBreakingFarms", false); if (!hasKey("toggles", "AutoSkillTracker")) writeBooleanConfig("toggles", "AutoSkillTracker", false); // Puzzle Solvers if (!hasKey("toggles", "ThreeManPuzzle")) writeBooleanConfig("toggles", "ThreeManPuzzle", false); @@ -225,7 +224,6 @@ public class ConfigHandler { if (!hasKey("toggles", "Superpairs")) writeBooleanConfig("toggles", "Superpairs", false); if (!hasKey("toggles", "HideTooltipsInExperimentAddons")) writeBooleanConfig("toggles", "HideTooltipsInExperimentAddons", false); - if (!hasKey("api", "APIKey")) writeStringConfig("api", "APIKey", ""); // Wolf Loot @@ -493,7 +491,6 @@ public class ConfigHandler { ToggleCommand.notifySlayerSlainToggled = getBoolean("toggles", "NotifySlayerSlain"); ToggleCommand.necronNotificationsToggled = getBoolean("toggles", "NecronNotifications"); ToggleCommand.bonzoTimerToggled = getBoolean("toggles", "BonzoTimer"); - ToggleCommand.blockBreakingFarmsToggled = getBoolean("toggles", "BlockBreakingFarms"); ToggleCommand.swapToPickBlockToggled = getBoolean("toggles", "PickBlock"); ToggleCommand.flowerWeaponsToggled = getBoolean("toggles", "FlowerWeapons"); ToggleCommand.autoSkillTrackerToggled = getBoolean("toggles", "AutoSkillTracker"); -- cgit