From 2ee36f7484320c609573083373b268a9dea9d9f8 Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Tue, 1 Nov 2011 16:32:56 +0100 Subject: [PATCH] //generate and //deform no longer behave oddly with selections that are only one block thick in either direction. --- .../com/sk89q/worldedit/commands/GenerationCommands.java | 6 +++++- .../java/com/sk89q/worldedit/commands/RegionCommands.java | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/commands/GenerationCommands.java b/src/main/java/com/sk89q/worldedit/commands/GenerationCommands.java index 5512f0dce..91a324b81 100644 --- a/src/main/java/com/sk89q/worldedit/commands/GenerationCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/GenerationCommands.java @@ -322,7 +322,7 @@ public class GenerationCommands { final String expression = args.getJoinedStrings(1); final Vector zero; - final Vector unit; + Vector unit; if (args.hasFlag('r')) { zero = new Vector(0,0,0); @@ -336,6 +336,10 @@ public class GenerationCommands { zero = max.add(min).multiply(0.5); unit = max.subtract(zero); + + if (unit.getX() == 0) unit = unit.setX(1.0); + if (unit.getY() == 0) unit = unit.setY(1.0); + if (unit.getZ() == 0) unit = unit.setZ(1.0); } try { diff --git a/src/main/java/com/sk89q/worldedit/commands/RegionCommands.java b/src/main/java/com/sk89q/worldedit/commands/RegionCommands.java index 53d100ce8..05fa5252c 100644 --- a/src/main/java/com/sk89q/worldedit/commands/RegionCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/RegionCommands.java @@ -346,7 +346,7 @@ public class RegionCommands { final String expression = args.getJoinedStrings(0); final Vector zero; - final Vector unit; + Vector unit; if (args.hasFlag('r')) { zero = new Vector(0,0,0); @@ -360,6 +360,10 @@ public class RegionCommands { zero = max.add(min).multiply(0.5); unit = max.subtract(zero); + + if (unit.getX() == 0) unit = unit.setX(1.0); + if (unit.getY() == 0) unit = unit.setY(1.0); + if (unit.getZ() == 0) unit = unit.setZ(1.0); } try {