From d7c9e6a2a01d5a9573e45cf0fe8d3c24b2b7e6ae Mon Sep 17 00:00:00 2001 From: Gugle Date: Wed, 18 Dec 2024 15:54:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=82=BB=E6=BA=9C=E6=A7=BD?= =?UTF-8?q?=E6=97=8B=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dubhe/anvilcraft/block/SimpleChuteBlock.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/common/src/main/java/dev/dubhe/anvilcraft/block/SimpleChuteBlock.java b/common/src/main/java/dev/dubhe/anvilcraft/block/SimpleChuteBlock.java index 49be26d31..a25dcb5c1 100644 --- a/common/src/main/java/dev/dubhe/anvilcraft/block/SimpleChuteBlock.java +++ b/common/src/main/java/dev/dubhe/anvilcraft/block/SimpleChuteBlock.java @@ -18,7 +18,9 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.BaseEntityBlock; import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Mirror; import net.minecraft.world.level.block.RenderShape; +import net.minecraft.world.level.block.Rotation; import net.minecraft.world.level.block.SimpleWaterloggedBlock; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityTicker; @@ -255,4 +257,16 @@ public boolean change(Player player, BlockPos pos, @NotNull Level level, ItemSta public @Nullable Property getChangeableProperty(BlockState blockState) { return FACING; } + + @SuppressWarnings("deprecation") + @Override + public @NotNull BlockState rotate(@NotNull BlockState state, @NotNull Rotation rotation) { + return state.setValue(FACING, rotation.rotate(state.getValue(FACING))); + } + + @SuppressWarnings("deprecation") + @Override + public @NotNull BlockState mirror(@NotNull BlockState state, @NotNull Mirror mirror) { + return state.rotate(mirror.getRotation(state.getValue(FACING))); + } }