diff options
author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2024-04-07 18:39:07 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-07 10:39:07 +0200 |
commit | 0850dc6a0195d7e52cea13cc5838e75d216f81b7 (patch) | |
tree | e59d05b9fff66dd3d50ff75d497cbc8448d2fdd2 /src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt | |
parent | 31bfd8a1d3437f4bdbefa7bcba75143e37c4ac90 (diff) | |
download | skyhanni-0850dc6a0195d7e52cea13cc5838e75d216f81b7.tar.gz skyhanni-0850dc6a0195d7e52cea13cc5838e75d216f81b7.tar.bz2 skyhanni-0850dc6a0195d7e52cea13cc5838e75d216f81b7.zip |
Backend: Change stuff around with chat messages (#1227)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt b/src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt index 8573a629f..40ef1399a 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt @@ -16,7 +16,6 @@ import at.hannibal2.skyhanni.utils.StringUtils.removeColor import net.minecraft.client.Minecraft import net.minecraft.client.gui.ChatLine import net.minecraft.client.gui.GuiNewChat -import net.minecraft.event.HoverEvent import net.minecraft.network.play.client.C01PacketChatMessage import net.minecraft.util.ChatComponentText import net.minecraft.util.EnumChatFormatting @@ -124,9 +123,7 @@ object ChatManager { } val key = IdentityCharacteristics(original) val chatEvent = LorenzChatEvent(message, original) - if (!isSoopyMessage(event.message)) { - chatEvent.postAndCatch() - } + chatEvent.postAndCatch() val blockReason = chatEvent.blockedReason.uppercase() if (blockReason != "") { @@ -161,33 +158,6 @@ object ChatManager { } } - private fun isSoopyMessage(message: IChatComponent): Boolean { - for (sibling in message.siblings) { - if (isSoopyMessage(sibling)) return true - } - - val style = message.chatStyle ?: return false - val hoverEvent = style.chatHoverEvent ?: return false - if (hoverEvent.action != HoverEvent.Action.SHOW_TEXT) return false - val text = hoverEvent.value?.formattedText ?: return false - - val lines = text.split("\n") - if (lines.isEmpty()) return false - - val last = lines.last() - if (last.startsWith("§f§lCOMMON")) return true - if (last.startsWith("§a§lUNCOMMON")) return true - if (last.startsWith("§9§lRARE")) return true - if (last.startsWith("§5§lEPIC")) return true - if (last.startsWith("§6§lLEGENDARY")) return true - if (last.startsWith("§d§lMYTHIC")) return true - if (last.startsWith("§c§lSPECIAL")) return true - - // TODO confirm this format is correct - if (last.startsWith("§c§lVERY SPECIAL")) return true - return false - } - fun openChatFilterGUI(args: Array<String>) { SkyHanniMod.screenToOpen = if (args.isEmpty()) { ChatFilterGui(getRecentMessageHistory()) |