do not call BlockGrowEvent on each age grow for cactus

this might be something we do in the future but it should be consistent with the rest too
closes https://github.com/PaperMC/Paper/issues/12662
This commit is contained in:
Lulu13022002
2025-06-14 17:28:55 +02:00
parent dac59acac9
commit 084abd4546

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/block/CactusBlock.java
+++ b/net/minecraft/world/level/block/CactusBlock.java
@@ -58,25 +_,29 @@
@@ -58,18 +_,22 @@
int ageValue = state.getValue(AGE);
while (level.getBlockState(pos.below(i)).is(this)) {
@@ -29,14 +29,6 @@
BlockState blockState = state.setValue(AGE, 0);
level.setBlock(pos, blockState, 260);
level.neighborChanged(blockState, blockPos, this, null, false);
}
if (ageValue < 15) {
- level.setBlock(pos, state.setValue(AGE, ageValue + 1), 260);
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(level, pos, state.setValue(AGE, ageValue + 1), 260); // Paper
}
}
}
@@ -124,7 +_,8 @@
@Override