diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Swap.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Swap.java index bda380b4c..596abad8d 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Swap.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Swap.java @@ -102,10 +102,17 @@ public class Swap extends SubCommand { final ArrayList selection2 = MainUtil.getPlotSelectionIds(bot2.id, top2.id); // Getting selections as location coordinates - Location pos1 = MainUtil.getPlotBottomLocAbs(world, bot1.id).add(1, 0, 1); - Location pos2 = MainUtil.getPlotTopLocAbs(world, top1.id); - Location pos3 = MainUtil.getPlotBottomLocAbs(world, bot2.id).add(1, 0, 1); - Location pos4 = MainUtil.getPlotTopLocAbs(world, top2.id); + Location pos1 = MainUtil.getPlotBottomLocAbs(world, bot1.id); + Location pos2 = MainUtil.getPlotTopLocAbs(world, top1.id).subtract(1, 0, 1); + Location pos3 = MainUtil.getPlotBottomLocAbs(world, bot2.id); + Location pos4 = MainUtil.getPlotTopLocAbs(world, top2.id).subtract(1, 0, 1); + + if (MainUtil.getPlot(pos2) != null) { + pos1.add(1, 0, 1); + pos2.add(1, 0, 1); + pos3.add(1, 0, 1); + pos4.add(1, 0, 1); + } // Swapping the blocks, states and entites ChunkManager.manager.swap(world, pos1, pos2, pos3, pos4);