From ba4bd667eb246e3001522fe1415de92927c1b013 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sun, 18 Jun 2017 06:17:28 +1000 Subject: [PATCH] Support sourceMask for paste --- .../java/com/boydti/fawe/object/schematic/Schematic.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/src/main/java/com/boydti/fawe/object/schematic/Schematic.java b/core/src/main/java/com/boydti/fawe/object/schematic/Schematic.java index b8f110a5..e079e6a9 100644 --- a/core/src/main/java/com/boydti/fawe/object/schematic/Schematic.java +++ b/core/src/main/java/com/boydti/fawe/object/schematic/Schematic.java @@ -149,6 +149,15 @@ public class Schematic { BlockTransformExtent source = new BlockTransformExtent(clipboard, transform, worldData.getBlockRegistry()); ForwardExtentCopy copy = new ForwardExtentCopy(source, clipboard.getRegion(), clipboard.getOrigin(), extent, to); copy.setTransform(transform); + if (extent instanceof EditSession) { + EditSession editSession = (EditSession) extent; + Mask sourceMask = editSession.getSourceMask(); + if (sourceMask != null) { + new MaskTraverser(sourceMask).reset(extent); + copy.setSourceMask(sourceMask); + editSession.setSourceMask(null); + } + } if (!pasteAir) { copy.setSourceMask(new ExistingBlockMask(clipboard)); }