From 76c239fe5c70b831a3de431bfa3fd14e5fb4f6cb Mon Sep 17 00:00:00 2001 From: Madeline Miller Date: Sun, 3 Sep 2023 18:40:01 +1000 Subject: [PATCH] Review changes --- .../extent/transform/BlockTransformExtent.java | 14 ++++++-------- .../com/sk89q/worldedit/util/LocatedBlock.java | 6 +++--- 2 files changed, 9 insertions(+), 11 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 a20b37e915..c86e97c146 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 @@ -136,14 +136,12 @@ public static > B transform(B block, Transform tra } else if (property instanceof EnumProperty enumProp) { if (property.getName().equals("axis")) { // We have an axis - this is something we can do the rotations to :sunglasses: - Direction value = null; - switch ((String) block.getState(property)) { - case "x" -> value = Direction.EAST; - case "y" -> value = Direction.UP; - case "z" -> value = Direction.NORTH; - default -> { - } - } + Direction value = switch ((String) block.getState(property)) { + case "x" -> Direction.EAST; + case "y" -> Direction.UP; + case "z" -> Direction.NORTH; + default -> null; + }; if (value != null) { Vector3 newValue = getNewStateValue(Direction.valuesOf(Direction.Flag.UPRIGHT | Direction.Flag.CARDINAL), transform, value.toVector()); if (newValue != null) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/LocatedBlock.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/LocatedBlock.java index 5b4152d98e..b3a5288581 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/LocatedBlock.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/LocatedBlock.java @@ -29,9 +29,9 @@ */ public record LocatedBlock(BlockVector3 location, BaseBlock block) { - public LocatedBlock(BlockVector3 location, BaseBlock block) { - this.location = checkNotNull(location); - this.block = checkNotNull(block); + public LocatedBlock { + checkNotNull(location); + checkNotNull(block); } /**