diff --git a/patches/server/Call-BlockGrowEvent-for-the-pitcher-crop.patch b/patches/server/Call-BlockGrowEvent-for-the-pitcher-crop.patch new file mode 100644 index 0000000000..2c92410664 --- /dev/null +++ b/patches/server/Call-BlockGrowEvent-for-the-pitcher-crop.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> +Date: Fri, 9 Jun 2023 13:04:42 +0200 +Subject: [PATCH] Call BlockGrowEvent for the pitcher crop + + +diff --git a/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java b/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java ++++ b/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java +@@ -0,0 +0,0 @@ public class PitcherCropBlock extends DoublePlantBlock implements BonemealableBl + private void grow(ServerLevel world, BlockState state, BlockPos pos, int amount) { + int i = Math.min(state.getValue(AGE) + amount, 4); + if (this.canGrow(world, pos, state, i)) { +- world.setBlock(pos, state.setValue(AGE, Integer.valueOf(i)), 2); ++ if (!org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, pos, state.setValue(AGE, Integer.valueOf(i)), 2)) return; // Paper + if (i >= 3) { + BlockPos blockPos = pos.above(); + world.setBlock(blockPos, copyWaterloggedFrom(world, pos, this.defaultBlockState().setValue(AGE, Integer.valueOf(i)).setValue(HALF, DoubleBlockHalf.UPPER)), 3); diff --git a/patches/server/Fix-Spigot-growth-modifiers.patch b/patches/server/Fix-Spigot-growth-modifiers.patch index bb4a249026..94e1b68828 100644 --- a/patches/server/Fix-Spigot-growth-modifiers.patch +++ b/patches/server/Fix-Spigot-growth-modifiers.patch @@ -4,8 +4,8 @@ Date: Fri, 3 Dec 2021 17:09:24 -0800 Subject: [PATCH] Fix Spigot growth modifiers Fixes kelp modifier changing growth for other crops -Also add growth modifiers for glow berries, mangrove propagules -and torchflower crops +Also add growth modifiers for glow berries, mangrove propagules, +torchflower crops and pitcher plant crops Also fix above-mentioned modifiers from having the reverse effect Co-authored-by: Jake Potrebic @@ -87,6 +87,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.advanceTree(world, pos, state, random); } +diff --git a/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java b/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java ++++ b/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java +@@ -0,0 +0,0 @@ public class PitcherCropBlock extends DoublePlantBlock implements BonemealableBl + @Override + public void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) { + float f = CropBlock.getGrowthSpeed(this, world, pos); +- boolean bl = random.nextInt((int)(25.0F / f) + 1) == 0; ++ boolean bl = random.nextFloat() < (world.spigotConfig.pitcherPlantModifier / (100.0F * (Math.floor(25.0F / f) + 1))); // Paper + if (bl) { + this.grow(world, state, pos, 1); + } diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java @@ -104,6 +117,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public int weepingVinesModifier; public int caveVinesModifier; + public int glowBerryModifier; // Paper ++ public int pitcherPlantModifier; // Paper private int getAndValidateGrowth(String crop) { int modifier = this.getInt( "growth." + crop.toLowerCase(java.util.Locale.ENGLISH) + "-modifier", 100 ); @@ -120,6 +134,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.weepingVinesModifier = this.getAndValidateGrowth( "WeepingVines" ); this.caveVinesModifier = this.getAndValidateGrowth( "CaveVines" ); + this.glowBerryModifier = this.getAndValidateGrowth("GlowBerry"); // Paper ++ this.pitcherPlantModifier = this.getAndValidateGrowth("PitcherPlant"); // Paper } public double itemMerge;