From 09d299645128feb65790f82790b317bab0fc0039 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Tue, 14 Sep 2021 14:30:32 +0100 Subject: [PATCH] Don't accept values smaller than parallel threads for target size - Smaller than parallel threads implies any time any thread tries to do anything, another thread must cancel its work, and the chunk is submitted. --- .../src/main/java/com/fastasyncworldedit/core/Fawe.java | 1 + .../com/fastasyncworldedit/core/configuration/Settings.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/Fawe.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/Fawe.java index 078f00a80..473e20837 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/Fawe.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/Fawe.java @@ -253,6 +253,7 @@ public class Fawe { } catch (Throwable e) { LOGGER.error("Failed to load config.", e); } + Settings.IMP.QUEUE.TARGET_SIZE = Math.max(Settings.IMP.QUEUE.TARGET_SIZE, Settings.IMP.QUEUE.PARALLEL_THREADS); } diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/configuration/Settings.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/configuration/Settings.java index 13ef5e074..69dfa12f7 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/configuration/Settings.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/configuration/Settings.java @@ -293,7 +293,8 @@ public class Settings extends Config { " - FAWE will start placing before all calculations are finished", " - A larger value will use slightly less CPU time", " - A smaller value will reduce memory usage", - " - A value too small may break some operations (deform?)" + " - A value too small may break some operations (deform?)", + " - Values smaller than the configurated parallel threads are not accepted" }) public int TARGET_SIZE = 64;