aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason Penilla <[email protected]>2022-02-28 21:21:01 -0700
committerJason Penilla <[email protected]>2022-02-28 22:52:40 -0700
commit126ca7376e368424ea0b6e473a31b16adb19ec7a (patch)
tree942785c58ecbba7240c2b6287c0f6caed7f48c33
parentb9037a5c7dd462daf7e1954f93a58306d27e1c8b (diff)
downloadPaper-126ca7376e368424ea0b6e473a31b16adb19ec7a.tar.gz
Paper-126ca7376e368424ea0b6e473a31b16adb19ec7a.zip
Add TODO for leaf
-rw-r--r--patches/server/0403-Fix-Chunk-Post-Processing-deadlock-risk.patch31
1 files changed, 31 insertions, 0 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 38dc0cae67..b6319a14e0 100644
--- a/patches/server/0403-Fix-Chunk-Post-Processing-deadlock-risk.patch
+++ b/patches/server/0403-Fix-Chunk-Post-Processing-deadlock-risk.patch
@@ -24,6 +24,37 @@ the executor so that the mailbox ChunkQueue is now considered empty.
This successfully fixed a reoccurring and highly reproduceable crash
for heightmaps.
+TODO FOR LEAF: 1.18.2 changed this
+
+OLD
+
+ CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> completablefuture1 = completablefuture.thenApplyAsync((either) -> {
+ return either.flatMap((list) -> {
+ LevelChunk chunk = (LevelChunk) list.get(list.size() / 2);
+
+ chunk.postProcessGeneration();
+ this.level.startTickingChunk(chunk);
+ return Either.left(chunk);
+ });
+ }, (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.
+ });
+
+NEW
+
+ 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, () -> 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) -> {
+ chunk.postProcessGeneration();
+ this.level.startTickingChunk(chunk);
+ });
+ }, 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
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java