Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
me4502 committed Sep 3, 2023
1 parent 9c614cd commit 76c239f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,12 @@ public static <B extends BlockStateHolder<B>> 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 76c239f

Please sign in to comment.