From 3b65d0e14cbb5f27c7e8df0371303518dfc2cc1f 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) --- ...Configurable-cactus-bamboo-and-reed-growth-heights.patch | 2 +- .../Fix-kelp-modifier-changing-growth-for-other-crops.patch | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/patches/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch b/patches/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch index 6322bafee3..692bc28e37 100644 --- a/patches/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch +++ b/patches/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch @@ -107,7 +107,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } - 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/Fix-kelp-modifier-changing-growth-for-other-crops.patch b/patches/server/Fix-kelp-modifier-changing-growth-for-other-crops.patch index e7ffdc05c2..21cc54c784 100644 --- a/patches/server/Fix-kelp-modifier-changing-growth-for-other-crops.patch +++ b/patches/server/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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java @@ -51,7 +55,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } 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);