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.
This commit is contained in:
Aikar 2020-04-11 17:15:41 -04:00
parent 089d83568b
commit bb5c294ecf
No known key found for this signature in database
GPG key ID: 401ADFC9891FAAFE

View file

@ -1,4 +1,4 @@
From 79568d5d2ba10081b7b930c8b5b3012f22f4d39c Mon Sep 17 00:00:00 2001
From b8eb5c25128518b9fe63d9acdd1bbb794cb8fc90 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Sat, 13 Jul 2019 09:23:10 -0700
Subject: [PATCH] Asynchronous chunk IO and loading
@ -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 +1,492 @@
@ -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