Support sourceMask for paste

This commit is contained in:
Jesse Boyd 2017-06-18 06:17:28 +10:00
parent 455353ec51
commit ba4bd667eb
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -149,6 +149,15 @@ public class Schematic {
BlockTransformExtent source = new BlockTransformExtent(clipboard, transform, worldData.getBlockRegistry()); BlockTransformExtent source = new BlockTransformExtent(clipboard, transform, worldData.getBlockRegistry());
ForwardExtentCopy copy = new ForwardExtentCopy(source, clipboard.getRegion(), clipboard.getOrigin(), extent, to); ForwardExtentCopy copy = new ForwardExtentCopy(source, clipboard.getRegion(), clipboard.getOrigin(), extent, to);
copy.setTransform(transform); 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) { if (!pasteAir) {
copy.setSourceMask(new ExistingBlockMask(clipboard)); copy.setSourceMask(new ExistingBlockMask(clipboard));
} }