From a703bba082dcf0b98796ea48467e7bd115025c19 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Thu, 16 Aug 2018 03:07:36 +1000 Subject: [PATCH] Potential fix for anvil issues --- core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAFile.java | 1 + core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAQueue.java | 4 ++++ .../src/main/java/com/boydti/fawe/jnbt/anvil/MCAQueueMap.java | 2 ++ core/src/main/java/com/sk89q/worldedit/EditSession.java | 2 +- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAFile.java b/core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAFile.java index b274b241..bad3e4e3 100644 --- a/core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAFile.java +++ b/core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAFile.java @@ -670,6 +670,7 @@ public class MCAFile { pool.awaitQuiescence(Long.MAX_VALUE, TimeUnit.MILLISECONDS); } } + chunks.clear(); } IterableThreadLocal.clean(byteStore1); IterableThreadLocal.clean(byteStore2); diff --git a/core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAQueue.java b/core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAQueue.java index 738f2b54..81ef08e9 100644 --- a/core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAQueue.java +++ b/core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAQueue.java @@ -70,6 +70,10 @@ public class MCAQueue extends NMSMappedFaweQueue> iter = mcaFileMap.entrySet().iterator(); boolean result; diff --git a/core/src/main/java/com/sk89q/worldedit/EditSession.java b/core/src/main/java/com/sk89q/worldedit/EditSession.java index baa8fae3..146bd825 100644 --- a/core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -1309,7 +1309,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, queue.dequeue(); return; } - if (Fawe.isMainThread()) { + if (Fawe.isMainThread() && (!(queue instanceof MCAQueue) || ((MCAQueue) queue).hasParent())) { SetQueue.IMP.flush(queue); } else { queue.flush();