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;
|
if (accessor == null) return;
|
||||||
|
|
||||||
final PlayerListEntryAccessor entryAccessor = (PlayerListEntryAccessor) accessor.playerListEntries().get(newEntry.profile().getId());
|
final PlayerListEntryAccessor entryAccessor = (PlayerListEntryAccessor) accessor.playerListEntries().get(newEntry.profile().getId());
|
||||||
|
if(entryAccessor == null) return;
|
||||||
entryAccessor.setGameMode(newEntry.gameMode());
|
entryAccessor.setGameMode(newEntry.gameMode());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -157,6 +157,8 @@ public class Players extends Listener {
|
||||||
|
|
||||||
final PlayerListEntryAccessor entryAccessor = (PlayerListEntryAccessor) accessor.playerListEntries().get(newEntry.profile().getId());
|
final PlayerListEntryAccessor entryAccessor = (PlayerListEntryAccessor) accessor.playerListEntries().get(newEntry.profile().getId());
|
||||||
|
|
||||||
|
if(entryAccessor == null) return;
|
||||||
|
|
||||||
entryAccessor.setLatency(newEntry.latency());
|
entryAccessor.setLatency(newEntry.latency());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,8 +171,9 @@ public class Players extends Listener {
|
||||||
final ClientPlayNetworkHandlerAccessor accessor = ((ClientPlayNetworkHandlerAccessor) MinecraftClient.getInstance().getNetworkHandler());
|
final ClientPlayNetworkHandlerAccessor accessor = ((ClientPlayNetworkHandlerAccessor) MinecraftClient.getInstance().getNetworkHandler());
|
||||||
|
|
||||||
if (accessor == null) return;
|
if (accessor == null) return;
|
||||||
|
PlayerListEntry entry = accessor.playerListEntries().get(newEntry.profile().getId());
|
||||||
accessor.playerListEntries().get(newEntry.profile().getId()).setDisplayName(newEntry.displayName());
|
if(entry == null) return;
|
||||||
|
entry.setDisplayName(newEntry.displayName());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removePlayer (UUID uuid) {
|
private void removePlayer (UUID uuid) {
|
||||||
|
|
Loading…
Reference in a new issue