mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-25 12:05:53 +01:00
38 lines
1.7 KiB
Diff
38 lines
1.7 KiB
Diff
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
|
|
index 8cbc8eeaa8719f8bb136543e80ec85248c90e154..3cd23d329fae0a6a4eff36510edc5d9bd27c804e 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -1405,6 +1405,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
if (super.pollTask()) {
|
|
return true;
|
|
} else {
|
|
+ boolean ret = false; // Paper - force execution of all worlds, do not just bias the first
|
|
if (this.tickRateManager.isSprinting() || this.haveTime()) {
|
|
Iterator iterator = this.getAllLevels().iterator();
|
|
|
|
@@ -1412,12 +1413,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
|
|
}
|
|
}
|
|
|