Files
Purpur/patches/server/0135-Add-twisting-and-weeping-vines-growth-rates.patch
jmp c7b279fe1b Updated Upstream (Paper & Tuinity)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
05af2837c [CI-SKIP] Improved the annotation test output
586966949 abstract custom set tags, add entity tags
c7667378e Added PlayerLoomPatternSelectEvent
00972e80d Reimplement GS4QueryEvent
544c5c278 Re-add coral block tags (#4987)
7d56c8deb Added PlayerLecternPageChangeEvent
c7cdf255b Add BlockFailedDispenseEvent
c8a8d6fbe Added world settings for mobs picking up loot
91eda5bd3 Added ServerResourcesReloadedEvent
be81b4f5c Add a Enchantable MaterialTag
975d18703 Add doors to material tags
d075e748e colorful itemdump
f3ba3dee0 Added WorldGameRuleChangeEvent
086d20118 Guardian beam workaround
b63c890ec Support spawning item stacks
d7d74c552 added height config for bamboo
7878e3bc2 Use setAmount for Recipe Amount
50e70697b Add EntityLoadCrossbowEvent
f344e092c Add Anti-Xray bypass permission
9fd31e675 fix for nerfed slime mobs splitting
4a7962cd1 Zombie API - breaking doors
5650a41f5 Fix interact event not being called in adventure
2c9ed4335 Add PlayerFlowerPotManipulateEvent
1f32290b6 [Auto] Updated Upstream (CraftBukkit)
d87694a20 Redact Velocity forwarding secret properly (#4980)
24a0b0206 [Auto] Updated Upstream (CraftBukkit)
7681042ef [Auto] Updated Upstream (Bukkit/CraftBukkit)
7dea3dba6 [Auto] Updated Upstream (CraftBukkit)
4b3792920 JavaDoc fixes
f13b4727e Allow disabling mob spawner spawn egg transformation
525b50737 Cache burn durations
2c37d1077 Optimized tick ready check
b4000b01a Add API to get the Material of Boats and Minecarts
f1317386d Fix sign lazy initialisation
9f61759d9 Updated Upstream (CraftBukkit/Spigot) (#4972)
aaff430b6 [CI-SKIP] Use GitHub Actions for build status
9f4055d99 Fix harming potion dupe
7bfb781ff Additional Block Material API's
0eaffd008 Micro Optimize DataBits

Tuinity Changes:
9e5cabb6e Port starlight changes
2021-01-04 15:21:27 -08:00

90 lines
4.6 KiB
Diff

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 d4e876fb5dc5f405d5a06982589bf8b4e05b2394..cf6fa370ce968a882311f1403556cea618c7c7fe 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -401,6 +401,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;