Skip to content

Commit

Permalink
修复傻溜槽旋转
Browse files Browse the repository at this point in the history
  • Loading branch information
Gu-ZT committed Dec 18, 2024
1 parent 947d05d commit 0254592
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/main/java/dev/dubhe/anvilcraft/block/SimpleChuteBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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)));
}
}

0 comments on commit 0254592

Please sign in to comment.