|
1 | 1 | --- a/net/minecraft/world/level/block/CactusBlock.java |
2 | 2 | +++ b/net/minecraft/world/level/block/CactusBlock.java |
3 | | -@@ -58,18 +_,22 @@ |
| 3 | +@@ -58,18 +_,18 @@ |
4 | 4 | int age = state.getValue(AGE); |
5 | 5 |
|
6 | 6 | while (level.getBlockState(pos.below(height)).is(this)) { |
|
14 | 14 | - double chanceToGrowFlower = height >= 3 ? 0.25 : 0.1; |
15 | 15 | + double chanceToGrowFlower = height >= level.paperConfig().maxGrowthHeight.cactus ? 0.25 : 0.1; // Paper - Configurable cactus/bamboo/reed growth height |
16 | 16 | if (random.nextDouble() <= chanceToGrowFlower) { |
17 | | - level.setBlockAndUpdate(above, Blocks.CACTUS_FLOWER.defaultBlockState()); |
| 17 | +- level.setBlockAndUpdate(above, Blocks.CACTUS_FLOWER.defaultBlockState()); |
| 18 | ++ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(level, above, Blocks.CACTUS_FLOWER.defaultBlockState(), Block.UPDATE_ALL); // Paper - block grow event |
18 | 19 | } |
19 | 20 | - } else if (age == 15 && height < 3) { |
20 | 21 | - level.setBlockAndUpdate(above, this.defaultBlockState()); |
21 | 22 | + } else if (age == 15 && height < level.paperConfig().maxGrowthHeight.cactus) { // Paper - Configurable cactus/bamboo/reed growth height |
22 | | -+ // Paper start |
23 | | -+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(level, above, this.defaultBlockState(), Block.UPDATE_ALL)) { |
24 | | -+ return; |
25 | | -+ } |
26 | | -+ // Paper end |
| 23 | ++ if (!org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(level, above, this.defaultBlockState(), Block.UPDATE_ALL)) return; // Paper - block grow event |
27 | 24 | BlockState aboveBlock = state.setValue(AGE, 0); |
28 | 25 | level.setBlock(pos, aboveBlock, Block.UPDATE_NONE); |
29 | 26 | level.neighborChanged(aboveBlock, above, this, null, false); |
|
0 commit comments