9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-29 11:59:24 +00:00

add temporary compatibility for plugins to PWT

This commit is contained in:
Taiyou06
2025-03-22 14:20:34 +01:00
parent d5426137dd
commit 4c947f92ce
2 changed files with 121 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ public class SparklyPaperParallelWorldTicking extends ConfigModules {
public static int threads = 8;
public static boolean logContainerCreationStacktraces = false;
public static boolean disableHardThrow = false;
public static boolean runAsyncTasksSync = false;
@Override
public void onLoaded() {
@@ -26,6 +27,7 @@ public class SparklyPaperParallelWorldTicking extends ConfigModules {
**实验性功能**
启用并行世界处理以提高多核系统的性能.""");
enabled = config.getBoolean(getBasePath() + ".enabled", enabled);
threads = config.getInt(getBasePath() + ".threads", threads);
threads = enabled ? threads : 0;
@@ -33,5 +35,7 @@ public class SparklyPaperParallelWorldTicking extends ConfigModules {
logContainerCreationStacktraces = enabled && logContainerCreationStacktraces;
disableHardThrow = config.getBoolean(getBasePath() + ".disable-hard-throw", disableHardThrow);
disableHardThrow = enabled && disableHardThrow;
runAsyncTasksSync = config.getBoolean(getBasePath() + ".run-async-tasks-sync", runAsyncTasksSync);
runAsyncTasksSync = enabled && runAsyncTasksSync;
}
}