|
9 | 9 | return;
|
10 | 10 | }
|
11 | 11 | }
|
12 |
| -@@ -66,17 +_,20 @@ |
| 12 | +@@ -66,17 +_,21 @@ |
13 | 13 | if (ageValue == 8 && this.canSurvive(this.defaultBlockState(), level, pos.above())) {
|
14 | 14 | double d = i >= 3 ? 0.25 : 0.1;
|
15 | 15 | if (random.nextDouble() <= d) {
|
16 | 16 | - level.setBlockAndUpdate(blockPos, Blocks.CACTUS_FLOWER.defaultBlockState());
|
17 |
| -+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(level, pos, Blocks.CACTUS_FLOWER.defaultBlockState(), 3); |
18 |
| - } |
| 17 | +- } |
19 | 18 | - } else if (ageValue == 15 && i < 3) {
|
20 | 19 | - level.setBlockAndUpdate(blockPos, this.defaultBlockState());
|
| 20 | ++ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(level, blockPos, Blocks.CACTUS_FLOWER.defaultBlockState(), 3); |
| 21 | ++ } |
21 | 22 | + } else if (ageValue == 15 && i < level.paperConfig().maxGrowthHeight.cactus) { // Paper - Configurable cactus/bamboo/reed growth height
|
22 |
| - BlockState blockState = state.setValue(AGE, 0); |
23 |
| -- level.setBlock(pos, blockState, 260); |
24 | 23 | + // Paper start
|
25 |
| -+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(level, pos, blockState, 260)) { |
| 24 | ++ if (!org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(level, blockPos, this.defaultBlockState(), 3)) { |
26 | 25 | + return;
|
27 | 26 | + }
|
28 | 27 | + // Paper end
|
| 28 | + BlockState blockState = state.setValue(AGE, 0); |
| 29 | + level.setBlock(pos, blockState, 260); |
29 | 30 | level.neighborChanged(blockState, blockPos, this, null, false);
|
30 | 31 | }
|
31 | 32 |
|
|
0 commit comments