--- a/net/minecraft/world/level/block/SnowLayerBlock.java
+++ b/net/minecraft/world/level/block/SnowLayerBlock.java
@@ -23,37 +23,28 @@
 import net.minecraft.world.phys.shapes.VoxelShape;
 
 public class SnowLayerBlock extends Block {
+
     public static final MapCodec<SnowLayerBlock> CODEC = simpleCodec(SnowLayerBlock::new);
     public static final int MAX_HEIGHT = 8;
     public static final IntegerProperty LAYERS = BlockStateProperties.LAYERS;
-    protected static final VoxelShape[] SHAPE_BY_LAYER = new VoxelShape[]{
-        Shapes.empty(),
-        Block.box(0.0, 0.0, 0.0, 16.0, 2.0, 16.0),
-        Block.box(0.0, 0.0, 0.0, 16.0, 4.0, 16.0),
-        Block.box(0.0, 0.0, 0.0, 16.0, 6.0, 16.0),
-        Block.box(0.0, 0.0, 0.0, 16.0, 8.0, 16.0),
-        Block.box(0.0, 0.0, 0.0, 16.0, 10.0, 16.0),
-        Block.box(0.0, 0.0, 0.0, 16.0, 12.0, 16.0),
-        Block.box(0.0, 0.0, 0.0, 16.0, 14.0, 16.0),
-        Block.box(0.0, 0.0, 0.0, 16.0, 16.0, 16.0)
-    };
+    protected static final VoxelShape[] SHAPE_BY_LAYER = new VoxelShape[]{Shapes.empty(), Block.box(0.0D, 0.0D, 0.0D, 16.0D, 2.0D, 16.0D), Block.box(0.0D, 0.0D, 0.0D, 16.0D, 4.0D, 16.0D), Block.box(0.0D, 0.0D, 0.0D, 16.0D, 6.0D, 16.0D), Block.box(0.0D, 0.0D, 0.0D, 16.0D, 8.0D, 16.0D), Block.box(0.0D, 0.0D, 0.0D, 16.0D, 10.0D, 16.0D), Block.box(0.0D, 0.0D, 0.0D, 16.0D, 12.0D, 16.0D), Block.box(0.0D, 0.0D, 0.0D, 16.0D, 14.0D, 16.0D), Block.box(0.0D, 0.0D, 0.0D, 16.0D, 16.0D, 16.0D)};
     public static final int HEIGHT_IMPASSABLE = 5;
 
     @Override
     public MapCodec<SnowLayerBlock> codec() {
-        return CODEC;
+        return SnowLayerBlock.CODEC;
     }
 
     protected SnowLayerBlock(BlockBehaviour.Properties settings) {
         super(settings);
-        this.registerDefaultState(this.stateDefinition.any().setValue(LAYERS, Integer.valueOf(1)));
+        this.registerDefaultState((BlockState) ((BlockState) this.stateDefinition.any()).setValue(SnowLayerBlock.LAYERS, 1));
     }
 
     @Override
     protected boolean isPathfindable(BlockState state, PathComputationType type) {
         switch (type) {
             case LAND:
-                return state.getValue(LAYERS) < 5;
+                return (Integer) state.getValue(SnowLayerBlock.LAYERS) < 5;
             case WATER:
                 return false;
             case AIR:
@@ -65,22 +56,22 @@
 
     @Override
     protected VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
-        return SHAPE_BY_LAYER[state.getValue(LAYERS)];
+        return SnowLayerBlock.SHAPE_BY_LAYER[(Integer) state.getValue(SnowLayerBlock.LAYERS)];
     }
 
     @Override
     protected VoxelShape getCollisionShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
-        return SHAPE_BY_LAYER[state.getValue(LAYERS) - 1];
+        return SnowLayerBlock.SHAPE_BY_LAYER[(Integer) state.getValue(SnowLayerBlock.LAYERS) - 1];
     }
 
     @Override
     protected VoxelShape getBlockSupportShape(BlockState state, BlockGetter world, BlockPos pos) {
-        return SHAPE_BY_LAYER[state.getValue(LAYERS)];
+        return SnowLayerBlock.SHAPE_BY_LAYER[(Integer) state.getValue(SnowLayerBlock.LAYERS)];
     }
 
     @Override
     protected VoxelShape getVisualShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
-        return SHAPE_BY_LAYER[state.getValue(LAYERS)];
+        return SnowLayerBlock.SHAPE_BY_LAYER[(Integer) state.getValue(SnowLayerBlock.LAYERS)];
     }
 
     @Override
