From fcb81aa6605ab467071e6ee242b34f0b1255cd64 Mon Sep 17 00:00:00 2001 From: LexManos Date: Thu, 14 Apr 2022 10:58:43 -0700 Subject: [PATCH] Fix debug text being rendered slightly wrong. --- .../client/gui/ForgeIngameGui.java | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/main/java/net/minecraftforge/client/gui/ForgeIngameGui.java b/src/main/java/net/minecraftforge/client/gui/ForgeIngameGui.java index d34b0ab119..2ec453139a 100644 --- a/src/main/java/net/minecraftforge/client/gui/ForgeIngameGui.java +++ b/src/main/java/net/minecraftforge/client/gui/ForgeIngameGui.java @@ -673,20 +673,24 @@ public class ForgeIngameGui extends Gui int top = 2; for (String msg : listL) { - if (msg == null) continue; - fill(poseStack, 1, top - 1, 2 + font.width(msg) + 1, top + font.lineHeight - 1, -1873784752); - font.draw(poseStack, msg, 2, top, 14737632); + if (msg != null && !msg.isEmpty()) + { + fill(poseStack, 1, top - 1, 2 + font.width(msg) + 1, top + font.lineHeight - 1, -1873784752); + font.draw(poseStack, msg, 2, top, 14737632); + } top += font.lineHeight; } top = 2; for (String msg : listR) { - if (msg == null) continue; - int w = font.width(msg); - int left = width - 2 - w; - fill(poseStack, left - 1, top - 1, left + w + 1, top + font.lineHeight - 1, -1873784752); - font.draw(poseStack, msg, left, top, 14737632); + if (msg != null && !msg.isEmpty()) + { + int w = font.width(msg); + int left = width - 2 - w; + fill(poseStack, left - 1, top - 1, left + w + 1, top + font.lineHeight - 1, -1873784752); + font.draw(poseStack, msg, left, top, 14737632); + } top += font.lineHeight; } } @@ -897,7 +901,8 @@ public class ForgeIngameGui extends Gui { List ret = this.getGameInformation(); ret.add(""); - ret.add("Debug: Pie [shift]: " + (this.mc.options.renderDebugCharts ? "visible" : "hidden") + " FPS [alt]: " + (this.mc.options.renderFpsChart ? "visible" : "hidden")); + boolean flag = this.mc.getSingleplayerServer() != null; + ret.add("Debug: Pie [shift]: " + (this.mc.options.renderDebugCharts ? "visible" : "hidden") + (flag ? " FPS + TPS" : " FPS") + " [alt]: " + (this.mc.options.renderFpsChart ? "visible" : "hidden")); ret.add("For help: press F3 + Q"); return ret; }