调整自动索敌实体的击杀提示发送逻辑

This commit is contained in:
17146 2025-05-23 22:34:03 +08:00 committed by Light_Quanta
parent 79deec6740
commit 4232a03347
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959

View file

@ -9,8 +9,8 @@ import com.atsuishio.superbwarfare.data.gun.GunData;
import com.atsuishio.superbwarfare.data.gun.value.ReloadState; import com.atsuishio.superbwarfare.data.gun.value.ReloadState;
import com.atsuishio.superbwarfare.entity.TargetEntity; import com.atsuishio.superbwarfare.entity.TargetEntity;
import com.atsuishio.superbwarfare.entity.mixin.ICustomKnockback; import com.atsuishio.superbwarfare.entity.mixin.ICustomKnockback;
import com.atsuishio.superbwarfare.entity.vehicle.LaserTowerEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.ArmedVehicleEntity; import com.atsuishio.superbwarfare.entity.vehicle.base.ArmedVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.AutoAimable;
import com.atsuishio.superbwarfare.entity.vehicle.base.ContainerMobileVehicleEntity; import com.atsuishio.superbwarfare.entity.vehicle.base.ContainerMobileVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity; import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import com.atsuishio.superbwarfare.init.*; import com.atsuishio.superbwarfare.init.*;
@ -633,14 +633,14 @@ public class LivingEventHandler {
@SubscribeEvent @SubscribeEvent
public static void onPreSendKillMessage(PreKillEvent.SendKillMessage event) { public static void onPreSendKillMessage(PreKillEvent.SendKillMessage event) {
if (event.getSource().getDirectEntity() instanceof LaserTowerEntity && !(event.getTarget() instanceof Player)) { if (event.getSource().getDirectEntity() instanceof AutoAimable && !(event.getTarget() instanceof Player)) {
event.setCanceled(true); event.setCanceled(true);
} }
} }
@SubscribeEvent @SubscribeEvent
public static void onPreIndicator(PreKillEvent.Indicator event) { public static void onPreIndicator(PreKillEvent.Indicator event) {
if (event.getSource().getDirectEntity() instanceof LaserTowerEntity && !(event.getTarget() instanceof Player)) { if (event.getSource().getDirectEntity() instanceof AutoAimable && !(event.getTarget() instanceof Player)) {
event.setCanceled(true); event.setCanceled(true);
} }
} }