Skip to content

Commit 86b716b

Browse files
authored
Fix BlockFadeEvent not being called when fire extinguishes in rain (#12972)
1 parent 4fe66e5 commit 86b716b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

paper-server/patches/sources/net/minecraft/world/level/block/FireBlock.java.patch

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
}
2828

2929
@Override
30-
@@ -141,11 +_,11 @@
30+
@@ -141,18 +_,18 @@
3131

3232
@Override
3333
protected void tick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) {
@@ -41,12 +41,20 @@
4141
}
4242

4343
BlockState blockState = level.getBlockState(pos.below());
44+
boolean isTag = blockState.is(level.dimensionType().infiniburn());
45+
int ageValue = state.getValue(AGE);
46+
if (!isTag && level.isRaining() && this.isNearRain(level, pos) && random.nextFloat() < 0.2F + ageValue * 0.03F) {
47+
- level.removeBlock(pos, false);
48+
+ this.fireExtinguished(level, pos); // CraftBukkit - extinguished by rain
49+
} else {
50+
int min = Math.min(15, ageValue + random.nextInt(3) / 2);
51+
if (ageValue != min) {
4452
@@ -164,26 +_,28 @@
4553
if (!this.isValidFireLocation(level, pos)) {
4654
BlockPos blockPos = pos.below();
4755
if (!level.getBlockState(blockPos).isFaceSturdy(level, blockPos, Direction.UP) || ageValue > 3) {
4856
- level.removeBlock(pos, false);
49-
+ this.fireExtinguished(level, pos); // CraftBukkit - extinguished by rain
57+
+ this.fireExtinguished(level, pos); // CraftBukkit
5058
}
5159

5260
return;

0 commit comments

Comments
 (0)