summaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/ftbsc/bscv/modules/hud/InfoDisplay.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/ftbsc/bscv/modules/hud/InfoDisplay.java b/src/main/java/ftbsc/bscv/modules/hud/InfoDisplay.java
index df48b3f..2df6b10 100644
--- a/src/main/java/ftbsc/bscv/modules/hud/InfoDisplay.java
+++ b/src/main/java/ftbsc/bscv/modules/hud/InfoDisplay.java
@@ -127,9 +127,12 @@ public class InfoDisplay extends HudModule {
if (MC.player != null) {
this.instant_speed = this.last_position.distanceTo(MC.player.position());
this.last_position = MC.player.position();
- this.instant_ping = MC.getConnection().getPlayerInfo(
+ NetworkPlayerInfo info = MC.getConnection().getPlayerInfo(
MC.player.getGameProfile().getId()
- ).getLatency();
+ );
+ if (info != null) { // bungeecord switching makes this null for a second
+ this.instant_ping = info.getLatency();
+ }
} else {
this.instant_speed = 0.0;
this.instant_ping = 0;