From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Fri, 5 Mar 2021 17:59:05 -0600
Subject: [PATCH] Add config for snow on blue ice


diff --git a/src/main/java/net/minecraft/world/level/block/SnowLayerBlock.java b/src/main/java/net/minecraft/world/level/block/SnowLayerBlock.java
index 0169d874247a96c2e10a65ecb9c0c093f5a6ecfb..b760e2d014b3ae70671878082bb853b75572ed7f 100644
--- a/src/main/java/net/minecraft/world/level/block/SnowLayerBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SnowLayerBlock.java
@@ -76,7 +76,18 @@ public class SnowLayerBlock extends Block {
     public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
         BlockState iblockdata1 = world.getBlockState(pos.below());
 
-        return !iblockdata1.is(Blocks.ICE) && !iblockdata1.is(Blocks.PACKED_ICE) && !iblockdata1.is(Blocks.BARRIER) ? (!iblockdata1.is(Blocks.HONEY_BLOCK) && !iblockdata1.is(Blocks.SOUL_SAND) ? Block.isFaceFull(iblockdata1.getCollisionShape(world, pos.below()), Direction.UP) || iblockdata1.is((Block) this) && (Integer) iblockdata1.getValue(SnowLayerBlock.LAYERS) == 8 : true) : false;
+        // Purpur start - rewrite this whole return to make more sense
+        if (iblockdata1.is(Blocks.ICE) || iblockdata1.is(Blocks.PACKED_ICE) || iblockdata1.is(Blocks.BARRIER)) {
+            return false;
+        }
+        if (iblockdata1.is(Blocks.BLUE_ICE) && !world.getWorldBorder().world.purpurConfig.snowOnBlueIce) {
+            return false;
+        }
+        if (iblockdata1.is(Blocks.HONEY_BLOCK) || iblockdata1.is(Blocks.SOUL_SAND)) {
+            return true;
+        }
+        return Block.isFaceFull(iblockdata1.getCollisionShape(world, pos.below()), Direction.UP) || iblockdata1.is(this) && iblockdata1.getValue(LAYERS) == 8;
+        // Purpur end
     }
 
     @Override
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 6475a8289a774c0407d4de2167c9e98103263d38..2b2668e3245a9bf13942de18fdfc3ea38a41a873 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -535,6 +535,11 @@ public class PurpurWorldConfig {
         furnaceUseLavaFromUnderneath = getBoolean("blocks.furnace.use-lava-from-underneath", furnaceUseLavaFromUnderneath);
     }
 
+    public boolean snowOnBlueIce = true;
+    private void iceSettings() {
+        snowOnBlueIce = getBoolean("blocks.blue_ice.allow-snow-formation", snowOnBlueIce);
+    }
+
     public boolean lavaInfinite = false;
     public int lavaInfiniteRequiredSources = 2;
     public int lavaSpeedNether = 10;
