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
|
2024-04-23 19:02:08 +02:00
|
|
|
index e367711dc3ef96280fe672f02e2ce99e43a5cd3c..f32bddb777082e7db307c4691b88e037926174b5 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
|
2024-01-25 10:54:46 +01:00
|
|
|
@@ -1296,6 +1296,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
2024-01-22 21:04:08 +01:00
|
|
|
if (super.pollTask()) {
|
2022-02-18 18:44:46 +01:00
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
+ boolean ret = false; // Paper - force execution of all worlds, do not just bias the first
|
2023-12-06 17:00:26 +01:00
|
|
|
if (this.tickRateManager.isSprinting() || this.haveTime()) {
|
2022-02-18 18:44:46 +01:00
|
|
|
Iterator iterator = this.getAllLevels().iterator();
|
|
|
|
|
2024-01-25 10:54:46 +01:00
|
|
|
@@ -1303,12 +1304,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
2023-12-06 19:07:47 +01:00
|
|
|
ServerLevel worldserver = (ServerLevel) iterator.next();
|
2022-02-18 18:44:46 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|