From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <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/server/BlockSnow.java b/src/main/java/net/minecraft/server/BlockSnow.java
index 66f188c9eb6431eedfd655a1dd4a35b5141e7196..21fd6689e1e6e837debc3c39d155402bca084595 100644
--- a/src/main/java/net/minecraft/server/BlockSnow.java
+++ b/src/main/java/net/minecraft/server/BlockSnow.java
@@ -56,7 +56,18 @@ public class BlockSnow extends Block {
     public boolean canPlace(IBlockData iblockdata, IWorldReader iworldreader, BlockPosition blockposition) {
         IBlockData iblockdata1 = iworldreader.getType(blockposition.down());
 
-        return !iblockdata1.a(Blocks.ICE) && !iblockdata1.a(Blocks.PACKED_ICE) && !iblockdata1.a(Blocks.BARRIER) ? (!iblockdata1.a(Blocks.HONEY_BLOCK) && !iblockdata1.a(Blocks.SOUL_SAND) ? Block.a(iblockdata1.getCollisionShape(iworldreader, blockposition.down()), EnumDirection.UP) || iblockdata1.getBlock() == this && (Integer) iblockdata1.get(BlockSnow.LAYERS) == 8 : true) : false;
+        // Purpur start - rewrite this whole return to make more sense
+        if (iblockdata1.equals(Blocks.ICE) || iblockdata1.equals(Blocks.PACKED_ICE) || iblockdata1.equals(Blocks.BARRIER)) {
+            return false;
+        }
+        if (iblockdata1.equals(Blocks.BLUE_ICE) && !iworldreader.getWorldBorder().world.purpurConfig.snowOnBlueIce) {
+            return false;
+        }
+        if (iblockdata1.equals(Blocks.HONEY_BLOCK) || iblockdata1.equals(Blocks.SOUL_SAND)) {
+            return true;
+        }
+        return Block.a(iblockdata1.getCollisionShape(iworldreader, blockposition.down()), EnumDirection.UP) || iblockdata1.equals(this) && iblockdata1.get(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 1e7c75c1f8830b5c2660c2cf8aab0167916ff501..bf8a842e7c43946c87c8f27afdf364b1475cf44e 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -419,6 +419,11 @@ public class PurpurWorldConfig {
         }
     }
 
+    public boolean snowOnBlueIce = true;
+    private void blueIceSettings() {
+        snowOnBlueIce = getBoolean("blocks.blue_ice.allow-snow-formation", snowOnBlueIce);
+    }
+
     public boolean chestOpenWithBlockOnTop = false;
     private void chestSettings() {
         chestOpenWithBlockOnTop = getBoolean("blocks.chest.open-with-solid-block-on-top", chestOpenWithBlockOnTop);
