From 2b97750f60f588c8c4b922be4e5c581721abbc61 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Fri, 3 Dec 2021 18:12:42 -0800 Subject: [PATCH] Fix kelp modifier having reverse effect (#6806) --- ...nfigurable-cactus-bamboo-and-reed-growth-heights.patch | 2 +- ...ix-kelp-modifier-changing-growth-for-other-crops.patch | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/patches/server/0013-Configurable-cactus-bamboo-and-reed-growth-heights.patch b/patches/server/0013-Configurable-cactus-bamboo-and-reed-growth-heights.patch index 0eed5bc2f6..94ed00ecde 100644 --- a/patches/server/0013-Configurable-cactus-bamboo-and-reed-growth-heights.patch +++ b/patches/server/0013-Configurable-cactus-bamboo-and-reed-growth-heights.patch @@ -107,7 +107,7 @@ index f57884fa5f0fbbdbf35c22e692da4f9b6f3f98cc..9b30b359f1559e5f97c3b2a7acffda5b } - if (i < 3) { -+ if (i < world.paperConfig.reedMaxHeight) { // Paper - Configurable growth height ++ if (i < world.paperConfig.reedMaxHeight) { // Paper - Configurable growth height int j = (Integer) state.getValue(SugarCaneBlock.AGE); if (j >= (byte) range(3, ((100.0F / world.spigotConfig.caneModifier) * 15) + 0.5F, 15)) { // Spigot diff --git a/patches/server/0819-Fix-kelp-modifier-changing-growth-for-other-crops.patch b/patches/server/0819-Fix-kelp-modifier-changing-growth-for-other-crops.patch index 5075d1301e..3342b664b5 100644 --- a/patches/server/0819-Fix-kelp-modifier-changing-growth-for-other-crops.patch +++ b/patches/server/0819-Fix-kelp-modifier-changing-growth-for-other-crops.patch @@ -6,6 +6,10 @@ Subject: [PATCH] Fix kelp modifier changing growth for other crops Also add growth modifiers for twisting vines, weeping vines, cave vines, and glow berries +Also fix above-mentioned modifiers from having the reverse effect + +Co-authored-by: Jake Potrebic + 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..effee89e308c9a663938ac5b00a8c6512ce407c2 100644 --- a/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java @@ -30,7 +34,7 @@ index 87dabe3c80b48bff52f2e3dbbaceb37a1a21e431..effee89e308c9a663938ac5b00a8c651 public ItemStack getCloneItemStack(BlockGetter world, BlockPos pos, BlockState state) { return new ItemStack(Items.GLOW_BERRIES); 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..d3dde8ce3f55bda0b7f55491aef3bc9aaad43dd3 100644 +index def3b62feada5cebae4049883fa967b12f6f32b4..8e642ff6d387e05f900acfc3cf6cfa5975bf69e4 100644 --- a/src/main/java/net/minecraft/world/level/block/GrowingPlantHeadBlock.java +++ b/src/main/java/net/minecraft/world/level/block/GrowingPlantHeadBlock.java @@ -40,16 +40,36 @@ public abstract class GrowingPlantHeadBlock extends GrowingPlantBlock implements @@ -51,7 +55,7 @@ index def3b62feada5cebae4049883fa967b12f6f32b4..d3dde8ce3f55bda0b7f55491aef3bc9a + } else { + modifier = 100; // Above cases are exhaustive as of 1.18 + } -+ if ((Integer) state.getValue(GrowingPlantHeadBlock.AGE) < 25 && random.nextDouble() < (100.0D / modifier) * this.growPerTickProbability) { // Spigot ++ if ((Integer) state.getValue(GrowingPlantHeadBlock.AGE) < 25 && random.nextDouble() < (modifier / 100.0D) * this.growPerTickProbability) { // Spigot // Paper - fix growth modifier having the reverse effect + // Paper end BlockPos blockposition1 = pos.relative(this.growthDirection);