From d8a71de94f7fcbd237aafad3a6ef65ddc8712276 Mon Sep 17 00:00:00 2001 From: XThe <101992755+SirXThe@users.noreply.github.com> Date: Tue, 28 Feb 2023 17:59:24 +0100 Subject: fix: resolve message copying not working properly in search mode (#23) --- src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java b/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java index 5503e35..97b00a7 100644 --- a/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java +++ b/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java @@ -4,6 +4,7 @@ import cc.polyfrost.oneconfig.config.core.OneColor; import cc.polyfrost.oneconfig.libs.universal.UMouse; import cc.polyfrost.oneconfig.utils.Notifications; import cc.woverflow.chatting.Chatting; +import cc.woverflow.chatting.chat.ChatSearchingManager; import cc.woverflow.chatting.config.ChattingConfig; import cc.woverflow.chatting.gui.components.CleanButton; import cc.woverflow.chatting.hook.GuiNewChatHook; @@ -227,7 +228,8 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook { int i1 = k / this.mc.fontRendererObj.FONT_HEIGHT + this.scrollPos; if (i1 >= 0 && i1 < this.drawnChatLines.size()) { - return this.drawnChatLines.get(i1); + List m = ChatSearchingManager.filterMessages(ChatSearchingManager.INSTANCE.getLastSearch(), this.drawnChatLines); + return m != null ? m.get(i1) : null; } } -- cgit