From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <blake.galbreath@gmail.com>
Date: Sun, 22 Nov 2020 06:02:32 -0600
Subject: [PATCH] Add twisting and weeping vines growth rates


diff --git a/src/main/java/net/minecraft/server/BlockGrowingTop.java b/src/main/java/net/minecraft/server/BlockGrowingTop.java
index 7963411be990fed8eb0ffca3eba35d15a9b8d7bd..6c084ad5cda41425eed04465d942f6a73968cd61 100644
--- a/src/main/java/net/minecraft/server/BlockGrowingTop.java
+++ b/src/main/java/net/minecraft/server/BlockGrowingTop.java
@@ -23,9 +23,11 @@ public abstract class BlockGrowingTop extends BlockGrowingAbstract implements IB
         return (Integer) iblockdata.get(BlockGrowingTop.d) < 25;
     }
 
+    public abstract double getGrowthModifier(WorldServer worldserver); // Purpur
+
     @Override
     public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
-        if ((Integer) iblockdata.get(BlockGrowingTop.d) < 25 && random.nextDouble() < (100.0D / worldserver.spigotConfig.kelpModifier) * this.e) { // Spigot
+        if ((Integer) iblockdata.get(BlockGrowingTop.d) < 25 && random.nextDouble() < (100.0D / getGrowthModifier(worldserver)) * this.e) { // Spigot // Purpur
             BlockPosition blockposition1 = blockposition.shift(this.a);
 
             if (this.h(worldserver.getType(blockposition1))) {
diff --git a/src/main/java/net/minecraft/server/BlockKelp.java b/src/main/java/net/minecraft/server/BlockKelp.java
index a243aaed58454ae304c988df8a8a090a8236075e..2a7a6e5943f2ff87815c398ffec01bb78d320690 100644
--- a/src/main/java/net/minecraft/server/BlockKelp.java
+++ b/src/main/java/net/minecraft/server/BlockKelp.java
@@ -53,4 +53,10 @@ public class BlockKelp extends BlockGrowingTop implements IFluidContainer {
     public Fluid d(IBlockData iblockdata) {
         return FluidTypes.WATER.a(false);
     }
+
+    // Purpur start
+    public double getGrowthModifier(WorldServer worldserver) {
+        return worldserver.spigotConfig.kelpModifier;
+    }
+    // Purpur end
 }
diff --git a/src/main/java/net/minecraft/server/BlockTwistingVines.java b/src/main/java/net/minecraft/server/BlockTwistingVines.java
index be381674632c49d7465dd7d52084b52f45194b54..146638111c56ec81ab46b514d45a7cc8aac2b36a 100644
--- a/src/main/java/net/minecraft/server/BlockTwistingVines.java
+++ b/src/main/java/net/minecraft/server/BlockTwistingVines.java
@@ -24,4 +24,10 @@ public class BlockTwistingVines extends BlockGrowingTop {
     protected boolean h(IBlockData iblockdata) {
         return BlockNetherVinesUtil.a(iblockdata);
     }
+
+    // Purpur start
+    public double getGrowthModifier(WorldServer worldserver) {
+        return worldserver.purpurConfig.twistingVinesGrowthModifier;
+    }
+    // Purpur end
 }
diff --git a/src/main/java/net/minecraft/server/BlockWeepingVines.java b/src/main/java/net/minecraft/server/BlockWeepingVines.java
index 23dca1940375d243531fc4a891f04e937ae2f48f..94ffadb91fec65a721cf0c8fa98bad708a2ca269 100644
--- a/src/main/java/net/minecraft/server/BlockWeepingVines.java
+++ b/src/main/java/net/minecraft/server/BlockWeepingVines.java
@@ -24,4 +24,10 @@ public class BlockWeepingVines extends BlockGrowingTop {
     protected boolean h(IBlockData iblockdata) {
         return BlockNetherVinesUtil.a(iblockdata);
     }
+
+    // Purpur start
+    public double getGrowthModifier(WorldServer worldserver) {
+        return worldserver.purpurConfig.weepingVinesGrowthModifier;
+    }
+    // Purpur end
 }
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 9a419e2e591113015bd122202aba2a8aa8494f63..8f59e8412c2d82211274abdc9fc9bb94f117960d 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -419,6 +419,16 @@ public class PurpurWorldConfig {
         turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
     }
 
+    public double twistingVinesGrowthModifier = 0.10D;
+    private void twistingVinesSettings() {
+        twistingVinesGrowthModifier = getDouble("blocks.twisting_vines.growth-modifier", twistingVinesGrowthModifier);
+    }
+
+    public double weepingVinesGrowthModifier = 0.10D;
+    private void weepingVinesSettings() {
+        weepingVinesGrowthModifier = getDouble("blocks.weeping_vines.growth-modifier", weepingVinesGrowthModifier);
+    }
+
     public boolean babiesAreRidable = true;
     public boolean untamedTamablesAreRidable = true;
     public boolean useNightVisionWhenRiding = false;
