From cd4d701b5f2ee6c65d5409a213aa94f9ffbd9b93 Mon Sep 17 00:00:00 2001 From: mezz Date: Sat, 8 Jul 2017 22:55:45 -0700 Subject: [PATCH] Fix game freeze when resizing the window too small on the mods gui (#4148) --- src/main/java/net/minecraftforge/fml/client/GuiModList.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraftforge/fml/client/GuiModList.java b/src/main/java/net/minecraftforge/fml/client/GuiModList.java index 4af9cd51d..452ea27e9 100644 --- a/src/main/java/net/minecraftforge/fml/client/GuiModList.java +++ b/src/main/java/net/minecraftforge/fml/client/GuiModList.java @@ -511,7 +511,11 @@ public class GuiModList extends GuiScreen } ITextComponent chat = ForgeHooks.newChatWithLinks(line, false); - ret.addAll(GuiUtilRenderComponents.splitText(chat, this.listWidth-8, GuiModList.this.fontRenderer, false, true)); + int maxTextLength = this.listWidth - 8; + if (maxTextLength >= 0) + { + ret.addAll(GuiUtilRenderComponents.splitText(chat, maxTextLength, GuiModList.this.fontRenderer, false, true)); + } } return ret; }