From 0254592fcc6c65401558e5f79409e1c05207bebe Mon Sep 17 00:00:00 2001 From: Gugle Date: Wed, 18 Dec 2024 15:54:17 +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/src/main/java/dev/dubhe/anvilcraft/block/SimpleChuteBlock.java b/src/main/java/dev/dubhe/anvilcraft/block/SimpleChuteBlock.java index 01e84336c..dc99d5c13 100644 --- a/src/main/java/dev/dubhe/anvilcraft/block/SimpleChuteBlock.java +++ b/src/main/java/dev/dubhe/anvilcraft/block/SimpleChuteBlock.java @@ -20,7 +20,9 @@ import net.minecraft.world.level.LevelReader; 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; @@ -42,6 +44,7 @@ import net.neoforged.neoforge.items.IItemHandler; import com.mojang.serialization.MapCodec; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.annotation.ParametersAreNonnullByDefault; @@ -291,4 +294,15 @@ public boolean change(Player player, BlockPos pos, Level level, ItemStack anvilH public @Nullable Property getChangeableProperty(BlockState blockState) { return FACING; } + + @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))); + } }