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') 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 f04296de38493e1eb00a9e6351a0b821b3c0fff1 Mon Sep 17 00:00:00 2001 From: Sychic Date: Fri, 11 Dec 2020 19:15:20 -0500 Subject: resolve conflicts --- README.md | 2 +- src/main/java/me/Danker/DankersSkyblockMod.java | 2 +- .../java/me/Danker/commands/ToggleCommand.java | 24 +++++++++++----------- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src/main/java') diff --git a/README.md b/README.md index b07a462..0d794cb 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,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/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 7e67d6c..c8eaff5 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -474,7 +474,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); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index b94bc16..d9a5805 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -66,10 +66,10 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName() + " "; + "aotd/lividdagger/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/" + + "outlinetext/midasstaffmessages/implosionmessages/healmessages/cooldownmessages/manamessages/caketimer/lowhealthnotify/" + + "lividsolver/stopsalvagestarred/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/waterpuzzle/tictactoepuzzle/" + + "watchermessage/startswithterminal/selectallterminal/itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>"; } @Override @@ -81,14 +81,14 @@ public class ToggleCommand extends CommandBase implements ICommand { public List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", - "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "lividdagger", - "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"); + "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "lividdagger", + "sceptremessages", "petcolors", "dungeontimer", "golemalerts", + "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", + "implosionmessages", "healmessages", "cooldownmessages", "manamessages", "caketimer", "lowhealthnotify", + "lividsolver", "stopsalvagestarred", "threemanpuzzle", "oruopuzzle", "blazepuzzle", + "creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "watchermessage", "startswithterminal", + "selectallterminal", "itemframeonsealanterns", "ultrasequencer", + "chronomatron", "superpairs", "hidetooltipsinaddons", "pickblock", "list"); } return null; } -- cgit From ca385ba25b6c086aad2908129f75dddebe18abd9 Mon Sep 17 00:00:00 2001 From: Sychic Date: Sun, 13 Dec 2020 17:12:52 -0500 Subject: Add danker gui for new features. --- src/main/java/me/Danker/gui/DankerGui.java | 66 +++++++++++++++++++----------- 1 file changed, 41 insertions(+), 25 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 613e968..2b83511 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -39,18 +39,22 @@ public class DankerGui extends GuiScreen { private GuiButton chatMaddox; private GuiButton spiritBearAlert; private GuiButton aotd; - private GuiButton lividDagger; - private GuiButton sceptreMessages; - private GuiButton midasStaffMessages; - private GuiButton implosionMessages; - private GuiButton healMessages; private GuiButton petColours; - private GuiButton dungeonTimer; private GuiButton golemAlerts; private GuiButton expertiseLore; private GuiButton skill50Display; private GuiButton outlineText; private GuiButton cakeTimer; + // Chat Messages + private GuiButton lividDagger; + private GuiButton sceptreMessages; + private GuiButton midasStaffMessages; + private GuiButton implosionMessages; + private GuiButton healMessages; + private GuiButton cooldownMessages; + private GuiButton manaMessages; + //Dungeons + private GuiButton dungeonTimer; private GuiButton lowHealthNotify; private GuiButton lividSolver; private GuiButton stopSalvageStarred; @@ -91,32 +95,34 @@ public class DankerGui extends GuiScreen { 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)); + chatMaddox = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Click On-Screen to Open Maddox: " + Utils.getColouredBoolean(ToggleCommand.chatMaddoxToggled)); cakeTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Cake Timer: " + Utils.getColouredBoolean(ToggleCommand.cakeTimerToggled)); skill50Display = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Display Progress To Skill Level 50: " + Utils.getColouredBoolean(ToggleCommand.skill50DisplayToggled)); slayerCount = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Count Total 20% Drops: " + Utils.getColouredBoolean(ToggleCommand.slayerCountTotal)); aotd = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Disable AOTD Ability: " + Utils.getColouredBoolean(ToggleCommand.aotdToggled)); lividDagger = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Disable Livid Dagger Ability: " + Utils.getColouredBoolean(ToggleCommand.lividDaggerToggled)); // Page 3 - chatMaddox = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Click On-Screen to Open Maddox: " + Utils.getColouredBoolean(ToggleCommand.chatMaddoxToggled)); - gparty = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Guild Party Notifications: " + Utils.getColouredBoolean(ToggleCommand.gpartyToggled)); - spiritBearAlert = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Spirit Bear Spawn Alerts: " + Utils.getColouredBoolean(ToggleCommand.spiritBearAlerts)); - sceptreMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Spirit Sceptre Messages: " + Utils.getColouredBoolean(ToggleCommand.sceptreMessages)); - midasStaffMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Midas Staff Messages: " + Utils.getColouredBoolean(ToggleCommand.midasStaffMessages)); - implosionMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Implosion Messages: " + Utils.getColouredBoolean(ToggleCommand.implosionMessages)); - healMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Heal Messages: " + Utils.getColouredBoolean(ToggleCommand.healMessages)); + spiritBearAlert = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Spirit Bear Spawn Alerts: " + Utils.getColouredBoolean(ToggleCommand.spiritBearAlerts)); + sceptreMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Spirit Sceptre Messages: " + Utils.getColouredBoolean(ToggleCommand.sceptreMessages)); + midasStaffMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Midas Staff Messages: " + Utils.getColouredBoolean(ToggleCommand.midasStaffMessages)); + implosionMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Implosion Messages: " + Utils.getColouredBoolean(ToggleCommand.implosionMessages)); + healMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Heal Messages: " + Utils.getColouredBoolean(ToggleCommand.healMessages)); + cooldownMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Cooldown Messages: " + Utils.getColouredBoolean(ToggleCommand.cooldownMessages)); + manaMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Mana Messages: " + Utils.getColouredBoolean((ToggleCommand.manaMessages))); // Page 4 goldenEnch = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Golden T10/T6/T4 Enchantments: " + Utils.getColouredBoolean(ToggleCommand.goldenToggled)); petColours = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Colour Pet Backgrounds: " + Utils.getColouredBoolean(ToggleCommand.petColoursToggled)); expertiseLore = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Expertise Kills In Lore: " + Utils.getColouredBoolean(ToggleCommand.expertiseLoreToggled)); - lividSolver = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Find Correct Livid: " + Utils.getColouredBoolean(ToggleCommand.lividSolverToggled)); + gparty = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Guild Party Notifications: " + Utils.getColouredBoolean(ToggleCommand.gpartyToggled)); golemAlerts = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Alert When Golem Spawns: " + Utils.getColouredBoolean(ToggleCommand.golemAlertToggled)); rngesusAlert = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "RNGesus Alerts: " + Utils.getColouredBoolean(ToggleCommand.rngesusAlerts)); - lowHealthNotify = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Low Health Notifications: " + Utils.getColouredBoolean(ToggleCommand.lowHealthNotifyToggled)); + splitFishing = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing)); // 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)); + lowHealthNotify = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Low Health Notifications: " + Utils.getColouredBoolean(ToggleCommand.lowHealthNotifyToggled)); + lividSolver = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Find Correct Livid: " + Utils.getColouredBoolean(ToggleCommand.lividSolverToggled)); + dungeonTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Display Dungeon Timers: " + Utils.getColouredBoolean(ToggleCommand.dungeonTimerToggled)); + stopSalvageStarred = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Stop Salvaging Starred Items: " + Utils.getColouredBoolean(ToggleCommand.stopSalvageStarredToggled)); + watcherReadyMessage = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Display Watcher Ready Message: " + Utils.getColouredBoolean(ToggleCommand.watcherReadyToggled)); switch (page) { case 1: this.buttonList.add(changeDisplay); @@ -130,7 +136,7 @@ public class DankerGui extends GuiScreen { break; case 2: this.buttonList.add(coords); - this.buttonList.add(dungeonTimer); + this.buttonList.add(chatMaddox); this.buttonList.add(cakeTimer); this.buttonList.add(skill50Display); this.buttonList.add(slayerCount); @@ -140,13 +146,13 @@ public class DankerGui extends GuiScreen { this.buttonList.add(backPage); break; case 3: - this.buttonList.add(chatMaddox); - this.buttonList.add(gparty); this.buttonList.add(spiritBearAlert); this.buttonList.add(sceptreMessages); this.buttonList.add(midasStaffMessages); this.buttonList.add(implosionMessages); this.buttonList.add(healMessages); + this.buttonList.add(cooldownMessages); + this.buttonList.add(manaMessages); this.buttonList.add(nextPage); this.buttonList.add(backPage); break; @@ -154,17 +160,19 @@ public class DankerGui extends GuiScreen { this.buttonList.add(goldenEnch); this.buttonList.add(petColours); this.buttonList.add(expertiseLore); - this.buttonList.add(lividSolver); + this.buttonList.add(gparty); this.buttonList.add(golemAlerts); this.buttonList.add(rngesusAlert); - this.buttonList.add(lowHealthNotify); + this.buttonList.add(splitFishing); this.buttonList.add(nextPage); this.buttonList.add(backPage); break; case 5: + this.buttonList.add(lowHealthNotify); + this.buttonList.add(lividSolver); + this.buttonList.add(dungeonTimer); this.buttonList.add(stopSalvageStarred); this.buttonList.add(watcherReadyMessage); - this.buttonList.add(splitFishing); this.buttonList.add(backPage); break; } @@ -297,6 +305,14 @@ public class DankerGui extends GuiScreen { ToggleCommand.healMessages = !ToggleCommand.healMessages; ConfigHandler.writeBooleanConfig("toggles", "HealMessages", ToggleCommand.healMessages); healMessages.displayString = "Heal Messages: " + Utils.getColouredBoolean(ToggleCommand.healMessages); + } else if (button == cooldownMessages) { + ToggleCommand.cooldownMessages = !ToggleCommand.cooldownMessages; + ConfigHandler.writeBooleanConfig("toggles", "cooldownMessages", ToggleCommand.cooldownMessages); + cooldownMessages.displayString = "Cooldown Messages: " + Utils.getColouredBoolean(ToggleCommand.cooldownMessages); + } else if (button == manaMessages) { + ToggleCommand.manaMessages = !ToggleCommand.manaMessages; + ConfigHandler.writeBooleanConfig("toggles", "manaMessages", ToggleCommand.manaMessages); + manaMessages.displayString = "Mana Messages: " + Utils.getColouredBoolean(ToggleCommand.manaMessages); } else if (button == lowHealthNotify) { ToggleCommand.lowHealthNotifyToggled = !ToggleCommand.lowHealthNotifyToggled; ConfigHandler.writeBooleanConfig("toggles", "LowHealthNotify", ToggleCommand.lowHealthNotifyToggled); -- cgit From ec82c3fa2aa6dd364a1810c36b3f8c1bfa947185 Mon Sep 17 00:00:00 2001 From: Sychic Date: Sun, 13 Dec 2020 17:16:55 -0500 Subject: I forgot my own capitalization... --- src/main/java/me/Danker/gui/DankerGui.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 2b83511..2a77702 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -307,11 +307,11 @@ public class DankerGui extends GuiScreen { healMessages.displayString = "Heal Messages: " + Utils.getColouredBoolean(ToggleCommand.healMessages); } else if (button == cooldownMessages) { ToggleCommand.cooldownMessages = !ToggleCommand.cooldownMessages; - ConfigHandler.writeBooleanConfig("toggles", "cooldownMessages", ToggleCommand.cooldownMessages); + ConfigHandler.writeBooleanConfig("toggles", "CooldownMessages", ToggleCommand.cooldownMessages); cooldownMessages.displayString = "Cooldown Messages: " + Utils.getColouredBoolean(ToggleCommand.cooldownMessages); } else if (button == manaMessages) { ToggleCommand.manaMessages = !ToggleCommand.manaMessages; - ConfigHandler.writeBooleanConfig("toggles", "manaMessages", ToggleCommand.manaMessages); + ConfigHandler.writeBooleanConfig("toggles", "ManaMessages", ToggleCommand.manaMessages); manaMessages.displayString = "Mana Messages: " + Utils.getColouredBoolean(ToggleCommand.manaMessages); } else if (button == lowHealthNotify) { ToggleCommand.lowHealthNotifyToggled = !ToggleCommand.lowHealthNotifyToggled; -- cgit From 4b1addfd3d47085811693764c15a7dfafd443c6c Mon Sep 17 00:00:00 2001 From: Sychic Date: Thu, 17 Dec 2020 04:52:36 -0500 Subject: Warning for Spiderfrog's old animations mod. --- src/main/java/me/Danker/DankersSkyblockMod.java | 32 ++++++++++-- src/main/java/me/Danker/gui/WarningGui.java | 61 ++++++++++++++++++++++ .../java/me/Danker/gui/WarningGuiRedirect.java | 28 ++++++++++ 3 files changed, 118 insertions(+), 3 deletions(-) create mode 100644 src/main/java/me/Danker/gui/WarningGui.java create mode 100644 src/main/java/me/Danker/gui/WarningGuiRedirect.java (limited to 'src/main/java') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index b7c853d..1023cdb 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -1,5 +1,6 @@ package me.Danker; +import akka.event.Logging; import com.google.gson.JsonObject; import me.Danker.commands.*; import me.Danker.gui.*; @@ -9,9 +10,7 @@ import me.Danker.utils.Utils; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiChat; -import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.gui.*; import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.client.settings.GameSettings; import net.minecraft.client.settings.KeyBinding; @@ -68,6 +67,7 @@ import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; import java.awt.*; +import java.net.URLDecoder; import java.text.NumberFormat; import java.util.List; import java.util.*; @@ -98,6 +98,8 @@ public class DankersSkyblockMod static double lastMaddoxTime = 0; static KeyBinding[] keyBindings = new KeyBinding[2]; static boolean usingLabymod = false; + static boolean usingOAM = false; + static boolean OAMWarning = false; public static String guiToOpen = null; static boolean foundLivid = false; static Entity livid = null; @@ -305,9 +307,33 @@ public class DankersSkyblockMod @EventHandler public void postInit(final FMLPostInitializationEvent event) { + Package[] packages = Package.getPackages(); + for(Package p : packages){ + if(p.getName().startsWith("com.spiderfrog.gadgets")){ + usingOAM = true; + break; + } + } + System.out.println("OAM detection: " + usingOAM); + + usingLabymod = Loader.isModLoaded("labymod"); System.out.println("LabyMod detection: " + usingLabymod); } + + @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"); + } + } + } // Update checker @SubscribeEvent diff --git a/src/main/java/me/Danker/gui/WarningGui.java b/src/main/java/me/Danker/gui/WarningGui.java new file mode 100644 index 0000000..63b4710 --- /dev/null +++ b/src/main/java/me/Danker/gui/WarningGui.java @@ -0,0 +1,61 @@ +package me.Danker.gui; + +import akka.event.Logging; +import me.Danker.handlers.TextRenderer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiLabel; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; + +import javax.xml.soap.Text; +import java.util.ArrayList; +import java.util.List; + +public class WarningGui extends GuiScreen { + private GuiButton close; + + public WarningGui(){ + + } + + @Override + public boolean doesGuiPauseGame() { + return false; + } + + @Override + public void initGui() { + super.initGui(); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int height = sr.getScaledHeight(); + int width = sr.getScaledWidth(); + + close = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Close"); + + this.buttonList.add(close); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + String text0 = "§cWARNING!§0"; + int text0Width = mc.fontRendererObj.getStringWidth(text0); + new TextRenderer(mc, text0, (int)(width * 0.45) - text0Width / 2, (int) (height * 0.1), 2 ); + String text1 = "You are using SpiderFrog's Old Animations mod."; + int text1Width = mc.fontRendererObj.getStringWidth(text1); + new TextRenderer(mc, text1, width / 2 - text1Width / 2, (int) (height * 0.3), 1D ); + String text2 = "This mod breaks Danker's Skyblock Mod."; + int text2Width = mc.fontRendererObj.getStringWidth(text2); + new TextRenderer(mc, text2, width / 2 - text2Width / 2, (int) (height * 0.4), 1D); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + @Override + public void actionPerformed(GuiButton button){ + if(button == close) { + Minecraft.getMinecraft().displayGuiScreen(null); + } + } +} diff --git a/src/main/java/me/Danker/gui/WarningGuiRedirect.java b/src/main/java/me/Danker/gui/WarningGuiRedirect.java new file mode 100644 index 0000000..78e6f18 --- /dev/null +++ b/src/main/java/me/Danker/gui/WarningGuiRedirect.java @@ -0,0 +1,28 @@ +package me.Danker.gui; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiMainMenu; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; + +public class WarningGuiRedirect extends GuiMainMenu { + public GuiScreen guiToShow; + private GuiButton close; + + protected void keyTyped(char par1, int par2){} + public WarningGuiRedirect(GuiScreen g){ + guiToShow = g; + } + + public void initGui(){ + super.initGui(); + } + + + public void drawScreen(int par1, int par2, float par3){ + super.drawScreen(par1, par2, par3); + + mc.displayGuiScreen(guiToShow); + } +} -- cgit From 2a43011799565bd03b489291272c5b0ff69b3644 Mon Sep 17 00:00:00 2001 From: Sychic Date: Thu, 17 Dec 2020 13:57:36 -0500 Subject: secrets found --- src/main/java/me/Danker/commands/DungeonsCommand.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/me/Danker/commands/DungeonsCommand.java b/src/main/java/me/Danker/commands/DungeonsCommand.java index bdc1403..f557b93 100644 --- a/src/main/java/me/Danker/commands/DungeonsCommand.java +++ b/src/main/java/me/Danker/commands/DungeonsCommand.java @@ -84,6 +84,14 @@ public class DungeonsCommand extends CommandBase { player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "This player has not played dungeons.")); return; } + + String playerURL = "https://api.hypixel.net/player?uuid=" + uuid + "&key=" + key; + System.out.println("Fetching player data..."); + JsonObject playerResponse = APIHandler.getResponse(playerURL); + if(!playerResponse.get("success").getAsBoolean()){ + String reason = playerResponse.get("cause").getAsString(); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "This player has not played on Hypixel.")); + } double catacombs = Utils.xpToDungeonsLevel(dungeonsObject.get("dungeon_types").getAsJsonObject().get("catacombs").getAsJsonObject().get("experience").getAsDouble()); double healer = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("healer").getAsJsonObject().get("experience").getAsDouble()); @@ -92,6 +100,7 @@ public class DungeonsCommand extends CommandBase { double archer = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("archer").getAsJsonObject().get("experience").getAsDouble()); double tank = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("tank").getAsJsonObject().get("experience").getAsDouble()); String selectedClass = Utils.capitalizeString(dungeonsObject.get("selected_dungeon_class").getAsString()); + int secrets = playerResponse.get("player").getAsJsonObject().get("achievements").getAsJsonObject().get("skyblock_treasure_hunter").getAsInt(); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" + EnumChatFormatting.RED + " Catacombs Level: " + catacombs + "\n" + @@ -100,7 +109,8 @@ public class DungeonsCommand extends CommandBase { EnumChatFormatting.LIGHT_PURPLE + " Mage Level: " + mage + "\n" + EnumChatFormatting.RED + " Berserk Level: " + berserk + "\n" + EnumChatFormatting.GREEN + " Archer Level: " + archer + "\n" + - EnumChatFormatting.BLUE + " Tank Level: " + tank + "\n" + + EnumChatFormatting.BLUE + " Tank Level: " + tank + "\n\n" + + EnumChatFormatting.WHITE + " Screts Found: " + secrets + "\n" + DankersSkyblockMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------")); }).start(); } -- cgit From 7032f3ee8bd86d430e9aac7d641b849171fe2472 Mon Sep 17 00:00:00 2001 From: Sychic Date: Thu, 17 Dec 2020 14:00:53 -0500 Subject: remove weird linebreak --- src/main/java/me/Danker/commands/DungeonsCommand.java | 1 - 1 file changed, 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/me/Danker/commands/DungeonsCommand.java b/src/main/java/me/Danker/commands/DungeonsCommand.java index f557b93..79d5d96 100644 --- a/src/main/java/me/Danker/commands/DungeonsCommand.java +++ b/src/main/java/me/Danker/commands/DungeonsCommand.java @@ -114,5 +114,4 @@ public class DungeonsCommand extends CommandBase { DankersSkyblockMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------")); }).start(); } - } -- cgit From c64eea238237c80a0c8361685ce8b9e01d61f9cb Mon Sep 17 00:00:00 2001 From: Sychic Date: Thu, 17 Dec 2020 21:43:37 -0500 Subject: Add Repartying --- src/main/java/me/Danker/DankersSkyblockMod.java | 221 ++++++++++++--------- .../java/me/Danker/commands/RepartyCommand.java | 58 ++++++ .../java/me/Danker/commands/SetPartyCommand.java | 46 +++++ 3 files changed, 226 insertions(+), 99 deletions(-) create mode 100644 src/main/java/me/Danker/commands/RepartyCommand.java create mode 100644 src/main/java/me/Danker/commands/SetPartyCommand.java (limited to 'src/main/java') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index a1468e4..734543e 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -33,6 +33,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemMap; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.play.client.C01PacketChatMessage; import net.minecraft.util.*; import net.minecraft.world.World; import net.minecraft.world.storage.MapData; @@ -79,7 +80,7 @@ public class DankersSkyblockMod { public static final String MODID = "Danker's Skyblock Mod"; public static final String VERSION = "1.8.5-beta5"; - + static double checkItemsNow = 0; static double itemsChecked = 0; public static Map t6Enchants = new HashMap<>(); @@ -96,7 +97,7 @@ public class DankersSkyblockMod static int tickAmount = 1; static String lastMaddoxCommand = "/cb placeholder"; static double lastMaddoxTime = 0; - static KeyBinding[] keyBindings = new KeyBinding[2]; + static KeyBinding[] keyBindings = new KeyBinding[3]; static boolean usingLabymod = false; static boolean usingOAM = false; static boolean OAMWarning = false; @@ -104,10 +105,10 @@ public class DankersSkyblockMod static boolean foundLivid = false; static Entity livid = null; public static double cakeTime; - + 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", + + 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<>(); @@ -142,7 +143,7 @@ public class DankersSkyblockMod static int witherDoors = 0; static int dungeonDeaths = 0; static int puzzleFails = 0; - + static String lastSkill = "Farming"; public static boolean showSkillTracker; public static StopWatch skillStopwatch = new StopWatch(); @@ -161,7 +162,7 @@ public class DankersSkyblockMod static double alchemyXP = 0; public static double alchemyXPGained = 0; static double xpLeft = 0; - + public static String MAIN_COLOUR; public static String SECONDARY_COLOUR; public static String ERROR_COLOUR; @@ -188,14 +189,14 @@ public class DankersSkyblockMod 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) { MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(new PacketHandler()); - + ConfigHandler.reloadConfig(); - + // For golden enchants t6Enchants.put("9Angler VI", "6Angler VI"); t6Enchants.put("9Bane of Arthropods VI", "6Bane of Arthropods VI"); @@ -212,7 +213,7 @@ public class DankersSkyblockMod t6Enchants.put("9Giant Killer VI", "6Giant Killer VI"); t6Enchants.put("9Growth VI", "6Growth VI"); t6Enchants.put("9Infinite Quiver X", "6Infinite Quiver X"); - t6Enchants.put("9Lethality VI", "6Lethality VI"); + t6Enchants.put("9Lethality VI", "6Lethality VI"); t6Enchants.put("9Life Steal IV", "6Life Steal IV"); t6Enchants.put("9Looting IV", "6Looting IV"); t6Enchants.put("9Luck VI", "6Luck VI"); @@ -229,7 +230,7 @@ public class DankersSkyblockMod t6Enchants.put("9Spiked Hook VI", "6Spiked Hook VI"); t6Enchants.put("9Thunderlord VI", "6Thunderlord VI"); t6Enchants.put("9Vampirism VI", "6Vampirism VI"); - + triviaSolutions.put("What is the status of The Watcher?", new String[]{"Stalker"}); triviaSolutions.put("What is the status of Bonzo?", new String[]{"New Necromancer"}); triviaSolutions.put("What is the status of Scarf?", new String[]{"Apprentice Necromancer"}); @@ -266,18 +267,19 @@ public class DankersSkyblockMod triviaSolutions.put("Which of these monsters only spawns at night?", new String[]{"Zombie Villager", "Ghast"}); triviaSolutions.put("Which of these is not a dragon in The End?", new String[]{"Zoomer Dragon", "Weak Dragon", "Stonk Dragon", "Holy Dragon", "Boomer Dragon", "Booger Dragon", "Older Dragon", "Elder Dragon", "Stable Dragon", "Professor Dragon"}); - + String patternString = "(" + String.join("|", t6Enchants.keySet()) + ")"; t6EnchantPattern = Pattern.compile(patternString); - + keyBindings[0] = new KeyBinding("Open Maddox Menu", Keyboard.KEY_M, "Danker's Skyblock Mod"); keyBindings[1] = new KeyBinding("Start/Stop Skill Tracker", Keyboard.KEY_NUMPAD5, "Danker's Skyblock Mod"); + keyBindings[2] = new KeyBinding("Reparty", Keyboard.KEY_P,"Danker's Skyblock Mod"); for (KeyBinding keyBinding : keyBindings) { ClientRegistry.registerKeyBinding(keyBinding); } } - + @EventHandler public void preInit(final FMLPreInitializationEvent event) { ClientCommandHandler.instance.registerCommand(new ToggleCommand()); @@ -303,8 +305,10 @@ public class DankersSkyblockMod ClientCommandHandler.instance.registerCommand(new LobbySkillsCommand()); ClientCommandHandler.instance.registerCommand(new DankerGuiCommand()); ClientCommandHandler.instance.registerCommand(new SkillTrackerCommand()); + ClientCommandHandler.instance.registerCommand(new SetPartyCommand()); + ClientCommandHandler.instance.registerCommand(new RepartyCommand()); } - + @EventHandler public void postInit(final FMLPostInitializationEvent event) { Package[] packages = Package.getPackages(); @@ -334,30 +338,30 @@ public class DankersSkyblockMod } } } - + // Update checker @SubscribeEvent public void onJoin(EntityJoinWorldEvent event) { if (!updateChecked) { updateChecked = true; - + // MULTI THREAD DRIFTING new Thread(() -> { - EntityPlayer player = Minecraft.getMinecraft().thePlayer; - + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + System.out.println("Checking for updates..."); JsonObject latestRelease = APIHandler.getResponse("https://api.github.com/repos/bowser0000/SkyblockMod/releases/latest"); - + String latestTag = latestRelease.get("tag_name").getAsString(); DefaultArtifactVersion currentVersion = new DefaultArtifactVersion(VERSION); DefaultArtifactVersion latestVersion = new DefaultArtifactVersion(latestTag.substring(1)); - + if (currentVersion.compareTo(latestVersion) < 0) { String releaseURL = latestRelease.get("html_url").getAsString(); - + ChatComponentText update = new ChatComponentText(EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + " [UPDATE] "); update.setChatStyle(update.getChatStyle().setChatClickEvent(new ClickEvent(Action.OPEN_URL, releaseURL))); - + try { Thread.sleep(2000); } catch (InterruptedException ex) { @@ -368,20 +372,20 @@ public class DankersSkyblockMod }).start(); } } - + @SubscribeEvent public void onWorldChange(WorldEvent.Load event) { foundLivid = false; livid = null; } - + // It randomly broke, so I had to make it the highest priority @SubscribeEvent(priority = EventPriority.HIGHEST) public void onChat(ClientChatReceivedEvent event) { String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); - + if (!Utils.inSkyblock) return; - + // Action Bar if (event.type == 2) { String[] actionBarSections = event.message.getUnformattedText().split(" {3,}"); @@ -449,7 +453,7 @@ public class DankersSkyblockMod System.err.println("Unknown skill."); } } - + if (ToggleCommand.skill50DisplayToggled && !section.contains("Runecrafting")) { String xpGained = section.substring(section.indexOf("+"), section.indexOf("(") - 1); double currentXp = Double.parseDouble(section.substring(section.indexOf("(") + 1, section.indexOf("/")).replace(",", "")); @@ -464,7 +468,7 @@ public class DankersSkyblockMod } int previousXp = Utils.getPastXpEarned(Integer.parseInt(section.substring(section.indexOf("/") + 1, section.indexOf(")")).replaceAll(",", "")), limit); double percentage = Math.floor(((currentXp + previousXp) / totalXp) * 10000D) / 100D; - + NumberFormat nf = NumberFormat.getNumberInstance(Locale.US); skillTimer = SKILL_TIME; showSkill = true; @@ -474,7 +478,7 @@ public class DankersSkyblockMod } return; } - + // Dungeon chat spoken by an NPC, containing : if (ToggleCommand.threeManToggled && Utils.inDungeons && message.contains("[NPC]")) { for (String solution : riddleSolutions) { @@ -485,7 +489,7 @@ public class DankersSkyblockMod } } } - + if (message.contains("[BOSS] The Watcher: You have proven yourself. You may pass.")) { watcherClearTime = System.currentTimeMillis() / 1000; } @@ -495,9 +499,9 @@ public class DankersSkyblockMod if (message.contains("PUZZLE FAIL! ") || message.contains("chose the wrong answer! I shall never forget this moment")) { puzzleFails++; } - + if (message.contains(":")) return; - + // Spirit Sceptre if (!ToggleCommand.sceptreMessages && message.contains("Your Spirit Sceptre hit ")) { event.setCanceled(true); @@ -530,18 +534,18 @@ public class DankersSkyblockMod return; } } - + if (ToggleCommand.oruoToggled && Utils.inDungeons) { // Don't set every answer to wrong with this question if (message.contains("What SkyBlock year is it?")) triviaAnswers = null; - + for (String question : triviaSolutions.keySet()) { if (message.contains(question)) { triviaAnswers = triviaSolutions.get(question); break; } } - + // Set wrong answers to red and remove click events if (triviaAnswers != null && (message.contains("ⓐ") || message.contains("ⓑ") || message.contains("ⓒ"))) { boolean isSolution = false; @@ -559,7 +563,7 @@ public class DankersSkyblockMod } } } - + if (ToggleCommand.gpartyToggled) { if (message.contains(" has invited all members of ")) { try { @@ -576,18 +580,18 @@ 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); } } - + if (message.contains("Yum! You gain +") && message.contains(" for 48 hours!")) { cakeTime = System.currentTimeMillis() / 1000 + 172800; // Add 48 hours ConfigHandler.writeDoubleConfig("misc", "cakeTime", cakeTime); } - + boolean wolfRNG = false; boolean spiderRNG = false; boolean zombieRNG = false; @@ -815,7 +819,7 @@ public class DankersSkyblockMod increaseSeaCreatures(); } else if (message.contains("The Sea Emperor arises from the depths")) { increaseSeaCreatures(); - + LootCommand.seaEmperors++; LootCommand.empTime = System.currentTimeMillis() / 1000; LootCommand.empSCs = 0; @@ -958,7 +962,7 @@ public class DankersSkyblockMod } } } - + if (wolfRNG) { LootCommand.wolfTime = System.currentTimeMillis() / 1000; LootCommand.wolfBosses = 0; @@ -983,7 +987,7 @@ public class DankersSkyblockMod ConfigHandler.writeDoubleConfig("zombie", "timeRNG", LootCommand.zombieTime); ConfigHandler.writeIntConfig("zombie", "bossRNG", 0); } - + // Mythological Tracker if (message.contains("You dug out")) { if (message.contains(" coins!")) { @@ -1029,7 +1033,7 @@ public class DankersSkyblockMod ConfigHandler.writeIntConfig("mythological", "minosInquisitor", LootCommand.minosInquisitors); } } - + // Dungeons Trackers if (message.contains(" ")) { if (message.contains("Recombobulator 3000")) { @@ -1091,7 +1095,7 @@ public class DankersSkyblockMod LootCommand.legSpiritPets++; LootCommand.legSpiritPetsSession++; ConfigHandler.writeIntConfig("catacombs", "spiritPetLeg", LootCommand.legSpiritPets); - } + } } else if (message.contains("Spirit Sword")) { LootCommand.spiritSwords++; LootCommand.spiritSwordsSession++; @@ -1206,7 +1210,7 @@ public class DankersSkyblockMod ConfigHandler.writeIntConfig("catacombs", "witherBoot", LootCommand.witherBoots); } } - + // Chat Maddox if (message.contains("[OPEN MENU]")) { List listOfSiblings = event.message.getSiblings(); @@ -1218,20 +1222,20 @@ public class DankersSkyblockMod } if (ToggleCommand.chatMaddoxToggled) Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(MAIN_COLOUR + "Open chat then click anywhere on-screen to open Maddox")); } - + // Spirit Bear alerts if (ToggleCommand.spiritBearAlerts && message.contains("The Spirit Bear has appeared!")) { Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "SPIRIT BEAR", 2); } } - + @SubscribeEvent public void renderPlayerInfo(final RenderGameOverlayEvent.Post event) { if (usingLabymod && !(Minecraft.getMinecraft().ingameGUI instanceof GuiIngameForge)) return; if (event.type != RenderGameOverlayEvent.ElementType.EXPERIENCE && event.type != RenderGameOverlayEvent.ElementType.JUMPBAR) return; renderEverything(); } - + // LabyMod Support @SubscribeEvent public void renderPlayerInfoLabyMod(final RenderGameOverlayEvent event) { @@ -1239,24 +1243,24 @@ public class DankersSkyblockMod if (event.type != null) return; renderEverything(); } - + public void renderEverything() { if (Minecraft.getMinecraft().currentScreen instanceof EditLocationsGui) return; Minecraft mc = Minecraft.getMinecraft(); - + if (ToggleCommand.coordsToggled) { EntityPlayer player = mc.thePlayer; - + double xDir = (player.rotationYaw % 360 + 360) % 360; if (xDir > 180) xDir -= 360; xDir = (double) Math.round(xDir * 10d) / 10d; double yDir = (double) Math.round(player.rotationPitch * 10d) / 10d; - + String coordText = COORDS_COLOUR + (int) player.posX + " / " + (int) player.posY + " / " + (int) player.posZ + " (" + xDir + " / " + yDir + ")"; new TextRenderer(mc, coordText, MoveCommand.coordsXY[0], MoveCommand.coordsXY[1], ScaleCommand.coordsScale); } - + if (ToggleCommand.dungeonTimerToggled && Utils.inDungeons) { String dungeonTimerText = EnumChatFormatting.GRAY + "Wither Doors:\n" + EnumChatFormatting.DARK_RED + "Blood Open:\n" + @@ -1273,20 +1277,20 @@ public class DankersSkyblockMod new TextRenderer(mc, dungeonTimerText, MoveCommand.dungeonTimerXY[0], MoveCommand.dungeonTimerXY[1], ScaleCommand.dungeonTimerScale); new TextRenderer(mc, dungeonTimers, (int) (MoveCommand.dungeonTimerXY[0] + (80 * ScaleCommand.dungeonTimerScale)), MoveCommand.dungeonTimerXY[1], ScaleCommand.dungeonTimerScale); } - + if (ToggleCommand.lividSolverToggled && foundLivid && livid != null) { new TextRenderer(mc, livid.getName().replace("" + EnumChatFormatting.BOLD, ""), MoveCommand.lividHpXY[0], MoveCommand.lividHpXY[1], ScaleCommand.lividHpScale); } - + if (ToggleCommand.cakeTimerToggled && Utils.inSkyblock) { double scale = ScaleCommand.cakeTimerScale; double scaleReset = Math.pow(scale, -1); GL11.glScaled(scale, scale, scale); - + double timeNow = System.currentTimeMillis() / 1000; mc.getTextureManager().bindTexture(CAKE_ICON); Gui.drawModalRectWithCustomSizedTexture(MoveCommand.cakeTimerXY[0], MoveCommand.cakeTimerXY[1], 0, 0, 16, 16, 16, 16); - + String cakeText; if (cakeTime - timeNow < 0) { cakeText = EnumChatFormatting.RED + "NONE"; @@ -1294,10 +1298,10 @@ public class DankersSkyblockMod cakeText = CAKE_COLOUR + Utils.getTimeBetween(timeNow, cakeTime); } new TextRenderer(mc, cakeText, MoveCommand.cakeTimerXY[0] + 20, MoveCommand.cakeTimerXY[1] + 5, 1); - + GL11.glScaled(scaleReset, scaleReset, scaleReset); } - + if (showSkillTracker && Utils.inSkyblock) { int xpPerHour; double xpToShow = 0; @@ -1337,7 +1341,7 @@ public class DankersSkyblockMod if (!skillStopwatch.isStarted() || skillStopwatch.isSuspended()) { skillTrackerText += "\n" + EnumChatFormatting.RED + "PAUSED"; } - + new TextRenderer(mc, skillTrackerText, MoveCommand.skillTrackerXY[0], MoveCommand.skillTrackerXY[1], ScaleCommand.skillTrackerScale); } @@ -1355,7 +1359,7 @@ public class DankersSkyblockMod String drop20; double timeNow = System.currentTimeMillis() / 1000; NumberFormat nf = NumberFormat.getIntegerInstance(Locale.US); - + switch (DisplayCommand.display) { case "wolf": if (LootCommand.wolfTime == -1) { @@ -1373,11 +1377,11 @@ public class DankersSkyblockMod } else { drop20 = nf.format(LootCommand.wolfWheelsDrops) + " times"; } - + dropsText = EnumChatFormatting.GOLD + "Svens Killed:\n" + EnumChatFormatting.GREEN + "Wolf Teeth:\n" + EnumChatFormatting.BLUE + "Hamster Wheels:\n" + - EnumChatFormatting.AQUA + "Spirit Runes:\n" + + EnumChatFormatting.AQUA + "Spirit Runes:\n" + EnumChatFormatting.WHITE + "Critical VI Books:\n" + EnumChatFormatting.DARK_RED + "Red Claw Eggs:\n" + EnumChatFormatting.GOLD + "Couture Runes:\n" + @@ -1388,7 +1392,7 @@ public class DankersSkyblockMod countText = EnumChatFormatting.GOLD + nf.format(LootCommand.wolfSvens) + "\n" + EnumChatFormatting.GREEN + nf.format(LootCommand.wolfTeeth) + "\n" + EnumChatFormatting.BLUE + drop20 + "\n" + - EnumChatFormatting.AQUA + LootCommand.wolfSpirits + "\n" + + EnumChatFormatting.AQUA + LootCommand.wolfSpirits + "\n" + EnumChatFormatting.WHITE + LootCommand.wolfBooks + "\n" + EnumChatFormatting.DARK_RED + LootCommand.wolfEggs + "\n" + EnumChatFormatting.GOLD + LootCommand.wolfCoutures + "\n" + @@ -1413,11 +1417,11 @@ public class DankersSkyblockMod } else { drop20 = nf.format(LootCommand.wolfWheelsDropsSession) + " times"; } - + dropsText = EnumChatFormatting.GOLD + "Svens Killed:\n" + EnumChatFormatting.GREEN + "Wolf Teeth:\n" + EnumChatFormatting.BLUE + "Hamster Wheels:\n" + - EnumChatFormatting.AQUA + "Spirit Runes:\n" + + EnumChatFormatting.AQUA + "Spirit Runes:\n" + EnumChatFormatting.WHITE + "Critical VI Books:\n" + EnumChatFormatting.DARK_RED + "Red Claw Eggs:\n" + EnumChatFormatting.GOLD + "Couture Runes:\n" + @@ -1428,7 +1432,7 @@ public class DankersSkyblockMod countText = EnumChatFormatting.GOLD + nf.format(LootCommand.wolfSvensSession) + "\n" + EnumChatFormatting.GREEN + nf.format(LootCommand.wolfTeethSession) + "\n" + EnumChatFormatting.BLUE + drop20 + "\n" + - EnumChatFormatting.AQUA + LootCommand.wolfSpiritsSession + "\n" + + EnumChatFormatting.AQUA + LootCommand.wolfSpiritsSession + "\n" + EnumChatFormatting.WHITE + LootCommand.wolfBooksSession + "\n" + EnumChatFormatting.DARK_RED + LootCommand.wolfEggsSession + "\n" + EnumChatFormatting.GOLD + LootCommand.wolfCouturesSession + "\n" + @@ -1453,11 +1457,11 @@ public class DankersSkyblockMod } else { drop20 = nf.format(LootCommand.spiderTAPDrops) + " times"; } - + dropsText = EnumChatFormatting.GOLD + "Tarantulas Killed:\n" + EnumChatFormatting.GREEN + "Tarantula Webs:\n" + EnumChatFormatting.DARK_GREEN + "Arrow Poison:\n" + - EnumChatFormatting.DARK_GRAY + "Bite Runes:\n" + + EnumChatFormatting.DARK_GRAY + "Bite Runes:\n" + EnumChatFormatting.WHITE + "Bane VI Books:\n" + EnumChatFormatting.AQUA + "Spider Catalysts:\n" + EnumChatFormatting.DARK_PURPLE + "Tarantula Talismans:\n" + @@ -1468,7 +1472,7 @@ public class DankersSkyblockMod countText = EnumChatFormatting.GOLD + nf.format(LootCommand.spiderTarantulas) + "\n" + EnumChatFormatting.GREEN + nf.format(LootCommand.spiderWebs) + "\n" + EnumChatFormatting.DARK_GREEN + drop20 + "\n" + - EnumChatFormatting.DARK_GRAY + LootCommand.spiderBites + "\n" + + EnumChatFormatting.DARK_GRAY + LootCommand.spiderBites + "\n" + EnumChatFormatting.WHITE + LootCommand.spiderBooks + "\n" + EnumChatFormatting.AQUA + LootCommand.spiderCatalysts + "\n" + EnumChatFormatting.DARK_PURPLE + LootCommand.spiderTalismans + "\n" + @@ -1493,11 +1497,11 @@ public class DankersSkyblockMod } else { drop20 = nf.format(LootCommand.spiderTAPDropsSession) + " times"; } - + dropsText = EnumChatFormatting.GOLD + "Tarantulas Killed:\n" + EnumChatFormatting.GREEN + "Tarantula Webs:\n" + EnumChatFormatting.DARK_GREEN + "Arrow Poison:\n" + - EnumChatFormatting.DARK_GRAY + "Bite Runes:\n" + + EnumChatFormatting.DARK_GRAY + "Bite Runes:\n" + EnumChatFormatting.WHITE + "Bane VI Books:\n" + EnumChatFormatting.AQUA + "Spider Catalysts:\n" + EnumChatFormatting.DARK_PURPLE + "Tarantula Talismans:\n" + @@ -1508,7 +1512,7 @@ public class DankersSkyblockMod countText = EnumChatFormatting.GOLD + nf.format(LootCommand.spiderTarantulasSession) + "\n" + EnumChatFormatting.GREEN + nf.format(LootCommand.spiderWebsSession) + "\n" + EnumChatFormatting.DARK_GREEN + drop20 + "\n" + - EnumChatFormatting.DARK_GRAY + LootCommand.spiderBitesSession + "\n" + + EnumChatFormatting.DARK_GRAY + LootCommand.spiderBitesSession + "\n" + EnumChatFormatting.WHITE + LootCommand.spiderBooksSession + "\n" + EnumChatFormatting.AQUA + LootCommand.spiderCatalystsSession + "\n" + EnumChatFormatting.DARK_PURPLE + LootCommand.spiderTalismansSession + "\n" + @@ -1533,11 +1537,11 @@ public class DankersSkyblockMod } else { drop20 = nf.format(LootCommand.zombieFoulFleshDrops) + " times"; } - + dropsText = EnumChatFormatting.GOLD + "Revs Killed:\n" + EnumChatFormatting.GREEN + "Revenant Flesh:\n" + EnumChatFormatting.BLUE + "Foul Flesh:\n" + - EnumChatFormatting.DARK_GREEN + "Pestilence Runes:\n" + + EnumChatFormatting.DARK_GREEN + "Pestilence Runes:\n" + EnumChatFormatting.WHITE + "Smite VI Books:\n" + EnumChatFormatting.AQUA + "Undead Catalysts:\n" + EnumChatFormatting.DARK_PURPLE + "Beheaded Horrors:\n" + @@ -1549,7 +1553,7 @@ public class DankersSkyblockMod countText = EnumChatFormatting.GOLD + nf.format(LootCommand.zombieRevs) + "\n" + EnumChatFormatting.GREEN + nf.format(LootCommand.zombieRevFlesh) + "\n" + EnumChatFormatting.BLUE + drop20 + "\n" + - EnumChatFormatting.DARK_GREEN + LootCommand.zombiePestilences + "\n" + + EnumChatFormatting.DARK_GREEN + LootCommand.zombiePestilences + "\n" + EnumChatFormatting.WHITE + LootCommand.zombieBooks + "\n" + EnumChatFormatting.AQUA + LootCommand.zombieUndeadCatas + "\n" + EnumChatFormatting.DARK_PURPLE + LootCommand.zombieBeheadeds + "\n" + @@ -1575,11 +1579,11 @@ public class DankersSkyblockMod } else { drop20 = nf.format(LootCommand.zombieFoulFleshDropsSession) + " times"; } - + dropsText = EnumChatFormatting.GOLD + "Revs Killed:\n" + EnumChatFormatting.GREEN + "Revenant Flesh:\n" + EnumChatFormatting.BLUE + "Foul Flesh:\n" + - EnumChatFormatting.DARK_GREEN + "Pestilence Runes:\n" + + EnumChatFormatting.DARK_GREEN + "Pestilence Runes:\n" + EnumChatFormatting.WHITE + "Smite VI Books:\n" + EnumChatFormatting.AQUA + "Undead Catalysts:\n" + EnumChatFormatting.DARK_PURPLE + "Beheaded Horrors:\n" + @@ -1591,7 +1595,7 @@ public class DankersSkyblockMod countText = EnumChatFormatting.GOLD + nf.format(LootCommand.zombieRevsSession) + "\n" + EnumChatFormatting.GREEN + nf.format(LootCommand.zombieRevFleshSession) + "\n" + EnumChatFormatting.BLUE + drop20 + "\n" + - EnumChatFormatting.DARK_GREEN + LootCommand.zombiePestilencesSession + "\n" + + EnumChatFormatting.DARK_GREEN + LootCommand.zombiePestilencesSession + "\n" + EnumChatFormatting.WHITE + LootCommand.zombieBooksSession + "\n" + EnumChatFormatting.AQUA + LootCommand.zombieUndeadCatasSession + "\n" + EnumChatFormatting.DARK_PURPLE + LootCommand.zombieBeheadedsSession + "\n" + @@ -1612,7 +1616,7 @@ public class DankersSkyblockMod } else { bossesBetween = nf.format(LootCommand.empSCs); } - + dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + EnumChatFormatting.AQUA + "Fishing Milestone:\n" + EnumChatFormatting.GOLD + "Good Catches:\n" + @@ -1654,7 +1658,7 @@ public class DankersSkyblockMod EnumChatFormatting.GOLD + nf.format(LootCommand.seaEmperors) + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; - + if (ToggleCommand.splitFishing) { new TextRenderer(mc, dropsTextTwo, (int) (MoveCommand.displayXY[0] + (160 * ScaleCommand.displayScale)), MoveCommand.displayXY[1], ScaleCommand.displayScale); new TextRenderer(mc, countTextTwo, (int) (MoveCommand.displayXY[0] + (270 * ScaleCommand.displayScale)), MoveCommand.displayXY[1], ScaleCommand.displayScale); @@ -1674,7 +1678,7 @@ public class DankersSkyblockMod } else { bossesBetween = nf.format(LootCommand.empSCsSession); } - + dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + EnumChatFormatting.AQUA + "Fishing Milestone:\n" + EnumChatFormatting.GOLD + "Good Catches:\n" + @@ -1716,7 +1720,7 @@ public class DankersSkyblockMod EnumChatFormatting.GOLD + nf.format(LootCommand.seaEmperorsSession) + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; - + if (ToggleCommand.splitFishing) { new TextRenderer(mc, dropsTextTwo, (int) (MoveCommand.displayXY[0] + (160 * ScaleCommand.displayScale)), MoveCommand.displayXY[1], ScaleCommand.displayScale); new TextRenderer(mc, countTextTwo, (int) (MoveCommand.displayXY[0] + (270 * ScaleCommand.displayScale)), MoveCommand.displayXY[1], ScaleCommand.displayScale); @@ -1736,7 +1740,7 @@ public class DankersSkyblockMod } else { bossesBetween = nf.format(LootCommand.yetiSCs); } - + dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + EnumChatFormatting.AQUA + "Fishing Milestone:\n" + EnumChatFormatting.GOLD + "Good Catches:\n" + @@ -1769,7 +1773,7 @@ public class DankersSkyblockMod } else { bossesBetween = nf.format(LootCommand.yetiSCsSession); } - + dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + EnumChatFormatting.AQUA + "Fishing Milestone:\n" + EnumChatFormatting.GOLD + "Good Catches:\n" + @@ -2223,7 +2227,7 @@ public class DankersSkyblockMod new TextRenderer(mc, dropsText, MoveCommand.displayXY[0], MoveCommand.displayXY[1], ScaleCommand.displayScale); new TextRenderer(mc, countText, (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), MoveCommand.displayXY[1], ScaleCommand.displayScale); } - + if (showTitle) { Utils.drawTitle(titleText); } @@ -2231,17 +2235,17 @@ public class DankersSkyblockMod new TextRenderer(mc, skillText, MoveCommand.skill50XY[0], MoveCommand.skill50XY[1], ScaleCommand.skill50Scale); } } - + @SubscribeEvent(priority = EventPriority.HIGHEST) public void onSound(final PlaySoundEvent event) { if (!Utils.inSkyblock) return; if (event.name.equals("note.pling")) { - // Don't check twice within 3 seconds + // Don't check twice within 3 seconds checkItemsNow = System.currentTimeMillis() / 1000; if (checkItemsNow - itemsChecked < 3) return; - + List scoreboard = ScoreboardHandler.getSidebarLines(); - + for (String line : scoreboard) { String cleanedLine = ScoreboardHandler.cleanSB(line); // If Hypixel lags and scoreboard doesn't update @@ -2252,7 +2256,7 @@ public class DankersSkyblockMod int itemTAP = Utils.getItems("Toxic Arrow Poison"); int itemRev = Utils.getItems("Revenant Flesh"); int itemFoul = Utils.getItems("Foul Flesh"); - + // If no items, are detected, allow check again. Should fix items not being found if (itemTeeth + itemWheels + itemWebs + itemTAP + itemRev + itemFoul > 0) { itemsChecked = System.currentTimeMillis() / 1000; @@ -2268,7 +2272,7 @@ public class DankersSkyblockMod LootCommand.spiderTAPSession += itemTAP; LootCommand.zombieRevFleshSession += itemRev; LootCommand.zombieFoulFleshSession += itemFoul; - + ConfigHandler.writeIntConfig("wolf", "teeth", LootCommand.wolfTeeth); ConfigHandler.writeIntConfig("wolf", "wheel", LootCommand.wolfWheels); ConfigHandler.writeIntConfig("spider", "web", LootCommand.spiderWebs); @@ -2280,12 +2284,12 @@ public class DankersSkyblockMod } } } - + @SubscribeEvent(priority = EventPriority.HIGHEST) public void onTooltip(ItemTooltipEvent event) { if (!Utils.inSkyblock) return; if (event.toolTip == null) return; - + ItemStack item = event.itemStack; Minecraft mc = Minecraft.getMinecraft(); EntityPlayerSP player = mc.thePlayer; @@ -2295,7 +2299,7 @@ public class DankersSkyblockMod event.toolTip.set(i, Utils.returnGoldenEnchants(event.toolTip.get(i))); } } - + if (ToggleCommand.expertiseLoreToggled) { if (item.hasTagCompound()) { NBTTagCompound tags = item.getSubCompound("ExtraAttributes", false); @@ -2303,7 +2307,7 @@ public class DankersSkyblockMod if (tags.hasKey("expertise_kills")) { int index = 4; if (!Minecraft.getMinecraft().gameSettings.advancedItemTooltips) index -= 2; - + event.toolTip.add(event.toolTip.size() - index, ""); event.toolTip.add(event.toolTip.size() - index, "Expertise Kills: " + EnumChatFormatting.RED + tags.getInteger("expertise_kills")); if (Utils.expertiseKillsLeft(tags.getInteger("expertise_kills")) != -1) { @@ -2987,9 +2991,27 @@ public class DankersSkyblockMod @SubscribeEvent public void onKey(KeyInputEvent event) { + + + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + + // Check for pressing P for reparty + if (keyBindings[2].isPressed()) { + if(!SetPartyCommand.set){ + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + SetPartyCommand.getUsage())); + return; + } + + String members = String.join("\n" + EnumChatFormatting.GOLD, RepartyCommand.players); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.RED + EnumChatFormatting.BOLD + "Repartying: \n" + + EnumChatFormatting.GOLD + members + "\n" + + DankersSkyblockMod.DELIMITER_COLOUR + EnumChatFormatting.BOLD + "-------------------")); + RepartyCommand.processCommand(); + } + if (!Utils.inSkyblock) return; - EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; if (keyBindings[0].isPressed()) { player.sendChatMessage(lastMaddoxCommand); } @@ -3005,6 +3027,7 @@ public class DankersSkyblockMod player.addChatMessage(new ChatComponentText(MAIN_COLOUR + "Skill tracker paused.")); } } + } @SubscribeEvent 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..1658298 --- /dev/null +++ b/src/main/java/me/Danker/commands/RepartyCommand.java @@ -0,0 +1,58 @@ +package me.Danker.commands; + +import me.Danker.DankersSkyblockMod; +import net.minecraft.client.Minecraft; +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.ChatComponentText; + +public class RepartyCommand extends CommandBase implements ICommand { + public static String[] players; + + @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 { + + final EntityPlayer player = (EntityPlayer) sender; + + if(!SetPartyCommand.set){ + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Party unset! use " + SetPartyCommand.getUsage())); + return; + } + try{ + Minecraft.getMinecraft().thePlayer.sendChatMessage("/p disband"); + Thread.sleep(210); + Minecraft.getMinecraft().thePlayer.sendChatMessage("/p " + String.join(" ",players)); + } catch (InterruptedException e) { + e.printStackTrace(); + } + + } + + public static void processCommand() { + + if(!SetPartyCommand.set){ + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Party unset! use " + SetPartyCommand.getUsage())); + return; + } + try{ + Minecraft.getMinecraft().thePlayer.sendChatMessage("/p disband"); + Thread.sleep(210); + Minecraft.getMinecraft().thePlayer.sendChatMessage("/p " + String.join(" ",players)); + } catch (InterruptedException e) { + e.printStackTrace(); + } + + } +} diff --git a/src/main/java/me/Danker/commands/SetPartyCommand.java b/src/main/java/me/Danker/commands/SetPartyCommand.java new file mode 100644 index 0000000..f840527 --- /dev/null +++ b/src/main/java/me/Danker/commands/SetPartyCommand.java @@ -0,0 +1,46 @@ +package me.Danker.commands; + +import me.Danker.DankersSkyblockMod; +import net.minecraft.client.Minecraft; +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.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +public class SetPartyCommand extends CommandBase implements ICommand { + + public static boolean set = false; + + @Override + public String getCommandName() { return "setparty"; } + public static String getName() { return "setparty"; } + + @Override + public String getCommandUsage(ICommandSender sender) { return "/" + getCommandName() + " "; } + public static String getUsage(){ return "/" + getName() + " "; } + + @Override + public int getRequiredPermissionLevel() { return 0; } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + final EntityPlayer player = (EntityPlayer) sender; + + if(args.length == 0) { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(sender))); + return; + } + + RepartyCommand.players = args; + + String members = String.join("\n" + EnumChatFormatting.GOLD,RepartyCommand.players); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.GOLD + members + "\n" + + DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------")); + + set = true; + } +} -- cgit From 6baa9f89600d23e0b7265b0a30d6003b928bf4a0 Mon Sep 17 00:00:00 2001 From: Sychic Date: Thu, 17 Dec 2020 21:52:20 -0500 Subject: update version --- build.gradle | 2 +- src/main/java/me/Danker/DankersSkyblockMod.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/build.gradle b/build.gradle index 441a4db..3056755 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-beta5" +version = "1.8.5-beta6" 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 734543e..95c5436 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -79,7 +79,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-beta5"; + public static final String VERSION = "1.8.5-beta6"; static double checkItemsNow = 0; static double itemsChecked = 0; -- cgit From 20034c5391551471ab9d534002c1167dbe87aba4 Mon Sep 17 00:00:00 2001 From: Sychic Date: Fri, 18 Dec 2020 10:34:43 -0500 Subject: Separate partying thread to allow for it to wait separately from main thread. --- src/main/java/me/Danker/commands/RepartyCommand.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/me/Danker/commands/RepartyCommand.java b/src/main/java/me/Danker/commands/RepartyCommand.java index 1658298..d3ac7f0 100644 --- a/src/main/java/me/Danker/commands/RepartyCommand.java +++ b/src/main/java/me/Danker/commands/RepartyCommand.java @@ -46,13 +46,15 @@ public class RepartyCommand extends CommandBase implements ICommand { Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Party unset! use " + SetPartyCommand.getUsage())); return; } - try{ - Minecraft.getMinecraft().thePlayer.sendChatMessage("/p disband"); - Thread.sleep(210); - Minecraft.getMinecraft().thePlayer.sendChatMessage("/p " + String.join(" ",players)); - } catch (InterruptedException e) { - e.printStackTrace(); - } + (new Thread(() -> { + try{ + Minecraft.getMinecraft().thePlayer.sendChatMessage("/p disband"); + Thread.sleep(210); + Minecraft.getMinecraft().thePlayer.sendChatMessage("/p " + String.join(" ",players)); + } catch (InterruptedException e) { + e.printStackTrace(); + } + })).start(); } } -- 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') 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 7777fe8a544a347013c4790e16b061eca5b5e0de Mon Sep 17 00:00:00 2001 From: Sychic Date: Sat, 19 Dec 2020 15:37:39 -0500 Subject: Grab party with a button. Manual command still works, this just grabs from the current party. --- src/main/java/me/Danker/DankersSkyblockMod.java | 41 +++++++++++++++++++++- .../java/me/Danker/commands/SetPartyCommand.java | 20 +++++++++++ .../java/me/Danker/commands/SetkeyCommand.java | 1 - 3 files changed, 60 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 95c5436..e253646 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -97,7 +97,7 @@ public class DankersSkyblockMod static int tickAmount = 1; static String lastMaddoxCommand = "/cb placeholder"; static double lastMaddoxTime = 0; - static KeyBinding[] keyBindings = new KeyBinding[3]; + static KeyBinding[] keyBindings = new KeyBinding[4]; static boolean usingLabymod = false; static boolean usingOAM = false; static boolean OAMWarning = false; @@ -274,6 +274,7 @@ public class DankersSkyblockMod keyBindings[0] = new KeyBinding("Open Maddox Menu", Keyboard.KEY_M, "Danker's Skyblock Mod"); keyBindings[1] = new KeyBinding("Start/Stop Skill Tracker", Keyboard.KEY_NUMPAD5, "Danker's Skyblock Mod"); keyBindings[2] = new KeyBinding("Reparty", Keyboard.KEY_P,"Danker's Skyblock Mod"); + keyBindings[3] = new KeyBinding("Get Party", Keyboard.KEY_O, "Danker's Skyblock Mod"); for (KeyBinding keyBinding : keyBindings) { ClientRegistry.registerKeyBinding(keyBinding); @@ -384,6 +385,39 @@ public class DankersSkyblockMod public void onChat(ClientChatReceivedEvent event) { String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + if(SetPartyCommand.gettingParty){ + if(message.contains("-----------------------------")){ + switch(SetPartyCommand.delimiter){ + case 0: + System.out.println("Delimiter Cancelled"); + SetPartyCommand.delimiter++; + event.setCanceled(true); + return; + case 1: + System.out.println("Done Querying Party"); + SetPartyCommand.gettingParty = false; + SetPartyCommand.delimiter = 0; + event.setCanceled(true); + return; + } + } else if(message.contains("Party M")){ + // Looks for number between parentheses + Matcher members = (Pattern.compile("^.*?\\([^\\d]*(\\d+)[^\\d]*\\).*$")).matcher(message); + if(members.find()){ + System.out.println("Number of members read: " + members.group(1)); + event.setCanceled(true); + return; + } + System.out.println("Reading Party"); + SetPartyCommand.partyResponse += message.substring(message.indexOf(":") + 2); + event.setCanceled(true); + return; + } else if (message.contains("Party Leader")){ + event.setCanceled(true); + return; + } + } + if (!Utils.inSkyblock) return; // Action Bar @@ -2995,6 +3029,11 @@ public class DankersSkyblockMod EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + //Check for pressing O to read party + if(keyBindings[3].isPressed()){ + SetPartyCommand.getParty(); + } + // Check for pressing P for reparty if (keyBindings[2].isPressed()) { if(!SetPartyCommand.set){ diff --git a/src/main/java/me/Danker/commands/SetPartyCommand.java b/src/main/java/me/Danker/commands/SetPartyCommand.java index f840527..40551d3 100644 --- a/src/main/java/me/Danker/commands/SetPartyCommand.java +++ b/src/main/java/me/Danker/commands/SetPartyCommand.java @@ -10,9 +10,14 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; +import java.util.Arrays; + public class SetPartyCommand extends CommandBase implements ICommand { public static boolean set = false; + public static int delimiter = 0; + public static boolean gettingParty; + public static String partyResponse = ""; @Override public String getCommandName() { return "setparty"; } @@ -43,4 +48,19 @@ public class SetPartyCommand extends CommandBase implements ICommand { set = true; } + + public static void getParty() { + gettingParty = true; + partyResponse = ""; + Minecraft.getMinecraft().thePlayer.sendChatMessage("/pl"); + (new Thread(() ->{ + try{ + Thread.sleep(500); + RepartyCommand.players = Arrays.stream(partyResponse.split(" ")).filter(e -> !e.contains("[") && !e.contains("●")).toArray(String[]::new); + set = true; + } catch (InterruptedException e) { + e.printStackTrace(); + } + })).start(); + } } diff --git a/src/main/java/me/Danker/commands/SetkeyCommand.java b/src/main/java/me/Danker/commands/SetkeyCommand.java index db5fb9a..ee4b5a5 100644 --- a/src/main/java/me/Danker/commands/SetkeyCommand.java +++ b/src/main/java/me/Danker/commands/SetkeyCommand.java @@ -38,5 +38,4 @@ public class SetkeyCommand extends CommandBase implements ICommand { ConfigHandler.writeStringConfig("api", "APIKey", arg1[0]); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Set API key to " + DankersSkyblockMod.SECONDARY_COLOUR + arg1[0])); } - } -- cgit From 174b46ccbb36aaa75d46c65c6f6dc38ee0998ba4 Mon Sep 17 00:00:00 2001 From: Sychic Date: Wed, 23 Dec 2020 12:07:30 -0500 Subject: Revert "Add Repartying" This reverts commit c64eea23 --- src/main/java/me/Danker/DankersSkyblockMod.java | 262 ++++++++------------- .../java/me/Danker/commands/RepartyCommand.java | 60 ----- .../java/me/Danker/commands/SetPartyCommand.java | 66 ------ 3 files changed, 100 insertions(+), 288 deletions(-) delete mode 100644 src/main/java/me/Danker/commands/RepartyCommand.java delete mode 100644 src/main/java/me/Danker/commands/SetPartyCommand.java (limited to 'src/main/java') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index e253646..a1468e4 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -33,7 +33,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemMap; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.play.client.C01PacketChatMessage; import net.minecraft.util.*; import net.minecraft.world.World; import net.minecraft.world.storage.MapData; @@ -79,8 +78,8 @@ 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-beta6"; - + public static final String VERSION = "1.8.5-beta5"; + static double checkItemsNow = 0; static double itemsChecked = 0; public static Map t6Enchants = new HashMap<>(); @@ -97,7 +96,7 @@ public class DankersSkyblockMod static int tickAmount = 1; static String lastMaddoxCommand = "/cb placeholder"; static double lastMaddoxTime = 0; - static KeyBinding[] keyBindings = new KeyBinding[4]; + static KeyBinding[] keyBindings = new KeyBinding[2]; static boolean usingLabymod = false; static boolean usingOAM = false; static boolean OAMWarning = false; @@ -105,10 +104,10 @@ public class DankersSkyblockMod static boolean foundLivid = false; static Entity livid = null; public static double cakeTime; - + 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", + + 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<>(); @@ -143,7 +142,7 @@ public class DankersSkyblockMod static int witherDoors = 0; static int dungeonDeaths = 0; static int puzzleFails = 0; - + static String lastSkill = "Farming"; public static boolean showSkillTracker; public static StopWatch skillStopwatch = new StopWatch(); @@ -162,7 +161,7 @@ public class DankersSkyblockMod static double alchemyXP = 0; public static double alchemyXPGained = 0; static double xpLeft = 0; - + public static String MAIN_COLOUR; public static String SECONDARY_COLOUR; public static String ERROR_COLOUR; @@ -189,14 +188,14 @@ public class DankersSkyblockMod 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) { MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(new PacketHandler()); - + ConfigHandler.reloadConfig(); - + // For golden enchants t6Enchants.put("9Angler VI", "6Angler VI"); t6Enchants.put("9Bane of Arthropods VI", "6Bane of Arthropods VI"); @@ -213,7 +212,7 @@ public class DankersSkyblockMod t6Enchants.put("9Giant Killer VI", "6Giant Killer VI"); t6Enchants.put("9Growth VI", "6Growth VI"); t6Enchants.put("9Infinite Quiver X", "6Infinite Quiver X"); - t6Enchants.put("9Lethality VI", "6Lethality VI"); + t6Enchants.put("9Lethality VI", "6Lethality VI"); t6Enchants.put("9Life Steal IV", "6Life Steal IV"); t6Enchants.put("9Looting IV", "6Looting IV"); t6Enchants.put("9Luck VI", "6Luck VI"); @@ -230,7 +229,7 @@ public class DankersSkyblockMod t6Enchants.put("9Spiked Hook VI", "6Spiked Hook VI"); t6Enchants.put("9Thunderlord VI", "6Thunderlord VI"); t6Enchants.put("9Vampirism VI", "6Vampirism VI"); - + triviaSolutions.put("What is the status of The Watcher?", new String[]{"Stalker"}); triviaSolutions.put("What is the status of Bonzo?", new String[]{"New Necromancer"}); triviaSolutions.put("What is the status of Scarf?", new String[]{"Apprentice Necromancer"}); @@ -267,20 +266,18 @@ public class DankersSkyblockMod triviaSolutions.put("Which of these monsters only spawns at night?", new String[]{"Zombie Villager", "Ghast"}); triviaSolutions.put("Which of these is not a dragon in The End?", new String[]{"Zoomer Dragon", "Weak Dragon", "Stonk Dragon", "Holy Dragon", "Boomer Dragon", "Booger Dragon", "Older Dragon", "Elder Dragon", "Stable Dragon", "Professor Dragon"}); - + String patternString = "(" + String.join("|", t6Enchants.keySet()) + ")"; t6EnchantPattern = Pattern.compile(patternString); - + keyBindings[0] = new KeyBinding("Open Maddox Menu", Keyboard.KEY_M, "Danker's Skyblock Mod"); keyBindings[1] = new KeyBinding("Start/Stop Skill Tracker", Keyboard.KEY_NUMPAD5, "Danker's Skyblock Mod"); - keyBindings[2] = new KeyBinding("Reparty", Keyboard.KEY_P,"Danker's Skyblock Mod"); - keyBindings[3] = new KeyBinding("Get Party", Keyboard.KEY_O, "Danker's Skyblock Mod"); for (KeyBinding keyBinding : keyBindings) { ClientRegistry.registerKeyBinding(keyBinding); } } - + @EventHandler public void preInit(final FMLPreInitializationEvent event) { ClientCommandHandler.instance.registerCommand(new ToggleCommand()); @@ -306,10 +303,8 @@ public class DankersSkyblockMod ClientCommandHandler.instance.registerCommand(new LobbySkillsCommand()); ClientCommandHandler.instance.registerCommand(new DankerGuiCommand()); ClientCommandHandler.instance.registerCommand(new SkillTrackerCommand()); - ClientCommandHandler.instance.registerCommand(new SetPartyCommand()); - ClientCommandHandler.instance.registerCommand(new RepartyCommand()); } - + @EventHandler public void postInit(final FMLPostInitializationEvent event) { Package[] packages = Package.getPackages(); @@ -339,30 +334,30 @@ public class DankersSkyblockMod } } } - + // Update checker @SubscribeEvent public void onJoin(EntityJoinWorldEvent event) { if (!updateChecked) { updateChecked = true; - + // MULTI THREAD DRIFTING new Thread(() -> { - EntityPlayer player = Minecraft.getMinecraft().thePlayer; - + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + System.out.println("Checking for updates..."); JsonObject latestRelease = APIHandler.getResponse("https://api.github.com/repos/bowser0000/SkyblockMod/releases/latest"); - + String latestTag = latestRelease.get("tag_name").getAsString(); DefaultArtifactVersion currentVersion = new DefaultArtifactVersion(VERSION); DefaultArtifactVersion latestVersion = new DefaultArtifactVersion(latestTag.substring(1)); - + if (currentVersion.compareTo(latestVersion) < 0) { String releaseURL = latestRelease.get("html_url").getAsString(); - + ChatComponentText update = new ChatComponentText(EnumChatFormatting.GREEN + "" + EnumChatFormatting.BOLD + " [UPDATE] "); update.setChatStyle(update.getChatStyle().setChatClickEvent(new ClickEvent(Action.OPEN_URL, releaseURL))); - + try { Thread.sleep(2000); } catch (InterruptedException ex) { @@ -373,53 +368,20 @@ public class DankersSkyblockMod }).start(); } } - + @SubscribeEvent public void onWorldChange(WorldEvent.Load event) { foundLivid = false; livid = null; } - + // It randomly broke, so I had to make it the highest priority @SubscribeEvent(priority = EventPriority.HIGHEST) public void onChat(ClientChatReceivedEvent event) { String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); - - if(SetPartyCommand.gettingParty){ - if(message.contains("-----------------------------")){ - switch(SetPartyCommand.delimiter){ - case 0: - System.out.println("Delimiter Cancelled"); - SetPartyCommand.delimiter++; - event.setCanceled(true); - return; - case 1: - System.out.println("Done Querying Party"); - SetPartyCommand.gettingParty = false; - SetPartyCommand.delimiter = 0; - event.setCanceled(true); - return; - } - } else if(message.contains("Party M")){ - // Looks for number between parentheses - Matcher members = (Pattern.compile("^.*?\\([^\\d]*(\\d+)[^\\d]*\\).*$")).matcher(message); - if(members.find()){ - System.out.println("Number of members read: " + members.group(1)); - event.setCanceled(true); - return; - } - System.out.println("Reading Party"); - SetPartyCommand.partyResponse += message.substring(message.indexOf(":") + 2); - event.setCanceled(true); - return; - } else if (message.contains("Party Leader")){ - event.setCanceled(true); - return; - } - } - + if (!Utils.inSkyblock) return; - + // Action Bar if (event.type == 2) { String[] actionBarSections = event.message.getUnformattedText().split(" {3,}"); @@ -487,7 +449,7 @@ public class DankersSkyblockMod System.err.println("Unknown skill."); } } - + if (ToggleCommand.skill50DisplayToggled && !section.contains("Runecrafting")) { String xpGained = section.substring(section.indexOf("+"), section.indexOf("(") - 1); double currentXp = Double.parseDouble(section.substring(section.indexOf("(") + 1, section.indexOf("/")).replace(",", "")); @@ -502,7 +464,7 @@ public class DankersSkyblockMod } int previousXp = Utils.getPastXpEarned(Integer.parseInt(section.substring(section.indexOf("/") + 1, section.indexOf(")")).replaceAll(",", "")), limit); double percentage = Math.floor(((currentXp + previousXp) / totalXp) * 10000D) / 100D; - + NumberFormat nf = NumberFormat.getNumberInstance(Locale.US); skillTimer = SKILL_TIME; showSkill = true; @@ -512,7 +474,7 @@ public class DankersSkyblockMod } return; } - + // Dungeon chat spoken by an NPC, containing : if (ToggleCommand.threeManToggled && Utils.inDungeons && message.contains("[NPC]")) { for (String solution : riddleSolutions) { @@ -523,7 +485,7 @@ public class DankersSkyblockMod } } } - + if (message.contains("[BOSS] The Watcher: You have proven yourself. You may pass.")) { watcherClearTime = System.currentTimeMillis() / 1000; } @@ -533,9 +495,9 @@ public class DankersSkyblockMod if (message.contains("PUZZLE FAIL! ") || message.contains("chose the wrong answer! I shall never forget this moment")) { puzzleFails++; } - + if (message.contains(":")) return; - + // Spirit Sceptre if (!ToggleCommand.sceptreMessages && message.contains("Your Spirit Sceptre hit ")) { event.setCanceled(true); @@ -568,18 +530,18 @@ public class DankersSkyblockMod return; } } - + if (ToggleCommand.oruoToggled && Utils.inDungeons) { // Don't set every answer to wrong with this question if (message.contains("What SkyBlock year is it?")) triviaAnswers = null; - + for (String question : triviaSolutions.keySet()) { if (message.contains(question)) { triviaAnswers = triviaSolutions.get(question); break; } } - + // Set wrong answers to red and remove click events if (triviaAnswers != null && (message.contains("ⓐ") || message.contains("ⓑ") || message.contains("ⓒ"))) { boolean isSolution = false; @@ -597,7 +559,7 @@ public class DankersSkyblockMod } } } - + if (ToggleCommand.gpartyToggled) { if (message.contains(" has invited all members of ")) { try { @@ -614,18 +576,18 @@ 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); } } - + if (message.contains("Yum! You gain +") && message.contains(" for 48 hours!")) { cakeTime = System.currentTimeMillis() / 1000 + 172800; // Add 48 hours ConfigHandler.writeDoubleConfig("misc", "cakeTime", cakeTime); } - + boolean wolfRNG = false; boolean spiderRNG = false; boolean zombieRNG = false; @@ -853,7 +815,7 @@ public class DankersSkyblockMod increaseSeaCreatures(); } else if (message.contains("The Sea Emperor arises from the depths")) { increaseSeaCreatures(); - + LootCommand.seaEmperors++; LootCommand.empTime = System.currentTimeMillis() / 1000; LootCommand.empSCs = 0; @@ -996,7 +958,7 @@ public class DankersSkyblockMod } } } - + if (wolfRNG) { LootCommand.wolfTime = System.currentTimeMillis() / 1000; LootCommand.wolfBosses = 0; @@ -1021,7 +983,7 @@ public class DankersSkyblockMod ConfigHandler.writeDoubleConfig("zombie", "timeRNG", LootCommand.zombieTime); ConfigHandler.writeIntConfig("zombie", "bossRNG", 0); } - + // Mythological Tracker if (message.contains("You dug out")) { if (message.contains(" coins!")) { @@ -1067,7 +1029,7 @@ public class DankersSkyblockMod ConfigHandler.writeIntConfig("mythological", "minosInquisitor", LootCommand.minosInquisitors); } } - + // Dungeons Trackers if (message.contains(" ")) { if (message.contains("Recombobulator 3000")) { @@ -1129,7 +1091,7 @@ public class DankersSkyblockMod LootCommand.legSpiritPets++; LootCommand.legSpiritPetsSession++; ConfigHandler.writeIntConfig("catacombs", "spiritPetLeg", LootCommand.legSpiritPets); - } + } } else if (message.contains("Spirit Sword")) { LootCommand.spiritSwords++; LootCommand.spiritSwordsSession++; @@ -1244,7 +1206,7 @@ public class DankersSkyblockMod ConfigHandler.writeIntConfig("catacombs", "witherBoot", LootCommand.witherBoots); } } - + // Chat Maddox if (message.contains("[OPEN MENU]")) { List listOfSiblings = event.message.getSiblings(); @@ -1256,20 +1218,20 @@ public class DankersSkyblockMod } if (ToggleCommand.chatMaddoxToggled) Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(MAIN_COLOUR + "Open chat then click anywhere on-screen to open Maddox")); } - + // Spirit Bear alerts if (ToggleCommand.spiritBearAlerts && message.contains("The Spirit Bear has appeared!")) { Utils.createTitle(EnumChatFormatting.DARK_PURPLE + "SPIRIT BEAR", 2); } } - + @SubscribeEvent public void renderPlayerInfo(final RenderGameOverlayEvent.Post event) { if (usingLabymod && !(Minecraft.getMinecraft().ingameGUI instanceof GuiIngameForge)) return; if (event.type != RenderGameOverlayEvent.ElementType.EXPERIENCE && event.type != RenderGameOverlayEvent.ElementType.JUMPBAR) return; renderEverything(); } - + // LabyMod Support @SubscribeEvent public void renderPlayerInfoLabyMod(final RenderGameOverlayEvent event) { @@ -1277,24 +1239,24 @@ public class DankersSkyblockMod if (event.type != null) return; renderEverything(); } - + public void renderEverything() { if (Minecraft.getMinecraft().currentScreen instanceof EditLocationsGui) return; Minecraft mc = Minecraft.getMinecraft(); - + if (ToggleCommand.coordsToggled) { EntityPlayer player = mc.thePlayer; - + double xDir = (player.rotationYaw % 360 + 360) % 360; if (xDir > 180) xDir -= 360; xDir = (double) Math.round(xDir * 10d) / 10d; double yDir = (double) Math.round(player.rotationPitch * 10d) / 10d; - + String coordText = COORDS_COLOUR + (int) player.posX + " / " + (int) player.posY + " / " + (int) player.posZ + " (" + xDir + " / " + yDir + ")"; new TextRenderer(mc, coordText, MoveCommand.coordsXY[0], MoveCommand.coordsXY[1], ScaleCommand.coordsScale); } - + if (ToggleCommand.dungeonTimerToggled && Utils.inDungeons) { String dungeonTimerText = EnumChatFormatting.GRAY + "Wither Doors:\n" + EnumChatFormatting.DARK_RED + "Blood Open:\n" + @@ -1311,20 +1273,20 @@ public class DankersSkyblockMod new TextRenderer(mc, dungeonTimerText, MoveCommand.dungeonTimerXY[0], MoveCommand.dungeonTimerXY[1], ScaleCommand.dungeonTimerScale); new TextRenderer(mc, dungeonTimers, (int) (MoveCommand.dungeonTimerXY[0] + (80 * ScaleCommand.dungeonTimerScale)), MoveCommand.dungeonTimerXY[1], ScaleCommand.dungeonTimerScale); } - + if (ToggleCommand.lividSolverToggled && foundLivid && livid != null) { new TextRenderer(mc, livid.getName().replace("" + EnumChatFormatting.BOLD, ""), MoveCommand.lividHpXY[0], MoveCommand.lividHpXY[1], ScaleCommand.lividHpScale); } - + if (ToggleCommand.cakeTimerToggled && Utils.inSkyblock) { double scale = ScaleCommand.cakeTimerScale; double scaleReset = Math.pow(scale, -1); GL11.glScaled(scale, scale, scale); - + double timeNow = System.currentTimeMillis() / 1000; mc.getTextureManager().bindTexture(CAKE_ICON); Gui.drawModalRectWithCustomSizedTexture(MoveCommand.cakeTimerXY[0], MoveCommand.cakeTimerXY[1], 0, 0, 16, 16, 16, 16); - + String cakeText; if (cakeTime - timeNow < 0) { cakeText = EnumChatFormatting.RED + "NONE"; @@ -1332,10 +1294,10 @@ public class DankersSkyblockMod cakeText = CAKE_COLOUR + Utils.getTimeBetween(timeNow, cakeTime); } new TextRenderer(mc, cakeText, MoveCommand.cakeTimerXY[0] + 20, MoveCommand.cakeTimerXY[1] + 5, 1); - + GL11.glScaled(scaleReset, scaleReset, scaleReset); } - + if (showSkillTracker && Utils.inSkyblock) { int xpPerHour; double xpToShow = 0; @@ -1375,7 +1337,7 @@ public class DankersSkyblockMod if (!skillStopwatch.isStarted() || skillStopwatch.isSuspended()) { skillTrackerText += "\n" + EnumChatFormatting.RED + "PAUSED"; } - + new TextRenderer(mc, skillTrackerText, MoveCommand.skillTrackerXY[0], MoveCommand.skillTrackerXY[1], ScaleCommand.skillTrackerScale); } @@ -1393,7 +1355,7 @@ public class DankersSkyblockMod String drop20; double timeNow = System.currentTimeMillis() / 1000; NumberFormat nf = NumberFormat.getIntegerInstance(Locale.US); - + switch (DisplayCommand.display) { case "wolf": if (LootCommand.wolfTime == -1) { @@ -1411,11 +1373,11 @@ public class DankersSkyblockMod } else { drop20 = nf.format(LootCommand.wolfWheelsDrops) + " times"; } - + dropsText = EnumChatFormatting.GOLD + "Svens Killed:\n" + EnumChatFormatting.GREEN + "Wolf Teeth:\n" + EnumChatFormatting.BLUE + "Hamster Wheels:\n" + - EnumChatFormatting.AQUA + "Spirit Runes:\n" + + EnumChatFormatting.AQUA + "Spirit Runes:\n" + EnumChatFormatting.WHITE + "Critical VI Books:\n" + EnumChatFormatting.DARK_RED + "Red Claw Eggs:\n" + EnumChatFormatting.GOLD + "Couture Runes:\n" + @@ -1426,7 +1388,7 @@ public class DankersSkyblockMod countText = EnumChatFormatting.GOLD + nf.format(LootCommand.wolfSvens) + "\n" + EnumChatFormatting.GREEN + nf.format(LootCommand.wolfTeeth) + "\n" + EnumChatFormatting.BLUE + drop20 + "\n" + - EnumChatFormatting.AQUA + LootCommand.wolfSpirits + "\n" + + EnumChatFormatting.AQUA + LootCommand.wolfSpirits + "\n" + EnumChatFormatting.WHITE + LootCommand.wolfBooks + "\n" + EnumChatFormatting.DARK_RED + LootCommand.wolfEggs + "\n" + EnumChatFormatting.GOLD + LootCommand.wolfCoutures + "\n" + @@ -1451,11 +1413,11 @@ public class DankersSkyblockMod } else { drop20 = nf.format(LootCommand.wolfWheelsDropsSession) + " times"; } - + dropsText = EnumChatFormatting.GOLD + "Svens Killed:\n" + EnumChatFormatting.GREEN + "Wolf Teeth:\n" + EnumChatFormatting.BLUE + "Hamster Wheels:\n" + - EnumChatFormatting.AQUA + "Spirit Runes:\n" + + EnumChatFormatting.AQUA + "Spirit Runes:\n" + EnumChatFormatting.WHITE + "Critical VI Books:\n" + EnumChatFormatting.DARK_RED + "Red Claw Eggs:\n" + EnumChatFormatting.GOLD + "Couture Runes:\n" + @@ -1466,7 +1428,7 @@ public class DankersSkyblockMod countText = EnumChatFormatting.GOLD + nf.format(LootCommand.wolfSvensSession) + "\n" + EnumChatFormatting.GREEN + nf.format(LootCommand.wolfTeethSession) + "\n" + EnumChatFormatting.BLUE + drop20 + "\n" + - EnumChatFormatting.AQUA + LootCommand.wolfSpiritsSession + "\n" + + EnumChatFormatting.AQUA + LootCommand.wolfSpiritsSession + "\n" + EnumChatFormatting.WHITE + LootCommand.wolfBooksSession + "\n" + EnumChatFormatting.DARK_RED + LootCommand.wolfEggsSession + "\n" + EnumChatFormatting.GOLD + LootCommand.wolfCouturesSession + "\n" + @@ -1491,11 +1453,11 @@ public class DankersSkyblockMod } else { drop20 = nf.format(LootCommand.spiderTAPDrops) + " times"; } - + dropsText = EnumChatFormatting.GOLD + "Tarantulas Killed:\n" + EnumChatFormatting.GREEN + "Tarantula Webs:\n" + EnumChatFormatting.DARK_GREEN + "Arrow Poison:\n" + - EnumChatFormatting.DARK_GRAY + "Bite Runes:\n" + + EnumChatFormatting.DARK_GRAY + "Bite Runes:\n" + EnumChatFormatting.WHITE + "Bane VI Books:\n" + EnumChatFormatting.AQUA + "Spider Catalysts:\n" + EnumChatFormatting.DARK_PURPLE + "Tarantula Talismans:\n" + @@ -1506,7 +1468,7 @@ public class DankersSkyblockMod countText = EnumChatFormatting.GOLD + nf.format(LootCommand.spiderTarantulas) + "\n" + EnumChatFormatting.GREEN + nf.format(LootCommand.spiderWebs) + "\n" + EnumChatFormatting.DARK_GREEN + drop20 + "\n" + - EnumChatFormatting.DARK_GRAY + LootCommand.spiderBites + "\n" + + EnumChatFormatting.DARK_GRAY + LootCommand.spiderBites + "\n" + EnumChatFormatting.WHITE + LootCommand.spiderBooks + "\n" + EnumChatFormatting.AQUA + LootCommand.spiderCatalysts + "\n" + EnumChatFormatting.DARK_PURPLE + LootCommand.spiderTalismans + "\n" + @@ -1531,11 +1493,11 @@ public class DankersSkyblockMod } else { drop20 = nf.format(LootCommand.spiderTAPDropsSession) + " times"; } - + dropsText = EnumChatFormatting.GOLD + "Tarantulas Killed:\n" + EnumChatFormatting.GREEN + "Tarantula Webs:\n" + EnumChatFormatting.DARK_GREEN + "Arrow Poison:\n" + - EnumChatFormatting.DARK_GRAY + "Bite Runes:\n" + + EnumChatFormatting.DARK_GRAY + "Bite Runes:\n" + EnumChatFormatting.WHITE + "Bane VI Books:\n" + EnumChatFormatting.AQUA + "Spider Catalysts:\n" + EnumChatFormatting.DARK_PURPLE + "Tarantula Talismans:\n" + @@ -1546,7 +1508,7 @@ public class DankersSkyblockMod countText = EnumChatFormatting.GOLD + nf.format(LootCommand.spiderTarantulasSession) + "\n" + EnumChatFormatting.GREEN + nf.format(LootCommand.spiderWebsSession) + "\n" + EnumChatFormatting.DARK_GREEN + drop20 + "\n" + - EnumChatFormatting.DARK_GRAY + LootCommand.spiderBitesSession + "\n" + + EnumChatFormatting.DARK_GRAY + LootCommand.spiderBitesSession + "\n" + EnumChatFormatting.WHITE + LootCommand.spiderBooksSession + "\n" + EnumChatFormatting.AQUA + LootCommand.spiderCatalystsSession + "\n" + EnumChatFormatting.DARK_PURPLE + LootCommand.spiderTalismansSession + "\n" + @@ -1571,11 +1533,11 @@ public class DankersSkyblockMod } else { drop20 = nf.format(LootCommand.zombieFoulFleshDrops) + " times"; } - + dropsText = EnumChatFormatting.GOLD + "Revs Killed:\n" + EnumChatFormatting.GREEN + "Revenant Flesh:\n" + EnumChatFormatting.BLUE + "Foul Flesh:\n" + - EnumChatFormatting.DARK_GREEN + "Pestilence Runes:\n" + + EnumChatFormatting.DARK_GREEN + "Pestilence Runes:\n" + EnumChatFormatting.WHITE + "Smite VI Books:\n" + EnumChatFormatting.AQUA + "Undead Catalysts:\n" + EnumChatFormatting.DARK_PURPLE + "Beheaded Horrors:\n" + @@ -1587,7 +1549,7 @@ public class DankersSkyblockMod countText = EnumChatFormatting.GOLD + nf.format(LootCommand.zombieRevs) + "\n" + EnumChatFormatting.GREEN + nf.format(LootCommand.zombieRevFlesh) + "\n" + EnumChatFormatting.BLUE + drop20 + "\n" + - EnumChatFormatting.DARK_GREEN + LootCommand.zombiePestilences + "\n" + + EnumChatFormatting.DARK_GREEN + LootCommand.zombiePestilences + "\n" + EnumChatFormatting.WHITE + LootCommand.zombieBooks + "\n" + EnumChatFormatting.AQUA + LootCommand.zombieUndeadCatas + "\n" + EnumChatFormatting.DARK_PURPLE + LootCommand.zombieBeheadeds + "\n" + @@ -1613,11 +1575,11 @@ public class DankersSkyblockMod } else { drop20 = nf.format(LootCommand.zombieFoulFleshDropsSession) + " times"; } - + dropsText = EnumChatFormatting.GOLD + "Revs Killed:\n" + EnumChatFormatting.GREEN + "Revenant Flesh:\n" + EnumChatFormatting.BLUE + "Foul Flesh:\n" + - EnumChatFormatting.DARK_GREEN + "Pestilence Runes:\n" + + EnumChatFormatting.DARK_GREEN + "Pestilence Runes:\n" + EnumChatFormatting.WHITE + "Smite VI Books:\n" + EnumChatFormatting.AQUA + "Undead Catalysts:\n" + EnumChatFormatting.DARK_PURPLE + "Beheaded Horrors:\n" + @@ -1629,7 +1591,7 @@ public class DankersSkyblockMod countText = EnumChatFormatting.GOLD + nf.format(LootCommand.zombieRevsSession) + "\n" + EnumChatFormatting.GREEN + nf.format(LootCommand.zombieRevFleshSession) + "\n" + EnumChatFormatting.BLUE + drop20 + "\n" + - EnumChatFormatting.DARK_GREEN + LootCommand.zombiePestilencesSession + "\n" + + EnumChatFormatting.DARK_GREEN + LootCommand.zombiePestilencesSession + "\n" + EnumChatFormatting.WHITE + LootCommand.zombieBooksSession + "\n" + EnumChatFormatting.AQUA + LootCommand.zombieUndeadCatasSession + "\n" + EnumChatFormatting.DARK_PURPLE + LootCommand.zombieBeheadedsSession + "\n" + @@ -1650,7 +1612,7 @@ public class DankersSkyblockMod } else { bossesBetween = nf.format(LootCommand.empSCs); } - + dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + EnumChatFormatting.AQUA + "Fishing Milestone:\n" + EnumChatFormatting.GOLD + "Good Catches:\n" + @@ -1692,7 +1654,7 @@ public class DankersSkyblockMod EnumChatFormatting.GOLD + nf.format(LootCommand.seaEmperors) + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; - + if (ToggleCommand.splitFishing) { new TextRenderer(mc, dropsTextTwo, (int) (MoveCommand.displayXY[0] + (160 * ScaleCommand.displayScale)), MoveCommand.displayXY[1], ScaleCommand.displayScale); new TextRenderer(mc, countTextTwo, (int) (MoveCommand.displayXY[0] + (270 * ScaleCommand.displayScale)), MoveCommand.displayXY[1], ScaleCommand.displayScale); @@ -1712,7 +1674,7 @@ public class DankersSkyblockMod } else { bossesBetween = nf.format(LootCommand.empSCsSession); } - + dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + EnumChatFormatting.AQUA + "Fishing Milestone:\n" + EnumChatFormatting.GOLD + "Good Catches:\n" + @@ -1754,7 +1716,7 @@ public class DankersSkyblockMod EnumChatFormatting.GOLD + nf.format(LootCommand.seaEmperorsSession) + "\n" + EnumChatFormatting.AQUA + timeBetween + "\n" + EnumChatFormatting.AQUA + bossesBetween; - + if (ToggleCommand.splitFishing) { new TextRenderer(mc, dropsTextTwo, (int) (MoveCommand.displayXY[0] + (160 * ScaleCommand.displayScale)), MoveCommand.displayXY[1], ScaleCommand.displayScale); new TextRenderer(mc, countTextTwo, (int) (MoveCommand.displayXY[0] + (270 * ScaleCommand.displayScale)), MoveCommand.displayXY[1], ScaleCommand.displayScale); @@ -1774,7 +1736,7 @@ public class DankersSkyblockMod } else { bossesBetween = nf.format(LootCommand.yetiSCs); } - + dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + EnumChatFormatting.AQUA + "Fishing Milestone:\n" + EnumChatFormatting.GOLD + "Good Catches:\n" + @@ -1807,7 +1769,7 @@ public class DankersSkyblockMod } else { bossesBetween = nf.format(LootCommand.yetiSCsSession); } - + dropsText = EnumChatFormatting.AQUA + "Creatures Caught:\n" + EnumChatFormatting.AQUA + "Fishing Milestone:\n" + EnumChatFormatting.GOLD + "Good Catches:\n" + @@ -2261,7 +2223,7 @@ public class DankersSkyblockMod new TextRenderer(mc, dropsText, MoveCommand.displayXY[0], MoveCommand.displayXY[1], ScaleCommand.displayScale); new TextRenderer(mc, countText, (int) (MoveCommand.displayXY[0] + (110 * ScaleCommand.displayScale)), MoveCommand.displayXY[1], ScaleCommand.displayScale); } - + if (showTitle) { Utils.drawTitle(titleText); } @@ -2269,17 +2231,17 @@ public class DankersSkyblockMod new TextRenderer(mc, skillText, MoveCommand.skill50XY[0], MoveCommand.skill50XY[1], ScaleCommand.skill50Scale); } } - + @SubscribeEvent(priority = EventPriority.HIGHEST) public void onSound(final PlaySoundEvent event) { if (!Utils.inSkyblock) return; if (event.name.equals("note.pling")) { - // Don't check twice within 3 seconds + // Don't check twice within 3 seconds checkItemsNow = System.currentTimeMillis() / 1000; if (checkItemsNow - itemsChecked < 3) return; - + List scoreboard = ScoreboardHandler.getSidebarLines(); - + for (String line : scoreboard) { String cleanedLine = ScoreboardHandler.cleanSB(line); // If Hypixel lags and scoreboard doesn't update @@ -2290,7 +2252,7 @@ public class DankersSkyblockMod int itemTAP = Utils.getItems("Toxic Arrow Poison"); int itemRev = Utils.getItems("Revenant Flesh"); int itemFoul = Utils.getItems("Foul Flesh"); - + // If no items, are detected, allow check again. Should fix items not being found if (itemTeeth + itemWheels + itemWebs + itemTAP + itemRev + itemFoul > 0) { itemsChecked = System.currentTimeMillis() / 1000; @@ -2306,7 +2268,7 @@ public class DankersSkyblockMod LootCommand.spiderTAPSession += itemTAP; LootCommand.zombieRevFleshSession += itemRev; LootCommand.zombieFoulFleshSession += itemFoul; - + ConfigHandler.writeIntConfig("wolf", "teeth", LootCommand.wolfTeeth); ConfigHandler.writeIntConfig("wolf", "wheel", LootCommand.wolfWheels); ConfigHandler.writeIntConfig("spider", "web", LootCommand.spiderWebs); @@ -2318,12 +2280,12 @@ public class DankersSkyblockMod } } } - + @SubscribeEvent(priority = EventPriority.HIGHEST) public void onTooltip(ItemTooltipEvent event) { if (!Utils.inSkyblock) return; if (event.toolTip == null) return; - + ItemStack item = event.itemStack; Minecraft mc = Minecraft.getMinecraft(); EntityPlayerSP player = mc.thePlayer; @@ -2333,7 +2295,7 @@ public class DankersSkyblockMod event.toolTip.set(i, Utils.returnGoldenEnchants(event.toolTip.get(i))); } } - + if (ToggleCommand.expertiseLoreToggled) { if (item.hasTagCompound()) { NBTTagCompound tags = item.getSubCompound("ExtraAttributes", false); @@ -2341,7 +2303,7 @@ public class DankersSkyblockMod if (tags.hasKey("expertise_kills")) { int index = 4; if (!Minecraft.getMinecraft().gameSettings.advancedItemTooltips) index -= 2; - + event.toolTip.add(event.toolTip.size() - index, ""); event.toolTip.add(event.toolTip.size() - index, "Expertise Kills: " + EnumChatFormatting.RED + tags.getInteger("expertise_kills")); if (Utils.expertiseKillsLeft(tags.getInteger("expertise_kills")) != -1) { @@ -3025,32 +2987,9 @@ public class DankersSkyblockMod @SubscribeEvent public void onKey(KeyInputEvent event) { - - - EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; - - //Check for pressing O to read party - if(keyBindings[3].isPressed()){ - SetPartyCommand.getParty(); - } - - // Check for pressing P for reparty - if (keyBindings[2].isPressed()) { - if(!SetPartyCommand.set){ - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + SetPartyCommand.getUsage())); - return; - } - - String members = String.join("\n" + EnumChatFormatting.GOLD, RepartyCommand.players); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + EnumChatFormatting.BOLD + "-------------------\n" + - EnumChatFormatting.RED + EnumChatFormatting.BOLD + "Repartying: \n" + - EnumChatFormatting.GOLD + members + "\n" + - DankersSkyblockMod.DELIMITER_COLOUR + EnumChatFormatting.BOLD + "-------------------")); - RepartyCommand.processCommand(); - } - if (!Utils.inSkyblock) return; + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; if (keyBindings[0].isPressed()) { player.sendChatMessage(lastMaddoxCommand); } @@ -3066,7 +3005,6 @@ public class DankersSkyblockMod player.addChatMessage(new ChatComponentText(MAIN_COLOUR + "Skill tracker paused.")); } } - } @SubscribeEvent diff --git a/src/main/java/me/Danker/commands/RepartyCommand.java b/src/main/java/me/Danker/commands/RepartyCommand.java deleted file mode 100644 index d3ac7f0..0000000 --- a/src/main/java/me/Danker/commands/RepartyCommand.java +++ /dev/null @@ -1,60 +0,0 @@ -package me.Danker.commands; - -import me.Danker.DankersSkyblockMod; -import net.minecraft.client.Minecraft; -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.ChatComponentText; - -public class RepartyCommand extends CommandBase implements ICommand { - public static String[] players; - - @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 { - - final EntityPlayer player = (EntityPlayer) sender; - - if(!SetPartyCommand.set){ - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Party unset! use " + SetPartyCommand.getUsage())); - return; - } - try{ - Minecraft.getMinecraft().thePlayer.sendChatMessage("/p disband"); - Thread.sleep(210); - Minecraft.getMinecraft().thePlayer.sendChatMessage("/p " + String.join(" ",players)); - } catch (InterruptedException e) { - e.printStackTrace(); - } - - } - - public static void processCommand() { - - if(!SetPartyCommand.set){ - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Party unset! use " + SetPartyCommand.getUsage())); - return; - } - (new Thread(() -> { - try{ - Minecraft.getMinecraft().thePlayer.sendChatMessage("/p disband"); - Thread.sleep(210); - Minecraft.getMinecraft().thePlayer.sendChatMessage("/p " + String.join(" ",players)); - } catch (InterruptedException e) { - e.printStackTrace(); - } - })).start(); - - } -} diff --git a/src/main/java/me/Danker/commands/SetPartyCommand.java b/src/main/java/me/Danker/commands/SetPartyCommand.java deleted file mode 100644 index 40551d3..0000000 --- a/src/main/java/me/Danker/commands/SetPartyCommand.java +++ /dev/null @@ -1,66 +0,0 @@ -package me.Danker.commands; - -import me.Danker.DankersSkyblockMod; -import net.minecraft.client.Minecraft; -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.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; - -import java.util.Arrays; - -public class SetPartyCommand extends CommandBase implements ICommand { - - public static boolean set = false; - public static int delimiter = 0; - public static boolean gettingParty; - public static String partyResponse = ""; - - @Override - public String getCommandName() { return "setparty"; } - public static String getName() { return "setparty"; } - - @Override - public String getCommandUsage(ICommandSender sender) { return "/" + getCommandName() + " "; } - public static String getUsage(){ return "/" + getName() + " "; } - - @Override - public int getRequiredPermissionLevel() { return 0; } - - @Override - public void processCommand(ICommandSender sender, String[] args) throws CommandException { - final EntityPlayer player = (EntityPlayer) sender; - - if(args.length == 0) { - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(sender))); - return; - } - - RepartyCommand.players = args; - - String members = String.join("\n" + EnumChatFormatting.GOLD,RepartyCommand.players); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" + - EnumChatFormatting.GOLD + members + "\n" + - DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------")); - - set = true; - } - - public static void getParty() { - gettingParty = true; - partyResponse = ""; - Minecraft.getMinecraft().thePlayer.sendChatMessage("/pl"); - (new Thread(() ->{ - try{ - Thread.sleep(500); - RepartyCommand.players = Arrays.stream(partyResponse.split(" ")).filter(e -> !e.contains("[") && !e.contains("●")).toArray(String[]::new); - set = true; - } catch (InterruptedException e) { - e.printStackTrace(); - } - })).start(); - } -} -- cgit From 3e4b6728eaee4daae95dfb8c40ed46510e9ea280 Mon Sep 17 00:00:00 2001 From: Sychic Date: Fri, 25 Dec 2020 15:54:21 -0500 Subject: Fix mispelling --- src/main/java/me/Danker/commands/DungeonsCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/me/Danker/commands/DungeonsCommand.java b/src/main/java/me/Danker/commands/DungeonsCommand.java index 79d5d96..290f99d 100644 --- a/src/main/java/me/Danker/commands/DungeonsCommand.java +++ b/src/main/java/me/Danker/commands/DungeonsCommand.java @@ -110,7 +110,7 @@ public class DungeonsCommand extends CommandBase { EnumChatFormatting.RED + " Berserk Level: " + berserk + "\n" + EnumChatFormatting.GREEN + " Archer Level: " + archer + "\n" + EnumChatFormatting.BLUE + " Tank Level: " + tank + "\n\n" + - EnumChatFormatting.WHITE + " Screts Found: " + secrets + "\n" + + EnumChatFormatting.WHITE + " Secrets Found: " + secrets + "\n" + DankersSkyblockMod.DELIMITER_COLOUR + " " + EnumChatFormatting.BOLD + "-------------------")); }).start(); } -- cgit From f8a26eac5faa5cee84eaae3fe1b9a7b4588fb7ec Mon Sep 17 00:00:00 2001 From: Sychic Date: Sat, 26 Dec 2020 18:24:14 -0500 Subject: Add secrets back because i accidentally removed it while resolving conflicts --- src/main/java/me/Danker/commands/DungeonsCommand.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/me/Danker/commands/DungeonsCommand.java b/src/main/java/me/Danker/commands/DungeonsCommand.java index 4179420..f9ad93e 100644 --- a/src/main/java/me/Danker/commands/DungeonsCommand.java +++ b/src/main/java/me/Danker/commands/DungeonsCommand.java @@ -78,6 +78,14 @@ public class DungeonsCommand extends CommandBase { player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Failed with reason: " + reason)); return; } + + String playerURL = "https://api.hypixel.net/player?uuid=" + uuid + "&key=" + key; + System.out.println("Fetching player data..."); + JsonObject playerResponse = APIHandler.getResponse(playerURL); + if(!playerResponse.get("success").getAsBoolean()){ + String reason = playerResponse.get("cause").getAsString(); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "This player has not played on Hypixel.")); + } System.out.println("Fetching dungeon stats..."); JsonObject dungeonsObject = profileResponse.get("profile").getAsJsonObject().get("members").getAsJsonObject().get(uuid).getAsJsonObject().get("dungeons").getAsJsonObject(); @@ -94,6 +102,7 @@ public class DungeonsCommand extends CommandBase { double archer = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("archer").getAsJsonObject().get("experience").getAsDouble()); double tank = Utils.xpToDungeonsLevel(dungeonsObject.get("player_classes").getAsJsonObject().get("tank").getAsJsonObject().get("experience").getAsDouble()); String selectedClass = Utils.capitalizeString(dungeonsObject.get("selected_dungeon_class").getAsString()); + int secrets = playerResponse.get("player").getAsJsonObject().get("achievements").getAsJsonObject().get("skyblock_treasure_hunter").getAsInt(); int highestFloor = catacombsObject.get("highest_tier_completed").getAsInt(); JsonObject completionObj = catacombsObject.get("tier_completions").getAsJsonObject(); @@ -107,7 +116,8 @@ public class DungeonsCommand extends CommandBase { EnumChatFormatting.LIGHT_PURPLE + " Mage Level: " + mage + "\n" + EnumChatFormatting.RED + " Berserk Level: " + berserk + "\n" + EnumChatFormatting.GREEN + " Archer Level: " + archer + "\n" + - EnumChatFormatting.BLUE + " Tank Level: " + tank + "\n\n"); + EnumChatFormatting.BLUE + " Tank Level: " + tank + "\n\n" + + EnumChatFormatting.WHITE + " Secrets Found: " + secrets + "\n\n"); StringBuilder completionsHoverString = new StringBuilder(); -- cgit From b2ea896a92afa735400c11e573651d8d207d5c79 Mon Sep 17 00:00:00 2001 From: Sychic Date: Wed, 30 Dec 2020 20:56:48 -0500 Subject: Edits to GUI which fix mishaps created while resolving conflicts --- src/main/java/me/Danker/gui/DankerGui.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index b91ed3e..ee8a5d8 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -123,18 +123,17 @@ public class DankerGui extends GuiScreen { rngesusAlert = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "RNGesus Alerts: " + Utils.getColouredBoolean(ToggleCommand.rngesusAlerts)); splitFishing = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing)); // Page 5 - lowHealthNotify = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Low Health Notifications: " + Utils.getColouredBoolean(ToggleCommand.lowHealthNotifyToggled)); + lowHealthNotify = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Low Health Notifications: " + Utils.getColouredBoolean(ToggleCommand.lowHealthNotifyToggled)); lividSolver = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Find Correct Livid: " + Utils.getColouredBoolean(ToggleCommand.lividSolverToggled)); dungeonTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Display Dungeon Timers: " + Utils.getColouredBoolean(ToggleCommand.dungeonTimerToggled)); stopSalvageStarred = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Stop Salvaging Starred Items: " + Utils.getColouredBoolean(ToggleCommand.stopSalvageStarredToggled)); watcherReadyMessage = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Display Watcher Ready Message: " + Utils.getColouredBoolean(ToggleCommand.watcherReadyToggled)); - splitFishing = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing)); + flowerWeapons = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Prevent Placing FoT/Spirit Sceptre: " + Utils.getColouredBoolean(ToggleCommand.flowerWeaponsToggled)); notifySlayerSlain = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Notify when Slayer Slain: " + Utils.getColouredBoolean(ToggleCommand.notifySlayerSlainToggled)); //Page 6 - flowerWeapons = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Prevent Placing FoT/Spirit Sceptre: " + Utils.getColouredBoolean(ToggleCommand.flowerWeaponsToggled)); - necronNotifications = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Necron Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled)); - bonzoTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Bonzo's Mask Timer: " + Utils.getColouredBoolean(ToggleCommand.bonzoTimerToggled)); - blockBreakingFarms = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Prevent Breaking Farms: " + Utils.getColouredBoolean(ToggleCommand.blockBreakingFarmsToggled)); + 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)); switch (page) { case 1: @@ -186,13 +185,13 @@ public class DankerGui extends GuiScreen { this.buttonList.add(dungeonTimer); this.buttonList.add(stopSalvageStarred); this.buttonList.add(watcherReadyMessage); - this.buttonList.add(notifySlayerSlain); this.buttonList.add(flowerWeapons); + this.buttonList.add(notifySlayerSlain); this.buttonList.add(nextPage); 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(backPage); -- cgit From 382dd472e4eb37d62588e673567a4d75d6b33ab3 Mon Sep 17 00:00:00 2001 From: Sychic Date: Thu, 31 Dec 2020 23:08:01 -0500 Subject: Version Change --- build.gradle | 2 +- src/main/java/me/Danker/DankersSkyblockMod.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/build.gradle b/build.gradle index 1561870..26dd98f 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-beta7" +version = "1.8.5-beta8" 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 fa00436..febc468 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; @Mod(modid = DankersSkyblockMod.MODID, version = DankersSkyblockMod.VERSION, clientSideOnly = true) public class DankersSkyblockMod { public static final String MODID = "Danker's Skyblock Mod"; - public static final String VERSION = "1.8.5-beta7"; + public static final String VERSION = "1.8.5-beta8"; static double checkItemsNow = 0; static double itemsChecked = 0; public static Map t6Enchants = new HashMap<>(); -- cgit From 9fa3405d2ac107488634af3fc7302954d90f4b17 Mon Sep 17 00:00:00 2001 From: Sychic Date: Fri, 1 Jan 2021 20:13:53 -0500 Subject: OAM Warning Patch --- src/main/java/me/Danker/DankersSkyblockMod.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index febc468..0bcecba 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -315,7 +315,7 @@ public class DankersSkyblockMod { public void postInit(final FMLPostInitializationEvent event) { Package[] packages = Package.getPackages(); for(Package p : packages){ - if(p.getName().startsWith("com.spiderfrog.gadgets")){ + if(p.getName().startsWith("com.spiderfrog.gadgets") || p.getName().startsWith("com.spiderfrog.oldanimations")){ usingOAM = true; break; } -- cgit From 320dab0e8050e4d771c339c3c836035a0a8df990 Mon Sep 17 00:00:00 2001 From: Sychic Date: Tue, 5 Jan 2021 22:50:33 -0500 Subject: Reparty Edits: Change message cancelling and reparty fail handling. (also add a miscellanous logger for debugging) --- src/main/java/me/Danker/DankersSkyblockMod.java | 160 ++++++++++++++++----- .../java/me/Danker/commands/RepartyCommand.java | 105 ++++++++++---- 2 files changed, 202 insertions(+), 63 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 0bcecba..8285bec 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -63,6 +63,7 @@ import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent; import net.minecraftforge.fml.common.versioning.DefaultArtifactVersion; import org.apache.commons.lang3.time.StopWatch; +import org.apache.logging.log4j.Logger; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; @@ -79,6 +80,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-beta8"; + public static Logger DSMLogger; static double checkItemsNow = 0; static double itemsChecked = 0; public static Map t6Enchants = new HashMap<>(); @@ -108,8 +110,9 @@ public class DankersSkyblockMod { public static final ResourceLocation CAKE_ICON = new ResourceLocation("dsm", "icons/cake.png"); public static final ResourceLocation BONZO_ICON = new ResourceLocation("dsm", "icons/bonzo.png"); + public static final ResourceLocation LOGO = new ResourceLocation("dsm", "icons/dsm.png"); - static String[] riddleSolutions = {"The reward is not in my chest!", "At least one of them is lying, and the reward is not in", + 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<>(); @@ -285,6 +288,7 @@ public class DankersSkyblockMod { @EventHandler public void preInit(final FMLPreInitializationEvent event) { + DSMLogger = event.getModLog(); ClientCommandHandler.instance.registerCommand(new ToggleCommand()); ClientCommandHandler.instance.registerCommand(new SetkeyCommand()); ClientCommandHandler.instance.registerCommand(new GetkeyCommand()); @@ -315,6 +319,7 @@ public class DankersSkyblockMod { 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; @@ -426,38 +431,125 @@ public class DankersSkyblockMod { } // Reparty command - if (System.currentTimeMillis() / 1000 - RepartyCommand.callTime <= 5) { - if (!(message.contains("----") || message.contains("disbanded") || message.contains("seconds to accept") || message.contains("●") || message.contains("Party Members") || message.contains("Couldn't find a player") || message.contains("cannot invite that player") || message.length() == 0)) { - 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 if (message.contains("Couldn't find a player") || message.contains("You cannot invite that player")) { - RepartyCommand.repartyFailList.add(RepartyCommand.currentMember); - } - else { - while (members.find()) { - String partyMember = members.group(1); - if (!partyMember.equals(player.getName())) { - RepartyCommand.party.add(partyMember); - } - } - } - event.setCanceled(true); + // Getting party + if (RepartyCommand.gettingParty) { + if (message.contains("-----")) { + switch(RepartyCommand.Delimiter) { + case 0: + System.out.println("Get Party Delimiter Cancelled"); + RepartyCommand.Delimiter++; + event.setCanceled(true); + return; + case 1: + System.out.println("Done querying party"); + RepartyCommand.gettingParty = false; + RepartyCommand.Delimiter = 0; + event.setCanceled(true); + return; + } + }else if (message.startsWith("Party M") || message.startsWith("Party Leader")){ + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + + Pattern party_start_pattern = Pattern.compile("^Party Members \\((\\d+)\\)$"); + Pattern leader_pattern = Pattern.compile("^Party Leader: (?:\\[.+?] )?(\\w+) ●$"); + Pattern members_pattern = Pattern.compile(" (?:\\[.+?] )?(\\w+) ●"); + Matcher party_start = party_start_pattern.matcher(message); + Matcher leader = leader_pattern.matcher(message); + Matcher members = members_pattern.matcher(message); + + if (party_start.matches() && Integer.parseInt(party_start.group(1)) == 1) { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "You cannot reparty yourself.")); + RepartyCommand.partyThread.interrupt(); + } else if (leader.matches() && !(leader.group(1).equals(player.getName()))) { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "You are not party leader.")); + RepartyCommand.partyThread.interrupt(); + } else { + while (members.find()) { + String partyMember = members.group(1); + if (!partyMember.equals(player.getName())) { + RepartyCommand.party.add(partyMember); + System.out.println(partyMember); + } + } + } + event.setCanceled(true); + return; + } + } + // Disbanding party + if (RepartyCommand.disbanding) { + if (message.contains("-----")) { + switch (RepartyCommand.Delimiter) { + case 0: + System.out.println("Disband Delimiter Cancelled"); + RepartyCommand.Delimiter++; + event.setCanceled(true); + return; + case 1: + System.out.println("Done disbanding"); + RepartyCommand.disbanding = false; + RepartyCommand.Delimiter = 0; + event.setCanceled(true); + return; + } + } else if (message.endsWith("has disbanded the party!")) { + event.setCanceled(true); + return; + } + } + // Inviting + if (RepartyCommand.inviting) { + if (message.contains("-----")) { + 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; + } + } else if (message.endsWith(" to the party! They have 60 seconds to accept.")) { + Pattern invitePattern = Pattern.compile("(?:(?:\\[.+?] )?(?:\\w+) invited )(?:\\[.+?] )?(\\w+)"); + Matcher invitee = invitePattern.matcher(message); + if (invitee.find()) { + System.out.println("" + invitee.group(1) + ": " + RepartyCommand.repartyFailList.remove(invitee.group(1))); + } + event.setCanceled(true); + return; + } else if (message.contains("Couldn't find a player") || message.contains("You cannot invite that player")) { + event.setCanceled(true); + return; + } + } + // Fail Inviting + if (RepartyCommand.failInviting) { + if (message.contains("-----")) { + 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; + } + } else if (message.endsWith(" to the party! They have 60 seconds to accept.")) { + Pattern invitePattern = Pattern.compile("(?:(?:\\[.+?] )?(?:\\w+) invited )(?:\\[.+?] )?(\\w+)"); + Matcher invitee = invitePattern.matcher(message); + if (invitee.find()) { + System.out.println("" + invitee.group(1) + ": " + RepartyCommand.repartyFailList.remove(invitee.group(1))); + } + event.setCanceled(true); + return; + } else if (message.contains("Couldn't find a player") || message.contains("You cannot invite that player")) { + event.setCanceled(true); + return; + } } if (!Utils.inSkyblock) return; @@ -689,7 +781,7 @@ public class DankersSkyblockMod { return; } } - + if (ToggleCommand.oruoToggled && Utils.inDungeons) { if (message.contains("What SkyBlock year is it?")) { double currentTime = System.currentTimeMillis() /1000L; diff --git a/src/main/java/me/Danker/commands/RepartyCommand.java b/src/main/java/me/Danker/commands/RepartyCommand.java index d3bf9e4..92836c5 100644 --- a/src/main/java/me/Danker/commands/RepartyCommand.java +++ b/src/main/java/me/Danker/commands/RepartyCommand.java @@ -1,9 +1,9 @@ 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.client.gui.GuiNewChat; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommand; @@ -13,6 +13,7 @@ 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.ObfuscationReflectionHelper; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -25,10 +26,16 @@ import java.util.regex.Pattern; public class RepartyCommand extends CommandBase implements ICommand { public static double callTime = 0; - public static boolean inviteFailed = false; + public static boolean gettingParty = false; + public static int Delimiter = 0; + public static boolean disbanding = false; + public static boolean inviting = false; + public static boolean failInviting = false; public static String currentMember; public static List party = new ArrayList<>(); public static List repartyFailList = new ArrayList<>(); + public static List joinList = new ArrayList<>(); + public static Thread partyThread = null; @Override public String getCommandName() { @@ -52,47 +59,87 @@ public class RepartyCommand extends CommandBase implements ICommand { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { + if (args.length > 0 && (args[0].startsWith("fail") || args[0].equals("f"))) { + partyThread = new Thread(() -> { + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + RepartyCommand.callTime = (double) System.currentTimeMillis() / 1000; + GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI(); + + + try { + player.sendChatMessage("/p " + String.join(" ", repartyFailList)); + String members = String.join(EnumChatFormatting.WHITE + "\n- " + EnumChatFormatting.YELLOW, repartyFailList); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------\n" + + DankersSkyblockMod.MAIN_COLOUR + "Partying:" + EnumChatFormatting.WHITE + "\n- " + + EnumChatFormatting.YELLOW + members + "\n" + + DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------")); + failInviting = true; + while (failInviting) { + Thread.sleep(10); + } + if (repartyFailList.size() > 0) { + String repartyFails = String.join("\n- " + EnumChatFormatting.RED, repartyFailList); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------\n" + + DankersSkyblockMod.MAIN_COLOUR + "Failed to invite:" + EnumChatFormatting.WHITE + "\n- " + + EnumChatFormatting.RED + repartyFails + "\n" + + DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------")); + } + } catch (InterruptedException e) { + e.printStackTrace(); + } + }); + + partyThread.start(); + + return; + } + + party.clear(); repartyFailList.clear(); // MULTI THREAD DRIFTING - new Thread(() -> { + partyThread = new Thread(() -> { EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; RepartyCommand.callTime = (double) System.currentTimeMillis() / 1000; - + GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI(); + + try { - Thread.sleep(210); - player.sendChatMessage("/p list"); - System.out.println("Grabbing the party members..."); - Thread.sleep(550); - if (RepartyCommand.party.size() == 0) return; - + player.sendChatMessage("/pl"); + gettingParty = true; + while (gettingParty) { + Thread.sleep(10); + } + if (party.size() == 0) return; player.sendChatMessage("/p disband"); - Thread.sleep(210); - - String members = String.join(EnumChatFormatting.WHITE + "\n- " + EnumChatFormatting.GOLD, RepartyCommand.party); + disbanding = true; + while (disbanding) { + Thread.sleep(10); + } + 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.GOLD + members + "\n" + - DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------\n")); - - for (int i = 0; i < RepartyCommand.party.size(); i++) { - RepartyCommand.currentMember = RepartyCommand.party.get(i); - player.sendChatMessage("/p " + RepartyCommand.currentMember); - Thread.sleep(400); + DankersSkyblockMod.MAIN_COLOUR + "Repartying:" + EnumChatFormatting.WHITE + "\n- " + + EnumChatFormatting.YELLOW + members + "\n" + + DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------")); + inviting = true; + repartyFailList = new ArrayList<>(party); + while (inviting) { + Thread.sleep(10); } - - if (RepartyCommand.repartyFailList.size() > 0) { - Thread.sleep(300); - String failedMembers = String.join(EnumChatFormatting.WHITE + "\n- " + EnumChatFormatting.GOLD, RepartyCommand.repartyFailList); + if (repartyFailList.size() > 0) { + String repartyFails = String.join("\n- " + EnumChatFormatting.RED, repartyFailList); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------\n" + - DankersSkyblockMod.ERROR_COLOUR + "Unable to Invite:" + EnumChatFormatting.WHITE + "\n- " + - EnumChatFormatting.GOLD + failedMembers + "\n" + - DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------\n")); + DankersSkyblockMod.MAIN_COLOUR + "Failed to invite:" + EnumChatFormatting.WHITE + "\n- " + + EnumChatFormatting.RED + repartyFails + "\n" + + DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------")); } } catch (InterruptedException e) { e.printStackTrace(); } - }).start(); + }); + + partyThread.start(); } } \ No newline at end of file -- cgit From d20b0500e64a92d2db48d15d2ccf9f033b08f003 Mon Sep 17 00:00:00 2001 From: Sychic Date: Sun, 10 Jan 2021 18:11:52 -0500 Subject: Ghost party argument. Planning on changing to individual partying later when I can figure the logic out. --- .../java/me/Danker/commands/RepartyCommand.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/me/Danker/commands/RepartyCommand.java b/src/main/java/me/Danker/commands/RepartyCommand.java index 92836c5..fd63f39 100644 --- a/src/main/java/me/Danker/commands/RepartyCommand.java +++ b/src/main/java/me/Danker/commands/RepartyCommand.java @@ -25,13 +25,11 @@ import java.util.regex.Pattern; public class RepartyCommand extends CommandBase implements ICommand { - public static double callTime = 0; public static boolean gettingParty = false; public static int Delimiter = 0; public static boolean disbanding = false; public static boolean inviting = false; public static boolean failInviting = false; - public static String currentMember; public static List party = new ArrayList<>(); public static List repartyFailList = new ArrayList<>(); public static List joinList = new ArrayList<>(); @@ -62,7 +60,6 @@ public class RepartyCommand extends CommandBase implements ICommand { if (args.length > 0 && (args[0].startsWith("fail") || args[0].equals("f"))) { partyThread = new Thread(() -> { EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; - RepartyCommand.callTime = (double) System.currentTimeMillis() / 1000; GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI(); @@ -94,22 +91,25 @@ public class RepartyCommand extends CommandBase implements ICommand { return; } + boolean ghost = args.length > 0 && (args[0].toLowerCase().equals("g") || args[0].toLowerCase().equals("ghost")); - party.clear(); - repartyFailList.clear(); + if(ghost){ + party.clear(); + repartyFailList.clear(); + } // MULTI THREAD DRIFTING partyThread = new Thread(() -> { EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; - RepartyCommand.callTime = (double) System.currentTimeMillis() / 1000; - GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI(); try { - player.sendChatMessage("/pl"); - gettingParty = true; - while (gettingParty) { - Thread.sleep(10); + if(ghost){ + player.sendChatMessage("/pl"); + gettingParty = true; + while (gettingParty) { + Thread.sleep(10); + } } if (party.size() == 0) return; player.sendChatMessage("/p disband"); -- cgit From caf6e89bffcf0b75843f3ec9b036a7f15bc48185 Mon Sep 17 00:00:00 2001 From: Sychic Date: Mon, 11 Jan 2021 21:35:34 -0500 Subject: Messed up ghost party argument, actually sends reparty now --- .../java/me/Danker/commands/RepartyCommand.java | 53 ++++++++++++++++------ 1 file changed, 38 insertions(+), 15 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/me/Danker/commands/RepartyCommand.java b/src/main/java/me/Danker/commands/RepartyCommand.java index 92836c5..f4cc43d 100644 --- a/src/main/java/me/Danker/commands/RepartyCommand.java +++ b/src/main/java/me/Danker/commands/RepartyCommand.java @@ -8,30 +8,18 @@ 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.ObfuscationReflectionHelper; -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; public static boolean gettingParty = false; public static int Delimiter = 0; public static boolean disbanding = false; public static boolean inviting = false; public static boolean failInviting = false; - public static String currentMember; public static List party = new ArrayList<>(); public static List repartyFailList = new ArrayList<>(); public static List joinList = new ArrayList<>(); @@ -62,7 +50,6 @@ public class RepartyCommand extends CommandBase implements ICommand { if (args.length > 0 && (args[0].startsWith("fail") || args[0].equals("f"))) { partyThread = new Thread(() -> { EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; - RepartyCommand.callTime = (double) System.currentTimeMillis() / 1000; GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI(); @@ -94,6 +81,44 @@ public class RepartyCommand extends CommandBase implements ICommand { return; } + if (args.length > 0 && (args[0].toLowerCase().equals("g") || args[0].toLowerCase().equals("ghost"))) { + partyThread = new Thread(() -> { + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + + + try { + player.sendChatMessage("/p disband"); + disbanding = true; + while (disbanding) { + Thread.sleep(10); + } + 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); + while (inviting) { + Thread.sleep(10); + } + if (repartyFailList.size() > 0) { + String repartyFails = String.join("\n- " + EnumChatFormatting.RED, repartyFailList); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------\n" + + DankersSkyblockMod.MAIN_COLOUR + "Failed to invite:" + EnumChatFormatting.WHITE + "\n- " + + EnumChatFormatting.RED + repartyFails + "\n" + + DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------")); + } + } catch (InterruptedException e) { + e.printStackTrace(); + } + }); + + partyThread.start(); + + return; + } party.clear(); repartyFailList.clear(); @@ -101,8 +126,6 @@ public class RepartyCommand extends CommandBase implements ICommand { // MULTI THREAD DRIFTING partyThread = new Thread(() -> { EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; - RepartyCommand.callTime = (double) System.currentTimeMillis() / 1000; - GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI(); try { -- cgit From b9a74f0420d0cdba780fecfe92e1367e4f1cb358 Mon Sep 17 00:00:00 2001 From: Sychic Date: Sun, 10 Jan 2021 18:11:52 -0500 Subject: Ghost party argument. Planning on changing to individual partying later when I can figure the logic out. --- .../java/me/Danker/commands/RepartyCommand.java | 63 +++++++--------------- 1 file changed, 20 insertions(+), 43 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/me/Danker/commands/RepartyCommand.java b/src/main/java/me/Danker/commands/RepartyCommand.java index f4cc43d..fd63f39 100644 --- a/src/main/java/me/Danker/commands/RepartyCommand.java +++ b/src/main/java/me/Danker/commands/RepartyCommand.java @@ -8,10 +8,20 @@ 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.ObfuscationReflectionHelper; +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 { @@ -81,58 +91,25 @@ public class RepartyCommand extends CommandBase implements ICommand { return; } - if (args.length > 0 && (args[0].toLowerCase().equals("g") || args[0].toLowerCase().equals("ghost"))) { - partyThread = new Thread(() -> { - EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; - + boolean ghost = args.length > 0 && (args[0].toLowerCase().equals("g") || args[0].toLowerCase().equals("ghost")); - try { - player.sendChatMessage("/p disband"); - disbanding = true; - while (disbanding) { - Thread.sleep(10); - } - 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); - while (inviting) { - Thread.sleep(10); - } - if (repartyFailList.size() > 0) { - String repartyFails = String.join("\n- " + EnumChatFormatting.RED, repartyFailList); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------\n" + - DankersSkyblockMod.MAIN_COLOUR + "Failed to invite:" + EnumChatFormatting.WHITE + "\n- " + - EnumChatFormatting.RED + repartyFails + "\n" + - DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------")); - } - } catch (InterruptedException e) { - e.printStackTrace(); - } - }); - - partyThread.start(); - - return; + if(ghost){ + party.clear(); + repartyFailList.clear(); } - party.clear(); - repartyFailList.clear(); - // MULTI THREAD DRIFTING partyThread = new Thread(() -> { EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; try { - player.sendChatMessage("/pl"); - gettingParty = true; - while (gettingParty) { - Thread.sleep(10); + if(ghost){ + player.sendChatMessage("/pl"); + gettingParty = true; + while (gettingParty) { + Thread.sleep(10); + } } if (party.size() == 0) return; player.sendChatMessage("/p disband"); -- cgit From 39bf45abfcd4d1704f1173149f8f028e07016f39 Mon Sep 17 00:00:00 2001 From: Sychic Date: Mon, 11 Jan 2021 21:50:58 -0500 Subject: Revert reparty edit commits 1/2 --- .../java/me/Danker/commands/RepartyCommand.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/me/Danker/commands/RepartyCommand.java b/src/main/java/me/Danker/commands/RepartyCommand.java index fd63f39..92836c5 100644 --- a/src/main/java/me/Danker/commands/RepartyCommand.java +++ b/src/main/java/me/Danker/commands/RepartyCommand.java @@ -25,11 +25,13 @@ import java.util.regex.Pattern; public class RepartyCommand extends CommandBase implements ICommand { + public static double callTime = 0; public static boolean gettingParty = false; public static int Delimiter = 0; public static boolean disbanding = false; public static boolean inviting = false; public static boolean failInviting = false; + public static String currentMember; public static List party = new ArrayList<>(); public static List repartyFailList = new ArrayList<>(); public static List joinList = new ArrayList<>(); @@ -60,6 +62,7 @@ public class RepartyCommand extends CommandBase implements ICommand { if (args.length > 0 && (args[0].startsWith("fail") || args[0].equals("f"))) { partyThread = new Thread(() -> { EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + RepartyCommand.callTime = (double) System.currentTimeMillis() / 1000; GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI(); @@ -91,25 +94,22 @@ 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(() -> { EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + RepartyCommand.callTime = (double) System.currentTimeMillis() / 1000; + GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI(); 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"); -- cgit From 9838bc712ff8c4614a658b1bde4dae913f03541f Mon Sep 17 00:00:00 2001 From: Sychic Date: Mon, 11 Jan 2021 21:51:20 -0500 Subject: Revert reparty edit commits 2/2 --- src/main/java/me/Danker/DankersSkyblockMod.java | 160 +++++---------------- .../java/me/Danker/commands/RepartyCommand.java | 105 ++++---------- 2 files changed, 63 insertions(+), 202 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 8285bec..0bcecba 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -63,7 +63,6 @@ import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent; import net.minecraftforge.fml.common.versioning.DefaultArtifactVersion; import org.apache.commons.lang3.time.StopWatch; -import org.apache.logging.log4j.Logger; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; @@ -80,7 +79,6 @@ 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-beta8"; - public static Logger DSMLogger; static double checkItemsNow = 0; static double itemsChecked = 0; public static Map t6Enchants = new HashMap<>(); @@ -110,9 +108,8 @@ public class DankersSkyblockMod { public static final ResourceLocation CAKE_ICON = new ResourceLocation("dsm", "icons/cake.png"); public static final ResourceLocation BONZO_ICON = new ResourceLocation("dsm", "icons/bonzo.png"); - public static final ResourceLocation LOGO = new ResourceLocation("dsm", "icons/dsm.png"); - static String[] riddleSolutions = {"The reward is not in my chest!", "At least one of them is lying, and the reward is not in", + 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<>(); @@ -288,7 +285,6 @@ public class DankersSkyblockMod { @EventHandler public void preInit(final FMLPreInitializationEvent event) { - DSMLogger = event.getModLog(); ClientCommandHandler.instance.registerCommand(new ToggleCommand()); ClientCommandHandler.instance.registerCommand(new SetkeyCommand()); ClientCommandHandler.instance.registerCommand(new GetkeyCommand()); @@ -319,7 +315,6 @@ public class DankersSkyblockMod { 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; @@ -431,125 +426,38 @@ public class DankersSkyblockMod { } // Reparty command - // Getting party - if (RepartyCommand.gettingParty) { - if (message.contains("-----")) { - switch(RepartyCommand.Delimiter) { - case 0: - System.out.println("Get Party Delimiter Cancelled"); - RepartyCommand.Delimiter++; - event.setCanceled(true); - return; - case 1: - System.out.println("Done querying party"); - RepartyCommand.gettingParty = false; - RepartyCommand.Delimiter = 0; - event.setCanceled(true); - return; - } - }else if (message.startsWith("Party M") || message.startsWith("Party Leader")){ - EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; - - Pattern party_start_pattern = Pattern.compile("^Party Members \\((\\d+)\\)$"); - Pattern leader_pattern = Pattern.compile("^Party Leader: (?:\\[.+?] )?(\\w+) ●$"); - Pattern members_pattern = Pattern.compile(" (?:\\[.+?] )?(\\w+) ●"); - Matcher party_start = party_start_pattern.matcher(message); - Matcher leader = leader_pattern.matcher(message); - Matcher members = members_pattern.matcher(message); - - if (party_start.matches() && Integer.parseInt(party_start.group(1)) == 1) { - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "You cannot reparty yourself.")); - RepartyCommand.partyThread.interrupt(); - } else if (leader.matches() && !(leader.group(1).equals(player.getName()))) { - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "You are not party leader.")); - RepartyCommand.partyThread.interrupt(); - } else { - while (members.find()) { - String partyMember = members.group(1); - if (!partyMember.equals(player.getName())) { - RepartyCommand.party.add(partyMember); - System.out.println(partyMember); - } - } - } - event.setCanceled(true); - return; - } - } - // Disbanding party - if (RepartyCommand.disbanding) { - if (message.contains("-----")) { - switch (RepartyCommand.Delimiter) { - case 0: - System.out.println("Disband Delimiter Cancelled"); - RepartyCommand.Delimiter++; - event.setCanceled(true); - return; - case 1: - System.out.println("Done disbanding"); - RepartyCommand.disbanding = false; - RepartyCommand.Delimiter = 0; - event.setCanceled(true); - return; - } - } else if (message.endsWith("has disbanded the party!")) { - event.setCanceled(true); - return; - } - } - // Inviting - if (RepartyCommand.inviting) { - if (message.contains("-----")) { - 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; - } - } else if (message.endsWith(" to the party! They have 60 seconds to accept.")) { - Pattern invitePattern = Pattern.compile("(?:(?:\\[.+?] )?(?:\\w+) invited )(?:\\[.+?] )?(\\w+)"); - Matcher invitee = invitePattern.matcher(message); - if (invitee.find()) { - System.out.println("" + invitee.group(1) + ": " + RepartyCommand.repartyFailList.remove(invitee.group(1))); - } - event.setCanceled(true); - return; - } else if (message.contains("Couldn't find a player") || message.contains("You cannot invite that player")) { - event.setCanceled(true); - return; - } - } - // Fail Inviting - if (RepartyCommand.failInviting) { - if (message.contains("-----")) { - 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; - } - } else if (message.endsWith(" to the party! They have 60 seconds to accept.")) { - Pattern invitePattern = Pattern.compile("(?:(?:\\[.+?] )?(?:\\w+) invited )(?:\\[.+?] )?(\\w+)"); - Matcher invitee = invitePattern.matcher(message); - if (invitee.find()) { - System.out.println("" + invitee.group(1) + ": " + RepartyCommand.repartyFailList.remove(invitee.group(1))); - } - event.setCanceled(true); - return; - } else if (message.contains("Couldn't find a player") || message.contains("You cannot invite that player")) { - event.setCanceled(true); - return; - } + if (System.currentTimeMillis() / 1000 - RepartyCommand.callTime <= 5) { + if (!(message.contains("----") || message.contains("disbanded") || message.contains("seconds to accept") || message.contains("●") || message.contains("Party Members") || message.contains("Couldn't find a player") || message.contains("cannot invite that player") || message.length() == 0)) { + 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 if (message.contains("Couldn't find a player") || message.contains("You cannot invite that player")) { + RepartyCommand.repartyFailList.add(RepartyCommand.currentMember); + } + else { + while (members.find()) { + String partyMember = members.group(1); + if (!partyMember.equals(player.getName())) { + RepartyCommand.party.add(partyMember); + } + } + } + event.setCanceled(true); } if (!Utils.inSkyblock) return; @@ -781,7 +689,7 @@ public class DankersSkyblockMod { return; } } - + if (ToggleCommand.oruoToggled && Utils.inDungeons) { if (message.contains("What SkyBlock year is it?")) { double currentTime = System.currentTimeMillis() /1000L; diff --git a/src/main/java/me/Danker/commands/RepartyCommand.java b/src/main/java/me/Danker/commands/RepartyCommand.java index 92836c5..d3bf9e4 100644 --- a/src/main/java/me/Danker/commands/RepartyCommand.java +++ b/src/main/java/me/Danker/commands/RepartyCommand.java @@ -1,9 +1,9 @@ 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.client.gui.GuiNewChat; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommand; @@ -13,7 +13,6 @@ 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.ObfuscationReflectionHelper; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -26,16 +25,10 @@ import java.util.regex.Pattern; public class RepartyCommand extends CommandBase implements ICommand { public static double callTime = 0; - public static boolean gettingParty = false; - public static int Delimiter = 0; - public static boolean disbanding = false; - public static boolean inviting = false; - public static boolean failInviting = false; + public static boolean inviteFailed = false; public static String currentMember; public static List party = new ArrayList<>(); public static List repartyFailList = new ArrayList<>(); - public static List joinList = new ArrayList<>(); - public static Thread partyThread = null; @Override public String getCommandName() { @@ -59,87 +52,47 @@ public class RepartyCommand extends CommandBase implements ICommand { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { - if (args.length > 0 && (args[0].startsWith("fail") || args[0].equals("f"))) { - partyThread = new Thread(() -> { - EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; - RepartyCommand.callTime = (double) System.currentTimeMillis() / 1000; - GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI(); - - - try { - player.sendChatMessage("/p " + String.join(" ", repartyFailList)); - String members = String.join(EnumChatFormatting.WHITE + "\n- " + EnumChatFormatting.YELLOW, repartyFailList); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------\n" + - DankersSkyblockMod.MAIN_COLOUR + "Partying:" + EnumChatFormatting.WHITE + "\n- " + - EnumChatFormatting.YELLOW + members + "\n" + - DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------")); - failInviting = true; - while (failInviting) { - Thread.sleep(10); - } - if (repartyFailList.size() > 0) { - String repartyFails = String.join("\n- " + EnumChatFormatting.RED, repartyFailList); - player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------\n" + - DankersSkyblockMod.MAIN_COLOUR + "Failed to invite:" + EnumChatFormatting.WHITE + "\n- " + - EnumChatFormatting.RED + repartyFails + "\n" + - DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------")); - } - } catch (InterruptedException e) { - e.printStackTrace(); - } - }); - - partyThread.start(); - - return; - } - - party.clear(); repartyFailList.clear(); // MULTI THREAD DRIFTING - partyThread = new Thread(() -> { + new Thread(() -> { EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; RepartyCommand.callTime = (double) System.currentTimeMillis() / 1000; - GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI(); - - + try { - player.sendChatMessage("/pl"); - gettingParty = true; - while (gettingParty) { - Thread.sleep(10); - } - if (party.size() == 0) return; + Thread.sleep(210); + player.sendChatMessage("/p list"); + System.out.println("Grabbing the party members..."); + Thread.sleep(550); + if (RepartyCommand.party.size() == 0) return; + player.sendChatMessage("/p disband"); - disbanding = true; - while (disbanding) { - Thread.sleep(10); - } - player.sendChatMessage("/p " + String.join(" ", party)); - String members = String.join(EnumChatFormatting.WHITE + "\n- " + EnumChatFormatting.YELLOW, RepartyCommand.party); + Thread.sleep(210); + + String members = String.join(EnumChatFormatting.WHITE + "\n- " + EnumChatFormatting.GOLD, 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); - while (inviting) { - Thread.sleep(10); + DankersSkyblockMod.MAIN_COLOUR + "Repartying:" + EnumChatFormatting.WHITE + "\n- " + + EnumChatFormatting.GOLD + members + "\n" + + DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------\n")); + + for (int i = 0; i < RepartyCommand.party.size(); i++) { + RepartyCommand.currentMember = RepartyCommand.party.get(i); + player.sendChatMessage("/p " + RepartyCommand.currentMember); + Thread.sleep(400); } - if (repartyFailList.size() > 0) { - String repartyFails = String.join("\n- " + EnumChatFormatting.RED, repartyFailList); + + if (RepartyCommand.repartyFailList.size() > 0) { + Thread.sleep(300); + String failedMembers = String.join(EnumChatFormatting.WHITE + "\n- " + EnumChatFormatting.GOLD, RepartyCommand.repartyFailList); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------\n" + - DankersSkyblockMod.MAIN_COLOUR + "Failed to invite:" + EnumChatFormatting.WHITE + "\n- " + - EnumChatFormatting.RED + repartyFails + "\n" + - DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------")); + DankersSkyblockMod.ERROR_COLOUR + "Unable to Invite:" + EnumChatFormatting.WHITE + "\n- " + + EnumChatFormatting.GOLD + failedMembers + "\n" + + DankersSkyblockMod.DELIMITER_COLOUR + "-----------------------------\n")); } } catch (InterruptedException e) { e.printStackTrace(); } - }); - - partyThread.start(); + }).start(); } } \ No newline at end of file -- 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') 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 658ce92df9f08d0da53e53bf61f059f0b15f222f Mon Sep 17 00:00:00 2001 From: Sychic Date: Sun, 24 Jan 2021 20:53:24 -0500 Subject: cleanup --- src/main/java/me/Danker/commands/RepartyCommand.java | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/me/Danker/commands/RepartyCommand.java b/src/main/java/me/Danker/commands/RepartyCommand.java index d436f90..9614daa 100644 --- a/src/main/java/me/Danker/commands/RepartyCommand.java +++ b/src/main/java/me/Danker/commands/RepartyCommand.java @@ -8,20 +8,11 @@ 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.ObfuscationReflectionHelper; -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 { @@ -56,9 +47,6 @@ 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; -- cgit