Fix clipboard paste error.

This commit is contained in:
Jesse Boyd 2016-10-21 00:54:02 +11:00
parent 8e91d8a6ad
commit 0054e432ae
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -335,7 +335,7 @@ public class ClipboardCommands {
Clipboard clipboard = holder.getClipboard();
Region region = clipboard.getRegion().clone();
final int maxY = editSession.getMaxY();
final Vector bot = clipboard.getMinimumPoint();
final Vector origin = clipboard.getOrigin();
final Vector to = atOrigin ? origin : session.getPlacementPosition(player);
@ -352,8 +352,10 @@ public class ClipboardCommands {
pos.x += relx;
pos.y += rely;
pos.z += relz;
if (pos.y >= 0 && pos.y <= maxY) {
editSession.setBlockFast(pos, block);
}
}
}, !ignoreAirBlocks);
} else {
// To must be relative to the clipboard origin ( player location - clipboard origin ) (as the locations supplied are relative to the world origin)
@ -370,7 +372,9 @@ public class ClipboardCommands {
loc.x += relx;
loc.y += rely;
loc.z += relz;
editSession.setBlock(loc, block);
if (loc.y >= 0 && loc.y <= maxY) {
editSession.setBlockFast(loc, block);
}
}
}
// Entity offset is the paste location subtract the clipboard origin (entity's location is already relative to the world origin)