Don't leave the NearbyPlayers tracker in an entirely busted state on double-add detection

This commit is contained in:
Shane Freeder 2023-11-05 22:15:38 +00:00
parent 6951909f8d
commit 3cf895a891

View file

@ -5520,7 +5520,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ public void addPlayer(final ServerPlayer player) {
+ final TrackedPlayer[] newTrackers = new TrackedPlayer[TOTAL_MAP_TYPES];
+ if (this.players.put(player, newTrackers) != null) {
+ if (this.players.putIfAbsent(player, newTrackers) != null) {
+ throw new IllegalStateException("Already have player " + player);
+ }
+