From b11a67e43586fd77e82316c83181499d31c52526 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Sun, 19 Sep 2021 21:20:18 +0100 Subject: [PATCH] Fix #1311 --- .../worldedit/extent/transform/BlockTransformExtent.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/transform/BlockTransformExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/transform/BlockTransformExtent.java index b8bf3e6b9..674ac46e6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/transform/BlockTransformExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/transform/BlockTransformExtent.java @@ -52,7 +52,6 @@ import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; -import java.util.EnumSet; import java.util.HashMap; import java.util.List; import java.util.Locale; @@ -107,7 +106,6 @@ public class BlockTransformExtent extends ResettableExtent { WEST, PropertyKey.WEST ); - private static final EnumSet NESW = EnumSet.range(NORTH, WEST); private final int[] ALL = new int[0]; private Transform transform; private Transform transformInverse; @@ -423,10 +421,10 @@ public class BlockTransformExtent extends ResettableExtent { .hasProperty(PropertyKey.WEST)) { BlockState tmp = state; - for (Direction direction : NESW) { - Direction newDir = findClosest(transform.apply(direction.toVector()), Flag.CARDINAL); + for (Map.Entry entry : directionMap.entrySet()) { + Direction newDir = findClosest(transform.apply(entry.getKey().toVector()), Flag.CARDINAL); if (newDir != null) { - Object dirState = tmp.getState(directionMap.get(direction)); + Object dirState = state.getState(entry.getValue()); tmp = tmp.with(directionMap.get(newDir), dirState); } }