修复前进中扔RGO手雷会被自己引爆的bug

This commit is contained in:
Atsuihsio 2024-09-10 02:17:56 +08:00
parent d024765666
commit a826f45ab8

View file

@ -89,6 +89,8 @@ public class RgoGrenadeEntity extends ThrowableItemProjectile implements GeoEnti
EntityHitResult entityResult = (EntityHitResult) result;
Entity entity = entityResult.getEntity();
if (entity == this.getOwner()) return;
if (this.getOwner() instanceof LivingEntity living) {
if (!living.level().isClientSide() && living instanceof ServerPlayer player) {
living.level().playSound(null, living.blockPosition(), ModSounds.INDICATION.get(), SoundSource.VOICE, 1, 1);