Skip to content

Commit

Permalink
Pass growing plant blockstate into onCropsGrowPre for various vine bl…
Browse files Browse the repository at this point in the history
…ocks (#967)
  • Loading branch information
TelepathicGrunt authored May 17, 2024
1 parent 0033435 commit 2bf3073
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@Override
protected void randomTick(BlockState p_221350_, ServerLevel p_221351_, BlockPos p_221352_, RandomSource p_221353_) {
- if (p_221350_.getValue(AGE) < 25 && p_221353_.nextDouble() < this.growPerTickProbability) {
+ if (p_221350_.getValue(AGE) < 25 && net.neoforged.neoforge.common.CommonHooks.onCropsGrowPre(p_221351_, p_221352_.relative(this.growthDirection), p_221351_.getBlockState(p_221352_.relative(this.growthDirection)), p_221353_.nextDouble() < this.growPerTickProbability)) {
+ if (p_221350_.getValue(AGE) < 25 && net.neoforged.neoforge.common.CommonHooks.onCropsGrowPre(p_221351_, p_221352_.relative(this.growthDirection), p_221350_, p_221353_.nextDouble() < this.growPerTickProbability)) {
BlockPos blockpos = p_221352_.relative(this.growthDirection);
if (this.canGrowInto(p_221351_.getBlockState(blockpos))) {
p_221351_.setBlockAndUpdate(blockpos, this.getGrowIntoState(p_221350_, p_221351_.random));
Expand Down

0 comments on commit 2bf3073

Please sign in to comment.