Ported ping mod
This commit is contained in:
parent
e880342a93
commit
6c68a0f664
Binary file not shown.
|
@ -3,7 +3,6 @@ package dev.resent.module.impl.hud;
|
||||||
import dev.resent.module.base.Category;
|
import dev.resent.module.base.Category;
|
||||||
import dev.resent.module.base.RenderModule;
|
import dev.resent.module.base.RenderModule;
|
||||||
import dev.resent.setting.BooleanSetting;
|
import dev.resent.setting.BooleanSetting;
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
|
|
||||||
public class Ping extends RenderModule{
|
public class Ping extends RenderModule{
|
||||||
public Ping(){
|
public Ping(){
|
||||||
|
@ -18,13 +17,12 @@ public class Ping extends RenderModule{
|
||||||
int ms = 0;
|
int ms = 0;
|
||||||
if(mc.isSingleplayer()){
|
if(mc.isSingleplayer()){
|
||||||
ms = -1;
|
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.setHeight(mc.fontRendererObj.FONT_HEIGHT+4);
|
||||||
this.setWidth(mc.fontRendererObj.getStringWidth("[" + ms + " ms]")+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());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user