aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason Penilla <[email protected]>2024-10-27 15:17:18 -0700
committerJason Penilla <[email protected]>2024-10-27 15:17:18 -0700
commit31ef96b48b65aef4be553765b62022e2b71c7af3 (patch)
tree04d078ee632f204da010553668ee908b168894da
parenta2d6c26baf3b1736e29ebdda0573c3eb9ca3d689 (diff)
downloadPaper-1.21.3-sleep-tasks.tar.gz
Paper-1.21.3-sleep-tasks.zip
Tick the global region scheduler, but not region tasks while sleeping1.21.3-sleep-tasks
-rw-r--r--patches/server/0835-Folia-scheduler-and-owned-region-API.patch47
-rw-r--r--patches/server/0918-Add-Lifecycle-Event-system.patch4
-rw-r--r--patches/server/0929-Add-onboarding-message-for-initial-server-start.patch2
-rw-r--r--patches/server/0956-Brigadier-based-command-API.patch6
-rw-r--r--patches/server/0983-Optimize-Hoppers.patch4
-rw-r--r--patches/server/1021-Tag-Lifecycle-Events.patch4
-rw-r--r--patches/server/1038-Moonrise-optimisation-patches.patch4
-rw-r--r--patches/server/1042-Improved-Watchdog-Support.patch4
-rw-r--r--patches/server/1046-Bundle-spark.patch9
-rw-r--r--patches/server/1048-Incremental-chunk-and-player-saving.patch4
-rw-r--r--patches/server/1051-Lag-compensation-ticks.patch4
-rw-r--r--patches/server/1055-Avoid-issues-with-certain-tasks-not-processing-durin.patch6
12 files changed, 63 insertions, 35 deletions
diff --git a/patches/server/0835-Folia-scheduler-and-owned-region-API.patch b/patches/server/0835-Folia-scheduler-and-owned-region-API.patch
index 3ff79fb2c6..4be490cc8a 100644
--- a/patches/server/0835-Folia-scheduler-and-owned-region-API.patch
+++ b/patches/server/0835-Folia-scheduler-and-owned-region-API.patch
@@ -17,10 +17,10 @@ outside of the buffer zone is owned. Then, the plugins may use
the schedulers depending on the result of the ownership check.
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java
-index d2dee700f2c5cc7d6a272e751a933901fe7a55b6..834b85f24df023642f8abf7213fe578ac8c17a3e 100644
+index d2dee700f2c5cc7d6a272e751a933901fe7a55b6..0cc1545cec32f7208d497c4553eecbd5d1749dbc 100644
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java
-@@ -263,6 +263,22 @@ class PaperPluginInstanceManager {
+@@ -263,6 +263,30 @@ class PaperPluginInstanceManager {
+ pluginName + " (Is it up to date?)", ex, plugin); // Paper
}
@@ -33,6 +33,14 @@ index d2dee700f2c5cc7d6a272e751a933901fe7a55b6..834b85f24df023642f8abf7213fe578a
+ }
+
+ try {
++ ((io.papermc.paper.threadedregions.scheduler.FallbackRegionScheduler) this.server.getRegionScheduler())
++ .getBackingScheduler().cancelTasks(plugin);
++ } catch (Throwable ex) {
++ this.handlePluginException("Error occurred (in the plugin loader) while cancelling global tasks for "
++ + pluginName + " (Is it up to date?)", ex, plugin); // Paper
++ }
++
++ try {
+ this.server.getAsyncScheduler().cancelTasks(plugin);
+ } catch (Throwable ex) {
+ this.handlePluginException("Error occurred (in the plugin loader) while cancelling async tasks for "
@@ -232,10 +240,10 @@ index 0000000000000000000000000000000000000000..c03608fec96b51e1867f43d8f42e5aef
+}
diff --git a/src/main/java/io/papermc/paper/threadedregions/scheduler/FallbackRegionScheduler.java b/src/main/java/io/papermc/paper/threadedregions/scheduler/FallbackRegionScheduler.java
new file mode 100644
-index 0000000000000000000000000000000000000000..94056d61a304ee012ae1828a33412516095f996f
+index 0000000000000000000000000000000000000000..93b4d55ac10007dde7f97f8d529a40b8a53a0b10
--- /dev/null
+++ b/src/main/java/io/papermc/paper/threadedregions/scheduler/FallbackRegionScheduler.java
-@@ -0,0 +1,30 @@
+@@ -0,0 +1,40 @@
+package io.papermc.paper.threadedregions.scheduler;
+
+import org.bukkit.World;
@@ -246,24 +254,34 @@ index 0000000000000000000000000000000000000000..94056d61a304ee012ae1828a33412516
+
+public final class FallbackRegionScheduler implements RegionScheduler {
+
++ private final FoliaGlobalRegionScheduler scheduler;
++
++ public FallbackRegionScheduler() {
++ this.scheduler = new FoliaGlobalRegionScheduler();
++ }
++
+ @Override
+ public void execute(@NotNull final Plugin plugin, @NotNull final World world, final int chunkX, final int chunkZ, @NotNull final Runnable run) {
-+ plugin.getServer().getGlobalRegionScheduler().execute(plugin, run);
++ this.scheduler.execute(plugin, run);
+ }
+
+ @Override
+ public @NotNull ScheduledTask run(@NotNull final Plugin plugin, @NotNull final World world, final int chunkX, final int chunkZ, @NotNull final Consumer<ScheduledTask> task) {
-+ return plugin.getServer().getGlobalRegionScheduler().run(plugin, task);
++ return this.scheduler.run(plugin, task);
+ }
+
+ @Override
+ public @NotNull ScheduledTask runDelayed(@NotNull final Plugin plugin, @NotNull final World world, final int chunkX, final int chunkZ, @NotNull final Consumer<ScheduledTask> task, final long delayTicks) {
-+ return plugin.getServer().getGlobalRegionScheduler().runDelayed(plugin, task, delayTicks);
++ return this.scheduler.runDelayed(plugin, task, delayTicks);
+ }
+
+ @Override
+ public @NotNull ScheduledTask runAtFixedRate(@NotNull final Plugin plugin, @NotNull final World world, final int chunkX, final int chunkZ, @NotNull final Consumer<ScheduledTask> task, final long initialDelayTicks, final long periodTicks) {
-+ return plugin.getServer().getGlobalRegionScheduler().runAtFixedRate(plugin, task, initialDelayTicks, periodTicks);
++ return this.scheduler.runAtFixedRate(plugin, task, initialDelayTicks, periodTicks);
++ }
++
++ public FoliaGlobalRegionScheduler getBackingScheduler() {
++ return this.scheduler;
+ }
+}
diff --git a/src/main/java/io/papermc/paper/threadedregions/scheduler/FoliaAsyncScheduler.java b/src/main/java/io/papermc/paper/threadedregions/scheduler/FoliaAsyncScheduler.java
@@ -1148,15 +1166,24 @@ index 0000000000000000000000000000000000000000..d306f911757a4d556c82c0070d4837db
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 8f7a808b0c89953a7f2932e68e2c85f9330469f2..be188079f12b3f7b394ae91db62cc17b1d0f4e79 100644
+index 8f7a808b0c89953a7f2932e68e2c85f9330469f2..9b1d491443600fa3a5f91e36742eef58a03e4ed5 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1625,6 +1625,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1498,6 +1498,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+ this.autoSave();
+ }
+
++ ((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick(); // Folia scheduler API
+ this.server.getScheduler().mainThreadHeartbeat(); // CraftBukkit
+ this.tickConnection();
+ return;
+@@ -1625,6 +1626,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
entityplayer.connection.suspendFlushing();
});
this.server.getScheduler().mainThreadHeartbeat(); // CraftBukkit
+ // Paper start - Folia scheduler API
+ ((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
++ ((io.papermc.paper.threadedregions.scheduler.FallbackRegionScheduler) Bukkit.getRegionScheduler()).getBackingScheduler().tick();
+ getAllLevels().forEach(level -> {
+ for (final Entity entity : level.getEntities().getAll()) {
+ if (entity.isRemoved()) {
diff --git a/patches/server/0918-Add-Lifecycle-Event-system.patch b/patches/server/0918-Add-Lifecycle-Event-system.patch
index 0eaff54d34..043e06db3e 100644
--- a/patches/server/0918-Add-Lifecycle-Event-system.patch
+++ b/patches/server/0918-Add-Lifecycle-Event-system.patch
@@ -692,10 +692,10 @@ index 0000000000000000000000000000000000000000..2ed622a61ddc37b11888867770b51390
+ }
+}
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java
-index 834b85f24df023642f8abf7213fe578ac8c17a3e..3e82ea07ca4194844c5528446e2c4a46ff4acee5 100644
+index 0cc1545cec32f7208d497c4553eecbd5d1749dbc..d6b79638d255f093308512658a88ed85af5042b1 100644
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java
-@@ -293,6 +293,15 @@ class PaperPluginInstanceManager {
+@@ -301,6 +301,15 @@ class PaperPluginInstanceManager {
+ pluginName + " (Is it up to date?)", ex, plugin); // Paper
}
diff --git a/patches/server/0929-Add-onboarding-message-for-initial-server-start.patch b/patches/server/0929-Add-onboarding-message-for-initial-server-start.patch
index 73d18bd703..05e905c359 100644
--- a/patches/server/0929-Add-onboarding-message-for-initial-server-start.patch
+++ b/patches/server/0929-Add-onboarding-message-for-initial-server-start.patch
@@ -29,7 +29,7 @@ index 56798215644d8bca1695856b3a941e8089f49e48..46c37c8db8ecf3cc808fcf59f6bee5fe
return instance;
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index be188079f12b3f7b394ae91db62cc17b1d0f4e79..2de0ae09de41f3ed254318a78d65045fc76e5016 100644
+index 9b1d491443600fa3a5f91e36742eef58a03e4ed5..30321119369794adb613d462d8abe819e5e1b08e 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1149,6 +1149,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
diff --git a/patches/server/0956-Brigadier-based-command-API.patch b/patches/server/0956-Brigadier-based-command-API.patch
index a0f076f9b2..ac65226e5a 100644
--- a/patches/server/0956-Brigadier-based-command-API.patch
+++ b/patches/server/0956-Brigadier-based-command-API.patch
@@ -2228,7 +2228,7 @@ index 55484826fc5ddd04ae024e25a0251796d7fa9c28..237e4f7b24908e9ade9a483eb7ae05fa
Component component = message.resolveComponent(commandSourceStack);
CommandSigningContext commandSigningContext = commandSourceStack.getSigningContext();
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 2de0ae09de41f3ed254318a78d65045fc76e5016..2d2bb7ed1456d90e7d9218a445a1cf26aaaa6ede 100644
+index 30321119369794adb613d462d8abe819e5e1b08e..a81c673dc3be7397920319f97dbfd2d8a6199581 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -316,7 +316,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2258,7 +2258,7 @@ index 2de0ae09de41f3ed254318a78d65045fc76e5016..2d2bb7ed1456d90e7d9218a445a1cf26
this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP));
this.connection.acceptConnections();
}
-@@ -2216,9 +2218,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2218,9 +2220,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return new MinecraftServer.ReloadableResources(resourcemanager, datapackresources);
});
}).thenAcceptAsync((minecraftserver_reloadableresources) -> {
@@ -2269,7 +2269,7 @@ index 2de0ae09de41f3ed254318a78d65045fc76e5016..2d2bb7ed1456d90e7d9218a445a1cf26
this.packRepository.setSelected(dataPacks);
WorldDataConfiguration worlddataconfiguration = new WorldDataConfiguration(MinecraftServer.getSelectedPacks(this.packRepository, true), this.worldData.enabledFeatures());
-@@ -2232,6 +2234,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2234,6 +2236,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager);
this.fuelValues = FuelValues.vanillaBurnTimes(this.registries.compositeAccess(), this.worldData.enabledFeatures());
org.bukkit.craftbukkit.block.data.CraftBlockData.reloadCache(); // Paper - cache block data strings; they can be defined by datapacks so refresh it here
diff --git a/patches/server/0983-Optimize-Hoppers.patch b/patches/server/0983-Optimize-Hoppers.patch
index f44f270f97..ba8add9a25 100644
--- a/patches/server/0983-Optimize-Hoppers.patch
+++ b/patches/server/0983-Optimize-Hoppers.patch
@@ -50,10 +50,10 @@ index 0000000000000000000000000000000000000000..5c42823726e70ce6c9d0121d07431548
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 2d2bb7ed1456d90e7d9218a445a1cf26aaaa6ede..e3e3099bb33d21055e480fdbd2df2a3e159f0f1a 100644
+index a81c673dc3be7397920319f97dbfd2d8a6199581..bfcf74023ab537e0b80570ba61678c91c62ba851 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1689,6 +1689,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1691,6 +1691,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
ServerLevel worldserver = (ServerLevel) iterator.next();
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent
worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent
diff --git a/patches/server/1021-Tag-Lifecycle-Events.patch b/patches/server/1021-Tag-Lifecycle-Events.patch
index 943c370a5b..3701bcdb6a 100644
--- a/patches/server/1021-Tag-Lifecycle-Events.patch
+++ b/patches/server/1021-Tag-Lifecycle-Events.patch
@@ -474,10 +474,10 @@ index fdc88e52235a152dbe3cca273990b4b68f8daaf8..13797035494a1e010e1da529fb46040f
static <E> void loadContentsFromNetwork(
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index e3e3099bb33d21055e480fdbd2df2a3e159f0f1a..843f8ccce6302a6db6cc61c496a5eee21305a88f 100644
+index bfcf74023ab537e0b80570ba61678c91c62ba851..8805eadf9eb1cd9e9c53e4db42c62947f2123bf2 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -2208,7 +2208,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2210,7 +2210,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return stream.<Pack>map(resourcepackrepository::getPack).filter(Objects::nonNull).map(Pack::open).collect(ImmutableList.toImmutableList()); // CraftBukkit - decompile error // Paper - decompile error // todo: is this needed anymore?
}, this).thenCompose((immutablelist) -> {
MultiPackResourceManager resourcemanager = new MultiPackResourceManager(PackType.SERVER_DATA, immutablelist);
diff --git a/patches/server/1038-Moonrise-optimisation-patches.patch b/patches/server/1038-Moonrise-optimisation-patches.patch
index 68646b52eb..26598c7575 100644
--- a/patches/server/1038-Moonrise-optimisation-patches.patch
+++ b/patches/server/1038-Moonrise-optimisation-patches.patch
@@ -23386,7 +23386,7 @@ index fc6ce3485dc890f5105a37fe3e344a1460867556..e114e687f2f4503546687fd6792226a6
DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, worldLoader.get(), thread, convertable_conversionsession, resourcepackrepository, worldstem, dedicatedserversettings, DataFixers.getDataFixer(), services, LoggerChunkProgressListener::createFromGameruleRadius);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 843f8ccce6302a6db6cc61c496a5eee21305a88f..e0b80b23197307d156ade8427a5227acbc45eb92 100644
+index 8805eadf9eb1cd9e9c53e4db42c62947f2123bf2..45f7adf042befb3eaf7e11e266e8c8b67e8c13b9 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -204,7 +204,7 @@ import org.bukkit.event.server.ServerLoadEvent;
@@ -23582,7 +23582,7 @@ index 843f8ccce6302a6db6cc61c496a5eee21305a88f..e0b80b23197307d156ade8427a5227ac
return true;
} else {
boolean ret = false; // Paper - force execution of all worlds, do not just bias the first
-@@ -2689,6 +2769,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2691,6 +2771,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
diff --git a/patches/server/1042-Improved-Watchdog-Support.patch b/patches/server/1042-Improved-Watchdog-Support.patch
index d19dc9a173..55d0a1dc3d 100644
--- a/patches/server/1042-Improved-Watchdog-Support.patch
+++ b/patches/server/1042-Improved-Watchdog-Support.patch
@@ -115,7 +115,7 @@ index e114e687f2f4503546687fd6792226a643af8793..90ca25c4aaf92a5639839a7cdaee2ffc
/* CraftBukkit start - Replace everything
OptionParser optionparser = new OptionParser();
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index e0b80b23197307d156ade8427a5227acbc45eb92..7a671772760152f26e5bb60ea2f2a7765c017c37 100644
+index 45f7adf042befb3eaf7e11e266e8c8b67e8c13b9..4513aa6a3201673faf3534aaf518ad454d6334b1 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -317,7 +317,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -252,7 +252,7 @@ index e0b80b23197307d156ade8427a5227acbc45eb92..7a671772760152f26e5bb60ea2f2a776
return new TickTask(this.tickCount, runnable);
}
-@@ -2309,7 +2351,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2311,7 +2353,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.resources.managers.updateStaticRegistryTags();
this.resources.managers.getRecipeManager().finalizeRecipeLoading(this.worldData.enabledFeatures());
this.potionBrewing = this.potionBrewing.reload(this.worldData.enabledFeatures()); // Paper - Custom Potion Mixes
diff --git a/patches/server/1046-Bundle-spark.patch b/patches/server/1046-Bundle-spark.patch
index 312f3bae9c..10cf807100 100644
--- a/patches/server/1046-Bundle-spark.patch
+++ b/patches/server/1046-Bundle-spark.patch
@@ -279,7 +279,7 @@ index 6b8ed8a0baaf4a57d20e57cec3400af5561ddd79..48604e7f96adc9e226e034054c5e2bad
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 7a671772760152f26e5bb60ea2f2a7765c017c37..8a45960de3fd890991a1c75a103fec1adb03c0cb 100644
+index 4513aa6a3201673faf3534aaf518ad454d6334b1..3340c1b7afa9ac237b295295774a8454d36b862c 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -765,6 +765,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -307,7 +307,7 @@ index 7a671772760152f26e5bb60ea2f2a7765c017c37..8a45960de3fd890991a1c75a103fec1a
org.spigotmc.WatchdogThread.tick();
// Paper end - Improved Watchdog Support
org.spigotmc.WatchdogThread.hasStarted = true; // Paper
-@@ -1627,17 +1631,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1627,6 +1631,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
if (this.emptyTicks >= j) {
@@ -315,8 +315,9 @@ index 7a671772760152f26e5bb60ea2f2a7765c017c37..8a45960de3fd890991a1c75a103fec1a
if (this.emptyTicks == j) {
MinecraftServer.LOGGER.info("Server empty for {} seconds, pausing", this.pauseWhileEmptySeconds());
this.autoSave();
- }
+@@ -1634,11 +1639,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+ ((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick(); // Folia scheduler API
this.server.getScheduler().mainThreadHeartbeat(); // CraftBukkit
+ this.server.spark.executeMainThreadTasks(); // Paper - spark
this.tickConnection();
@@ -329,7 +330,7 @@ index 7a671772760152f26e5bb60ea2f2a7765c017c37..8a45960de3fd890991a1c75a103fec1a
new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper - Server Tick Events
++this.tickCount;
this.tickRateManager.tick();
-@@ -1655,11 +1663,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1656,11 +1664,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
ProfilerFiller gameprofilerfiller = Profiler.get();
this.runAllTasks(); // Paper - move runAllTasks() into full server tick (previously for timings)
diff --git a/patches/server/1048-Incremental-chunk-and-player-saving.patch b/patches/server/1048-Incremental-chunk-and-player-saving.patch
index 180dd13004..14a46b153b 100644
--- a/patches/server/1048-Incremental-chunk-and-player-saving.patch
+++ b/patches/server/1048-Incremental-chunk-and-player-saving.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Incremental chunk and player saving
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 8a45960de3fd890991a1c75a103fec1adb03c0cb..c1e8d2679083516040e9d1768d79f5e4d71bf0a6 100644
+index 3340c1b7afa9ac237b295295774a8454d36b862c..ae1449b6b9a74048e5c6eea8b6005a264ff9ad90 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1008,7 +1008,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -17,7 +17,7 @@ index 8a45960de3fd890991a1c75a103fec1adb03c0cb..c1e8d2679083516040e9d1768d79f5e4
flag3 = this.saveAllChunks(suppressLogs, flush, force);
} finally {
this.isSaving = false;
-@@ -1656,9 +1656,29 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1657,9 +1657,29 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
--this.ticksUntilAutosave;
diff --git a/patches/server/1051-Lag-compensation-ticks.patch b/patches/server/1051-Lag-compensation-ticks.patch
index e00741dadd..f7b7103fdb 100644
--- a/patches/server/1051-Lag-compensation-ticks.patch
+++ b/patches/server/1051-Lag-compensation-ticks.patch
@@ -8,7 +8,7 @@ Areas affected by lag comepnsation:
- Eating food items
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index c1e8d2679083516040e9d1768d79f5e4d71bf0a6..af7c6f56444c0e495fd39da872f8030199afc634 100644
+index ae1449b6b9a74048e5c6eea8b6005a264ff9ad90..497c58f2050966d59e953fce14c589fd9d1b7a75 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -331,6 +331,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -19,7 +19,7 @@ index c1e8d2679083516040e9d1768d79f5e4d71bf0a6..af7c6f56444c0e495fd39da872f80301
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference();
-@@ -1842,6 +1843,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1844,6 +1845,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent
worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent
net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - Perf: Optimize Hoppers
diff --git a/patches/server/1055-Avoid-issues-with-certain-tasks-not-processing-durin.patch b/patches/server/1055-Avoid-issues-with-certain-tasks-not-processing-durin.patch
index ed38a06210..5a9072964b 100644
--- a/patches/server/1055-Avoid-issues-with-certain-tasks-not-processing-durin.patch
+++ b/patches/server/1055-Avoid-issues-with-certain-tasks-not-processing-durin.patch
@@ -6,12 +6,12 @@ Subject: [PATCH] Avoid issues with certain tasks not processing during sleep
Execute processQueue tasks during sleep & unload chunks during sleep
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index af7c6f56444c0e495fd39da872f8030199afc634..7933d6900dac67a24fb5f9378097dbde34be30b1 100644
+index 497c58f2050966d59e953fce14c589fd9d1b7a75..af2f2a1b6266390e3f334fa8a0b06cb4d0370ce1 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1639,6 +1639,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
- }
+@@ -1640,6 +1640,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+ ((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick(); // Folia scheduler API
this.server.getScheduler().mainThreadHeartbeat(); // CraftBukkit
+ // Paper start - avoid issues with certain tasks not processing during sleep
+ Runnable task;