Fix BlockFadeEvent not being called when fire extinguishes in rain (#12972)

This commit is contained in:
Jason Penilla
2025-08-13 08:29:06 -07:00
committed by GitHub
parent 4fe66e5800
commit 86b716bc5b
@@ -27,7 +27,7 @@
}
@Override
@@ -141,11 +_,11 @@
@@ -141,18 +_,18 @@
@Override
protected void tick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) {
@@ -41,12 +41,20 @@
}
BlockState blockState = level.getBlockState(pos.below());
boolean isTag = blockState.is(level.dimensionType().infiniburn());
int ageValue = state.getValue(AGE);
if (!isTag && level.isRaining() && this.isNearRain(level, pos) && random.nextFloat() < 0.2F + ageValue * 0.03F) {
- level.removeBlock(pos, false);
+ this.fireExtinguished(level, pos); // CraftBukkit - extinguished by rain
} else {
int min = Math.min(15, ageValue + random.nextInt(3) / 2);
if (ageValue != min) {
@@ -164,26 +_,28 @@
if (!this.isValidFireLocation(level, pos)) {
BlockPos blockPos = pos.below();
if (!level.getBlockState(blockPos).isFaceSturdy(level, blockPos, Direction.UP) || ageValue > 3) {
- level.removeBlock(pos, false);
+ this.fireExtinguished(level, pos); // CraftBukkit - extinguished by rain
+ this.fireExtinguished(level, pos); // CraftBukkit
}
return;