diff options
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt | 3 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt index 6a1fb52f8..0e719c4e1 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/TestChatCommand.kt @@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.test.command import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.utils.ChatUtils +import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.OSUtils import kotlinx.coroutines.launch import net.minecraft.util.ChatComponentText @@ -41,7 +42,7 @@ object TestChatCommand { ChatUtils.chat("§cChat blocked: ${event.blockedReason}") } else { val finalMessage = event.chatComponent.formattedText - if (finalMessage != message) { + if (LorenzUtils.stripVanillaMessage(finalMessage) != LorenzUtils.stripVanillaMessage(message)) { ChatUtils.chat("§eChat modified!") } ChatUtils.chat(finalMessage, false) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt index 2682c2973..433078b5f 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt @@ -335,7 +335,9 @@ object StringUtils { return null } - if (LorenzUtils.stripVanillaMessage(original.formattedText) == newText) return null + val originalText = LorenzUtils.stripVanillaMessage(original.formattedText) + val newTextt = LorenzUtils.stripVanillaMessage(newText) + if (originalText == newTextt) return null val text = ChatComponentText(newText) if (size == 1) { |