@@ -90,18 +81,14 @@
 
     @Override
     protected float getShadeBrightness(BlockState state, BlockGetter world, BlockPos pos) {
-        return state.getValue(LAYERS) == 8 ? 0.2F : 1.0F;
+        return (Integer) state.getValue(SnowLayerBlock.LAYERS) == 8 ? 0.2F : 1.0F;
     }
 
     @Override
     protected boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
-        BlockState blockState = world.getBlockState(pos.below());
-        return !blockState.is(BlockTags.SNOW_LAYER_CANNOT_SURVIVE_ON)
-            && (
-                blockState.is(BlockTags.SNOW_LAYER_CAN_SURVIVE_ON)
-                    || Block.isFaceFull(blockState.getCollisionShape(world, pos.below()), Direction.UP)
-                    || blockState.is(this) && blockState.getValue(LAYERS) == 8
-            );
+        BlockState iblockdata1 = world.getBlockState(pos.below());
+
+        return iblockdata1.is(BlockTags.SNOW_LAYER_CANNOT_SURVIVE_ON) ? false : (iblockdata1.is(BlockTags.SNOW_LAYER_CAN_SURVIVE_ON) ? true : Block.isFaceFull(iblockdata1.getCollisionShape(world, pos.below()), Direction.UP) || iblockdata1.is((Block) this) && (Integer) iblockdata1.getValue(SnowLayerBlock.LAYERS) == 8);
     }
 
     @Override
@@ -112,24 +99,33 @@
     @Override
     protected void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
         if (world.getBrightness(LightLayer.BLOCK, pos) > 11) {
+            // CraftBukkit start
+            if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, pos, Blocks.AIR.defaultBlockState()).isCancelled()) {
+                return;
+            }
+            // CraftBukkit end
             dropResources(state, world, pos);
             world.removeBlock(pos, false);
         }
+
     }
 
     @Override
     protected boolean canBeReplaced(BlockState state, BlockPlaceContext context) {
-        int i = state.getValue(LAYERS);
-        return !context.getItemInHand().is(this.asItem()) || i >= 8 ? i == 1 : !context.replacingClickedOnBlock() || context.getClickedFace() == Direction.UP;
+        int i = (Integer) state.getValue(SnowLayerBlock.LAYERS);
+
+        return context.getItemInHand().is(this.asItem()) && i < 8 ? (context.replacingClickedOnBlock() ? context.getClickedFace() == Direction.UP : true) : i == 1;
     }
 
     @Nullable
     @Override
     public BlockState getStateForPlacement(BlockPlaceContext ctx) {
-        BlockState blockState = ctx.getLevel().getBlockState(ctx.getClickedPos());
-        if (blockState.is(this)) {
-            int i = blockState.getValue(LAYERS);
-            return blockState.setValue(LAYERS, Integer.valueOf(Math.min(8, i + 1)));
+        BlockState iblockdata = ctx.getLevel().getBlockState(ctx.getClickedPos());
+
+        if (iblockdata.is((Block) this)) {
+            int i = (Integer) iblockdata.getValue(SnowLayerBlock.LAYERS);
+
+            return (BlockState) iblockdata.setValue(SnowLayerBlock.LAYERS, Math.min(8, i + 1));
         } else {
             return super.getStateForPlacement(ctx);
         }
@@ -137,6 +133,6 @@
 
     @Override
     protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
-        builder.add(LAYERS);
+        builder.add(SnowLayerBlock.LAYERS);
     }
 }
