修改RPG实体逻辑

This commit is contained in:
17146 2024-05-21 15:54:35 +08:00
parent c8d4e16338
commit 228524fd46

View file

@ -65,7 +65,7 @@ public class RpgRocketEntity extends ThrowableItemProjectile {
living.level().playSound(null, living.blockPosition(), TargetModSounds.INDICATION.get(), SoundSource.VOICE, 1, 1);
}
}
if (this.getPersistentData().getInt("time") > 0) {
if (this.level() instanceof ServerLevel level) {
level.explode(this, this.getX(), this.getY(), this.getZ(), 4, Level.ExplosionInteraction.NONE);
@ -74,7 +74,6 @@ public class RpgRocketEntity extends ThrowableItemProjectile {
}
this.discard();
}
}
if (entity instanceof LivingEntity) {
entity.invulnerableTime = 0;