From b2ef1cbc5080cb4ccad5a2b3c44c2408ddbd256d Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Wed, 21 Sep 2016 15:01:37 +1000 Subject: [PATCH] Fixes #302 --- core/src/main/java/com/boydti/fawe/config/Settings.java | 2 +- .../java/com/boydti/fawe/example/NMSMappedFaweQueue.java | 1 + core/src/main/java/com/boydti/fawe/util/SetQueue.java | 4 ++++ .../boydti/fawe/wrappers/LocationMaskedPlayerWrapper.java | 6 ++++-- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/boydti/fawe/config/Settings.java b/core/src/main/java/com/boydti/fawe/config/Settings.java index eea1b36e..c85b5276 100644 --- a/core/src/main/java/com/boydti/fawe/config/Settings.java +++ b/core/src/main/java/com/boydti/fawe/config/Settings.java @@ -103,7 +103,7 @@ public class Settings extends Config { " - Faster as it avoids duplicate block checks", " - Worse compression since dispatch order is different" }) - public static boolean COMBINE_STAGES = false; + public static boolean COMBINE_STAGES = true; @Comment({ "Higher compression reduces the size of history at the expense of CPU", "0 = Uncompressed byte array", diff --git a/core/src/main/java/com/boydti/fawe/example/NMSMappedFaweQueue.java b/core/src/main/java/com/boydti/fawe/example/NMSMappedFaweQueue.java index 0f98efb3..b860519e 100644 --- a/core/src/main/java/com/boydti/fawe/example/NMSMappedFaweQueue.java +++ b/core/src/main/java/com/boydti/fawe/example/NMSMappedFaweQueue.java @@ -56,6 +56,7 @@ public abstract class NMSMappedFaweQueue ex public void end(FaweChunk chunk) { super.end(chunk); if (Settings.LIGHTING.MODE == 0) { + refreshChunk(chunk); return; } if (relighter == null) { diff --git a/core/src/main/java/com/boydti/fawe/util/SetQueue.java b/core/src/main/java/com/boydti/fawe/util/SetQueue.java index e7b94532..28767a81 100644 --- a/core/src/main/java/com/boydti/fawe/util/SetQueue.java +++ b/core/src/main/java/com/boydti/fawe/util/SetQueue.java @@ -105,6 +105,10 @@ public class SetQueue { completer = new ExecutorCompletionService(pool); e.printStackTrace(); } + if (pool.getQueuedSubmissionCount() != 0 || pool.getRunningThreadCount() != 0 || pool.getQueuedTaskCount() != 0) { + Fawe.debug("Error flushing parallel pool"); + pool.awaitQuiescence(Long.MAX_VALUE, TimeUnit.MILLISECONDS); + } secondLast = System.currentTimeMillis(); } catch (Throwable e) { e.printStackTrace(); diff --git a/core/src/main/java/com/boydti/fawe/wrappers/LocationMaskedPlayerWrapper.java b/core/src/main/java/com/boydti/fawe/wrappers/LocationMaskedPlayerWrapper.java index 3fc5d575..adda6044 100644 --- a/core/src/main/java/com/boydti/fawe/wrappers/LocationMaskedPlayerWrapper.java +++ b/core/src/main/java/com/boydti/fawe/wrappers/LocationMaskedPlayerWrapper.java @@ -16,12 +16,14 @@ public class LocationMaskedPlayerWrapper extends PlayerWrapper { @Override public WorldVector getBlockIn() { - return new WorldVector((LocalWorld) getWorld(), position); + WorldVector pos = getPosition(); + return WorldVector.toBlockPoint(pos.getWorld(), pos.getX(), pos.getY(), pos.getZ()); } @Override public WorldVector getBlockOn() { - return new WorldVector((LocalWorld) getWorld(), position.subtract(0, 1, 0)); + WorldVector pos = getPosition(); + return WorldVector.toBlockPoint(pos.getWorld(), pos.getX(), pos.getY() - 1, pos.getZ()); } @Override