From 3cf895a891b6fd0d08e5aa8396a5dc68773c3920 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sun, 5 Nov 2023 22:15:38 +0000 Subject: [PATCH] Don't leave the NearbyPlayers tracker in an entirely busted state on double-add detection --- patches/server/MC-Utils.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/server/MC-Utils.patch b/patches/server/MC-Utils.patch index f5d99c50ff..281e2f6422 100644 --- a/patches/server/MC-Utils.patch +++ b/patches/server/MC-Utils.patch @@ -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); + } +