From 41fc2dcb859e91889c82a21db698e64d7251b2b4 Mon Sep 17 00:00:00 2001 From: kineticneticat <84404038+kineticneticat@users.noreply.github.com> Date: Tue, 10 Sep 2024 13:19:00 +0100 Subject: [PATCH 1/2] Add `rotate` and `mirror` to BlockSlate.java --- .../hexcasting/common/blocks/circles/BlockSlate.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/blocks/circles/BlockSlate.java b/Common/src/main/java/at/petrak/hexcasting/common/blocks/circles/BlockSlate.java index e265304a9f..7acad141cb 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/blocks/circles/BlockSlate.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/blocks/circles/BlockSlate.java @@ -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))); + } } From 70906ad435f9182a321d9d15d575055641e9c8d4 Mon Sep 17 00:00:00 2001 From: kineticneticat <84404038+kineticneticat@users.noreply.github.com> Date: Tue, 10 Sep 2024 13:30:56 +0100 Subject: [PATCH 2/2] add imports for `Mirror` and `Rotation` to `BlockSlate` --- .../at/petrak/hexcasting/common/blocks/circles/BlockSlate.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/blocks/circles/BlockSlate.java b/Common/src/main/java/at/petrak/hexcasting/common/blocks/circles/BlockSlate.java index 7acad141cb..a982c4c1e8 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/blocks/circles/BlockSlate.java +++ b/Common/src/main/java/at/petrak/hexcasting/common/blocks/circles/BlockSlate.java @@ -22,6 +22,8 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.EntityBlock; import net.minecraft.world.level.block.SimpleWaterloggedBlock; +import net.minecraft.world.level.block.Mirror; +import net.minecraft.world.level.block.Rotation; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition;