more patches added back
This commit is contained in:
@@ -401,13 +401,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
public Stream<ServerPlayer> getPlayers(ChunkPos chunkPos, boolean onlyOnWatchDistanceEdge) {
|
||||
- return this.playerMap.getPlayers(chunkPos.toLong()).filter((entityplayer) -> {
|
||||
- int i = ChunkMap.checkerboardDistance(chunkPos, entityplayer, true);
|
||||
-
|
||||
- return i > this.viewDistance ? false : !onlyOnWatchDistanceEdge || i == this.viewDistance;
|
||||
- });
|
||||
+ // Paper start - per player view distance
|
||||
+ // there can be potential desync with player's last mapped section and the view distance map, so use the
|
||||
+ // view distance map here.
|
||||
+ com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> inRange = this.playerViewDistanceBroadcastMap.getObjectsInRange(chunkPos);
|
||||
|
||||
- return i > this.viewDistance ? false : !onlyOnWatchDistanceEdge || i == this.viewDistance;
|
||||
- });
|
||||
+
|
||||
+ if (inRange == null) {
|
||||
+ return Stream.empty();
|
||||
+ }
|
||||
|
||||
Reference in New Issue
Block a user