--- a/net/minecraft/world/level/block/SnowLayerBlock.java
+++ b/net/minecraft/world/level/block/SnowLayerBlock.java
@@ -22,6 +22,7 @@
 import net.minecraft.world.phys.shapes.VoxelShape;
 
 public class SnowLayerBlock extends Block {
+
     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.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)};
@@ -29,14 +30,14 @@
 
     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
     public boolean isPathfindable(BlockState state, BlockGetter world, BlockPos pos, PathComputationType type) {
         switch (type) {
             case LAND:
-                return state.getValue(LAYERS) < 5;
+                return (Integer) state.getValue(SnowLayerBlock.LAYERS) < 5;
             case WATER:
                 return false;
             case AIR:
@@ -48,22 +49,22 @@
 
     @Override
     public 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
     public 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
     public 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
     public 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
@@ -73,19 +74,14 @@
 
     @Override
     public 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
     public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
-        BlockState blockState = world.getBlockState(pos.below());
-        if (blockState.is(BlockTags.SNOW_LAYER_CANNOT_SURVIVE_ON)) {
-            return false;
-        } else if (blockState.is(BlockTags.SNOW_LAYER_CAN_SURVIVE_ON)) {
-            return true;
-        } else {
-            return 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
@@ -96,6 +92,11 @@
     @Override
     public void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
         if (world.getBrightness(LightLayer.BLOCK, pos) > 11) {
+            // CraftBukkit start
+            if (org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.callBlockFadeEvent(world, pos, Blocks.AIR.defaultBlockState()).isCancelled()) {
+                return;
+            }
+            // CraftBukkit end
             dropResources(state, world, pos);
             world.removeBlock(pos, false);
         }
@@ -104,25 +105,20 @@
 
     @Override
     public boolean canBeReplaced(BlockState state, BlockPlaceContext context) {
-        int i = state.getValue(LAYERS);
-        if (context.getItemInHand().is(this.asItem()) && i < 8) {
-            if (context.replacingClickedOnBlock()) {
-                return context.getClickedFace() == Direction.UP;
-            } else {
-                return true;
-            }
-        } else {
-            return i == 1;
-        }
+        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);
         }
@@ -130,6 +126,6 @@
 
     @Override
     protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
-        builder.add(LAYERS);
+        builder.add(SnowLayerBlock.LAYERS);
     }
 }
