aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSpottedleaf <[email protected]>2020-07-24 20:28:57 -0700
committerGitHub <[email protected]>2020-07-25 04:28:57 +0100
commit0cf106087d4f210751df09e8d31a666444c02878 (patch)
treea3b19cb1ea7ce98e5aa145c8111d1fc5c4e8e32c
parent55b7402433c62f17cdb00754ebe9dd5f99ebd9d9 (diff)
downloadPaper-0cf106087d4f210751df09e8d31a666444c02878.tar.gz
Paper-0cf106087d4f210751df09e8d31a666444c02878.zip
[1.16] Do not sync load POI data (#3996)
Co-authored-by: Spottedleaf <[email protected]>
-rw-r--r--Spigot-Server-Patches/0377-Asynchronous-chunk-IO-and-loading.patch36
-rw-r--r--Spigot-Server-Patches/0411-Tracking-Range-Improvements.patch4
-rw-r--r--Spigot-Server-Patches/0433-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch4
-rw-r--r--Spigot-Server-Patches/0437-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch4
-rw-r--r--Spigot-Server-Patches/0459-Fix-Chunk-Post-Processing-deadlock-risk.patch4
-rw-r--r--Spigot-Server-Patches/0462-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch4
-rw-r--r--Spigot-Server-Patches/0478-Use-distance-map-to-optimise-entity-tracker.patch16
-rw-r--r--Spigot-Server-Patches/0479-Optimize-isOutsideRange-to-use-distance-maps.patch4
-rw-r--r--Spigot-Server-Patches/0481-No-Tick-view-distance-implementation.patch24
-rw-r--r--Spigot-Server-Patches/0493-Reduce-allocation-of-Vec3D-by-entity-tracker.patch4
-rw-r--r--Spigot-Server-Patches/0496-Workaround-for-Client-Lag-Spikes-MC-162253.patch4
-rw-r--r--Spigot-Server-Patches/0497-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch8
-rw-r--r--Spigot-Server-Patches/0500-Improve-Chunk-Status-Transition-Speed.patch4
13 files changed, 61 insertions, 59 deletions
diff --git a/Spigot-Server-Patches/0377-Asynchronous-chunk-IO-and-loading.patch b/Spigot-Server-Patches/0377-Asynchronous-chunk-IO-and-loading.patch
index 260bc170b5..77370b5351 100644
--- a/Spigot-Server-Patches/0377-Asynchronous-chunk-IO-and-loading.patch
+++ b/Spigot-Server-Patches/0377-Asynchronous-chunk-IO-and-loading.patch
@@ -3046,7 +3046,7 @@ index 3e1c1253ad5e2fa68fd8a0bac100c2e7536ea080..b6868b6b23a09e8e0dfe7a5e378dca22
completablefuture = (CompletableFuture) this.statusFutures.get(i);
if (completablefuture != null) {
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
-index 24f3e8a6866bb416f04aca342514fa5dd3d314c8..cacf60563826da0219754a67500fdc239b13f0cd 100644
+index 24f3e8a6866bb416f04aca342514fa5dd3d314c8..2021c77c2cc832927de642d3542c385050193651 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -64,7 +64,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -3230,7 +3230,7 @@ index 24f3e8a6866bb416f04aca342514fa5dd3d314c8..cacf60563826da0219754a67500fdc23
this.lightEngine.a(ichunkaccess.getPos());
this.lightEngine.queueUpdate();
this.worldLoadListener.a(ichunkaccess.getPos(), (ChunkStatus) null);
-@@ -573,19 +641,21 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -573,19 +641,23 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
private CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> f(ChunkCoordIntPair chunkcoordintpair) {
@@ -3247,21 +3247,23 @@ index 24f3e8a6866bb416f04aca342514fa5dd3d314c8..cacf60563826da0219754a67500fdc23
+ if (ioThrowable != null) {
+ com.destroystokyo.paper.util.SneakyThrow.sneaky(ioThrowable);
+ }
-+ chunkHolder.tasks.forEach(Runnable::run);
-+ // Paper end
- if (nbttagcompound != null) {try (Timing ignored2 = this.world.timings.chunkLoadLevelTimer.startTimingIfSync()) { // Paper start - timings
- boolean flag = nbttagcompound.hasKeyOfType("Level", 10) && nbttagcompound.getCompound("Level").hasKeyOfType("Status", 8);
-+ if (chunkHolder.protoChunk != null) {try (Timing ignored2 = this.world.timings.chunkLoadLevelTimer.startTimingIfSync()) { // Paper start - timings // Paper - chunk is created async
++ this.getVillagePlace().loadInData(chunkcoordintpair, chunkHolder.poiData);
++ chunkHolder.tasks.forEach(Runnable::run);
++ // Paper end
- if (flag) {
- ProtoChunk protochunk = ChunkRegionLoader.loadChunk(this.world, this.definedStructureManager, this.m, chunkcoordintpair, nbttagcompound);
++ if (chunkHolder.protoChunk != null) {try (Timing ignored2 = this.world.timings.chunkLoadLevelTimer.startTimingIfSync()) { // Paper start - timings // Paper - chunk is created async
++
+ if (true) {
+ ProtoChunk protochunk = chunkHolder.protoChunk;
protochunk.setLastSaved(this.world.getTime());
this.a(chunkcoordintpair, protochunk.getChunkStatus().getType());
-@@ -609,7 +679,32 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -609,7 +681,32 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.g(chunkcoordintpair);
return Either.left(new ProtoChunk(chunkcoordintpair, ChunkConverter.a, this.world)); // Paper - Anti-Xray - Add parameter
@@ -3295,7 +3297,7 @@ index 24f3e8a6866bb416f04aca342514fa5dd3d314c8..cacf60563826da0219754a67500fdc23
}
private void g(ChunkCoordIntPair chunkcoordintpair) {
-@@ -836,6 +931,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -836,6 +933,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
public boolean saveChunk(IChunkAccess ichunkaccess) {
@@ -3303,7 +3305,7 @@ index 24f3e8a6866bb416f04aca342514fa5dd3d314c8..cacf60563826da0219754a67500fdc23
this.m.a(ichunkaccess.getPos());
if (!ichunkaccess.isNeedsSaving()) {
return false;
-@@ -848,6 +944,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -848,6 +946,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
ChunkStatus chunkstatus = ichunkaccess.getChunkStatus();
if (chunkstatus.getType() != ChunkStatus.Type.LEVELCHUNK) {
@@ -3311,7 +3313,7 @@ index 24f3e8a6866bb416f04aca342514fa5dd3d314c8..cacf60563826da0219754a67500fdc23
if (this.h(chunkcoordintpair)) {
return false;
}
-@@ -855,12 +952,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -855,12 +954,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
if (chunkstatus == ChunkStatus.EMPTY && ichunkaccess.h().values().stream().noneMatch(StructureStart::e)) {
return false;
}
@@ -3334,7 +3336,7 @@ index 24f3e8a6866bb416f04aca342514fa5dd3d314c8..cacf60563826da0219754a67500fdc23
this.a(chunkcoordintpair, chunkstatus.getType());
return true;
} catch (Exception exception) {
-@@ -869,6 +974,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -869,6 +976,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return false;
}
}
@@ -3342,7 +3344,7 @@ index 24f3e8a6866bb416f04aca342514fa5dd3d314c8..cacf60563826da0219754a67500fdc23
}
private boolean h(ChunkCoordIntPair chunkcoordintpair) {
-@@ -998,6 +1104,35 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -998,6 +1106,35 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
}
@@ -3378,7 +3380,7 @@ index 24f3e8a6866bb416f04aca342514fa5dd3d314c8..cacf60563826da0219754a67500fdc23
@Nullable
public NBTTagCompound readChunkData(ChunkCoordIntPair chunkcoordintpair) throws IOException { // Paper - private -> public
NBTTagCompound nbttagcompound = this.read(chunkcoordintpair);
-@@ -1019,33 +1154,55 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1019,33 +1156,55 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
// Paper start - chunk status cache "api"
public ChunkStatus getChunkStatusOnDiskIfCached(ChunkCoordIntPair chunkPos) {
@@ -3410,12 +3412,12 @@ index 24f3e8a6866bb416f04aca342514fa5dd3d314c8..cacf60563826da0219754a67500fdc23
+ // Paper end
+ synchronized (this) { // Paper - async io
+ RegionFile regionFile = this.regionFileCache.getFile(chunkPos, true);
-
-- ChunkStatus status = regionFile.getStatusIfCached(chunkPos.x, chunkPos.z);
++
+ if (regionFile == null || !regionFile.chunkExists(chunkPos)) {
+ return null;
+ }
-+
+
+- ChunkStatus status = regionFile.getStatusIfCached(chunkPos.x, chunkPos.z);
+ ChunkStatus status = regionFile.getStatusIfCached(chunkPos.x, chunkPos.z);
- if (status != null) {
@@ -3445,7 +3447,7 @@ index 24f3e8a6866bb416f04aca342514fa5dd3d314c8..cacf60563826da0219754a67500fdc23
}
public IChunkAccess getUnloadingChunk(int chunkX, int chunkZ) {
-@@ -1054,6 +1211,39 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1054,6 +1213,39 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
// Paper end
@@ -3485,7 +3487,7 @@ index 24f3e8a6866bb416f04aca342514fa5dd3d314c8..cacf60563826da0219754a67500fdc23
boolean isOutsideOfRange(ChunkCoordIntPair chunkcoordintpair) {
// Spigot start
return isOutsideOfRange(chunkcoordintpair, false);
-@@ -1399,6 +1589,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1399,6 +1591,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
diff --git a/Spigot-Server-Patches/0411-Tracking-Range-Improvements.patch b/Spigot-Server-Patches/0411-Tracking-Range-Improvements.patch
index 010f002920..fcb91a24ba 100644
--- a/Spigot-Server-Patches/0411-Tracking-Range-Improvements.patch
+++ b/Spigot-Server-Patches/0411-Tracking-Range-Improvements.patch
@@ -8,10 +8,10 @@ Sets tracking range of watermobs to animals instead of misc and simplifies code
Also ignores Enderdragon, defaulting it to Mojang's setting
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
-index f06c41d06f853b625dbd46822126810da3c3264a..210e91c56197818b622a3ef12a644ea1b77584e0 100644
+index 16c501d5bb5bcf045ded81f61c738ce7a504c591..2542b24b0e1919fdc28417df718acd766deefd03 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
-@@ -1736,6 +1736,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1738,6 +1738,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
int j = entity.getEntityType().getChunkRange() * 16;
diff --git a/Spigot-Server-Patches/0433-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch b/Spigot-Server-Patches/0433-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch
index 1d1bc2eaca..3cac76355f 100644
--- a/Spigot-Server-Patches/0433-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch
+++ b/Spigot-Server-Patches/0433-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch
@@ -7,10 +7,10 @@ Suspected case would be around the technique used in .stopRiding
Stack will identify any causer of this and warn instead of crashing.
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
-index 210e91c56197818b622a3ef12a644ea1b77584e0..2d3eeb3a87e345ceb3496ec60d684452c070d4b7 100644
+index 2542b24b0e1919fdc28417df718acd766deefd03..d4207cb622bf17314f77831c604c8ba9e6cf848f 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
-@@ -1443,6 +1443,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1445,6 +1445,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
protected void addEntity(Entity entity) {
org.spigotmc.AsyncCatcher.catchOp("entity track"); // Spigot
diff --git a/Spigot-Server-Patches/0437-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch b/Spigot-Server-Patches/0437-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch
index 430f1dc967..74356f1cd9 100644
--- a/Spigot-Server-Patches/0437-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch
+++ b/Spigot-Server-Patches/0437-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch
@@ -83,7 +83,7 @@ index 9615c4d324e42f7f91a7e60b6151c16d20e9c739..a68e4fc411ae84f12b1ca7443fa66f63
List<PlayerChunk> allChunks = new ArrayList<>(visibleChunks.values());
List<EntityPlayer> players = world.players;
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
-index 2d3eeb3a87e345ceb3496ec60d684452c070d4b7..c31e7c977194c953a47f5f04d9f90442a88e2db3 100644
+index d4207cb622bf17314f77831c604c8ba9e6cf848f..d95ef14f5a4babc8c8fff349baf6a9aa44edcc82 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -56,8 +56,33 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -227,7 +227,7 @@ index 2d3eeb3a87e345ceb3496ec60d684452c070d4b7..c31e7c977194c953a47f5f04d9f90442
this.updatingChunksModified = false;
return true;
}
-@@ -1081,12 +1163,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1083,12 +1165,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
protected Iterable<PlayerChunk> f() {
diff --git a/Spigot-Server-Patches/0459-Fix-Chunk-Post-Processing-deadlock-risk.patch b/Spigot-Server-Patches/0459-Fix-Chunk-Post-Processing-deadlock-risk.patch
index 14f102c38e..2aaf29124e 100644
--- a/Spigot-Server-Patches/0459-Fix-Chunk-Post-Processing-deadlock-risk.patch
+++ b/Spigot-Server-Patches/0459-Fix-Chunk-Post-Processing-deadlock-risk.patch
@@ -37,7 +37,7 @@ index 91755cd7313d87bae85584dff140acbc6467428f..0080a0cbe58d1a81c434ef97659428c8
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
-index 6e7754588960a1e6ceacc8b4cfd8237a10e210bb..9cf0d6d5e65ce6bdd5dfa8e1c3280432a8c7829b 100644
+index 1fcf75b2ed3c8c1ca2e31f679fc7d507f963caf2..fbe7129280f371ab9658fba2965c003b455aaa7a 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -133,6 +133,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -49,7 +49,7 @@ index 6e7754588960a1e6ceacc8b4cfd8237a10e210bb..9cf0d6d5e65ce6bdd5dfa8e1c3280432
// Paper start - distance maps
private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets<EntityPlayer> pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>();
-@@ -996,7 +998,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -998,7 +1000,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return Either.left(chunk);
});
}, (runnable) -> {
diff --git a/Spigot-Server-Patches/0462-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch b/Spigot-Server-Patches/0462-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch
index ceee3120d4..f7669ccdf4 100644
--- a/Spigot-Server-Patches/0462-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch
+++ b/Spigot-Server-Patches/0462-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch
@@ -40,10 +40,10 @@ index d4d789e84a2b6a3ba108532630a89f51b3a23f54..bc78b08d3f235de5d98107403c414510
// CraftBukkit end
public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
-index 9cf0d6d5e65ce6bdd5dfa8e1c3280432a8c7829b..987d4129d7ec9c8be4f6a20376923702e895f231 100644
+index fbe7129280f371ab9658fba2965c003b455aaa7a..537d7889ff3eaacfb74f499c1adb6cac10b0feef 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
-@@ -1535,6 +1535,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1537,6 +1537,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
.printStackTrace();
return;
}
diff --git a/Spigot-Server-Patches/0478-Use-distance-map-to-optimise-entity-tracker.patch b/Spigot-Server-Patches/0478-Use-distance-map-to-optimise-entity-tracker.patch
index 551967ead2..843379b430 100644
--- a/Spigot-Server-Patches/0478-Use-distance-map-to-optimise-entity-tracker.patch
+++ b/Spigot-Server-Patches/0478-Use-distance-map-to-optimise-entity-tracker.patch
@@ -56,7 +56,7 @@ index d9ed9df3021dab1f5ee0a51215a002253ac1e34c..b32d41fac5f855e302469209f368c367
return i;
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
-index f2bbb61c7f54fabd9ee087eb4f7ec56aa3df6e99..de51ca8965a406cdab73e75be26fbf055383d037 100644
+index da7d4003ef9b9d5959a969eda6d864076666b09e..443d40ea6f2008ed16af801e7216f59ae2042ca4 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -145,21 +145,55 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -162,7 +162,7 @@ index f2bbb61c7f54fabd9ee087eb4f7ec56aa3df6e99..de51ca8965a406cdab73e75be26fbf05
}
public void updatePlayerMobTypeMap(Entity entity) {
-@@ -1432,17 +1505,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1434,17 +1507,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
public void movePlayer(EntityPlayer entityplayer) {
@@ -181,7 +181,7 @@ index f2bbb61c7f54fabd9ee087eb4f7ec56aa3df6e99..de51ca8965a406cdab73e75be26fbf05
int i = MathHelper.floor(entityplayer.locX()) >> 4;
int j = MathHelper.floor(entityplayer.locZ()) >> 4;
-@@ -1558,7 +1621,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1560,7 +1623,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
entity.tracker = playerchunkmap_entitytracker; // Paper - Fast access to tracker
this.trackedEntities.put(entity.getId(), playerchunkmap_entitytracker);
@@ -190,7 +190,7 @@ index f2bbb61c7f54fabd9ee087eb4f7ec56aa3df6e99..de51ca8965a406cdab73e75be26fbf05
if (entity instanceof EntityPlayer) {
EntityPlayer entityplayer = (EntityPlayer) entity;
-@@ -1601,7 +1664,37 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1603,7 +1666,37 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
entity.tracker = null; // Paper - We're no longer tracked
}
@@ -228,7 +228,7 @@ index f2bbb61c7f54fabd9ee087eb4f7ec56aa3df6e99..de51ca8965a406cdab73e75be26fbf05
List<EntityPlayer> list = Lists.newArrayList();
List<EntityPlayer> list1 = this.world.getPlayers();
-@@ -1669,23 +1762,31 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1671,23 +1764,31 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
PacketDebug.a(this.world, chunk.getPos());
List<Entity> list = Lists.newArrayList();
List<Entity> list1 = Lists.newArrayList();
@@ -272,7 +272,7 @@ index f2bbb61c7f54fabd9ee087eb4f7ec56aa3df6e99..de51ca8965a406cdab73e75be26fbf05
Iterator iterator;
Entity entity1;
-@@ -1723,7 +1824,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1725,7 +1826,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
public class EntityTracker {
@@ -281,7 +281,7 @@ index f2bbb61c7f54fabd9ee087eb4f7ec56aa3df6e99..de51ca8965a406cdab73e75be26fbf05
private final Entity tracker;
private final int trackingDistance;
private SectionPosition e;
-@@ -1740,6 +1841,42 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1742,6 +1843,42 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.e = SectionPosition.a(entity);
}
@@ -324,7 +324,7 @@ index f2bbb61c7f54fabd9ee087eb4f7ec56aa3df6e99..de51ca8965a406cdab73e75be26fbf05
public boolean equals(Object object) {
return object instanceof PlayerChunkMap.EntityTracker ? ((PlayerChunkMap.EntityTracker) object).tracker.getId() == this.tracker.getId() : false;
}
-@@ -1840,7 +1977,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1842,7 +1979,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
int j = entity.getEntityType().getChunkRange() * 16;
j = org.spigotmc.TrackingRange.getEntityTrackingRange(entity, j); // Paper
diff --git a/Spigot-Server-Patches/0479-Optimize-isOutsideRange-to-use-distance-maps.patch b/Spigot-Server-Patches/0479-Optimize-isOutsideRange-to-use-distance-maps.patch
index e1b33d52b2..1188eab2b6 100644
--- a/Spigot-Server-Patches/0479-Optimize-isOutsideRange-to-use-distance-maps.patch
+++ b/Spigot-Server-Patches/0479-Optimize-isOutsideRange-to-use-distance-maps.patch
@@ -192,7 +192,7 @@ index 9cb2ff09da0b8832e58eed4d70741853a25c9011..7f660d3c528f5fb4150e4ee8b2991343
// Paper start
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
-index de51ca8965a406cdab73e75be26fbf055383d037..c6564edcc7f9d9df3855eef9a9f702c21c44c2d5 100644
+index 443d40ea6f2008ed16af801e7216f59ae2042ca4..15a5c85cab5a5d9e74a577f648258e205fcb6251 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -159,6 +159,17 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -308,7 +308,7 @@ index de51ca8965a406cdab73e75be26fbf055383d037..c6564edcc7f9d9df3855eef9a9f702c2
}
if (playerchunk != null) {
-@@ -1434,30 +1489,53 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1436,30 +1491,53 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return isOutsideOfRange(chunkcoordintpair, false);
}
diff --git a/Spigot-Server-Patches/0481-No-Tick-view-distance-implementation.patch b/Spigot-Server-Patches/0481-No-Tick-view-distance-implementation.patch
index 8668cd3492..2dba7f5f77 100644
--- a/Spigot-Server-Patches/0481-No-Tick-view-distance-implementation.patch
+++ b/Spigot-Server-Patches/0481-No-Tick-view-distance-implementation.patch
@@ -235,7 +235,7 @@ index 7f660d3c528f5fb4150e4ee8b29913436f125b06..40347212ad1bcf857d5b8ddb0ee6a698
public CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> a(ChunkStatus chunkstatus, PlayerChunkMap playerchunkmap) {
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
-index c6564edcc7f9d9df3855eef9a9f702c21c44c2d5..e4f81e93bfb305af7b2bfbccac3fbe981dbddf11 100644
+index 15a5c85cab5a5d9e74a577f648258e205fcb6251..ecab6d2309a7804c1ab4e7f7bcc519efb7f0a49f 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -95,7 +95,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -368,7 +368,7 @@ index c6564edcc7f9d9df3855eef9a9f702c21c44c2d5..e4f81e93bfb305af7b2bfbccac3fbe98
}
public void updatePlayerMobTypeMap(Entity entity) {
-@@ -1140,15 +1226,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1142,15 +1228,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
completablefuture1.thenAcceptAsync((either) -> {
either.mapLeft((chunk) -> {
this.u.getAndIncrement();
@@ -386,7 +386,7 @@ index c6564edcc7f9d9df3855eef9a9f702c21c44c2d5..e4f81e93bfb305af7b2bfbccac3fbe98
});
return completablefuture1;
}
-@@ -1243,32 +1325,38 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1245,32 +1327,38 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
}
@@ -440,7 +440,7 @@ index c6564edcc7f9d9df3855eef9a9f702c21c44c2d5..e4f81e93bfb305af7b2bfbccac3fbe98
protected void sendChunk(EntityPlayer entityplayer, ChunkCoordIntPair chunkcoordintpair, Packet<?>[] apacket, boolean flag, boolean flag1) {
if (entityplayer.world == this.world) {
-@@ -1276,7 +1364,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1278,7 +1366,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
PlayerChunk playerchunk = this.getVisibleChunk(chunkcoordintpair.pair());
if (playerchunk != null) {
@@ -449,7 +449,7 @@ index c6564edcc7f9d9df3855eef9a9f702c21c44c2d5..e4f81e93bfb305af7b2bfbccac3fbe98
if (chunk != null) {
this.a(entityplayer, apacket, chunk);
-@@ -1537,6 +1625,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1539,6 +1627,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
// Paper end - optimise isOutsideOfRange
@@ -457,7 +457,7 @@ index c6564edcc7f9d9df3855eef9a9f702c21c44c2d5..e4f81e93bfb305af7b2bfbccac3fbe98
private boolean b(EntityPlayer entityplayer) {
return entityplayer.isSpectator() && !this.world.getGameRules().getBoolean(GameRules.SPECTATORS_GENERATE_CHUNKS);
}
-@@ -1564,13 +1653,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1566,13 +1655,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.removePlayerFromDistanceMaps(entityplayer); // Paper - distance maps
}
@@ -472,7 +472,7 @@ index c6564edcc7f9d9df3855eef9a9f702c21c44c2d5..e4f81e93bfb305af7b2bfbccac3fbe98
}
-@@ -1578,7 +1661,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1580,7 +1663,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
SectionPosition sectionposition = SectionPosition.a((Entity) entityplayer);
entityplayer.a(sectionposition);
@@ -481,7 +481,7 @@ index c6564edcc7f9d9df3855eef9a9f702c21c44c2d5..e4f81e93bfb305af7b2bfbccac3fbe98
return sectionposition;
}
-@@ -1623,6 +1706,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1625,6 +1708,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
int k1;
int l1;
@@ -489,7 +489,7 @@ index c6564edcc7f9d9df3855eef9a9f702c21c44c2d5..e4f81e93bfb305af7b2bfbccac3fbe98
if (Math.abs(i1 - i) <= this.viewDistance * 2 && Math.abs(j1 - j) <= this.viewDistance * 2) {
k1 = Math.min(i, i1) - this.viewDistance;
l1 = Math.min(j, j1) - this.viewDistance;
-@@ -1660,7 +1744,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1662,7 +1746,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.sendChunk(entityplayer, chunkcoordintpair1, new Packet[2], false, true);
}
}
@@ -498,7 +498,7 @@ index c6564edcc7f9d9df3855eef9a9f702c21c44c2d5..e4f81e93bfb305af7b2bfbccac3fbe98
this.updateMaps(entityplayer); // Paper - distance maps
-@@ -1668,11 +1752,46 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1670,11 +1754,46 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@Override
public Stream<EntityPlayer> a(ChunkCoordIntPair chunkcoordintpair, boolean flag) {
@@ -549,7 +549,7 @@ index c6564edcc7f9d9df3855eef9a9f702c21c44c2d5..e4f81e93bfb305af7b2bfbccac3fbe98
}
protected void addEntity(Entity entity) {
-@@ -1830,6 +1949,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1832,6 +1951,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
@@ -557,7 +557,7 @@ index c6564edcc7f9d9df3855eef9a9f702c21c44c2d5..e4f81e93bfb305af7b2bfbccac3fbe98
private void a(EntityPlayer entityplayer, Packet<?>[] apacket, Chunk chunk) {
if (apacket[0] == null) {
apacket[0] = new PacketPlayOutMapChunk(chunk, 65535, true);
-@@ -2015,7 +2135,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -2017,7 +2137,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(this.tracker.chunkX, this.tracker.chunkZ);
PlayerChunk playerchunk = PlayerChunkMap.this.getVisibleChunk(chunkcoordintpair.pair());
diff --git a/Spigot-Server-Patches/0493-Reduce-allocation-of-Vec3D-by-entity-tracker.patch b/Spigot-Server-Patches/0493-Reduce-allocation-of-Vec3D-by-entity-tracker.patch
index f26f984bff..dff167d6b7 100644
--- a/Spigot-Server-Patches/0493-Reduce-allocation-of-Vec3D-by-entity-tracker.patch
+++ b/Spigot-Server-Patches/0493-Reduce-allocation-of-Vec3D-by-entity-tracker.patch
@@ -39,10 +39,10 @@ index 0c46297e6ff229538d77b2f481e4ab13ea14c48e..f75c09d44a19f84588f21a55ea8f0dd8
if (!flag4 && this.o <= 400 && !this.q && this.r == this.tracker.isOnGround()) {
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
-index e4527f3f899ac194d629f39bfdb650667d2dab80..3c758c74f24443031d905dad4c0d7460762b89fb 100644
+index f6f77583d398c0a03464b0e318d6a93ab72dd206..9f1fa69912ea05798cffe4f520db92a3a2602dac 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
-@@ -2131,9 +2131,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -2133,9 +2133,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
public void updatePlayer(EntityPlayer entityplayer) {
org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // Spigot
if (entityplayer != this.tracker) {
diff --git a/Spigot-Server-Patches/0496-Workaround-for-Client-Lag-Spikes-MC-162253.patch b/Spigot-Server-Patches/0496-Workaround-for-Client-Lag-Spikes-MC-162253.patch
index 36d635ac90..a667eb97bd 100644
--- a/Spigot-Server-Patches/0496-Workaround-for-Client-Lag-Spikes-MC-162253.patch
+++ b/Spigot-Server-Patches/0496-Workaround-for-Client-Lag-Spikes-MC-162253.patch
@@ -37,10 +37,10 @@ index 860dc98ab4f84c470b27726314943936d23fcb79..8d45588ecfa33b8c7335df3db58ed686
return chunksection == Chunk.a || chunksection.c();
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
-index 3c758c74f24443031d905dad4c0d7460762b89fb..df315700fb28d682f406f8122e7cc187dbc13273 100644
+index 9f1fa69912ea05798cffe4f520db92a3a2602dac..1147f58c6a0bc153e03a461588efabdfd9ed6357 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
-@@ -1956,12 +1956,112 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1958,12 +1958,112 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
diff --git a/Spigot-Server-Patches/0497-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch b/Spigot-Server-Patches/0497-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch
index a6ad60392c..39ce143a46 100644
--- a/Spigot-Server-Patches/0497-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch
+++ b/Spigot-Server-Patches/0497-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch
@@ -484,7 +484,7 @@ index c072f61e8c88eac8335acd660d8ff0e2f9db819e..4c4108705e9d25912e57a7b3c28b4f1a
protected int c(long i) {
return this.a.get(i);
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
-index a6363b73522f9d27534b6e80f4b3789e84316c49..604e7004b659daed2844ba1a76bf09288ec549e5 100644
+index 319059ba31f3614cc59cd4c4e4fa9242f6e4fe99..7c87ef638d538093e944341525a1027be5d15a0e 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -443,6 +443,26 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -882,7 +882,7 @@ index e5751adde516544722b95016f64b2a46c16e77ce..04dea2c9fd9337631a6289c7242338e1
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
-index df315700fb28d682f406f8122e7cc187dbc13273..6a1ebb6daf2fdcb2bd276e36672fbec05d98adef 100644
+index 1147f58c6a0bc153e03a461588efabdfd9ed6357..6b48c4e1d69f8de6ec32258c200be3c136ba20aa 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -51,6 +51,7 @@ import org.apache.commons.lang3.mutable.MutableBoolean;
@@ -1094,7 +1094,7 @@ index df315700fb28d682f406f8122e7cc187dbc13273..6a1ebb6daf2fdcb2bd276e36672fbec0
list.add(completablefuture);
}
-@@ -1028,14 +1165,22 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1030,14 +1167,22 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
};
CompletableFuture<NBTTagCompound> chunkSaveFuture = this.world.asyncChunkTaskManager.getChunkSaveFuture(chunkcoordintpair.x, chunkcoordintpair.z);
@@ -1122,7 +1122,7 @@ index df315700fb28d682f406f8122e7cc187dbc13273..6a1ebb6daf2fdcb2bd276e36672fbec0
return ret;
// Paper end
}
-@@ -1172,7 +1317,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1174,7 +1319,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
long i = playerchunk.i().pair();
playerchunk.getClass();
diff --git a/Spigot-Server-Patches/0500-Improve-Chunk-Status-Transition-Speed.patch b/Spigot-Server-Patches/0500-Improve-Chunk-Status-Transition-Speed.patch
index a5bf178346..d73cded79d 100644
--- a/Spigot-Server-Patches/0500-Improve-Chunk-Status-Transition-Speed.patch
+++ b/Spigot-Server-Patches/0500-Improve-Chunk-Status-Transition-Speed.patch
@@ -54,7 +54,7 @@ index 04dea2c9fd9337631a6289c7242338e166d6bc1e..446c401b3139f8c6c0e70d883340f014
// Paper start - no-tick view distance
public final Chunk getSendingChunk() {
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
-index 6a1ebb6daf2fdcb2bd276e36672fbec05d98adef..2fac2e59ab0712459f03cdacc0f67c1528c5a5bf 100644
+index 6b48c4e1d69f8de6ec32258c200be3c136ba20aa..fea219dcfd5a98fc0e48fd70dc7d0fd41b2fc970 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -740,7 +740,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -84,7 +84,7 @@ index 6a1ebb6daf2fdcb2bd276e36672fbec05d98adef..2fac2e59ab0712459f03cdacc0f67c15
}
}
-@@ -1225,6 +1225,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1227,6 +1227,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return CompletableFuture.completedFuture(Either.right(playerchunk_failure));
});
}, (runnable) -> {