aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorShane Freeder <[email protected]>2022-03-02 18:08:10 +0000
committerShane Freeder <[email protected]>2022-03-02 18:08:10 +0000
commit12d89fe5aec699dedbf529d1dc57b0deddb22409 (patch)
treeebd5b4b13cf4b1a52ef67ccf8d7176d36d0439c0
parentc6ea84c7fae8d2974820333505a39c7b01c39b90 (diff)
downloadPaper-12d89fe5aec699dedbf529d1dc57b0deddb22409.tar.gz
Paper-12d89fe5aec699dedbf529d1dc57b0deddb22409.zip
Revert chunk postprocessing back to 1.18.1 logic
-rw-r--r--patches/server/0403-Fix-Chunk-Post-Processing-deadlock-risk.patch34
-rw-r--r--patches/server/0404-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch4
-rw-r--r--patches/server/0430-Reduce-allocation-of-Vec3D-by-entity-tracker.patch4
-rw-r--r--patches/server/0433-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch4
-rw-r--r--patches/server/0434-Use-distance-map-to-optimise-entity-tracker.patch12
-rw-r--r--patches/server/0457-incremental-chunk-and-player-saving.patch6
-rw-r--r--patches/server/0736-Fix-chunks-refusing-to-unload-at-low-TPS.patch4
-rw-r--r--patches/server/0750-Do-not-copy-visible-chunks.patch8
-rw-r--r--patches/server/0767-Oprimise-map-impl-for-tracked-players.patch4
-rw-r--r--patches/server/0864-Replace-player-chunk-loader-system.patch18
10 files changed, 58 insertions, 40 deletions
diff --git a/patches/server/0403-Fix-Chunk-Post-Processing-deadlock-risk.patch b/patches/server/0403-Fix-Chunk-Post-Processing-deadlock-risk.patch
index b6319a14e0..23939da803 100644
--- a/patches/server/0403-Fix-Chunk-Post-Processing-deadlock-risk.patch
+++ b/patches/server/0403-Fix-Chunk-Post-Processing-deadlock-risk.patch
@@ -56,7 +56,7 @@ NEW
}, this.mainThreadExecutor);
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 7e3f7b69fc7a608dd82b471d832cc401a77f0738..aeae3fb3d05b513031e4af217fe3db7fa3ec4a75 100644
+index 7e3f7b69fc7a608dd82b471d832cc401a77f0738..d251e07eec07f8f822af1f8713e46aebe54b4890 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -178,6 +178,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -67,15 +67,33 @@ index 7e3f7b69fc7a608dd82b471d832cc401a77f0738..aeae3fb3d05b513031e4af217fe3db7f
// Paper start - distance maps
private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets<ServerPlayer> pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>();
-@@ -1012,7 +1013,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
- return (LevelChunk) list.get(list.size() / 2);
- });
- }, (runnable) -> {
+@@ -1008,17 +1009,18 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+ return ChunkStatus.FULL;
+ });
+ CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> completablefuture1 = completablefuture.thenApplyAsync((either) -> {
+- return either.mapLeft((list) -> {
+- return (LevelChunk) list.get(list.size() / 2);
+- });
+- }, (runnable) -> {
- this.mainThreadMailbox.tell(ChunkTaskPriorityQueueSorter.message(holder, runnable));
-+ this.mainThreadMailbox.tell(ChunkTaskPriorityQueueSorter.message(holder, () -> ChunkMap.this.chunkLoadConversionCallbackExecutor.execute(runnable))); // Paper - delay running Chunk post processing until outside of the sorter to prevent a deadlock scenario when post processing causes another chunk request.
- }).thenApplyAsync((either) -> {
- return either.ifLeft((chunk) -> {
+- }).thenApplyAsync((either) -> {
+- return either.ifLeft((chunk) -> {
++ // Paper start
++ return either.flatMap((list) -> {
++ LevelChunk chunk = (LevelChunk) list.get(list.size() / 2);
chunk.postProcessGeneration();
+ this.level.startTickingChunk(chunk);
++ return Either.left(chunk);
++
+ });
+- }, this.mainThreadExecutor);
++ }, (runnable) -> {
++ this.mainThreadMailbox.tell(ChunkTaskPriorityQueueSorter.message(holder, () -> ChunkMap.this.chunkLoadConversionCallbackExecutor.execute(runnable))); // Paper - delay running Chunk post processing until outside of the sorter to prevent a deadlock scenario when post processing causes another chunk request.
++ });
++ // Paper end
+
+ completablefuture1.thenAcceptAsync((either) -> {
+ either.ifLeft((chunk) -> {
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index cf56b2ed508352205ef6ec71519b0626aa698987..1b6fb81079d3ad5d3c33be67a1c05111f9dd5f2d 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
diff --git a/patches/server/0404-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch b/patches/server/0404-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch
index 68ad104836..b07379339e 100644
--- a/patches/server/0404-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch
+++ b/patches/server/0404-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch
@@ -28,10 +28,10 @@ receives a deterministic result, and should no longer require 1 tick
delays anymore.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 86a06c7ee3b92fbff1e21ad36b6034d892cd0c01..94a5fa9cac20597181f435998413b1981d8ef289 100644
+index d251e07eec07f8f822af1f8713e46aebe54b4890..c11dac1aa504a9e82d883134caa9b4b689501ce1 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1623,6 +1623,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1624,6 +1624,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
.printStackTrace();
return;
}
diff --git a/patches/server/0430-Reduce-allocation-of-Vec3D-by-entity-tracker.patch b/patches/server/0430-Reduce-allocation-of-Vec3D-by-entity-tracker.patch
index 57001dea7b..291f734b76 100644
--- a/patches/server/0430-Reduce-allocation-of-Vec3D-by-entity-tracker.patch
+++ b/patches/server/0430-Reduce-allocation-of-Vec3D-by-entity-tracker.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Reduce allocation of Vec3D by entity tracker
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 94a5fa9cac20597181f435998413b1981d8ef289..d410298aa665084d5a066410679e69a6777bd637 100644
+index c11dac1aa504a9e82d883134caa9b4b689501ce1..d5e037385263cb094cbbf15823e38e81acafc7d7 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1901,9 +1901,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1902,9 +1902,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
public void updatePlayer(ServerPlayer player) {
org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // Spigot
if (player != this.entity) {
diff --git a/patches/server/0433-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch b/patches/server/0433-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch
index f98354fda3..6630f7f50a 100644
--- a/patches/server/0433-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch
+++ b/patches/server/0433-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch
@@ -42,7 +42,7 @@ index 674a6492e2eb10cfd29989643eedcea08b2d5218..dff475b327d6edaa4dcb9bc09029237f
// Paper start
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index d410298aa665084d5a066410679e69a6777bd637..fcdf19b6c0b88ef9a4b84575b461d60ff5d3879a 100644
+index d5e037385263cb094cbbf15823e38e81acafc7d7..0959adc5ec64d1939fc212151d5e0df073ebc312 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -181,11 +181,23 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -143,7 +143,7 @@ index d410298aa665084d5a066410679e69a6777bd637..fcdf19b6c0b88ef9a4b84575b461d60f
this.pendingUnloads.put(j, playerchunk);
this.modified = true;
this.scheduleUnload(j, playerchunk); // Paper - Move up - don't leak chunks
-@@ -1385,43 +1436,48 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1386,43 +1437,48 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return this.anyPlayerCloseEnoughForSpawning(pos, false);
}
diff --git a/patches/server/0434-Use-distance-map-to-optimise-entity-tracker.patch b/patches/server/0434-Use-distance-map-to-optimise-entity-tracker.patch
index a6fe98e1ee..ef37566a54 100644
--- a/patches/server/0434-Use-distance-map-to-optimise-entity-tracker.patch
+++ b/patches/server/0434-Use-distance-map-to-optimise-entity-tracker.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Use distance map to optimise entity tracker
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
-index fcdf19b6c0b88ef9a4b84575b461d60ff5d3879a..f6864aba42bab1e23450f8f600c5c1f1ce4d4846 100644
+index 0959adc5ec64d1939fc212151d5e0df073ebc312..1400975fd7debce564f289bf32d14dc2f55952fd 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -70,6 +70,7 @@ import net.minecraft.network.protocol.game.ClientboundSetEntityLinkPacket;
@@ -126,7 +126,7 @@ index fcdf19b6c0b88ef9a4b84575b461d60ff5d3879a..f6864aba42bab1e23450f8f600c5c1f1
// Paper start - optimise ChunkMap#anyPlayerCloseEnoughForSpawning
this.playerChunkTickRangeMap = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets,
(ServerPlayer player, int rangeX, int rangeZ, int currPosX, int currPosZ, int prevPosX, int prevPosZ,
-@@ -1559,17 +1637,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1560,17 +1638,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
public void move(ServerPlayer player) {
@@ -145,7 +145,7 @@ index fcdf19b6c0b88ef9a4b84575b461d60ff5d3879a..f6864aba42bab1e23450f8f600c5c1f1
int i = SectionPos.blockToSectionCoord(player.getBlockX());
int j = SectionPos.blockToSectionCoord(player.getBlockZ());
-@@ -1696,7 +1764,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1697,7 +1765,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
entity.tracker = playerchunkmap_entitytracker; // Paper - Fast access to tracker
this.entityMap.put(entity.getId(), playerchunkmap_entitytracker);
@@ -154,7 +154,7 @@ index fcdf19b6c0b88ef9a4b84575b461d60ff5d3879a..f6864aba42bab1e23450f8f600c5c1f1
if (entity instanceof ServerPlayer) {
ServerPlayer entityplayer = (ServerPlayer) entity;
-@@ -1740,7 +1808,37 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1741,7 +1809,37 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
entity.tracker = null; // Paper - We're no longer tracked
}
@@ -192,7 +192,7 @@ index fcdf19b6c0b88ef9a4b84575b461d60ff5d3879a..f6864aba42bab1e23450f8f600c5c1f1
List<ServerPlayer> list = Lists.newArrayList();
List<ServerPlayer> list1 = this.level.players();
ObjectIterator objectiterator = this.entityMap.values().iterator();
-@@ -1816,23 +1914,31 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1817,23 +1915,31 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
DebugPackets.sendPoiPacketsForChunk(this.level, chunk.getPos());
List<Entity> list = Lists.newArrayList();
List<Entity> list1 = Lists.newArrayList();
@@ -236,7 +236,7 @@ index fcdf19b6c0b88ef9a4b84575b461d60ff5d3879a..f6864aba42bab1e23450f8f600c5c1f1
Iterator iterator;
Entity entity1;
-@@ -1908,6 +2014,42 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1909,6 +2015,42 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.lastSectionPos = SectionPos.of(entity);
}
diff --git a/patches/server/0457-incremental-chunk-and-player-saving.patch b/patches/server/0457-incremental-chunk-and-player-saving.patch
index 86497575c4..32a8c94cd7 100644
--- a/patches/server/0457-incremental-chunk-and-player-saving.patch
+++ b/patches/server/0457-incremental-chunk-and-player-saving.patch
@@ -165,7 +165,7 @@ index dff475b327d6edaa4dcb9bc09029237f8f659846..05d2790b80a6d2e1dc6b8d2375f783be
for (int i = 0; i < this.futures.length(); ++i) {
CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> completablefuture = (CompletableFuture) this.futures.get(i);
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index f6864aba42bab1e23450f8f600c5c1f1ce4d4846..b1093b728f09a8b1235d27563004de3ff0fbe911 100644
+index 1400975fd7debce564f289bf32d14dc2f55952fd..644ab527da5107c7cbfc037a143b1afe54efed7b 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -104,6 +104,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureMana
@@ -264,7 +264,7 @@ index f6864aba42bab1e23450f8f600c5c1f1ce4d4846..b1093b728f09a8b1235d27563004de3f
this.lightEngine.updateChunkStatus(ichunkaccess.getPos());
this.lightEngine.tryScheduleUpdate();
-@@ -1247,6 +1301,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1248,6 +1302,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
asyncSaveData, chunk);
chunk.setUnsaved(false);
@@ -272,7 +272,7 @@ index f6864aba42bab1e23450f8f600c5c1f1ce4d4846..b1093b728f09a8b1235d27563004de3f
}
// Paper end
-@@ -1256,6 +1311,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1257,6 +1312,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (!chunk.isUnsaved()) {
return false;
} else {
diff --git a/patches/server/0736-Fix-chunks-refusing-to-unload-at-low-TPS.patch b/patches/server/0736-Fix-chunks-refusing-to-unload-at-low-TPS.patch
index 90920dfb9e..5885f67549 100644
--- a/patches/server/0736-Fix-chunks-refusing-to-unload-at-low-TPS.patch
+++ b/patches/server/0736-Fix-chunks-refusing-to-unload-at-low-TPS.patch
@@ -10,10 +10,10 @@ chunk future to complete. We can simply schedule to the immediate
executor to get this effect, rather than the main mailbox.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 7595f2bd6b26946e9f437dbd962a3b23e95a52b6..5602576dd8aea04fc233a801cce9bc14d27a55ec 100644
+index fcfb7df39457a539fea4c6b6af17d9d05e6ce812..74623b0f56e64afadb87cb6924159c0f9b79a56c 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1315,9 +1315,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1316,9 +1316,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return chunk;
});
diff --git a/patches/server/0750-Do-not-copy-visible-chunks.patch b/patches/server/0750-Do-not-copy-visible-chunks.patch
index e04a1deb15..b30322d410 100644
--- a/patches/server/0750-Do-not-copy-visible-chunks.patch
+++ b/patches/server/0750-Do-not-copy-visible-chunks.patch
@@ -35,7 +35,7 @@ index b3516862d796c2d9fcc1c67a6073445403d73088..b61abf227a04b4565c2525e5f469db30
List<ChunkHolder> allChunks = new ArrayList<>(visibleChunks.values());
List<ServerPlayer> players = world.players;
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 9c55ab3475397040ea3ae4a530c3ee3cb10bb899..c70bff94a356706e1051199de690ce2934cdaf4a 100644
+index 7aa89874aeb53755fc75f56614568f31110af42a..50a89a1f485611249a1b393ae75b4ff6b9534402 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -123,9 +123,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -152,7 +152,7 @@ index 9c55ab3475397040ea3ae4a530c3ee3cb10bb899..c70bff94a356706e1051199de690ce29
this.modified = false;
return true;
}
-@@ -1480,7 +1492,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1481,7 +1493,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.viewDistance = j;
this.distanceManager.updatePlayerTickets(this.viewDistance + 1);
@@ -161,7 +161,7 @@ index 9c55ab3475397040ea3ae4a530c3ee3cb10bb899..c70bff94a356706e1051199de690ce29
while (objectiterator.hasNext()) {
ChunkHolder playerchunk = (ChunkHolder) objectiterator.next();
-@@ -1523,7 +1535,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1524,7 +1536,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
public int size() {
@@ -170,7 +170,7 @@ index 9c55ab3475397040ea3ae4a530c3ee3cb10bb899..c70bff94a356706e1051199de690ce29
}
public DistanceManager getDistanceManager() {
-@@ -1531,13 +1543,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1532,13 +1544,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
protected Iterable<ChunkHolder> getChunks() {
diff --git a/patches/server/0767-Oprimise-map-impl-for-tracked-players.patch b/patches/server/0767-Oprimise-map-impl-for-tracked-players.patch
index 42dbf19683..aaa352b87b 100644
--- a/patches/server/0767-Oprimise-map-impl-for-tracked-players.patch
+++ b/patches/server/0767-Oprimise-map-impl-for-tracked-players.patch
@@ -7,7 +7,7 @@ Reference2BooleanOpenHashMap is going to have
better lookups than HashMap.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index c70bff94a356706e1051199de690ce2934cdaf4a..34847448b9808dc52deb76f654fa2797adea25d9 100644
+index 50a89a1f485611249a1b393ae75b4ff6b9534402..01cb03ab0839aa7e2b9c54226b557306e4115348 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -110,6 +110,7 @@ import org.apache.commons.lang3.mutable.MutableObject;
@@ -18,7 +18,7 @@ index c70bff94a356706e1051199de690ce2934cdaf4a..34847448b9808dc52deb76f654fa2797
public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider {
-@@ -2170,7 +2171,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -2171,7 +2172,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
final Entity entity;
private final int range;
SectionPos lastSectionPos;
diff --git a/patches/server/0864-Replace-player-chunk-loader-system.patch b/patches/server/0864-Replace-player-chunk-loader-system.patch
index 94e9434704..a852acb727 100644
--- a/patches/server/0864-Replace-player-chunk-loader-system.patch
+++ b/patches/server/0864-Replace-player-chunk-loader-system.patch
@@ -1381,7 +1381,7 @@ index 36b6e7295cf7484675c8c2b9624c1f6fea7aed1d..38db3905f47fefb5c958fa24aef2313e
public CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> getOrScheduleFuture(ChunkStatus targetStatus, ChunkMap chunkStorage) {
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 9f367f3e33c6bad8b9df4f18559ebcd98a97c95c..d93eb2d0f38598a8939048de16dc7f14f2d39302 100644
+index 81442caecba8c85ab5af96d712841615b7b7a5dd..42056c7a506a7edfe8a5feabacece5bc19f707f1 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -217,6 +217,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1434,7 +1434,7 @@ index 9f367f3e33c6bad8b9df4f18559ebcd98a97c95c..d93eb2d0f38598a8939048de16dc7f14
}
// Paper end
// Paper start
-@@ -1436,11 +1440,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1437,11 +1441,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
completablefuture1.thenAcceptAsync((either) -> {
either.ifLeft((chunk) -> {
this.tickingGenerated.getAndIncrement();
@@ -1447,7 +1447,7 @@ index 9f367f3e33c6bad8b9df4f18559ebcd98a97c95c..d93eb2d0f38598a8939048de16dc7f14
});
}, (runnable) -> {
this.mainThreadMailbox.tell(ChunkTaskPriorityQueueSorter.message(holder, runnable));
-@@ -1609,33 +1609,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1610,33 +1610,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
int k = this.viewDistance;
this.viewDistance = j;
@@ -1490,7 +1490,7 @@ index 9f367f3e33c6bad8b9df4f18559ebcd98a97c95c..d93eb2d0f38598a8939048de16dc7f14
if (chunk != null) {
this.playerLoadedChunk(player, packet, chunk);
-@@ -1666,7 +1657,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1667,7 +1658,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
void dumpChunks(Writer writer) throws IOException {
CsvOutput csvwriter = CsvOutput.builder().addColumn("x").addColumn("z").addColumn("level").addColumn("in_memory").addColumn("status").addColumn("full_status").addColumn("accessible_ready").addColumn("ticking_ready").addColumn("entity_ticking_ready").addColumn("ticket").addColumn("spawning").addColumn("block_entity_count").addColumn("ticking_ticket").addColumn("ticking_level").addColumn("block_ticks").addColumn("fluid_ticks").build(writer);
@@ -1499,7 +1499,7 @@ index 9f367f3e33c6bad8b9df4f18559ebcd98a97c95c..d93eb2d0f38598a8939048de16dc7f14
ObjectBidirectionalIterator objectbidirectionaliterator = this.updatingChunks.getVisibleMap().clone().long2ObjectEntrySet().fastIterator(); // Paper
while (objectbidirectionaliterator.hasNext()) {
-@@ -1682,7 +1673,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1683,7 +1674,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// CraftBukkit - decompile error
csvwriter.writeRow(chunkcoordintpair.x, chunkcoordintpair.z, playerchunk.getTicketLevel(), optional.isPresent(), optional.map(ChunkAccess::getStatus).orElse(null), optional1.map(LevelChunk::getFullStatus).orElse(null), ChunkMap.printFuture(playerchunk.getFullChunkFuture()), ChunkMap.printFuture(playerchunk.getTickingChunkFuture()), ChunkMap.printFuture(playerchunk.getEntityTickingChunkFuture()), this.distanceManager.getTicketDebugString(i), this.anyPlayerCloseEnoughForSpawning(chunkcoordintpair), optional1.map((chunk) -> {
return chunk.getBlockEntities().size();
@@ -1508,7 +1508,7 @@ index 9f367f3e33c6bad8b9df4f18559ebcd98a97c95c..d93eb2d0f38598a8939048de16dc7f14
return chunk.getBlockTicks().count();
}).orElse(0), optional1.map((chunk) -> {
return chunk.getFluidTicks().count();
-@@ -1899,15 +1890,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1900,15 +1891,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.removePlayerFromDistanceMaps(player); // Paper - distance maps
}
@@ -1525,7 +1525,7 @@ index 9f367f3e33c6bad8b9df4f18559ebcd98a97c95c..d93eb2d0f38598a8939048de16dc7f14
}
-@@ -1915,7 +1898,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1916,7 +1899,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
SectionPos sectionposition = SectionPos.of((Entity) player);
player.setLastSectionPos(sectionposition);
@@ -1534,7 +1534,7 @@ index 9f367f3e33c6bad8b9df4f18559ebcd98a97c95c..d93eb2d0f38598a8939048de16dc7f14
return sectionposition;
}
-@@ -1960,65 +1943,40 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1961,65 +1944,40 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
int k1;
int l1;
@@ -1622,7 +1622,7 @@ index 9f367f3e33c6bad8b9df4f18559ebcd98a97c95c..d93eb2d0f38598a8939048de16dc7f14
}
public void addEntity(Entity entity) {
-@@ -2387,7 +2345,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -2388,7 +2346,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
double vec3d_dx = player.getX() - this.entity.getX();
double vec3d_dz = player.getZ() - this.entity.getZ();
// Paper end - remove allocation of Vec3D here