mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
Fix distance map contains (#6530)
This commit is contained in:
parent
7d10cdea03
commit
2cd4bcfba1
1 changed files with 2 additions and 2 deletions
|
@ -6,7 +6,7 @@ Subject: [PATCH] Use distance map to optimise entity tracker
|
||||||
Use the distance map to find candidate players for tracking.
|
Use the distance map to find candidate players for tracking.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
index 22c691f3bfbfc5f8e7420c14de36a353b31fc123..5f8399cc2ba5114d11298808528b18f044c650ce 100644
|
index 22c691f3bfbfc5f8e7420c14de36a353b31fc123..136b832c1a04042457817b2bf2a4a5d057d1b6ca 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -63,6 +63,7 @@ import net.minecraft.network.protocol.game.ClientboundSetEntityLinkPacket;
|
@@ -63,6 +63,7 @@ import net.minecraft.network.protocol.game.ClientboundSetEntityLinkPacket;
|
||||||
|
@ -271,7 +271,7 @@ index 22c691f3bfbfc5f8e7420c14de36a353b31fc123..5f8399cc2ba5114d11298808528b18f0
|
||||||
+ // for players that were removed
|
+ // for players that were removed
|
||||||
+
|
+
|
||||||
+ for (ServerPlayerConnection conn : this.seenBy.toArray(new ServerPlayerConnection[0])) { // avoid CME
|
+ for (ServerPlayerConnection conn : this.seenBy.toArray(new ServerPlayerConnection[0])) { // avoid CME
|
||||||
+ if (newTrackerCandidates == null || !newTrackerCandidates.contains(conn)) {
|
+ if (newTrackerCandidates == null || !newTrackerCandidates.contains(conn.getPlayer())) {
|
||||||
+ this.updatePlayer(conn.getPlayer());
|
+ this.updatePlayer(conn.getPlayer());
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
|
|
Loading…
Reference in a new issue