aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0786-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0786-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch')
-rw-r--r--patches/server/0786-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/patches/server/0786-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch b/patches/server/0786-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch
new file mode 100644
index 0000000000..9ef9dbd884
--- /dev/null
+++ b/patches/server/0786-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch
@@ -0,0 +1,37 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Spottedleaf <[email protected]>
+Date: Tue, 28 Dec 2021 07:19:01 -0800
+Subject: [PATCH] Execute chunk tasks fairly for worlds while waiting for next
+ tick
+
+Currently, only the first world would have had tasks executed.
+This might result in chunks loading far slower in the nether,
+for example.
+
+diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
+index edb90f6630bc19c66579890f59cc1f296fd82a75..fe363bb2aff031c0efb812fa7e12d585984e2b29 100644
+--- a/src/main/java/net/minecraft/server/MinecraftServer.java
++++ b/src/main/java/net/minecraft/server/MinecraftServer.java
+@@ -1308,6 +1308,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+ this.executeMidTickTasks(); // Paper - execute chunk tasks mid tick
+ return true;
+ } else {
++ boolean ret = false; // Paper - force execution of all worlds, do not just bias the first
+ if (this.haveTime()) {
+ Iterator iterator = this.getAllLevels().iterator();
+
+@@ -1315,12 +1316,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+ ServerLevel worldserver = (ServerLevel) iterator.next();
+
+ if (worldserver.getChunkSource().pollTask()) {
+- return true;
++ ret = true; // Paper - force execution of all worlds, do not just bias the first
+ }
+ }
+ }
+
+- return false;
++ return ret; // Paper - force execution of all worlds, do not just bias the first
+ }
+ }
+