修复火箭实体爆炸逻辑

This commit is contained in:
17146 2024-05-20 17:45:44 +08:00
parent fb2316effa
commit 6541e94efa

View file

@ -133,11 +133,9 @@ public class RpgRocketEntity extends ThrowableItemProjectile {
public void onHitBlock(BlockHitResult blockHitResult) { public void onHitBlock(BlockHitResult blockHitResult) {
super.onHitBlock(blockHitResult); super.onHitBlock(blockHitResult);
if (this.getPersistentData().getInt("time") > 0) { if (this.level() instanceof ServerLevel level) {
if (this.level() instanceof ServerLevel level) { level.explode(this, this.getX(), this.getY(), this.getZ(), 6, Level.ExplosionInteraction.NONE);
level.explode(this, this.getX(), this.getY(), this.getZ(), 6, Level.ExplosionInteraction.NONE); ParticleTool.spawnMediumExplosionParticles(this.level(), this.position());
ParticleTool.spawnMediumExplosionParticles(this.level(), this.position());
}
} }
this.discard(); this.discard();