Files
Purpur/patches/server/0122-Add-twisting-and-weeping-vines-growth-rates.patch
William Blake Galbreath 17368d1aa9 Updated Upstream (Paper & Tuinity)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
12dec20 Bump paerweight to 1.1.7
e33ed89 Get short commit ref using a more proper method
7d6147d Remove now unneeded patch due to paperweight 1.1.7
e72fa41 Update task dependency for includeMappings so the new task isn't skipped
0ad5526 Trim whitspace off of git hash (oops)

Tuinity Changes:
e878ba9 Update paper
2bd2849 Bring back fix codec spam patch
2021-06-27 00:42:39 -05:00

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 4c4d059ca5c93ed37bc4473911d265fcec56c396..f63e79ff0df4b4f152f74e55134dc72932e6ae55 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 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 2634fef87b0535e048f51e53a351540ab0c23584..6d28d0f324ff174d8392059d34597da8316f62bc 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -399,6 +399,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() {
@@ -462,6 +467,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;