forked from ChomeNS/chipmunkmod
Stopped console from getting spammed with erros by the players module
This commit is contained in:
parent
a794ebd7d3
commit
ec6a142b73
1 changed files with 6 additions and 3 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue