aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower/net/minecraft/world/level/block/BellBlock.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower/net/minecraft/world/level/block/BellBlock.java.patch')
-rw-r--r--patch-remap/mache-vineflower/net/minecraft/world/level/block/BellBlock.java.patch407
1 files changed, 407 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower/net/minecraft/world/level/block/BellBlock.java.patch b/patch-remap/mache-vineflower/net/minecraft/world/level/block/BellBlock.java.patch
new file mode 100644
index 0000000000..1a998c5dbd
--- /dev/null
+++ b/patch-remap/mache-vineflower/net/minecraft/world/level/block/BellBlock.java.patch
@@ -0,0 +1,407 @@
+--- a/net/minecraft/world/level/block/BellBlock.java
++++ b/net/minecraft/world/level/block/BellBlock.java
+@@ -8,7 +8,7 @@
+ import net.minecraft.sounds.SoundEvents;
+ import net.minecraft.sounds.SoundSource;
+ import net.minecraft.stats.Stats;
+-import net.minecraft.world.InteractionHand;
++import net.minecraft.world.EnumHand;
+ import net.minecraft.world.InteractionResult;
+ import net.minecraft.world.entity.Entity;
+ import net.minecraft.world.entity.player.Player;
+@@ -25,7 +25,7 @@
+ import net.minecraft.world.level.block.entity.BlockEntityTicker;
+ import net.minecraft.world.level.block.entity.BlockEntityType;
+ import net.minecraft.world.level.block.state.BlockBehaviour;
+-import net.minecraft.world.level.block.state.BlockState;
++import net.minecraft.world.level.block.state.IBlockData;
+ import net.minecraft.world.level.block.state.StateDefinition;
+ import net.minecraft.world.level.block.state.properties.BellAttachType;
+ import net.minecraft.world.level.block.state.properties.BlockStateProperties;
+@@ -33,74 +33,78 @@
+ import net.minecraft.world.level.block.state.properties.DirectionProperty;
+ import net.minecraft.world.level.block.state.properties.EnumProperty;
+ import net.minecraft.world.level.gameevent.GameEvent;
+-import net.minecraft.world.level.pathfinder.PathComputationType;
++import net.minecraft.world.level.pathfinder.PathMode;
+ import net.minecraft.world.phys.BlockHitResult;
+ import net.minecraft.world.phys.shapes.CollisionContext;
+ import net.minecraft.world.phys.shapes.Shapes;
+ import net.minecraft.world.phys.shapes.VoxelShape;
+
+ public class BellBlock extends BaseEntityBlock {
++
+ public static final MapCodec<BellBlock> CODEC = simpleCodec(BellBlock::new);
+ public static final DirectionProperty FACING = HorizontalDirectionalBlock.FACING;
+ public static final EnumProperty<BellAttachType> ATTACHMENT = BlockStateProperties.BELL_ATTACHMENT;
+ public static final BooleanProperty POWERED = BlockStateProperties.POWERED;
+- private static final VoxelShape NORTH_SOUTH_FLOOR_SHAPE = Block.box(0.0, 0.0, 4.0, 16.0, 16.0, 12.0);
+- private static final VoxelShape EAST_WEST_FLOOR_SHAPE = Block.box(4.0, 0.0, 0.0, 12.0, 16.0, 16.0);
+- private static final VoxelShape BELL_TOP_SHAPE = Block.box(5.0, 6.0, 5.0, 11.0, 13.0, 11.0);
+- private static final VoxelShape BELL_BOTTOM_SHAPE = Block.box(4.0, 4.0, 4.0, 12.0, 6.0, 12.0);
+- private static final VoxelShape BELL_SHAPE = Shapes.or(BELL_BOTTOM_SHAPE, BELL_TOP_SHAPE);
+- private static final VoxelShape NORTH_SOUTH_BETWEEN = Shapes.or(BELL_SHAPE, Block.box(7.0, 13.0, 0.0, 9.0, 15.0, 16.0));
+- private static final VoxelShape EAST_WEST_BETWEEN = Shapes.or(BELL_SHAPE, Block.box(0.0, 13.0, 7.0, 16.0, 15.0, 9.0));
+- private static final VoxelShape TO_WEST = Shapes.or(BELL_SHAPE, Block.box(0.0, 13.0, 7.0, 13.0, 15.0, 9.0));
+- private static final VoxelShape TO_EAST = Shapes.or(BELL_SHAPE, Block.box(3.0, 13.0, 7.0, 16.0, 15.0, 9.0));
+- private static final VoxelShape TO_NORTH = Shapes.or(BELL_SHAPE, Block.box(7.0, 13.0, 0.0, 9.0, 15.0, 13.0));
+- private static final VoxelShape TO_SOUTH = Shapes.or(BELL_SHAPE, Block.box(7.0, 13.0, 3.0, 9.0, 15.0, 16.0));
+- private static final VoxelShape CEILING_SHAPE = Shapes.or(BELL_SHAPE, Block.box(7.0, 13.0, 7.0, 9.0, 16.0, 9.0));
++ private static final VoxelShape NORTH_SOUTH_FLOOR_SHAPE = Block.box(0.0D, 0.0D, 4.0D, 16.0D, 16.0D, 12.0D);
++ private static final VoxelShape EAST_WEST_FLOOR_SHAPE = Block.box(4.0D, 0.0D, 0.0D, 12.0D, 16.0D, 16.0D);
++ private static final VoxelShape BELL_TOP_SHAPE = Block.box(5.0D, 6.0D, 5.0D, 11.0D, 13.0D, 11.0D);
++ private static final VoxelShape BELL_BOTTOM_SHAPE = Block.box(4.0D, 4.0D, 4.0D, 12.0D, 6.0D, 12.0D);
++ private static final VoxelShape BELL_SHAPE = Shapes.or(BellBlock.BELL_BOTTOM_SHAPE, BellBlock.BELL_TOP_SHAPE);
++ private static final VoxelShape NORTH_SOUTH_BETWEEN = Shapes.or(BellBlock.BELL_SHAPE, Block.box(7.0D, 13.0D, 0.0D, 9.0D, 15.0D, 16.0D));
++ private static final VoxelShape EAST_WEST_BETWEEN = Shapes.or(BellBlock.BELL_SHAPE, Block.box(0.0D, 13.0D, 7.0D, 16.0D, 15.0D, 9.0D));
++ private static final VoxelShape TO_WEST = Shapes.or(BellBlock.BELL_SHAPE, Block.box(0.0D, 13.0D, 7.0D, 13.0D, 15.0D, 9.0D));
++ private static final VoxelShape TO_EAST = Shapes.or(BellBlock.BELL_SHAPE, Block.box(3.0D, 13.0D, 7.0D, 16.0D, 15.0D, 9.0D));
++ private static final VoxelShape TO_NORTH = Shapes.or(BellBlock.BELL_SHAPE, Block.box(7.0D, 13.0D, 0.0D, 9.0D, 15.0D, 13.0D));
++ private static final VoxelShape TO_SOUTH = Shapes.or(BellBlock.BELL_SHAPE, Block.box(7.0D, 13.0D, 3.0D, 9.0D, 15.0D, 16.0D));
++ private static final VoxelShape CEILING_SHAPE = Shapes.or(BellBlock.BELL_SHAPE, Block.box(7.0D, 13.0D, 7.0D, 9.0D, 16.0D, 9.0D));
+ public static final int EVENT_BELL_RING = 1;
+
+ @Override
+ public MapCodec<BellBlock> codec() {
+- return CODEC;
++ return BellBlock.CODEC;
+ }
+
+ public BellBlock(BlockBehaviour.Properties properties) {
+ super(properties);
+- this.registerDefaultState(
+- this.stateDefinition.any().setValue(FACING, Direction.NORTH).setValue(ATTACHMENT, BellAttachType.FLOOR).setValue(POWERED, Boolean.valueOf(false))
+- );
++ this.registerDefaultState((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.stateDefinition.any()).setValue(BellBlock.FACING, Direction.NORTH)).setValue(BellBlock.ATTACHMENT, BellAttachType.FLOOR)).setValue(BellBlock.POWERED, false));
+ }
+
+ @Override
+- public void neighborChanged(BlockState state, Level level, BlockPos pos, Block block, BlockPos fromPos, boolean isMoving) {
+- boolean hasNeighborSignal = level.hasNeighborSignal(pos);
+- if (hasNeighborSignal != state.getValue(POWERED)) {
+- if (hasNeighborSignal) {
+- this.attemptToRing(level, pos, null);
++ public void neighborChanged(IBlockData state, Level level, BlockPos pos, Block block, BlockPos fromPos, boolean isMoving) {
++ boolean flag1 = level.hasNeighborSignal(pos);
++
++ if (flag1 != (Boolean) state.getValue(BellBlock.POWERED)) {
++ if (flag1) {
++ this.attemptToRing(level, pos, (Direction) null);
+ }
+
+- level.setBlock(pos, state.setValue(POWERED, Boolean.valueOf(hasNeighborSignal)), 3);
++ level.setBlock(pos, (IBlockData) state.setValue(BellBlock.POWERED, flag1), 3);
+ }
++
+ }
+
+ @Override
+- public void onProjectileHit(Level level, BlockState state, BlockHitResult hit, Projectile projectile) {
+- Entity owner = projectile.getOwner();
+- Player player = owner instanceof Player ? (Player)owner : null;
+- this.onHit(level, state, hit, player, true);
++ public void onProjectileHit(Level level, IBlockData state, BlockHitResult hit, Projectile projectile) {
++ Entity entity = projectile.getOwner();
++ Player entityhuman = entity instanceof Player ? (Player) entity : null;
++
++ this.onHit(level, state, hit, entityhuman, true);
+ }
+
+ @Override
+- public InteractionResult use(BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
++ public InteractionResult use(IBlockData state, Level level, BlockPos pos, Player player, EnumHand hand, BlockHitResult hit) {
+ return this.onHit(level, state, hit, player, true) ? InteractionResult.sidedSuccess(level.isClientSide) : InteractionResult.PASS;
+ }
+
+- public boolean onHit(Level level, BlockState state, BlockHitResult result, @Nullable Player player, boolean canRingBell) {
+- Direction direction = result.getDirection();
+- BlockPos blockPos = result.getBlockPos();
+- boolean flag = !canRingBell || this.isProperHit(state, direction, result.getLocation().y - (double)blockPos.getY());
+- if (flag) {
+- boolean flag1 = this.attemptToRing(player, level, blockPos, direction);
+- if (flag1 && player != null) {
++ public boolean onHit(Level level, IBlockData state, BlockHitResult result, @Nullable Player player, boolean canRingBell) {
++ Direction enumdirection = result.getDirection();
++ BlockPos blockposition = result.getBlockPos();
++ boolean flag1 = !canRingBell || this.isProperHit(state, enumdirection, result.getLocation().y - (double) blockposition.getY());
++
++ if (flag1) {
++ boolean flag2 = this.attemptToRing(player, level, blockposition, enumdirection);
++
++ if (flag2 && player != null) {
+ player.awardStat(Stats.BELL_RING);
+ }
+
+@@ -110,16 +114,17 @@
+ }
+ }
+
+- private boolean isProperHit(BlockState pos, Direction direction, double distanceY) {
+- if (direction.getAxis() != Direction.Axis.Y && !(distanceY > 0.8124F)) {
+- Direction direction1 = pos.getValue(FACING);
+- BellAttachType bellAttachType = pos.getValue(ATTACHMENT);
+- switch (bellAttachType) {
++ private boolean isProperHit(IBlockData pos, Direction direction, double distanceY) {
++ if (direction.getAxis() != Direction.Axis.Y && distanceY <= 0.8123999834060669D) {
++ Direction enumdirection1 = (Direction) pos.getValue(BellBlock.FACING);
++ BellAttachType blockpropertybellattach = (BellAttachType) pos.getValue(BellBlock.ATTACHMENT);
++
++ switch (blockpropertybellattach) {
+ case FLOOR:
+- return direction1.getAxis() == direction.getAxis();
++ return enumdirection1.getAxis() == direction.getAxis();
+ case SINGLE_WALL:
+ case DOUBLE_WALL:
+- return direction1.getAxis() != direction.getAxis();
++ return enumdirection1.getAxis() != direction.getAxis();
+ case CEILING:
+ return true;
+ default:
+@@ -131,18 +136,24 @@
+ }
+
+ public boolean attemptToRing(Level level, BlockPos pos, @Nullable Direction direction) {
+- return this.attemptToRing(null, level, pos, direction);
++ return this.attemptToRing((Entity) null, level, pos, direction);
+ }
+
+ public boolean attemptToRing(@Nullable Entity entity, Level level, BlockPos pos, @Nullable Direction direction) {
+- BlockEntity blockEntity = level.getBlockEntity(pos);
+- if (!level.isClientSide && blockEntity instanceof BellBlockEntity) {
++ BlockEntity tileentity = level.getBlockEntity(pos);
++
++ if (!level.isClientSide && tileentity instanceof BellBlockEntity) {
+ if (direction == null) {
+- direction = level.getBlockState(pos).getValue(FACING);
++ direction = (Direction) level.getBlockState(pos).getValue(BellBlock.FACING);
+ }
++ // CraftBukkit start
++ if (!org.bukkit.craftbukkit.event.CraftEventFactory.handleBellRingEvent(level, pos, direction, entity)) {
++ return false;
++ }
++ // CraftBukkit end
+
+- ((BellBlockEntity)blockEntity).onHit(direction);
+- level.playSound(null, pos, SoundEvents.BELL_BLOCK, SoundSource.BLOCKS, 2.0F, 1.0F);
++ ((BellBlockEntity) tileentity).onHit(direction);
++ level.playSound((Player) null, pos, SoundEvents.BELL_BLOCK, SoundSource.BLOCKS, 2.0F, 1.0F);
+ level.gameEvent(entity, GameEvent.BLOCK_CHANGE, pos);
+ return true;
+ } else {
+@@ -150,71 +161,55 @@
+ }
+ }
+
+- private VoxelShape getVoxelShape(BlockState state) {
+- Direction direction = state.getValue(FACING);
+- BellAttachType bellAttachType = state.getValue(ATTACHMENT);
+- if (bellAttachType == BellAttachType.FLOOR) {
+- return direction != Direction.NORTH && direction != Direction.SOUTH ? EAST_WEST_FLOOR_SHAPE : NORTH_SOUTH_FLOOR_SHAPE;
+- } else if (bellAttachType == BellAttachType.CEILING) {
+- return CEILING_SHAPE;
+- } else if (bellAttachType == BellAttachType.DOUBLE_WALL) {
+- return direction != Direction.NORTH && direction != Direction.SOUTH ? EAST_WEST_BETWEEN : NORTH_SOUTH_BETWEEN;
+- } else if (direction == Direction.NORTH) {
+- return TO_NORTH;
+- } else if (direction == Direction.SOUTH) {
+- return TO_SOUTH;
+- } else {
+- return direction == Direction.EAST ? TO_EAST : TO_WEST;
+- }
++ private VoxelShape getVoxelShape(IBlockData state) {
++ Direction enumdirection = (Direction) state.getValue(BellBlock.FACING);
++ BellAttachType blockpropertybellattach = (BellAttachType) state.getValue(BellBlock.ATTACHMENT);
++
++ return blockpropertybellattach == BellAttachType.FLOOR ? (enumdirection != Direction.NORTH && enumdirection != Direction.SOUTH ? BellBlock.EAST_WEST_FLOOR_SHAPE : BellBlock.NORTH_SOUTH_FLOOR_SHAPE) : (blockpropertybellattach == BellAttachType.CEILING ? BellBlock.CEILING_SHAPE : (blockpropertybellattach == BellAttachType.DOUBLE_WALL ? (enumdirection != Direction.NORTH && enumdirection != Direction.SOUTH ? BellBlock.EAST_WEST_BETWEEN : BellBlock.NORTH_SOUTH_BETWEEN) : (enumdirection == Direction.NORTH ? BellBlock.TO_NORTH : (enumdirection == Direction.SOUTH ? BellBlock.TO_SOUTH : (enumdirection == Direction.EAST ? BellBlock.TO_EAST : BellBlock.TO_WEST)))));
+ }
+
+ @Override
+- public VoxelShape getCollisionShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
++ public VoxelShape getCollisionShape(IBlockData state, BlockGetter level, BlockPos pos, CollisionContext context) {
+ return this.getVoxelShape(state);
+ }
+
+ @Override
+- public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
++ public VoxelShape getShape(IBlockData state, BlockGetter level, BlockPos pos, CollisionContext context) {
+ return this.getVoxelShape(state);
+ }
+
+ @Override
+- public RenderShape getRenderShape(BlockState state) {
+- return RenderShape.MODEL;
++ public EnumRenderType getRenderShape(IBlockData state) {
++ return EnumRenderType.MODEL;
+ }
+
+ @Nullable
+ @Override
+- public BlockState getStateForPlacement(BlockPlaceContext context) {
+- Direction clickedFace = context.getClickedFace();
+- BlockPos clickedPos = context.getClickedPos();
+- Level level = context.getLevel();
+- Direction.Axis axis = clickedFace.getAxis();
+- if (axis == Direction.Axis.Y) {
+- BlockState blockState = this.defaultBlockState()
+- .setValue(ATTACHMENT, clickedFace == Direction.DOWN ? BellAttachType.CEILING : BellAttachType.FLOOR)
+- .setValue(FACING, context.getHorizontalDirection());
+- if (blockState.canSurvive(context.getLevel(), clickedPos)) {
+- return blockState;
++ public IBlockData getStateForPlacement(BlockPlaceContext context) {
++ Direction enumdirection = context.getClickedFace();
++ BlockPos blockposition = context.getClickedPos();
++ Level world = context.getLevel();
++ Direction.Axis enumdirection_enumaxis = enumdirection.getAxis();
++ IBlockData iblockdata;
++
++ if (enumdirection_enumaxis == Direction.Axis.Y) {
++ iblockdata = (IBlockData) ((IBlockData) this.defaultBlockState().setValue(BellBlock.ATTACHMENT, enumdirection == Direction.DOWN ? BellAttachType.CEILING : BellAttachType.FLOOR)).setValue(BellBlock.FACING, context.getHorizontalDirection());
++ if (iblockdata.canSurvive(context.getLevel(), blockposition)) {
++ return iblockdata;
+ }
+ } else {
+- boolean flag = axis == Direction.Axis.X
+- && level.getBlockState(clickedPos.west()).isFaceSturdy(level, clickedPos.west(), Direction.EAST)
+- && level.getBlockState(clickedPos.east()).isFaceSturdy(level, clickedPos.east(), Direction.WEST)
+- || axis == Direction.Axis.Z
+- && level.getBlockState(clickedPos.north()).isFaceSturdy(level, clickedPos.north(), Direction.SOUTH)
+- && level.getBlockState(clickedPos.south()).isFaceSturdy(level, clickedPos.south(), Direction.NORTH);
+- BlockState blockState = this.defaultBlockState()
+- .setValue(FACING, clickedFace.getOpposite())
+- .setValue(ATTACHMENT, flag ? BellAttachType.DOUBLE_WALL : BellAttachType.SINGLE_WALL);
+- if (blockState.canSurvive(context.getLevel(), context.getClickedPos())) {
+- return blockState;
++ boolean flag = enumdirection_enumaxis == Direction.Axis.X && world.getBlockState(blockposition.west()).isFaceSturdy(world, blockposition.west(), Direction.EAST) && world.getBlockState(blockposition.east()).isFaceSturdy(world, blockposition.east(), Direction.WEST) || enumdirection_enumaxis == Direction.Axis.Z && world.getBlockState(blockposition.north()).isFaceSturdy(world, blockposition.north(), Direction.SOUTH) && world.getBlockState(blockposition.south()).isFaceSturdy(world, blockposition.south(), Direction.NORTH);
++
++ iblockdata = (IBlockData) ((IBlockData) this.defaultBlockState().setValue(BellBlock.FACING, enumdirection.getOpposite())).setValue(BellBlock.ATTACHMENT, flag ? BellAttachType.DOUBLE_WALL : BellAttachType.SINGLE_WALL);
++ if (iblockdata.canSurvive(context.getLevel(), context.getClickedPos())) {
++ return iblockdata;
+ }
+
+- boolean isFaceSturdy = level.getBlockState(clickedPos.below()).isFaceSturdy(level, clickedPos.below(), Direction.UP);
+- BlockState var10 = blockState.setValue(ATTACHMENT, isFaceSturdy ? BellAttachType.FLOOR : BellAttachType.CEILING);
+- if (var10.canSurvive(context.getLevel(), context.getClickedPos())) {
+- return var10;
++ boolean flag1 = world.getBlockState(blockposition.below()).isFaceSturdy(world, blockposition.below(), Direction.UP);
++
++ iblockdata = (IBlockData) iblockdata.setValue(BellBlock.ATTACHMENT, flag1 ? BellAttachType.FLOOR : BellAttachType.CEILING);
++ if (iblockdata.canSurvive(context.getLevel(), context.getClickedPos())) {
++ return iblockdata;
+ }
+ }
+
+@@ -222,30 +217,29 @@
+ }
+
+ @Override
+- public void onExplosionHit(BlockState blockState, Level level, BlockPos blockPos, Explosion explosion, BiConsumer<ItemStack, BlockPos> biConsumer) {
+- if (explosion.getBlockInteraction() == Explosion.BlockInteraction.TRIGGER_BLOCK && !level.isClientSide()) {
+- this.attemptToRing(level, blockPos, null);
++ public void onExplosionHit(IBlockData iblockdata, Level world, BlockPos blockposition, Explosion explosion, BiConsumer<ItemStack, BlockPos> biconsumer) {
++ if (explosion.getBlockInteraction() == Explosion.Effect.TRIGGER_BLOCK && !world.isClientSide()) {
++ this.attemptToRing(world, blockposition, (Direction) null);
+ }
+
+- super.onExplosionHit(blockState, level, blockPos, explosion, biConsumer);
++ super.onExplosionHit(iblockdata, world, blockposition, explosion, biconsumer);
+ }
+
+ @Override
+- public BlockState updateShape(BlockState state, Direction facing, BlockState facingState, LevelAccessor level, BlockPos currentPos, BlockPos facingPos) {
+- BellAttachType bellAttachType = state.getValue(ATTACHMENT);
+- Direction opposite = getConnectedDirection(state).getOpposite();
+- if (opposite == facing && !state.canSurvive(level, currentPos) && bellAttachType != BellAttachType.DOUBLE_WALL) {
++ public IBlockData updateShape(IBlockData state, Direction facing, IBlockData facingState, LevelAccessor level, BlockPos currentPos, BlockPos facingPos) {
++ BellAttachType blockpropertybellattach = (BellAttachType) state.getValue(BellBlock.ATTACHMENT);
++ Direction enumdirection1 = getConnectedDirection(state).getOpposite();
++
++ if (enumdirection1 == facing && !state.canSurvive(level, currentPos) && blockpropertybellattach != BellAttachType.DOUBLE_WALL) {
+ return Blocks.AIR.defaultBlockState();
+ } else {
+- if (facing.getAxis() == state.getValue(FACING).getAxis()) {
+- if (bellAttachType == BellAttachType.DOUBLE_WALL && !facingState.isFaceSturdy(level, facingPos, facing)) {
+- return state.setValue(ATTACHMENT, BellAttachType.SINGLE_WALL).setValue(FACING, facing.getOpposite());
++ if (facing.getAxis() == ((Direction) state.getValue(BellBlock.FACING)).getAxis()) {
++ if (blockpropertybellattach == BellAttachType.DOUBLE_WALL && !facingState.isFaceSturdy(level, facingPos, facing)) {
++ return (IBlockData) ((IBlockData) state.setValue(BellBlock.ATTACHMENT, BellAttachType.SINGLE_WALL)).setValue(BellBlock.FACING, facing.getOpposite());
+ }
+
+- if (bellAttachType == BellAttachType.SINGLE_WALL
+- && opposite.getOpposite() == facing
+- && facingState.isFaceSturdy(level, facingPos, state.getValue(FACING))) {
+- return state.setValue(ATTACHMENT, BellAttachType.DOUBLE_WALL);
++ if (blockpropertybellattach == BellAttachType.SINGLE_WALL && enumdirection1.getOpposite() == facing && facingState.isFaceSturdy(level, facingPos, (Direction) state.getValue(BellBlock.FACING))) {
++ return (IBlockData) state.setValue(BellBlock.ATTACHMENT, BellAttachType.DOUBLE_WALL);
+ }
+ }
+
+@@ -254,53 +248,52 @@
+ }
+
+ @Override
+- public boolean canSurvive(BlockState state, LevelReader level, BlockPos pos) {
+- Direction opposite = getConnectedDirection(state).getOpposite();
+- return opposite == Direction.UP
+- ? Block.canSupportCenter(level, pos.above(), Direction.DOWN)
+- : FaceAttachedHorizontalDirectionalBlock.canAttach(level, pos, opposite);
++ public boolean canSurvive(IBlockData state, LevelReader level, BlockPos pos) {
++ Direction enumdirection = getConnectedDirection(state).getOpposite();
++
++ return enumdirection == Direction.UP ? Block.canSupportCenter(level, pos.above(), Direction.DOWN) : FaceAttachedHorizontalDirectionalBlock.canAttach(level, pos, enumdirection);
+ }
+
+- private static Direction getConnectedDirection(BlockState state) {
+- switch ((BellAttachType)state.getValue(ATTACHMENT)) {
++ private static Direction getConnectedDirection(IBlockData state) {
++ switch ((BellAttachType) state.getValue(BellBlock.ATTACHMENT)) {
+ case FLOOR:
+ return Direction.UP;
+ case CEILING:
+ return Direction.DOWN;
+ default:
+- return state.getValue(FACING).getOpposite();
++ return ((Direction) state.getValue(BellBlock.FACING)).getOpposite();
+ }
+ }
+
+ @Override
+- protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
+- builder.add(FACING, ATTACHMENT, POWERED);
++ protected void createBlockStateDefinition(StateDefinition.Builder<Block, IBlockData> builder) {
++ builder.add(BellBlock.FACING, BellBlock.ATTACHMENT, BellBlock.POWERED);
+ }
+
+ @Nullable
+ @Override
+- public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
++ public BlockEntity newBlockEntity(BlockPos pos, IBlockData state) {
+ return new BellBlockEntity(pos, state);
+ }
+
+ @Nullable
+ @Override
+- public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
++ public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, IBlockData state, BlockEntityType<T> blockEntityType) {
+ return createTickerHelper(blockEntityType, BlockEntityType.BELL, level.isClientSide ? BellBlockEntity::clientTick : BellBlockEntity::serverTick);
+ }
+
+ @Override
+- public boolean isPathfindable(BlockState state, BlockGetter level, BlockPos pos, PathComputationType type) {
++ public boolean isPathfindable(IBlockData state, BlockGetter level, BlockPos pos, PathMode type) {
+ return false;
+ }
+
+ @Override
+- public BlockState rotate(BlockState state, Rotation rotation) {
+- return state.setValue(FACING, rotation.rotate(state.getValue(FACING)));
++ public IBlockData rotate(IBlockData state, Rotation rotation) {
++ return (IBlockData) state.setValue(BellBlock.FACING, rotation.rotate((Direction) state.getValue(BellBlock.FACING)));
+ }
+
+ @Override
+- public BlockState mirror(BlockState state, Mirror mirror) {
+- return state.rotate(mirror.getRotation(state.getValue(FACING)));
++ public IBlockData mirror(IBlockData state, Mirror mirror) {
++ return state.rotate(mirror.getRotation((Direction) state.getValue(BellBlock.FACING)));
+ }
+ }