From 97a700fe1af0360b6deed3c6b0b0a3839d5a690d Mon Sep 17 00:00:00 2001 From: Wyvest Date: Thu, 23 Nov 2023 16:04:46 +0900 Subject: fix mixin 0.7.11 compat --- src/main/kotlin/org/polyfrost/chatting/utils/ModCompatHooks.kt | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/main/kotlin') diff --git a/src/main/kotlin/org/polyfrost/chatting/utils/ModCompatHooks.kt b/src/main/kotlin/org/polyfrost/chatting/utils/ModCompatHooks.kt index ad7d329..b6198fa 100644 --- a/src/main/kotlin/org/polyfrost/chatting/utils/ModCompatHooks.kt +++ b/src/main/kotlin/org/polyfrost/chatting/utils/ModCompatHooks.kt @@ -17,6 +17,7 @@ import net.minecraft.client.gui.Gui import net.minecraft.client.renderer.GlStateManager import org.polyfrost.chatting.hook.ChatLineHook import org.polyfrost.chatting.hook.GuiNewChatHook +import org.polyfrost.chatting.mixin.GuiNewChatAccessor // This exists because mixin doesn't like dummy classes object ModCompatHooks { @@ -44,6 +45,14 @@ object ModCompatHooks { val fontRenderer: FontRenderer get() = Minecraft.getMinecraft().fontRendererObj + @JvmStatic + val chatLines: List + get() = (Minecraft.getMinecraft().ingameGUI.chatGUI as GuiNewChatAccessor).chatLines + + @JvmStatic + val drawnChatLines: List + get() = (Minecraft.getMinecraft().ingameGUI.chatGUI as GuiNewChatAccessor).drawnChatLines + @JvmStatic fun redirectDrawString(text: String, x: Float, y: Float, color: Int, chatLine: ChatLine, screenshot: Boolean): Int { var actualX = x -- cgit