mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 18:07:43 +01:00
90 lines
4.9 KiB
Diff
90 lines
4.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: BillyGalbreath <blake.galbreath@gmail.com>
|
|
Date: Sat, 19 Jun 2021 15:16:56 -0500
|
|
Subject: [PATCH] Add twisting and weeping vines growth rates
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/GrowingPlantHeadBlock.java b/src/main/java/net/minecraft/world/level/block/GrowingPlantHeadBlock.java
|
|
index 3129c8db32fd79ab5917ffc93ee6dd5db58b1aad..9f1d43ad720750f9d50cc3cfbe1fc9b335cffd0d 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/GrowingPlantHeadBlock.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/GrowingPlantHeadBlock.java
|
|
@@ -39,9 +39,11 @@ public abstract class GrowingPlantHeadBlock extends GrowingPlantBlock implements
|
|
return (Integer) state.getValue(GrowingPlantHeadBlock.AGE) < 25;
|
|
}
|
|
|
|
+ public abstract double getGrowthModifier(ServerLevel world); // Purpur
|
|
+
|
|
@Override
|
|
public void randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random) {
|
|
- if ((Integer) state.getValue(GrowingPlantHeadBlock.AGE) < 25 && random.nextDouble() < (100.0D / world.spigotConfig.kelpModifier) * this.growPerTickProbability) { // Spigot
|
|
+ if (state.getValue(GrowingPlantHeadBlock.AGE) < 25 && random.nextDouble() < (100.0D / this.getGrowthModifier(world)) * this.growPerTickProbability) { // Spigot // Purpur
|
|
BlockPos blockposition1 = pos.relative(this.growthDirection);
|
|
|
|
if (this.canGrowInto(world.getBlockState(blockposition1))) {
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/KelpBlock.java b/src/main/java/net/minecraft/world/level/block/KelpBlock.java
|
|
index 2bd5db55656c9ace95ad5ffdc4a6d07daa0948e4..5f9a8dd6b4f7c9285ffcce8bbe0e334a28cc9699 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/KelpBlock.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/KelpBlock.java
|
|
@@ -64,4 +64,10 @@ public class KelpBlock extends GrowingPlantHeadBlock implements LiquidBlockConta
|
|
public FluidState getFluidState(BlockState state) {
|
|
return Fluids.WATER.getSource(false);
|
|
}
|
|
+
|
|
+ // Purpur start
|
|
+ public double getGrowthModifier(net.minecraft.server.level.ServerLevel world) {
|
|
+ return world.spigotConfig.kelpModifier;
|
|
+ }
|
|
+ // Purpur end
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/TwistingVinesBlock.java b/src/main/java/net/minecraft/world/level/block/TwistingVinesBlock.java
|
|
index bc9813ad36d95d90eafe51afa27857937b6eecc6..c877f7e4e55c63d91ce58c15850e279be3e159a7 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/TwistingVinesBlock.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/TwistingVinesBlock.java
|
|
@@ -27,4 +27,10 @@ public class TwistingVinesBlock extends GrowingPlantHeadBlock {
|
|
protected boolean canGrowInto(BlockState state) {
|
|
return NetherVines.isValidGrowthState(state);
|
|
}
|
|
+
|
|
+ // Purpur start
|
|
+ public double getGrowthModifier(net.minecraft.server.level.ServerLevel world) {
|
|
+ return world.purpurConfig.twistingVinesGrowthModifier;
|
|
+ }
|
|
+ // Purpur end
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/WeepingVinesBlock.java b/src/main/java/net/minecraft/world/level/block/WeepingVinesBlock.java
|
|
index 35b2bad76c45b5a94ba7f2e9c7a8cfeb8c3f498b..d2cb1a7e7ea364cb8e2af4c4e756d8e45bc0ca10 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/WeepingVinesBlock.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/WeepingVinesBlock.java
|
|
@@ -27,4 +27,10 @@ public class WeepingVinesBlock extends GrowingPlantHeadBlock {
|
|
protected boolean canGrowInto(BlockState state) {
|
|
return NetherVines.isValidGrowthState(state);
|
|
}
|
|
+
|
|
+ // Purpur start
|
|
+ public double getGrowthModifier(net.minecraft.server.level.ServerLevel world) {
|
|
+ return world.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 d2d5c5f92e5415f647cbebf16f3121f8230be24e..f1b0d55f425b3028178323e710991fff481e0ba6 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -457,6 +457,16 @@ public class PurpurWorldConfig {
|
|
stonecutterDamage = (float) getDouble("blocks.stonecutter.damage", stonecutterDamage);
|
|
}
|
|
|
|
+ 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;
|