Don't replace entries in the tracked player map (Fixes #2102)

This commit is contained in:
Shane Freeder 2019-05-29 05:54:11 +01:00
parent 35226c96e4
commit 18794d2123

View file

@ -77,7 +77,7 @@ index 315c3d9165..aaf3a54b08 100644
this.c(); this.c();
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 44e3340773..6c904968d7 100644 index 44e3340773..cfc7f5a118 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@ -102,7 +102,7 @@ index 44e3340773..6c904968d7 100644
// CraftBukkit end // CraftBukkit end
- if (flag1 && this.trackedPlayers.add(entityplayer)) { - if (flag1 && this.trackedPlayers.add(entityplayer)) {
+ if (flag1 && this.trackedPlayerMap.put(entityplayer, true) == null) { // Paper + if (flag1 && this.trackedPlayerMap.putIfAbsent(entityplayer, true) == null) { // Paper
this.trackerEntry.b(entityplayer); this.trackerEntry.b(entityplayer);
} }
} else if (this.trackedPlayers.remove(entityplayer)) { } else if (this.trackedPlayers.remove(entityplayer)) {