Use provided EditSession for paste(World, Vector)

This commit is contained in:
Jesse Boyd 2017-09-30 00:49:07 +10:00
parent 3cb561eda7
commit ad593deb0f
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -118,12 +118,16 @@ public class Schematic {
checkNotNull(world);
checkNotNull(to);
Region region = clipboard.getRegion();
EditSessionBuilder builder = new EditSessionBuilder(world).autoQueue(true).checkMemory(false).allowedRegionsEverywhere().limitUnlimited();
EditSession editSession;
if (allowUndo) {
editSession = builder.build();
if (world instanceof EditSession) {
editSession = (EditSession) world;
} else {
editSession = builder.changeSetNull().fastmode(true).build();
EditSessionBuilder builder = new EditSessionBuilder(world).autoQueue(true).checkMemory(false).allowedRegionsEverywhere().limitUnlimited();
if (allowUndo) {
editSession = builder.build();
} else {
editSession = builder.changeSetNull().fastmode(true).build();
}
}
Extent extent = clipboard;
Mask sourceMask = editSession.getSourceMask();