aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java2
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/Chatting.kt2
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/utils/ModCompatHooks.kt4
3 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java b/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java
index 2bc5592..e0a76d5 100644
--- a/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java
+++ b/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java
@@ -208,7 +208,7 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook {
@Redirect(method = "drawChat", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/FontRenderer;drawStringWithShadow(Ljava/lang/String;FFI)I"))
private int redirectDrawString(FontRenderer instance, String text, float x, float y, int color) {
- return ModCompatHooks.redirectDrawString(text, x, y, color, chatting$drawingLine);
+ return ModCompatHooks.redirectDrawString(text, x, y, color, chatting$drawingLine, false);
}
@Redirect(method = "drawChat", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiNewChat;drawRect(IIIII)V", ordinal = 1))
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<String, ChatLine> ->
- 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