From c260e3b0bb8eda50ea9e8af4f0214dc08d7f1d91 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Fri, 4 Mar 2022 02:55:02 -0500 Subject: Small fixes to chat message triggers Mainly fix crash with three man solver --- src/main/java/me/Danker/features/AutoAcceptReparty.java | 5 ++++- src/main/java/me/Danker/features/BonzoMaskTimer.java | 1 + src/main/java/me/Danker/features/puzzlesolvers/ThreeManSolver.java | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/Danker/features/AutoAcceptReparty.java b/src/main/java/me/Danker/features/AutoAcceptReparty.java index a89b30b..b2e563d 100644 --- a/src/main/java/me/Danker/features/AutoAcceptReparty.java +++ b/src/main/java/me/Danker/features/AutoAcceptReparty.java @@ -13,9 +13,12 @@ public class AutoAcceptReparty { @SubscribeEvent(receiveCanceled = true) public void onChat(ClientChatReceivedEvent event) { - String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); if (ToggleCommand.autoAcceptReparty) { + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + + if (message.contains(":")) return; + String[] split = message.split("\\s"); if (message.contains("has disbanded the party!")) { diff --git a/src/main/java/me/Danker/features/BonzoMaskTimer.java b/src/main/java/me/Danker/features/BonzoMaskTimer.java index e27d0bf..5bec1ba 100644 --- a/src/main/java/me/Danker/features/BonzoMaskTimer.java +++ b/src/main/java/me/Danker/features/BonzoMaskTimer.java @@ -35,6 +35,7 @@ public class BonzoMaskTimer { String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); if (!Utils.inDungeons) return; + if (message.contains(":")) return; if (ToggleCommand.bonzoTimerToggled && message.contains("Bonzo's Mask") && message.contains("saved your life!")) { double usedTime = System.currentTimeMillis() / 1000; diff --git a/src/main/java/me/Danker/features/puzzlesolvers/ThreeManSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/ThreeManSolver.java index b0935c3..d97509c 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/ThreeManSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/ThreeManSolver.java @@ -35,7 +35,7 @@ public class ThreeManSolver { if (!Utils.inDungeons) return; - if (ToggleCommand.threeManToggled && message.contains("[NPC]")) { + if (ToggleCommand.threeManToggled && message.startsWith("[NPC]")) { if (DankersSkyblockMod.data != null && DankersSkyblockMod.data.has("threeman")) { JsonArray riddleSolutions = DankersSkyblockMod.data.get("threeman").getAsJsonArray(); -- cgit