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 c605be20c7
commit 5405793b86
No known key found for this signature in database
GPG key ID: A3F61EA5A085289C

View file

@ -1,4 +1,4 @@
From ca539db6550e6555be046ed3e53f541e62d76dfb Mon Sep 17 00:00:00 2001
From 28bfe29b176f9cf6a0549258b52db485937e19b1 Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com>
Date: Wed, 2 Mar 2016 23:13:07 -0600
Subject: [PATCH] Send absolute position the first time an entity is seen
@ -77,7 +77,7 @@ index 315c3d9165..aaf3a54b08 100644
this.c();
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
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -1083,10 +1083,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@ -102,7 +102,7 @@ index 44e3340773..6c904968d7 100644
// CraftBukkit end
- 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);
}
} else if (this.trackedPlayers.remove(entityplayer)) {