From f34a20c36a1ff689c82b2d651d11b5a4d7b4917f Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Wed, 29 Mar 2023 17:08:56 -0700 Subject: [PATCH] Fix incorrect error handling in off-main chunk load task Now that there is no on-main task, the completion logic for the status task is completed with the results passed by the off-main task. Thus, the chunk system saw a non-null throwable and assumed a fatal crash. The old on-main task did not pass the throwable through in this case, which allowed the chunk to re-generate. Fixes https://github.com/PaperMC/Folia/issues/7 --- ...Make-ChunkStatus.EMPTY-not-rely-on-the-main-thread-f.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/server/0003-Make-ChunkStatus.EMPTY-not-rely-on-the-main-thread-f.patch b/patches/server/0003-Make-ChunkStatus.EMPTY-not-rely-on-the-main-thread-f.patch index 1456459..be3f358 100644 --- a/patches/server/0003-Make-ChunkStatus.EMPTY-not-rely-on-the-main-thread-f.patch +++ b/patches/server/0003-Make-ChunkStatus.EMPTY-not-rely-on-the-main-thread-f.patch @@ -70,7 +70,7 @@ index fb42d776f15f735fb59e972e00e2b512c23a8387..300700477ee34bc22b31315825c0e40f chunk = wrappedFull.getWrapped(); } else { diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkLoadTask.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkLoadTask.java -index be6f3f6a57668a9bd50d0ea5f2dd2335355b69d6..d52f68d0302d581b9bbe30fe0680fb8108e3da85 100644 +index be6f3f6a57668a9bd50d0ea5f2dd2335355b69d6..1f7c146ff0b2a835c818f49da6c1f1411f26aa39 100644 --- a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkLoadTask.java +++ b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkLoadTask.java @@ -25,6 +25,7 @@ import org.slf4j.Logger; @@ -265,7 +265,7 @@ index be6f3f6a57668a9bd50d0ea5f2dd2335355b69d6..d52f68d0302d581b9bbe30fe0680fb81 } catch (final Throwable thr2) { LOGGER.error("Failed to parse chunk data for task: " + this.toString() + ", chunk data will be lost", thr2); - return new TaskResult<>(null, thr2); -+ return new TaskResult<>(this.getEmptyChunk(), thr2); ++ return new TaskResult<>(this.getEmptyChunk(), null); } }