Fix kelp modifier having reverse effect (#6806)

This commit is contained in:
Jake Potrebic 2021-12-03 18:12:42 -08:00
parent 308d560605
commit 3b65d0e14c
2 changed files with 6 additions and 2 deletions

View file

@ -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

View file

@ -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 <jake.m.potrebic@gmail.com>
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);