From b3c24ff72fe8a4ea5c6f29e0ade44c635ab4d067 Mon Sep 17 00:00:00 2001 From: johni0702 Date: Wed, 2 Mar 2016 12:23:18 +0100 Subject: [PATCH] Use ingameGUI directly to print messages to chat --- src/main/java/com/replaymod/core/ReplayMod.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/replaymod/core/ReplayMod.java b/src/main/java/com/replaymod/core/ReplayMod.java index 303feab3..6eebeda3 100755 --- a/src/main/java/com/replaymod/core/ReplayMod.java +++ b/src/main/java/com/replaymod/core/ReplayMod.java @@ -366,7 +366,9 @@ public class ReplayMod { .appendSibling(new ChatComponentText("] ")) .appendSibling(new ChatComponentTranslation(message, args).setChatStyle(new ChatStyle() .setColor(warning ? EnumChatFormatting.RED : EnumChatFormatting.DARK_GREEN))); - mc.thePlayer.addChatMessage(text); + // Send message to chat GUI + // The ingame GUI is initialized at startup, therefore this is possible before the client is connected + mc.ingameGUI.getChatGUI().printChatMessage(text); } } }