aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-08-03 22:17:47 +0200
committernea <nea@nea.moe>2023-08-03 22:17:47 +0200
commit75ad1cd4a13487932750913b7c3054146adfd50e (patch)
tree04ae7ce0d7f4171562b2b5d2110abbe58bf86ad7 /src/main/java/at/hannibal2/skyhanni/features
parent67a47c003c76cebc7d57e789c114b62313a543fe (diff)
downloadskyhanni-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.kt10
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