From b347f25afc104a5eb80e4f686afde839579366fa Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 9 Jun 2022 18:40:07 -0700 Subject: [PATCH] fix 2 more migration issues --- .../server/Asynchronous-chunk-IO-and-loading.patch | 11 ++++++----- patches/server/Paper-config-files.patch | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/patches/server/Asynchronous-chunk-IO-and-loading.patch b/patches/server/Asynchronous-chunk-IO-and-loading.patch index 7e94323ac1..95c3081abb 100644 --- a/patches/server/Asynchronous-chunk-IO-and-loading.patch +++ b/patches/server/Asynchronous-chunk-IO-and-loading.patch @@ -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); + } + } + diff --git a/patches/server/Paper-config-files.patch b/patches/server/Paper-config-files.patch index f319997ef1..e69f0f4c36 100644 --- a/patches/server/Paper-config-files.patch +++ b/patches/server/Paper-config-files.patch @@ -3204,7 +3204,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + value.node("loot-tables").set(prevValue); + return path.with(path.size() - 1, "treasure-maps-find-already-discovered").array(); + }) -+ .addAction(path("alt-item-despawn-rate"), (path, value) -> { ++ .addAction(path("alt-item-despawn-rate", "items"), (path, value) -> { + if (value.isMap()) { + Map rebuild = new HashMap<>(); + value.childrenMap().forEach((key, node) -> {