From 64d6b4f76a76c93065000ac00862dd212f3f101c Mon Sep 17 00:00:00 2001 From: LexManos Date: Fri, 10 May 2024 10:39:13 -0700 Subject: [PATCH] Fix Melons/Pumpkins not growing correctly. --- .../world/level/block/StemBlock.java.patch | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/patches/minecraft/net/minecraft/world/level/block/StemBlock.java.patch b/patches/minecraft/net/minecraft/world/level/block/StemBlock.java.patch index 4cd858d1bc..951631520f 100644 --- a/patches/minecraft/net/minecraft/world/level/block/StemBlock.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/StemBlock.java.patch @@ -13,15 +13,14 @@ int i = p_222538_.getValue(AGE); if (i < 7) { p_222538_ = p_222538_.setValue(AGE, Integer.valueOf(i + 1)); -@@ -90,7 +_,7 @@ - Direction direction = Direction.Plane.HORIZONTAL.getRandomDirection(p_222541_); - BlockPos blockpos = p_222540_.relative(direction); - BlockState blockstate = p_222539_.getBlockState(blockpos.below()); -- if (p_222539_.getBlockState(blockpos).isAir() && (blockstate.is(Blocks.FARMLAND) || blockstate.is(BlockTags.DIRT))) { -+ if (p_222539_.getBlockState(blockpos).isAir() && blockstate.canSustainPlant(p_222539_, blockpos.below(), Direction.UP, this)) { - Registry registry = p_222539_.registryAccess().registryOrThrow(Registries.BLOCK); - Optional optional = registry.getOptional(this.fruit); - Optional optional1 = registry.getOptional(this.attachedStem); +@@ -100,6 +_,7 @@ + } + } + } ++ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_222539_, p_222540_, p_222538_); + } + } + } @@ -132,5 +_,10 @@ @Override protected void createBlockStateDefinition(StateDefinition.Builder p_57040_) {