From c520e1a686aa333d55708ccdb2fbfca53ef11ff2 Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Sun, 7 Aug 2022 09:13:09 +0200 Subject: [PATCH] Update upstream 54ed9e8 Add support for Y-offsets with back direction (2164) --- .../src/main/java/com/sk89q/worldedit/WorldEdit.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java index afd6aec72..b550d911a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java @@ -602,7 +602,12 @@ public final class WorldEdit { case "b": case "back": - return getDirectionRelative(player, 180); + Direction dir = getDirectionRelative(player, 180); + if (dir.isUpright()) { + // If this is an upright direction, flip it. + dir = dir == Direction.UP ? Direction.DOWN : Direction.UP; + } + return dir; case "l": case "left":