From 6ad6ec1ac95f1d50906b322bf4e4866cbed94dd9 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 11 Apr 2020 17:15:41 -0400 Subject: [PATCH] Fix Disabling Asynchronous Chunks This fix is for the few people who are using such low end systems that asynchronous chunk loading hurts them rather than helping. The previous build made paper crash if you turned off async chunks, and this fixes that issue. --- Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch b/Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch index ee585f9fd8..e3d893ac9b 100644 --- a/Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch +++ b/Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch @@ -1902,7 +1902,7 @@ index 0000000000..1dfa8abfd8 +} diff --git a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTaskManager.java b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTaskManager.java new file mode 100644 -index 0000000000..e8282e9781 +index 0000000000..ff19d38f82 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTaskManager.java @@ -0,0 +0,0 @@ @@ -2344,7 +2344,7 @@ index 0000000000..e8282e9781 + + private void raiseTaskPriority(ChunkTask task, int priority) { + final boolean raised = task.raisePriority(priority); -+ if (task.isScheduled() && raised) { ++ if (task.isScheduled() && raised && this.workers != null) { + // only notify if we're in queue to be executed + if (priority == PrioritizedTaskQueue.HIGHEST_PRIORITY) { + // was in another queue but became urgent later, add to urgent queue and the previous