Skip to content

Commit

Permalink
Merge pull request #1355 from Gu-ZT/releases/1.20.1
Browse files Browse the repository at this point in the history
修复傻溜槽旋转
  • Loading branch information
Gu-ZT authored Dec 18, 2024
2 parents 72cefcf + d7c9e6a commit 74547c8
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)));
}
}

0 comments on commit 74547c8

Please sign in to comment.