From 4c329492104765dbf2290cbd5b1d5ab98986aace Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 18 Nov 2019 07:23:48 +0000 Subject: [PATCH] temp fix for undo also fix inspect brush using wrong ids --- .../main/java/com/boydti/fawe/object/brush/InspectBrush.java | 2 +- .../java/com/boydti/fawe/object/changeset/FaweChangeSet.java | 1 + .../main/java/com/boydti/fawe/util/EditSessionBuilder.java | 1 - .../src/main/java/com/sk89q/worldedit/EditSession.java | 3 ++- .../src/main/java/com/sk89q/worldedit/LocalSession.java | 4 +++- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/InspectBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/InspectBrush.java index dd3089cdd..ea5323294 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/InspectBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/InspectBrush.java @@ -90,7 +90,7 @@ public class InspectBrush extends BrushTool implements DoubleActionTraceTool { int index = value.getIndex(); long age = System.currentTimeMillis() - value.getBDFile().lastModified(); String ageFormatted = MainUtil.secToTime(age / 1000); - BBC.TOOL_INSPECT_INFO.send(player, name, BlockState.getFromInternalId(from).getAsString(), BlockState.getFromInternalId(to).getAsString(), ageFormatted); + BBC.TOOL_INSPECT_INFO.send(player, name, BlockState.getFromOrdinal(from).getAsString(), BlockState.getFromOrdinal(to).getAsString(), ageFormatted); count.incrementAndGet(); return; } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/FaweChangeSet.java b/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/FaweChangeSet.java index dcb3a7074..ffc6afbf4 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/FaweChangeSet.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/FaweChangeSet.java @@ -145,6 +145,7 @@ public abstract class FaweChangeSet implements ChangeSet, IBatchProcessor, Close @Override public synchronized IChunkSet processSet(IChunk chunk, IChunkGet get, IChunkSet set) { + System.out.println("Add chunk " + chunk.getX() + "," + chunk.getZ() + " | " + set.getBitMask()); int bx = chunk.getX() << 4; int bz = chunk.getZ() << 4; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/util/EditSessionBuilder.java b/worldedit-core/src/main/java/com/boydti/fawe/util/EditSessionBuilder.java index 3a0d9008b..09b7d068c 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/util/EditSessionBuilder.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/util/EditSessionBuilder.java @@ -328,7 +328,6 @@ public class EditSessionBuilder { queue = parallel.getExtent(); extent = parallel; } else { - System.out.println("FAWE is in single threaded mode (performance reduced)"); extent = queue = Fawe.get().getQueueHandler().getQueue(world); } } else { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index 536541e45..eef58ec76 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -26,6 +26,7 @@ import static com.sk89q.worldedit.regions.Regions.maximumBlockY; import static com.sk89q.worldedit.regions.Regions.minimumBlockY; import com.boydti.fawe.FaweCache; +import com.boydti.fawe.beta.Filter; import com.boydti.fawe.config.BBC; import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.FaweLimit; @@ -204,7 +205,7 @@ public class EditSession extends PassthroughExtent implements AutoCloseable { private final MutableBlockVector3 mutablebv = new MutableBlockVector3(); - private int changes = 0; + private int changes = -1; private final BlockBag blockBag; private final int maxY; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java index 033fc604a..eae29d382 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java @@ -473,7 +473,9 @@ public class LocalSession implements TextureHolder { return; } // Don't store anything if no changes were made - if (editSession.size() == 0) return; + if (editSession.size() == 0) { + return; + } FaweChangeSet changeSet = (FaweChangeSet) editSession.getChangeSet(); if (changeSet.isEmpty()) {