aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/Chatting.kt4
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/gui/components/SearchButton.kt4
2 files changed, 3 insertions, 5 deletions
diff --git a/src/main/kotlin/cc/woverflow/chatting/Chatting.kt b/src/main/kotlin/cc/woverflow/chatting/Chatting.kt
index 27f1a87..8d40aa2 100644
--- a/src/main/kotlin/cc/woverflow/chatting/Chatting.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/Chatting.kt
@@ -12,7 +12,6 @@ import cc.woverflow.chatting.chat.ChatTabs
import cc.woverflow.chatting.command.ChattingCommand
import cc.woverflow.chatting.config.ChattingConfig
import cc.woverflow.chatting.hook.ChatLineHook
-import cc.woverflow.chatting.hook.GuiNewChatHook
import cc.woverflow.chatting.mixin.GuiNewChatAccessor
import cc.woverflow.chatting.utils.ModCompatHooks
import cc.woverflow.chatting.utils.copyToClipboard
@@ -32,7 +31,6 @@ import net.minecraftforge.fml.common.Mod
import net.minecraftforge.fml.common.event.FMLInitializationEvent
import net.minecraftforge.fml.common.event.FMLLoadCompleteEvent
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent
-import net.minecraftforge.fml.common.event.FMLPreInitializationEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import net.minecraftforge.fml.common.gameevent.TickEvent
import org.lwjgl.input.Keyboard
@@ -193,7 +191,7 @@ object Chatting {
val chat = hud.chatGUI
val chatLines = HashMap<String, ChatLine>()
ChatSearchingManager.filterMessages(
- (chat as GuiNewChatHook).prevText,
+ ChatSearchingManager.lastSearch,
(chat as GuiNewChatAccessor).drawnChatLines
)?.let { drawnLines ->
val chatHeight =
diff --git a/src/main/kotlin/cc/woverflow/chatting/gui/components/SearchButton.kt b/src/main/kotlin/cc/woverflow/chatting/gui/components/SearchButton.kt
index 2194bbb..54e9041 100644
--- a/src/main/kotlin/cc/woverflow/chatting/gui/components/SearchButton.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/gui/components/SearchButton.kt
@@ -2,7 +2,7 @@ package cc.woverflow.chatting.gui.components
import cc.polyfrost.oneconfig.libs.universal.UResolution
import cc.woverflow.chatting.Chatting
-import cc.woverflow.chatting.hook.GuiNewChatHook
+import cc.woverflow.chatting.chat.ChatSearchingManager
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.Gui
import net.minecraft.client.gui.GuiTextField
@@ -23,7 +23,7 @@ class SearchButton :
chatBox = !chatBox
inputField.setEnabled(chatBox)
inputField.isFocused = chatBox
- (Minecraft.getMinecraft().ingameGUI.chatGUI as GuiNewChatHook).prevText = ""
+ ChatSearchingManager.lastSearch = ""
inputField.text = ""
}