diff --git a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/async/SparklyPaperParallelWorldTicking.java b/leaf-server/src/main/java/org/dreeam/leaf/config/modules/async/SparklyPaperParallelWorldTicking.java index 7eaea021..f668a123 100644 --- a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/async/SparklyPaperParallelWorldTicking.java +++ b/leaf-server/src/main/java/org/dreeam/leaf/config/modules/async/SparklyPaperParallelWorldTicking.java @@ -2,6 +2,7 @@ package org.dreeam.leaf.config.modules.async; import org.dreeam.leaf.config.ConfigModules; import org.dreeam.leaf.config.EnumConfigCategory; +import org.dreeam.leaf.config.LeafConfig; import org.dreeam.leaf.config.annotations.Experimental; public class SparklyPaperParallelWorldTicking extends ConfigModules { @@ -25,16 +26,24 @@ public class SparklyPaperParallelWorldTicking extends ConfigModules { Enables parallel world ticking to improve performance on multi-core systems..""", """ **实验性功能** - 启用并行世界处理以提高多核系统的性能."""); + 启用并行世界处理以提高多核 CPU 使用率."""); enabled = config.getBoolean(getBasePath() + ".enabled", enabled); threads = config.getInt(getBasePath() + ".threads", threads); - threads = enabled ? threads : 0; + if (enabled) { + if (threads <= 0) threads = 8; + } else { + threads = 0; + } logContainerCreationStacktraces = config.getBoolean(getBasePath() + ".log-container-creation-stacktraces", logContainerCreationStacktraces); 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; + + if (enabled) { + LeafConfig.LOGGER.info("Using {} threads for Parallel World Ticking", threads); + } } }