mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
117 lines
6.2 KiB
Diff
117 lines
6.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <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/CaveVinesBlock.java b/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java
|
|
index 87dabe3c80b48bff52f2e3dbbaceb37a1a21e431..966fd0ecff8a0fa8a08edaeaad899ff13f8106f3 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java
|
|
@@ -80,4 +80,10 @@ public class CaveVinesBlock extends GrowingPlantHeadBlock implements Bonemealabl
|
|
public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) {
|
|
world.setBlock(pos, (BlockState) state.setValue(CaveVinesBlock.BERRIES, true), 2);
|
|
}
|
|
+
|
|
+ // Purpur start
|
|
+ public double getGrowthModifier(net.minecraft.server.level.ServerLevel world) {
|
|
+ return world.purpurConfig.caveVinesGrowthModifier;
|
|
+ }
|
|
+ // Purpur end
|
|
}
|
|
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 def3b62feada5cebae4049883fa967b12f6f32b4..c4ba28ea8f73092c85b08bbec0d9197f2983ce23 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/GrowingPlantHeadBlock.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/GrowingPlantHeadBlock.java
|
|
@@ -38,9 +38,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 9c3f2a19e7d4b01c21a82c69c202350d730ff7e7..d157860e20f7faa2a4e7f50e6fcad598e7794394 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -402,6 +402,11 @@ public class PurpurWorldConfig {
|
|
}
|
|
}
|
|
|
|
+ public double caveVinesGrowthModifier = 0.10D;
|
|
+ private void caveVinesSettings() {
|
|
+ caveVinesGrowthModifier = getDouble("blocks.cave_vines.growth-modifier", caveVinesGrowthModifier);
|
|
+ }
|
|
+
|
|
public boolean dispenserApplyCursedArmor = true;
|
|
public boolean dispenserPlaceAnvils = false;
|
|
private void dispenserSettings() {
|
|
@@ -478,6 +483,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;
|