Avoid issues with certain tasks not processing during sleep

Execute processQueue tasks during sleep: needed for console tab completions, pre join event, etc.

Upstream has set precedent that the bukkit scheduler will still tick during sleep, which avoids some problems
with plugins not accounting for the new sleep feature, but can still lead to others. Because of this we have disabled
sleep by default, which avoids the problem and makes it more obvious to check if this is the cause of issues when
enabled. We also unload chunks during sleep to prevent memory leaks caused by plugin chunk loads.
This commit is contained in:
Jason Penilla
2024-10-27 14:18:28 -07:00
parent 855db272b1
commit 21f51ebd74
2 changed files with 59 additions and 39 deletions

View File

@@ -47,6 +47,15 @@
this.regionFileComression = this.get("region-file-compression", "deflate");
this.enableJmxMonitoring = this.get("enable-jmx-monitoring", false);
this.enableStatus = this.get("enable-status", true);
@@ -151,7 +160,7 @@
this.whiteList = this.getMutable("white-list", false);
this.enforceSecureProfile = this.get("enforce-secure-profile", true);
this.logIPs = this.get("log-ips", true);
- this.pauseWhenEmptySeconds = this.get("pause-when-empty-seconds", 60);
+ this.pauseWhenEmptySeconds = this.get("pause-when-empty-seconds", -1); // Paper - disable tick sleeping by default
this.acceptsTransfers = this.get("accepts-transfers", false);
String s = this.get("level-seed", "");
boolean flag = this.get("generate-structures", true);
@@ -165,15 +174,21 @@
}, WorldPresets.NORMAL.location().toString()));
this.serverResourcePackInfo = DedicatedServerProperties.getServerPackInfo(this.get("resource-pack-id", ""), this.get("resource-pack", ""), this.get("resource-pack-sha1", ""), this.getLegacyString("resource-pack-hash"), this.get("require-resource-pack", false), this.get("resource-pack-prompt", ""));