From e5f092c3efcecc6d8db135a815ad65169133a7d9 Mon Sep 17 00:00:00 2001 From: Hazel Trinity Date: Sun, 16 Aug 2020 01:08:35 -0700 Subject: [PATCH] Updated ClipboardSpline paste --- .../fawe/object/brush/sweep/ClipboardSpline.java | 3 ++- .../com/boydti/fawe/object/brush/sweep/Spline.java | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/sweep/ClipboardSpline.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/sweep/ClipboardSpline.java index cfe5f99f9..849ba060e 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/sweep/ClipboardSpline.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/sweep/ClipboardSpline.java @@ -8,6 +8,7 @@ import com.sk89q.worldedit.function.operation.ForwardExtentCopy; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.function.operation.Operations; import com.sk89q.worldedit.math.BlockVector3; +import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.math.interpolation.Interpolation; import com.sk89q.worldedit.math.transform.AffineTransform; import com.sk89q.worldedit.math.transform.RoundedTransform; @@ -80,7 +81,7 @@ public class ClipboardSpline extends Spline { } @Override - protected int pasteBlocks(BlockVector3 target, BlockVector3 offset, double angle) throws MaxChangedBlocksException { + protected int pasteBlocks(BlockVector3 target, Vector3 offset, double angle) throws MaxChangedBlocksException { RoundedTransform transform = new RoundedTransform(new AffineTransform() .translate(offset) .rotateY(angle)); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/sweep/Spline.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/sweep/Spline.java index d8aaf070b..c9ee1b8bb 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/sweep/Spline.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/sweep/Spline.java @@ -127,9 +127,9 @@ public abstract class Spline { Preconditions.checkArgument(position <= 1); // Calculate position from spline - BlockVector3 target = interpolation.getPosition(position).toBlockPoint(); - BlockVector3 offset = target.subtract(target.round()); - target = target.subtract(offset).round(); + Vector3 target = interpolation.getPosition(position); + BlockVector3 blockTarget = target.toBlockPoint(); + Vector3 offset = target.subtract(target.floor()); // Calculate rotation from spline @@ -139,10 +139,10 @@ public abstract class Spline { Math.atan2(direction.getZ(), direction.getX()) - Math.atan2(deriv2D.getZ(), deriv2D.getX()) ); - return pasteBlocks(target, offset, angle); + return pasteBlocks(blockTarget, offset, angle); } - protected abstract int pasteBlocks(BlockVector3 target, BlockVector3 offset, double angle) throws MaxChangedBlocksException; + protected abstract int pasteBlocks(BlockVector3 target, Vector3 offset, double angle) throws MaxChangedBlocksException; private void initSections() { int sectionCount = nodeCount - 1;