--- a/net/minecraft/world/level/block/BellBlock.java
+++ b/net/minecraft/world/level/block/BellBlock.java
@@ -5,6 +5,7 @@
 import javax.annotation.Nullable;
 import net.minecraft.core.BlockPos;
 import net.minecraft.core.Direction;
+import net.minecraft.core.Holder;
 import net.minecraft.sounds.SoundEvents;
 import net.minecraft.sounds.SoundSource;
 import net.minecraft.stats.Stats;
@@ -39,53 +40,55 @@
 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 settings) {
         super(settings);
-        this.registerDefaultState(
-            this.stateDefinition.any().setValue(FACING, Direction.NORTH).setValue(ATTACHMENT, BellAttachType.FLOOR).setValue(POWERED, Boolean.valueOf(false))
-        );
+        this.registerDefaultState((BlockState) ((BlockState) ((BlockState) ((BlockState) this.stateDefinition.any()).setValue(BellBlock.FACING, Direction.NORTH)).setValue(BellBlock.ATTACHMENT, BellAttachType.FLOOR)).setValue(BellBlock.POWERED, false));
     }
 
     @Override
     protected void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) {
-        boolean bl = world.hasNeighborSignal(pos);
-        if (bl != state.getValue(POWERED)) {
-            if (bl) {
-                this.attemptToRing(world, pos, null);
+        boolean flag1 = world.hasNeighborSignal(pos);
+
+        if (flag1 != (Boolean) state.getValue(BellBlock.POWERED)) {
+            if (flag1) {
+                this.attemptToRing(world, pos, (Direction) null);
             }
 
-            world.setBlock(pos, state.setValue(POWERED, Boolean.valueOf(bl)), 3);
+            world.setBlock(pos, (BlockState) state.setValue(BellBlock.POWERED, flag1), 3);
         }
+
     }
 
     @Override
     protected void onProjectileHit(Level world, BlockState state, BlockHitResult hit, Projectile projectile) {
         Entity entity = projectile.getOwner();
-        Player player = entity instanceof Player ? (Player)entity : null;
-        this.onHit(world, state, hit, player, true);
+        Player entityhuman = entity instanceof Player ? (Player) entity : null;
+
+        this.onHit(world, state, hit, entityhuman, true);
     }
 
     @Override
@@ -94,12 +97,14 @@
     }
 
     public boolean onHit(Level world, BlockState state, BlockHitResult hitResult, @Nullable Player player, boolean checkHitPos) {
-        Direction direction = hitResult.getDirection();
-        BlockPos blockPos = hitResult.getBlockPos();
-        boolean bl = !checkHitPos || this.isProperHit(state, direction, hitResult.getLocation().y - (double)blockPos.getY());
-        if (bl) {
-            boolean bl2 = this.attemptToRing(player, world, blockPos, direction);
-            if (bl2 && player != null) {
+        Direction enumdirection = hitResult.getDirection();
+        BlockPos blockposition = hitResult.getBlockPos();
+        boolean flag1 = !checkHitPos || this.isProperHit(state, enumdirection, hitResult.getLocation().y - (double) blockposition.getY());
+
+        if (flag1) {
+            boolean flag2 = this.attemptToRing(player, world, blockposition, enumdirection);
+
+            if (flag2 && player != null) {
                 player.awardStat(Stats.BELL_RING);
             }
 
@@ -110,15 +115,16 @@
     }
 
     private boolean isProperHit(BlockState state, Direction side, double y) {
-        if (side.getAxis() != Direction.Axis.Y && !(y > 0.8124F)) {
-            Direction direction = state.getValue(FACING);
-            BellAttachType bellAttachType = state.getValue(ATTACHMENT);
-            switch (bellAttachType) {
+        if (side.getAxis() != Direction.Axis.Y && y <= 0.8123999834060669D) {
+            Direction enumdirection1 = (Direction) state.getValue(BellBlock.FACING);
+            BellAttachType blockpropertybellattach = (BellAttachType) state.getValue(BellBlock.ATTACHMENT);
+
+            switch (blockpropertybellattach) {
                 case FLOOR:
-                    return direction.getAxis() == side.getAxis();
+                    return enumdirection1.getAxis() == side.getAxis();
                 case SINGLE_WALL:
                 case DOUBLE_WALL:
-                    return direction.getAxis() != side.getAxis();
+                    return enumdirection1.getAxis() != side.getAxis();
                 case CEILING:
                     return true;
                 default:
@@ -130,19 +136,25 @@
     }
 
     public boolean attemptToRing(Level world, BlockPos pos, @Nullable Direction direction) {
-        return this.attemptToRing(null, world, pos, direction);
+        return this.attemptToRing((Entity) null, world, pos, direction);
     }
 
     public boolean attemptToRing(@Nullable Entity entity, Level world, BlockPos pos, @Nullable Direction direction) {
-        BlockEntity blockEntity = world.getBlockEntity(pos);
-        if (!world.isClientSide && blockEntity instanceof BellBlockEntity) {
+        BlockEntity tileentity = world.getBlockEntity(pos);
+
+        if (!world.isClientSide && tileentity instanceof BellBlockEntity) {
             if (direction == null) {
-                direction = world.getBlockState(pos).getValue(FACING);
+                direction = (Direction) world.getBlockState(pos).getValue(BellBlock.FACING);
+            }
+            // CraftBukkit start
+            if (!org.bukkit.craftbukkit.event.CraftEventFactory.handleBellRingEvent(world, pos, direction, entity)) {
+                return false;
             }
+            // CraftBukkit end
 
-            ((BellBlockEntity)blockEntity).onHit(direction);
-            world.playSound(null, pos, SoundEvents.BELL_BLOCK, SoundSource.BLOCKS, 2.0F, 1.0F);
-            world.gameEvent(entity, GameEvent.BLOCK_CHANGE, pos);
+            ((BellBlockEntity) tileentity).onHit(direction);
+            world.playSound((Player) null, pos, SoundEvents.BELL_BLOCK, SoundSource.BLOCKS, 2.0F, 1.0F);
+            world.gameEvent(entity, (Holder) GameEvent.BLOCK_CHANGE, pos);
             return true;
         } else {
             return false;
@@ -150,21 +162,10 @@
     }
 
     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;
-        }
+        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
@@ -185,35 +186,30 @@
     @Nullable
     @Override
     public BlockState getStateForPlacement(BlockPlaceContext ctx) {
-        Direction direction = ctx.getClickedFace();
-        BlockPos blockPos = ctx.getClickedPos();
-        Level level = ctx.getLevel();
-        Direction.Axis axis = direction.getAxis();
-        if (axis == Direction.Axis.Y) {
-            BlockState blockState = this.defaultBlockState()
-                .setValue(ATTACHMENT, direction == Direction.DOWN ? BellAttachType.CEILING : BellAttachType.FLOOR)
-                .setValue(FACING, ctx.getHorizontalDirection());
-            if (blockState.canSurvive(ctx.getLevel(), blockPos)) {
-                return blockState;
+        Direction enumdirection = ctx.getClickedFace();
+        BlockPos blockposition = ctx.getClickedPos();
+        Level world = ctx.getLevel();
+        Direction.Axis enumdirection_enumaxis = enumdirection.getAxis();
+        BlockState iblockdata;
+
+        if (enumdirection_enumaxis == Direction.Axis.Y) {
+            iblockdata = (BlockState) ((BlockState) this.defaultBlockState().setValue(BellBlock.ATTACHMENT, enumdirection == Direction.DOWN ? BellAttachType.CEILING : BellAttachType.FLOOR)).setValue(BellBlock.FACING, ctx.getHorizontalDirection());
+            if (iblockdata.canSurvive(ctx.getLevel(), blockposition)) {
+                return iblockdata;
             }
         } else {
-            boolean bl = axis == Direction.Axis.X
-                    && level.getBlockState(blockPos.west()).isFaceSturdy(level, blockPos.west(), Direction.EAST)
-                    && level.getBlockState(blockPos.east()).isFaceSturdy(level, blockPos.east(), Direction.WEST)
-                || axis == Direction.Axis.Z
-                    && level.getBlockState(blockPos.north()).isFaceSturdy(level, blockPos.north(), Direction.SOUTH)
-                    && level.getBlockState(blockPos.south()).isFaceSturdy(level, blockPos.south(), Direction.NORTH);
-            BlockState blockState2 = this.defaultBlockState()
-                .setValue(FACING, direction.getOpposite())
-                .setValue(ATTACHMENT, bl ? BellAttachType.DOUBLE_WALL : BellAttachType.SINGLE_WALL);
-            if (blockState2.canSurvive(ctx.getLevel(), ctx.getClickedPos())) {
-                return blockState2;
+            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 = (BlockState) ((BlockState) this.defaultBlockState().setValue(BellBlock.FACING, enumdirection.getOpposite())).setValue(BellBlock.ATTACHMENT, flag ? BellAttachType.DOUBLE_WALL : BellAttachType.SINGLE_WALL);
+            if (iblockdata.canSurvive(ctx.getLevel(), ctx.getClickedPos())) {
+                return iblockdata;
             }
 
-            boolean bl2 = level.getBlockState(blockPos.below()).isFaceSturdy(level, blockPos.below(), Direction.UP);
-            blockState2 = blockState2.setValue(ATTACHMENT, bl2 ? BellAttachType.FLOOR : BellAttachType.CEILING);
-            if (blockState2.canSurvive(ctx.getLevel(), ctx.getClickedPos())) {
-                return blockState2;
+            boolean flag1 = world.getBlockState(blockposition.below()).isFaceSturdy(world, blockposition.below(), Direction.UP);
+
+            iblockdata = (BlockState) iblockdata.setValue(BellBlock.ATTACHMENT, flag1 ? BellAttachType.FLOOR : BellAttachType.CEILING);
+            if (iblockdata.canSurvive(ctx.getLevel(), ctx.getClickedPos())) {
+                return iblockdata;
             }
         }
 
@@ -223,7 +219,7 @@
     @Override
     protected void onExplosionHit(BlockState state, Level world, BlockPos pos, Explosion explosion, BiConsumer<ItemStack, BlockPos> stackMerger) {
         if (explosion.getBlockInteraction() == Explosion.BlockInteraction.TRIGGER_BLOCK && !world.isClientSide()) {
-            this.attemptToRing(world, pos, null);
+            this.attemptToRing(world, pos, (Direction) null);
         }
 
         super.onExplosionHit(state, world, pos, explosion, stackMerger);
@@ -231,20 +227,19 @@
 
     @Override
     protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
-        BellAttachType bellAttachType = state.getValue(ATTACHMENT);
-        Direction direction2 = getConnectedDirection(state).getOpposite();
-        if (direction2 == direction && !state.canSurvive(world, pos) && bellAttachType != BellAttachType.DOUBLE_WALL) {
+        BellAttachType blockpropertybellattach = (BellAttachType) state.getValue(BellBlock.ATTACHMENT);
+        Direction enumdirection1 = BellBlock.getConnectedDirection(state).getOpposite();
+
+        if (enumdirection1 == direction && !state.canSurvive(world, pos) && blockpropertybellattach != BellAttachType.DOUBLE_WALL) {
             return Blocks.AIR.defaultBlockState();
         } else {
-            if (direction.getAxis() == state.getValue(FACING).getAxis()) {
-                if (bellAttachType == BellAttachType.DOUBLE_WALL && !neighborState.isFaceSturdy(world, neighborPos, direction)) {
-                    return state.setValue(ATTACHMENT, BellAttachType.SINGLE_WALL).setValue(FACING, direction.getOpposite());
+            if (direction.getAxis() == ((Direction) state.getValue(BellBlock.FACING)).getAxis()) {
+                if (blockpropertybellattach == BellAttachType.DOUBLE_WALL && !neighborState.isFaceSturdy(world, neighborPos, direction)) {
+                    return (BlockState) ((BlockState) state.setValue(BellBlock.ATTACHMENT, BellAttachType.SINGLE_WALL)).setValue(BellBlock.FACING, direction.getOpposite());
                 }
 
-                if (bellAttachType == BellAttachType.SINGLE_WALL
-                    && direction2.getOpposite() == direction
-                    && neighborState.isFaceSturdy(world, neighborPos, state.getValue(FACING))) {
-                    return state.setValue(ATTACHMENT, BellAttachType.DOUBLE_WALL);
+                if (blockpropertybellattach == BellAttachType.SINGLE_WALL && enumdirection1.getOpposite() == direction && neighborState.isFaceSturdy(world, neighborPos, (Direction) state.getValue(BellBlock.FACING))) {
+                    return (BlockState) state.setValue(BellBlock.ATTACHMENT, BellAttachType.DOUBLE_WALL);
                 }
             }
 
@@ -254,26 +249,25 @@
 
     @Override
     protected boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
-        Direction direction = getConnectedDirection(state).getOpposite();
-        return direction == Direction.UP
-            ? Block.canSupportCenter(world, pos.above(), Direction.DOWN)
-            : FaceAttachedHorizontalDirectionalBlock.canAttach(world, pos, direction);
+        Direction enumdirection = BellBlock.getConnectedDirection(state).getOpposite();
+
+        return enumdirection == Direction.UP ? Block.canSupportCenter(world, pos.above(), Direction.DOWN) : FaceAttachedHorizontalDirectionalBlock.canAttach(world, pos, enumdirection);
     }
 
     private static Direction getConnectedDirection(BlockState state) {
-        switch ((BellAttachType)state.getValue(ATTACHMENT)) {
+        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);
+        builder.add(BellBlock.FACING, BellBlock.ATTACHMENT, BellBlock.POWERED);
     }
 
     @Nullable
@@ -295,11 +289,11 @@
 
     @Override
     public BlockState rotate(BlockState state, Rotation rotation) {
-        return state.setValue(FACING, rotation.rotate(state.getValue(FACING)));
+        return (BlockState) 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)));
+        return state.rotate(mirror.getRotation((Direction) state.getValue(BellBlock.FACING)));
     }
 }
