From e4cd6c23b64d29b7aa5d889207bef2f161bb0caa Mon Sep 17 00:00:00 2001 From: Wizjany Date: Sat, 3 Sep 2011 20:25:20 -0400 Subject: [PATCH] Fixed odd-lengthed clipboards double flipping in the center as per anon's commit(s). --- src/main/java/com/sk89q/worldedit/CuboidClipboard.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/sk89q/worldedit/CuboidClipboard.java b/src/main/java/com/sk89q/worldedit/CuboidClipboard.java index 8592f5164..92174075b 100644 --- a/src/main/java/com/sk89q/worldedit/CuboidClipboard.java +++ b/src/main/java/com/sk89q/worldedit/CuboidClipboard.java @@ -197,6 +197,7 @@ public class CuboidClipboard { for (int z = 0; z < length; ++z) { for (int y = 0; y < height; ++y) { BaseBlock old = data[xs][y][z].flip(dir); + if (xs == width - xs - 1) continue; data[xs][y][z] = data[width - xs - 1][y][z].flip(dir); data[width - xs - 1][y][z] = old; } @@ -215,6 +216,7 @@ public class CuboidClipboard { for (int x = 0; x < width; ++x) { for (int y = 0; y < height; ++y) { BaseBlock old = data[x][y][zs].flip(dir); + if (zs == length - zs - 1) continue; data[x][y][zs] = data[x][y][length - zs - 1].flip(dir); data[x][y][length - zs - 1] = old; } @@ -233,6 +235,7 @@ public class CuboidClipboard { for (int x = 0; x < width; ++x) { for (int z = 0; z < length; ++z) { BaseBlock old = data[x][ys][z].flip(dir); + if (ys == height - ys - 1) continue; data[x][ys][z] = data[x][height - ys - 1][z].flip(dir); data[x][height - ys - 1][z] = old; }