2022-02-18 18:44:46 +01:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
|
|
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
|
2022-02-28 23:16:17 +01:00
|
|
|
index c2ddd9f8bf9dded65a7cd1fa69b30113336cd409..d19d816ee511bf5d44151c3e159adb288b60bc03 100644
|
2022-02-18 18:44:46 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
2022-03-01 06:43:03 +01:00
|
|
|
@@ -1358,6 +1358,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
2022-02-18 18:44:46 +01:00
|
|
|
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();
|
|
|
|
|
2022-03-01 06:43:03 +01:00
|
|
|
@@ -1365,12 +1366,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
2022-02-18 18:44:46 +01:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|