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/world/level/block/BlockGrowingTop.java b/src/main/java/net/minecraft/world/level/block/BlockGrowingTop.java
index 84bd1fa9edb59b8515685a47783ed5e6abe7333f..546c7877647bac41753a600bd25c630a0510be56 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockGrowingTop.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockGrowingTop.java
@@ -38,9 +38,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/world/level/block/BlockKelp.java b/src/main/java/net/minecraft/world/level/block/BlockKelp.java
index 424b9b3c1263910eb6113f19efc14607dd2bf638..27f1cbe8786d7c37d62193a21baf0a2bdc6f0294 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockKelp.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockKelp.java
@@ -4,6 +4,7 @@ import java.util.Random;
 import javax.annotation.Nullable;
 import net.minecraft.core.BlockPosition;
 import net.minecraft.core.EnumDirection;
+import net.minecraft.server.level.WorldServer;
 import net.minecraft.tags.Tag;
 import net.minecraft.tags.TagsFluid;
 import net.minecraft.world.item.context.BlockActionContext;
@@ -66,4 +67,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/world/level/block/BlockTwistingVines.java b/src/main/java/net/minecraft/world/level/block/BlockTwistingVines.java
index 2cfa96f144391e664207ac8e8bdd3f11bfed4dff..3a8d08a1ee8f066cea36e6acff492e5af62993c5 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockTwistingVines.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockTwistingVines.java
@@ -2,6 +2,7 @@ package net.minecraft.world.level.block;
 
 import java.util.Random;
 import net.minecraft.core.EnumDirection;
+import net.minecraft.server.level.WorldServer;
 import net.minecraft.world.level.block.state.BlockBase;
 import net.minecraft.world.level.block.state.IBlockData;
 import net.minecraft.world.phys.shapes.VoxelShape;
@@ -28,4 +29,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/world/level/block/BlockWeepingVines.java b/src/main/java/net/minecraft/world/level/block/BlockWeepingVines.java
index 2552631084926c2fad40b3f21ae479c0e1cfdb77..198bd8857571872ed3f7437529c330dceeb825db 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockWeepingVines.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockWeepingVines.java
@@ -2,6 +2,7 @@ package net.minecraft.world.level.block;
 
 import java.util.Random;
 import net.minecraft.core.EnumDirection;
+import net.minecraft.server.level.WorldServer;
 import net.minecraft.world.level.block.state.BlockBase;
 import net.minecraft.world.level.block.state.IBlockData;
 import net.minecraft.world.phys.shapes.VoxelShape;
@@ -28,4 +29,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 9298bfbf64aae5bcdd758e3cddba14f9e6e2ba4e..6894d0aa124b45bf6eb79d417026b85fc342f25a 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -431,6 +431,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;
