Skip to content

Commit

Permalink
Add rotate and mirror to BlockSlate.java
Browse files Browse the repository at this point in the history
  • Loading branch information
kineticneticat authored Sep 10, 2024
1 parent cdfe88c commit 41fc2dc
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,12 @@ protected static Direction getConnectedDirection(BlockState pState) {
default -> pState.getValue(FACING);
};
}

public BlockState rotate(BlockState state, Rotation rot) {
return (BlockState) state.setValue(FACING, rot.rotate((Direction) state.getValue(FACING)));
}

public BlockState mirror(BlockState state, Mirror mirror) {
return state.rotate(mirror.getRotation((Direction) state.getValue(FACING)));
}
}

0 comments on commit 41fc2dc

Please sign in to comment.