Do not spawn fire for visual lightning (#11845)

This commit is contained in:
Bjarne Koll 2024-12-28 14:58:22 +01:00 committed by GitHub
parent 0629524cb2
commit e0abc5f85d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -48,7 +48,12 @@
List<Entity> entities = this.level()
.getEntities(
this,
@@ -172,22 +_,30 @@
@@ -168,26 +_,34 @@
}
private void spawnFire(int extraIgnitions) {
- if (!this.visualOnly && this.level() instanceof ServerLevel serverLevel && serverLevel.getGameRules().getBoolean(GameRules.RULE_DOFIRETICK)) {
+ if (!this.visualOnly && !this.isEffect && this.level() instanceof ServerLevel serverLevel && serverLevel.getGameRules().getBoolean(GameRules.RULE_DOFIRETICK)) { // Paper - prevent any fire if only effect
BlockPos blockPos = this.blockPosition();
BlockState state = BaseFireBlock.getState(this.level(), blockPos);
if (this.level().getBlockState(blockPos).isAir() && state.canSurvive(this.level(), blockPos)) {