mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-29 11:12:04 -07:00
Don't leave the NearbyPlayers tracker in an entirely busted state on double-add detection
This commit is contained in:
@@ -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);
|
||||
+ }
|
||||
+
|
||||
|
Reference in New Issue
Block a user