diff --git a/src/main/java/com/atsuishio/superbwarfare/event/ClientMouseHandler.java b/src/main/java/com/atsuishio/superbwarfare/event/ClientMouseHandler.java index e610aa9a3..78e5deffd 100644 --- a/src/main/java/com/atsuishio/superbwarfare/event/ClientMouseHandler.java +++ b/src/main/java/com/atsuishio/superbwarfare/event/ClientMouseHandler.java @@ -2,8 +2,7 @@ package com.atsuishio.superbwarfare.event; import com.atsuishio.superbwarfare.client.MouseMovementHandler; import com.atsuishio.superbwarfare.config.client.VehicleControlConfig; -import com.atsuishio.superbwarfare.entity.vehicle.Ah6Entity; -import com.atsuishio.superbwarfare.entity.vehicle.Tom6Entity; +import com.atsuishio.superbwarfare.entity.vehicle.base.AirEntity; import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity; import com.atsuishio.superbwarfare.init.ModItems; import com.atsuishio.superbwarfare.init.ModMobEffects; @@ -99,13 +98,11 @@ public class ClientMouseHandler { Minecraft mc = Minecraft.getInstance(); Player player = mc.player; + // 反转鼠标 + if (player == null) return 1; - if (player.getVehicle() instanceof Ah6Entity ah6Entity && ah6Entity.getFirstPassenger() == player) { - return VehicleControlConfig.INVERT_AIRCRAFT_CONTROL.get() ? -1 : 1; - } - - if (player.getVehicle() instanceof Tom6Entity tom6 && tom6.getFirstPassenger() == player) { + if (player.getVehicle() instanceof VehicleEntity vehicle && vehicle instanceof AirEntity && vehicle.getFirstPassenger() == player) { return VehicleControlConfig.INVERT_AIRCRAFT_CONTROL.get() ? -1 : 1; } return 1;