From 0054e432ae08da29f2bc479f3d806abe6a55a295 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Fri, 21 Oct 2016 00:54:02 +1100 Subject: [PATCH] Fix clipboard paste error. --- .../com/sk89q/worldedit/command/ClipboardCommands.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java b/core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java index 13892e51..171ca070 100644 --- a/core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java +++ b/core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java @@ -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,7 +352,9 @@ public class ClipboardCommands { pos.x += relx; pos.y += rely; pos.z += relz; - editSession.setBlockFast(pos, block); + if (pos.y >= 0 && pos.y <= maxY) { + editSession.setBlockFast(pos, block); + } } }, !ignoreAirBlocks); } else { @@ -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)