From ad53066846fb168255499a332a1ad4bca39f5935 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Sat, 27 Feb 2021 18:25:51 -0500 Subject: Move features into their own files --- .../java/me/Danker/features/WatcherReadyAlert.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/main/java/me/Danker/features/WatcherReadyAlert.java (limited to 'src/main/java/me/Danker/features/WatcherReadyAlert.java') diff --git a/src/main/java/me/Danker/features/WatcherReadyAlert.java b/src/main/java/me/Danker/features/WatcherReadyAlert.java new file mode 100644 index 0000000..b68ccc2 --- /dev/null +++ b/src/main/java/me/Danker/features/WatcherReadyAlert.java @@ -0,0 +1,22 @@ +package me.Danker.features; + +import me.Danker.commands.ToggleCommand; +import me.Danker.utils.Utils; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StringUtils; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class WatcherReadyAlert { + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent event) { + String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); + + if (!Utils.inDungeons) return; + + if (message.contains("[BOSS] The Watcher: That will be enough for now.")) { + if (ToggleCommand.watcherReadyToggled) Utils.createTitle(EnumChatFormatting.RED + "WATCHER READY", 2); + } + } +} -- cgit From 786efa0ea48daffb075d2d6482a677571e136a1b Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Thu, 25 Mar 2021 10:54:07 -0400 Subject: Fix some dungeon features not working when other mods hide messages SkyblockAddons, Skytils, etc. --- src/main/java/me/Danker/features/DungeonTimer.java | 2 +- src/main/java/me/Danker/features/NecronNotifications.java | 2 +- src/main/java/me/Danker/features/WatcherReadyAlert.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/me/Danker/features/WatcherReadyAlert.java') diff --git a/src/main/java/me/Danker/features/DungeonTimer.java b/src/main/java/me/Danker/features/DungeonTimer.java index 5929f05..394f2de 100644 --- a/src/main/java/me/Danker/features/DungeonTimer.java +++ b/src/main/java/me/Danker/features/DungeonTimer.java @@ -22,7 +22,7 @@ public class DungeonTimer { static int dungeonDeaths = 0; static int puzzleFails = 0; - @SubscribeEvent + @SubscribeEvent(receiveCanceled = true) public void onChat(ClientChatReceivedEvent event) { String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); diff --git a/src/main/java/me/Danker/features/NecronNotifications.java b/src/main/java/me/Danker/features/NecronNotifications.java index a1d4d26..d35996c 100644 --- a/src/main/java/me/Danker/features/NecronNotifications.java +++ b/src/main/java/me/Danker/features/NecronNotifications.java @@ -18,7 +18,7 @@ import java.util.List; public class NecronNotifications { - @SubscribeEvent + @SubscribeEvent(receiveCanceled = true) public void onChat(ClientChatReceivedEvent event) { String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); diff --git a/src/main/java/me/Danker/features/WatcherReadyAlert.java b/src/main/java/me/Danker/features/WatcherReadyAlert.java index b68ccc2..ca3777b 100644 --- a/src/main/java/me/Danker/features/WatcherReadyAlert.java +++ b/src/main/java/me/Danker/features/WatcherReadyAlert.java @@ -9,7 +9,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class WatcherReadyAlert { - @SubscribeEvent + @SubscribeEvent(receiveCanceled = true) public void onChat(ClientChatReceivedEvent event) { String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); -- cgit