diff --git a/core/src/main/java/com/boydti/fawe/object/brush/sweep/ClipboardSpline.java b/core/src/main/java/com/boydti/fawe/object/brush/sweep/ClipboardSpline.java index c9cf335c..e8adafb6 100644 --- a/core/src/main/java/com/boydti/fawe/object/brush/sweep/ClipboardSpline.java +++ b/core/src/main/java/com/boydti/fawe/object/brush/sweep/ClipboardSpline.java @@ -6,6 +6,7 @@ import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.extent.clipboard.Clipboard; 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.interpolation.Interpolation; import com.sk89q.worldedit.math.transform.AffineTransform; @@ -98,7 +99,7 @@ public class ClipboardSpline extends Spline { final int offY = functionOffset.getBlockY(); final int offZ = functionOffset.getBlockZ(); - ForwardExtentCopy operation = clipboardHolder + Operation operation = clipboardHolder .createPaste(editSession, editSession.getWorldData()) .to(target) .ignoreAirBlocks(true) @@ -110,6 +111,6 @@ public class ClipboardSpline extends Spline { clipboardHolder.setTransform(originalTransform); clipboard.setOrigin(originalOrigin); - return operation.getAffected(); + return operation instanceof ForwardExtentCopy ? ((ForwardExtentCopy) operation).getAffected() : 0; } } \ No newline at end of file diff --git a/core/src/main/java/com/sk89q/worldedit/session/PasteBuilder.java b/core/src/main/java/com/sk89q/worldedit/session/PasteBuilder.java index 06d9b7cc..03e343e3 100644 --- a/core/src/main/java/com/sk89q/worldedit/session/PasteBuilder.java +++ b/core/src/main/java/com/sk89q/worldedit/session/PasteBuilder.java @@ -30,6 +30,7 @@ import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.function.mask.ExistingBlockMask; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.operation.ForwardExtentCopy; +import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.math.transform.Transform; import com.sk89q.worldedit.world.registry.WorldData; @@ -112,7 +113,7 @@ public class PasteBuilder { * * @return the operation */ - public ForwardExtentCopy build() { + public Operation build() { Extent extent = clipboard; if (!transform.isIdentity()) { extent = new BlockTransformExtent(extent, transform, targetWorldData.getBlockRegistry());