From c5073d79e754bd41ede6d984d6ae46c99169b77d Mon Sep 17 00:00:00 2001 From: Jordan Date: Tue, 21 Jun 2022 12:56:02 +0100 Subject: [PATCH] Account for use of MutableBlockVector3 in Spline Brush (#1831) --- .../core/command/tool/brush/SplineBrush.java | 2 +- .../core/function/visitor/DFSRecursiveVisitor.java | 4 ++-- .../fastasyncworldedit/core/function/visitor/DFSVisitor.java | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/SplineBrush.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/SplineBrush.java index aa5e0243e..55d8fd96a 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/SplineBrush.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/command/tool/brush/SplineBrush.java @@ -62,7 +62,7 @@ public class SplineBrush implements Brush, ResettableTool { final ArrayList points = new ArrayList<>(); if (size > 0) { DFSRecursiveVisitor visitor = new DFSRecursiveVisitor(mask, p -> { - points.add(p); + points.add(p.toImmutable()); return true; }, (int) size, 1); List directions = visitor.getDirections(); diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/function/visitor/DFSRecursiveVisitor.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/function/visitor/DFSRecursiveVisitor.java index ae8bbd189..a87c2001d 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/function/visitor/DFSRecursiveVisitor.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/function/visitor/DFSRecursiveVisitor.java @@ -7,8 +7,8 @@ import com.sk89q.worldedit.math.BlockVector3; import static com.google.common.base.Preconditions.checkNotNull; /** - * An implementation of an {@link com.sk89q.worldedit.function.visitor.BreadthFirstSearch} that uses - * a mask to determine where a block should be visited. + * An implementation of an {@link DFSVisitor} that uses a mask to determine where a block should be visited. The visit is + * performed using a {@link com.fastasyncworldedit.core.math.MutableBlockVector3} */ public class DFSRecursiveVisitor extends DFSVisitor { diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/function/visitor/DFSVisitor.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/function/visitor/DFSVisitor.java index 6eba1d7dc..58b6f0e41 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/function/visitor/DFSVisitor.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/function/visitor/DFSVisitor.java @@ -21,6 +21,9 @@ import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; +/** + * Depth-first-search visitor. The visit is performed using a {@link com.fastasyncworldedit.core.math.MutableBlockVector3} + */ public abstract class DFSVisitor implements Operation { private final RegionFunction function;