From f84b75c786ae20e912dfc914b7b3e24ab2416215 Mon Sep 17 00:00:00 2001 From: ThisIsALegitUsername Date: Thu, 29 Dec 2022 15:58:48 +0000 Subject: [PATCH] Optimize Serverinfo code --- src/main/java/dev/resent/module/impl/hud/ServerInfo.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/dev/resent/module/impl/hud/ServerInfo.java b/src/main/java/dev/resent/module/impl/hud/ServerInfo.java index ba011dbd..8cb1c7a8 100644 --- a/src/main/java/dev/resent/module/impl/hud/ServerInfo.java +++ b/src/main/java/dev/resent/module/impl/hud/ServerInfo.java @@ -12,9 +12,14 @@ public class ServerInfo extends RenderModule{ public BooleanSetting tshadow = new BooleanSetting("Text shadow", "", true); + public int getWidth(){ + return mc.fontRendererObj.getStringWidth(getText())+4; + } + + public int getHeight(){ + return mc.fontRendererObj.FONT_HEIGHT+4; + } public void draw(){ - this.setWidth(mc.fontRendererObj.getStringWidth(getText())+4); - this.setHeight(mc.fontRendererObj.FONT_HEIGHT+4); mc.fontRendererObj.drawString(getText(), this.x+2, this.y+2, -1, tshadow.getValue()); }