Optimize Serverinfo code

This commit is contained in:
ThisIsALegitUsername 2022-12-29 15:58:48 +00:00
parent 997bde4ec0
commit f84b75c786

View File

@ -12,9 +12,14 @@ public class ServerInfo extends RenderModule{
public BooleanSetting tshadow = new BooleanSetting("Text shadow", "", true); 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(){ 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()); mc.fontRendererObj.drawString(getText(), this.x+2, this.y+2, -1, tshadow.getValue());
} }