From f80dad6f297a60f23ca3066742c2df78e3b6fc83 Mon Sep 17 00:00:00 2001 From: Wyvest <45589059+Wyvest@users.noreply.github.com> Date: Fri, 13 Jan 2023 11:15:15 -0500 Subject: fix the empty void when screenshotting --- src/main/kotlin/cc/woverflow/chatting/Chatting.kt | 2 +- src/main/kotlin/cc/woverflow/chatting/utils/ModCompatHooks.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/kotlin/cc') diff --git a/src/main/kotlin/cc/woverflow/chatting/Chatting.kt b/src/main/kotlin/cc/woverflow/chatting/Chatting.kt index 98b12fd..d74dd6a 100644 --- a/src/main/kotlin/cc/woverflow/chatting/Chatting.kt +++ b/src/main/kotlin/cc/woverflow/chatting/Chatting.kt @@ -235,7 +235,7 @@ object Chatting { val scale = Minecraft.getMinecraft().gameSettings.chatScale GlStateManager.scale(scale, scale, 1f) messages.entries.forEachIndexed { i: Int, entry: MutableMap.MutableEntry -> - ModCompatHooks.redirectDrawString(entry.key, 0f, (messages.size - 1 - i) * 9f, 0xffffff, entry.value) + ModCompatHooks.redirectDrawString(entry.key, 0f, (messages.size - 1 - i) * 9f, 0xffffff, entry.value, true) } val image = fb.screenshot(file) diff --git a/src/main/kotlin/cc/woverflow/chatting/utils/ModCompatHooks.kt b/src/main/kotlin/cc/woverflow/chatting/utils/ModCompatHooks.kt index 0d1d512..b18bdaa 100644 --- a/src/main/kotlin/cc/woverflow/chatting/utils/ModCompatHooks.kt +++ b/src/main/kotlin/cc/woverflow/chatting/utils/ModCompatHooks.kt @@ -41,9 +41,9 @@ object ModCompatHooks { get() = Minecraft.getMinecraft().fontRendererObj @JvmStatic - fun redirectDrawString(text: String, x: Float, y: Float, color: Int, chatLine: ChatLine): Int { + fun redirectDrawString(text: String, x: Float, y: Float, color: Int, chatLine: ChatLine, screenshot: Boolean): Int { var actualX = x - if (showChatHeads) { + if (showChatHeads && !screenshot) { val hook = chatLine as ChatLineHook if (hook.hasDetected() || offsetNonPlayerMessages) { actualX += 10f -- cgit