diff options
author | nea <nea@nea.moe> | 2023-08-03 22:17:47 +0200 |
---|---|---|
committer | nea <nea@nea.moe> | 2023-08-03 22:17:47 +0200 |
commit | 75ad1cd4a13487932750913b7c3054146adfd50e (patch) | |
tree | 04ae7ce0d7f4171562b2b5d2110abbe58bf86ad7 /src/main/java/at/hannibal2/skyhanni/features | |
parent | 67a47c003c76cebc7d57e789c114b62313a543fe (diff) | |
download | skyhanni-75ad1cd4a13487932750913b7c3054146adfd50e.tar.gz skyhanni-75ad1cd4a13487932750913b7c3054146adfd50e.tar.bz2 skyhanni-75ad1cd4a13487932750913b7c3054146adfd50e.zip |
Add support for retracted messages
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/chat/CompactBestiaryChatMessage.kt | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/CompactBestiaryChatMessage.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/CompactBestiaryChatMessage.kt index 7b893afcf..67c76617b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/CompactBestiaryChatMessage.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/CompactBestiaryChatMessage.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.chat import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.ChatManager import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.makeAccessible @@ -41,13 +42,8 @@ class CompactBestiaryChatMessage { if (message == titleMessage) { event.blockedReason = "bestiary" - val chatGUI = Minecraft.getMinecraft().ingameGUI.chatGUI - val chatLinesField = ReflectionHelper.findField(chatGUI.javaClass, "chatLines") - val chatLines = chatLinesField.makeAccessible().get(chatGUI) as MutableList<ChatLine> - - lastBorder?.let { chat -> chatLines.removeIf { it.chatComponent === chat } } - lastEmpty?.let { chat -> chatLines.removeIf { it.chatComponent === chat } } - chatGUI.refreshChat() + ChatManager.retractMessage(lastBorder, "bestiary") + ChatManager.retractMessage(lastEmpty, "bestiary") lastBorder = null lastEmpty = null |