修改RPG实体逻辑

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

View file

@ -65,15 +65,14 @@ public class RpgRocketEntity extends ThrowableItemProjectile {
living.level().playSound(null, living.blockPosition(), TargetModSounds.INDICATION.get(), SoundSource.VOICE, 1, 1); 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);
if (!entity.level().isClientSide()) { if (this.level() instanceof ServerLevel level) {
ParticleTool.spawnMediumExplosionParticles(this.level(), this.position()); level.explode(this, this.getX(), this.getY(), this.getZ(), 4, Level.ExplosionInteraction.NONE);
}
this.discard(); if (!entity.level().isClientSide()) {
ParticleTool.spawnMediumExplosionParticles(this.level(), this.position());
} }
this.discard();
} }
if (entity instanceof LivingEntity) { if (entity instanceof LivingEntity) {