Ported ping mod

This commit is contained in:
ThisIsALegitUsername 2022-12-27 21:36:43 +00:00
parent e880342a93
commit 6c68a0f664
2 changed files with 2 additions and 4 deletions

View File

@ -3,7 +3,6 @@ package dev.resent.module.impl.hud;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.setting.BooleanSetting;
import net.minecraft.client.Minecraft;
public class Ping extends RenderModule{
public Ping(){
@ -18,13 +17,12 @@ public class Ping extends RenderModule{
int ms = 0;
if(mc.isSingleplayer()){
ms = -1;
}else if(mc.getServerData() != null){
ms = (int)mc.getServerData().pingToServer;
}
ms = (int)mc.getCurrentServerData().pingToServer;
this.setHeight(mc.fontRendererObj.FONT_HEIGHT+4);
this.setWidth(mc.fontRendererObj.getStringWidth("[" + ms + " ms]")+4);
Minecraft.getMinecraft().fontRenderer.drawString("[" + ms + " ms]", this.x+2, this.y+2, -1, tshadow.getValue());
mc.fontRendererObj.drawString("[" + ms + " ms]", this.x+2, this.y+2, -1, tshadow.getValue());
}
}