13
0
geforkt von Mirrors/Paper

Fix distance map contains (#6530)

Dieser Commit ist enthalten in:
Nassim Jahnke 2021-08-31 14:47:00 +02:00 committet von GitHub
Ursprung 7d10cdea03
Commit 2cd4bcfba1
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -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());
+ } + }
+ } + }