@@ -522,13 +522,13 @@ public void onPlayerListHeaderFooter(ClientboundTabListPacket packet) {
522
522
@ EventHandler
523
523
public void onPlayerListUpdate (ClientboundPlayerInfoUpdatePacket packet ) {
524
524
if (packet .getActions ().contains (PlayerListEntryAction .ADD_PLAYER )) {
525
- for (var entry : packet .getEntries ()) {
526
- playerListState .entries ().putIfAbsent (entry .getProfileId (), entry );
525
+ for (var newEntry : packet .getEntries ()) {
526
+ playerListState .entries ().putIfAbsent (newEntry .getProfileId (), newEntry );
527
527
}
528
528
}
529
529
530
- for (var newEntry : packet .getEntries ()) {
531
- var entry = playerListState .entries ().get (newEntry .getProfileId ());
530
+ for (var update : packet .getEntries ()) {
531
+ var entry = playerListState .entries ().get (update .getProfileId ());
532
532
if (entry == null ) {
533
533
continue ;
534
534
}
@@ -539,23 +539,23 @@ public void onPlayerListUpdate(ClientboundPlayerInfoUpdatePacket packet) {
539
539
// Don't handle, just like vanilla
540
540
};
541
541
case INITIALIZE_CHAT -> () -> {
542
- entry .setSessionId (newEntry .getSessionId ());
543
- entry .setExpiresAt (newEntry .getExpiresAt ());
544
- entry .setKeySignature (newEntry .getKeySignature ());
545
- entry .setPublicKey (newEntry .getPublicKey ());
542
+ entry .setSessionId (update .getSessionId ());
543
+ entry .setExpiresAt (update .getExpiresAt ());
544
+ entry .setKeySignature (update .getKeySignature ());
545
+ entry .setPublicKey (update .getPublicKey ());
546
546
};
547
547
case UPDATE_GAME_MODE -> () -> {
548
- if (entry .getGameMode () != newEntry .getGameMode () && localPlayer != null && newEntry .getProfileId ().equals (localPlayer .uuid ())) {
549
- localPlayer .onGameModeChanged (newEntry .getGameMode ());
548
+ if (entry .getGameMode () != update .getGameMode () && localPlayer != null && update .getProfileId ().equals (localPlayer .uuid ())) {
549
+ localPlayer .onGameModeChanged (update .getGameMode ());
550
550
}
551
551
552
- entry .setGameMode (newEntry .getGameMode ());
552
+ entry .setGameMode (update .getGameMode ());
553
553
};
554
- case UPDATE_LISTED -> () -> entry .setListed (newEntry .isListed ());
555
- case UPDATE_LATENCY -> () -> entry .setLatency (newEntry .getLatency ());
556
- case UPDATE_DISPLAY_NAME -> () -> entry .setDisplayName (newEntry .getDisplayName ());
557
- case UPDATE_HAT -> () -> entry .setShowHat (newEntry .isShowHat ());
558
- case UPDATE_LIST_ORDER -> () -> entry .setListOrder (newEntry .getListOrder ());
554
+ case UPDATE_LISTED -> () -> entry .setListed (update .isListed ());
555
+ case UPDATE_LATENCY -> () -> entry .setLatency (update .getLatency ());
556
+ case UPDATE_DISPLAY_NAME -> () -> entry .setDisplayName (update .getDisplayName ());
557
+ case UPDATE_HAT -> () -> entry .setShowHat (update .isShowHat ());
558
+ case UPDATE_LIST_ORDER -> () -> entry .setListOrder (update .getListOrder ());
559
559
});
560
560
}
561
561
}
0 commit comments