From 018b6bead8eafd57ce6cfde2d12db8f0fea58107 Mon Sep 17 00:00:00 2001 From: wizjany Date: Thu, 2 May 2019 18:15:04 -0400 Subject: [PATCH] Tweak removeabove/removebelow commands. Fix misplaced negative. Layer 0 will always be the current layer, plus layers above/below. No longer adds 1 arbitrarily to height. --- .../java/com/sk89q/worldedit/command/UtilityCommands.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index 0e18dbcbd..af59e5adc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -197,10 +197,9 @@ public class UtilityCommands { size = Math.max(1, size); we.checkMaxRadius(size); World world = player.getWorld(); - height = height != null ? Math.min((world.getMaxY() + 1), height + 2) : (world.getMaxY() + 1); + height = height != null ? Math.min((world.getMaxY() + 1), height + 1) : (world.getMaxY() + 1); - int affected = editSession.removeAbove( - session.getPlacementPosition(player), size, height); + int affected = editSession.removeAbove(session.getPlacementPosition(player), size, height); player.print(affected + " block(s) have been removed."); return affected; } @@ -220,7 +219,7 @@ public class UtilityCommands { size = Math.max(1, size); we.checkMaxRadius(size); World world = player.getWorld(); - height = height != null ? Math.min((-world.getMaxY() + 1), height + 2) : (world.getMaxY() + 1); + height = height != null ? Math.min((world.getMaxY() + 1), height + 1) : (world.getMaxY() + 1); int affected = editSession.removeBelow(session.getPlacementPosition(player), size, height); player.print(affected + " block(s) have been removed.");