--- a/net/minecraft/world/level/block/CoralWallFanBlock.java
+++ b/net/minecraft/world/level/block/CoralWallFanBlock.java
@@ -10,17 +10,21 @@
 import net.minecraft.world.level.LevelAccessor;
 import net.minecraft.world.level.block.state.BlockBehaviour;
 import net.minecraft.world.level.block.state.BlockState;
+import net.minecraft.world.level.material.Fluid;
 import net.minecraft.world.level.material.Fluids;
 
 public class CoralWallFanBlock extends BaseCoralWallFanBlock {
-    public static final MapCodec<CoralWallFanBlock> CODEC = RecordCodecBuilder.mapCodec(
-        instance -> instance.group(CoralBlock.DEAD_CORAL_FIELD.forGetter(block -> block.deadBlock), propertiesCodec()).apply(instance, CoralWallFanBlock::new)
-    );
+
+    public static final MapCodec<CoralWallFanBlock> CODEC = RecordCodecBuilder.mapCodec((instance) -> {
+        return instance.group(CoralBlock.DEAD_CORAL_FIELD.forGetter((blockcoralfanwall) -> {
+            return blockcoralfanwall.deadBlock;
+        }), propertiesCodec()).apply(instance, CoralWallFanBlock::new);
+    });
     private final Block deadBlock;
 
     @Override
     public MapCodec<CoralWallFanBlock> codec() {
-        return CODEC;
+        return CoralWallFanBlock.CODEC;
     }
 
     protected CoralWallFanBlock(Block deadCoralBlock, BlockBehaviour.Properties settings) {
@@ -36,17 +40,23 @@
     @Override
     protected void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
         if (!scanForWater(state, world, pos)) {
-            world.setBlock(pos, this.deadBlock.defaultBlockState().setValue(WATERLOGGED, Boolean.valueOf(false)).setValue(FACING, state.getValue(FACING)), 2);
+            // CraftBukkit start
+            if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, pos, this.deadBlock.defaultBlockState().setValue(CoralWallFanBlock.WATERLOGGED, false).setValue(CoralWallFanBlock.FACING, state.getValue(CoralWallFanBlock.FACING))).isCancelled()) {
+                return;
+            }
+            // CraftBukkit end
+            world.setBlock(pos, (BlockState) ((BlockState) this.deadBlock.defaultBlockState().setValue(CoralWallFanBlock.WATERLOGGED, false)).setValue(CoralWallFanBlock.FACING, (Direction) state.getValue(CoralWallFanBlock.FACING)), 2);
         }
+
     }
 
     @Override
     protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
-        if (direction.getOpposite() == state.getValue(FACING) && !state.canSurvive(world, pos)) {
+        if (direction.getOpposite() == state.getValue(CoralWallFanBlock.FACING) && !state.canSurvive(world, pos)) {
             return Blocks.AIR.defaultBlockState();
         } else {
-            if (state.getValue(WATERLOGGED)) {
-                world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
+            if ((Boolean) state.getValue(CoralWallFanBlock.WATERLOGGED)) {
+                world.scheduleTick(pos, (Fluid) Fluids.WATER, Fluids.WATER.getTickDelay(world));
             }
 
             this.tryScheduleDieTick(state, world, pos);
