防空炮弹不会击落防空炮弹

This commit is contained in:
Atsuishio 2025-05-02 17:07:26 +08:00 committed by Light_Quanta
parent fc8832ae8d
commit 65c5151c4b
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959

View file

@ -104,8 +104,10 @@ public class SmallCannonShellEntity extends FastThrowableProjectile implements G
@Override @Override
protected void onHitEntity(@NotNull EntityHitResult result) { protected void onHitEntity(@NotNull EntityHitResult result) {
Entity entity = result.getEntity();
if (result.getEntity() instanceof SmallCannonShellEntity) return;
if (this.level() instanceof ServerLevel) { if (this.level() instanceof ServerLevel) {
Entity entity = result.getEntity();
if (this.getOwner() instanceof LivingEntity living) { if (this.getOwner() instanceof LivingEntity living) {
if (!living.level().isClientSide() && living instanceof ServerPlayer player) { if (!living.level().isClientSide() && living instanceof ServerPlayer player) {
living.level().playSound(null, living.blockPosition(), ModSounds.INDICATION.get(), SoundSource.VOICE, 1, 1); living.level().playSound(null, living.blockPosition(), ModSounds.INDICATION.get(), SoundSource.VOICE, 1, 1);