From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Sat, 7 Aug 2021 03:37:56 -0500
Subject: [PATCH] Cactus breaks from solid neighbors config


diff --git a/src/main/java/net/minecraft/world/level/block/CactusBlock.java b/src/main/java/net/minecraft/world/level/block/CactusBlock.java
index 2a02fdf58640d26b82e0ca22d0d8ff3326921b61..c65ec767363b76aa8e8234037d937423abedfdcf 100644
--- a/src/main/java/net/minecraft/world/level/block/CactusBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CactusBlock.java
@@ -110,7 +110,7 @@ public class CactusBlock extends Block {
             BlockState iblockdata2 = world.getBlockState(pos.relative(enumdirection));
 
             material = iblockdata2.getMaterial();
-        } while (!material.isSolid() && !world.getFluidState(pos.relative(enumdirection)).is((Tag) FluidTags.LAVA));
+        } while ((!world.getWorldBorder().world.purpurConfig.cactusBreaksFromSolidNeighbors || !material.isSolid()) && !world.getFluidState(pos.relative(enumdirection)).is((Tag) FluidTags.LAVA)); // Purpur
 
         return false;
     }
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index b2b62319d10fd7716639967c9b4f08b6efbd6d32..8cf456545deca83a42f88aef44f2a8b60280d741 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -744,6 +744,11 @@ public class PurpurWorldConfig {
         buddingAmethystSilkTouch = getBoolean("blocks.budding_amethyst.silk-touch", buddingAmethystSilkTouch);
     }
 
+    public boolean cactusBreaksFromSolidNeighbors = true;
+    private void cactusSettings() {
+        cactusBreaksFromSolidNeighbors = getBoolean("blocks.cactus.breaks-from-solid-neighbors", cactusBreaksFromSolidNeighbors);
+    }
+
     public double caveVinesGrowthModifier = 0.10D;
     public int caveVinesMaxGrowthAge = 25;
     private void caveVinesSettings() {
