diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/Players.java b/src/main/java/land/chipmunk/chipmunkmod/modules/Players.java index 1e21707..6eb8c62 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/Players.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/Players.java @@ -138,7 +138,7 @@ public class Players extends Listener { if (accessor == null) return; final PlayerListEntryAccessor entryAccessor = (PlayerListEntryAccessor) accessor.playerListEntries().get(newEntry.profile().getId()); - + if(entryAccessor == null) return; entryAccessor.setGameMode(newEntry.gameMode()); } catch (Exception e) { e.printStackTrace(); @@ -157,6 +157,8 @@ public class Players extends Listener { final PlayerListEntryAccessor entryAccessor = (PlayerListEntryAccessor) accessor.playerListEntries().get(newEntry.profile().getId()); + if(entryAccessor == null) return; + entryAccessor.setLatency(newEntry.latency()); } @@ -169,8 +171,9 @@ public class Players extends Listener { final ClientPlayNetworkHandlerAccessor accessor = ((ClientPlayNetworkHandlerAccessor) MinecraftClient.getInstance().getNetworkHandler()); if (accessor == null) return; - - accessor.playerListEntries().get(newEntry.profile().getId()).setDisplayName(newEntry.displayName()); + PlayerListEntry entry = accessor.playerListEntries().get(newEntry.profile().getId()); + if(entry == null) return; + entry.setDisplayName(newEntry.displayName()); } private void removePlayer (UUID uuid) {