--- a/net/minecraft/world/level/block/CoralFanBlock.java
+++ b/net/minecraft/world/level/block/CoralFanBlock.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 CoralFanBlock extends BaseCoralFanBlock {
-    public static final MapCodec<CoralFanBlock> CODEC = RecordCodecBuilder.mapCodec(
-        instance -> instance.group(CoralBlock.DEAD_CORAL_FIELD.forGetter(block -> block.deadBlock), propertiesCodec()).apply(instance, CoralFanBlock::new)
-    );
+
+    public static final MapCodec<CoralFanBlock> CODEC = RecordCodecBuilder.mapCodec((instance) -> {
+        return instance.group(CoralBlock.DEAD_CORAL_FIELD.forGetter((blockcoralfan) -> {
+            return blockcoralfan.deadBlock;
+        }), propertiesCodec()).apply(instance, CoralFanBlock::new);
+    });
     private final Block deadBlock;
 
     @Override
     public MapCodec<CoralFanBlock> codec() {
-        return CODEC;
+        return CoralFanBlock.CODEC;
     }
 
     protected CoralFanBlock(Block deadCoralBlock, BlockBehaviour.Properties settings) {
@@ -36,8 +40,14 @@
     @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)), 2);
+            // CraftBukkit start
+            if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, pos, this.deadBlock.defaultBlockState().setValue(CoralFanBlock.WATERLOGGED, false)).isCancelled()) {
+                return;
+            }
+            // CraftBukkit end
+            world.setBlock(pos, (BlockState) this.deadBlock.defaultBlockState().setValue(CoralFanBlock.WATERLOGGED, false), 2);
         }
+
     }
 
     @Override
@@ -46,8 +56,8 @@
             return Blocks.AIR.defaultBlockState();
         } else {
             this.tryScheduleDieTick(state, world, pos);
-            if (state.getValue(WATERLOGGED)) {
-                world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
+            if ((Boolean) state.getValue(CoralFanBlock.WATERLOGGED)) {
+                world.scheduleTick(pos, (Fluid) Fluids.WATER, Fluids.WATER.getTickDelay(world));
             }
 
             return super.updateShape(state, direction, neighborState, world, pos, neighborPos);
