From 6e36b5236c98149e8143d5de98984f17239df5de Mon Sep 17 00:00:00 2001 From: Wyatt Childers Date: Tue, 28 Jun 2016 20:36:33 -0400 Subject: [PATCH] Fixed the automatic selection of a user's pasted area when using //paste -s Fixes WORLDEDIT-3457 --- .../sk89q/worldedit/command/ClipboardCommands.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java index a5980cdc2..d9cabddcc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java @@ -22,11 +22,7 @@ package com.sk89q.worldedit.command; import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.CommandPermissions; import com.sk89q.minecraft.util.commands.Logging; -import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.LocalSession; -import com.sk89q.worldedit.Vector; -import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.WorldEditException; +import com.sk89q.worldedit.*; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard; @@ -162,8 +158,10 @@ public class ClipboardCommands { Operations.completeLegacy(operation); if (selectPasted) { - Vector max = to.add(region.getMaximumPoint().subtract(region.getMinimumPoint())); - RegionSelector selector = new CuboidRegionSelector(player.getWorld(), to, max); + Vector clipboardOffset = clipboard.getRegion().getMinimumPoint().subtract(clipboard.getOrigin()); + Vector realTo = to.add(clipboardOffset); + Vector max = realTo.add(region.getMaximumPoint().subtract(region.getMinimumPoint())); + RegionSelector selector = new CuboidRegionSelector(player.getWorld(), realTo, max); session.setRegionSelector(player.getWorld(), selector); selector.learnChanges(); selector.explainRegionAdjust(player, session);