mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-07 15:42:19 -07:00
fix 2 more migration issues
This commit is contained in:
@@ -1851,12 +1851,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+
|
||||
+ public static void processConfiguration(GlobalConfiguration.AsyncChunks config) {
|
||||
+ int threads = config.threads; // don't write back to config
|
||||
+ int cpus = Runtime.getRuntime().availableProcessors() / 2;
|
||||
+ if (config.threads <= 0) {
|
||||
+ if (threads <= 0) {
|
||||
+ if (cpus <= 4) {
|
||||
+ config.threads = cpus <= 2 ? 1 : 2;
|
||||
+ threads = cpus <= 2 ? 1 : 2;
|
||||
+ } else {
|
||||
+ config.threads = (int) Math.min(Integer.getInteger("paper.maxChunkThreads", 4), cpus / 2);
|
||||
+ threads = (int) Math.min(Integer.getInteger("paper.maxChunkThreads", 4), cpus / 2);
|
||||
+ }
|
||||
+ }
|
||||
+ if (cpus == 1 && !Boolean.getBoolean("Paper.allowAsyncChunksSingleCore")) {
|
||||
@@ -1869,12 +1870,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ String sharedHostThreads = System.getenv("PAPER_ASYNC_CHUNKS_SHARED_HOST_THREADS");
|
||||
+ if (sharedHostThreads != null) {
|
||||
+ try {
|
||||
+ config.threads = Math.max(1, Math.min(config.threads, Integer.parseInt(sharedHostThreads)));
|
||||
+ threads = Math.max(1, Math.min(threads, Integer.parseInt(sharedHostThreads)));
|
||||
+ } catch (NumberFormatException ignored) {}
|
||||
+ }
|
||||
+
|
||||
+ if (config.asyncChunks) {
|
||||
+ ChunkTaskManager.initGlobalLoadThreads(config.threads);
|
||||
+ ChunkTaskManager.initGlobalLoadThreads(threads);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
|
Reference in New Issue
Block a user