Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

What I am trying to do is in my hud I am trying to display some information. I have tried:

 

 

private String getPingInformation()

{

NetHandlerPlayClient handler = this.mc.thePlayer.sendQueue;

List list = new ArrayList(handler.func_175106_d());

Iterator iterator = list.iterator();

 

while (iterator.hasNext())

{

NetworkPlayerInfo networkplayerinfo = (NetworkPlayerInfo) iterator.next();

EnumChatFormatting enumchatformatting;

if (networkplayerinfo.getResponseTime() <= 0) enumchatformatting = EnumChatFormatting.RED;

else if (networkplayerinfo.getResponseTime() < 150) enumchatformatting = EnumChatFormatting.GREEN;

else if (networkplayerinfo.getResponseTime() < 300) enumchatformatting = EnumChatFormatting.YELLOW;

else if (networkplayerinfo.getResponseTime() < 600) enumchatformatting = EnumChatFormatting.GOLD;

else if (networkplayerinfo.getResponseTime() < 1000) enumchatformatting = EnumChatFormatting.RED;

else enumchatformatting = EnumChatFormatting.DARK_RED;

return "Ping: " + enumchatformatting + (networkplayerinfo.getResponseTime() <= 0 ? "Unavailable" : networkplayerinfo.getResponseTime());

}

 

return "Ping: Unavailable";

}

 

 

and it sometimes works, but most of the time it returns 0.

  • Author

Maybe, but I would also expect the ping to update every so often, but it seems the stay at the same number for long periods of time.

EDIT: What happens it when I join a server the ping will be a single number for about 5-10 seconds, then goto 0, then a random time later will be another number, and continuously do that.

  • Author

The only reason I wanted the players ping was for my HUD to tell the player what their ping was, since I already have it displaying the server IP.

  • Author

I do know that there is a way to do it without calculating it myself because the pixelmon mod does it with their custom tab list with the vanilla methods.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.