优化AK动画,禁止实用无人机时操控载具,修复类名错误

This commit is contained in:
Atsuihsio 2024-12-29 15:17:32 +08:00
parent 6b7da3b749
commit 104a3f26e4
4 changed files with 1064 additions and 1026 deletions

View file

@ -389,7 +389,7 @@ public class ClickHandler {
}
private static void handleVehicleMove(int key, int state, Player player) {
if (player.getVehicle() != null && player.getVehicle() instanceof IArmedVehicleEntity && player.getVehicle().getFirstPassenger() == player) {
if (player.getVehicle() != null && player.getVehicle() instanceof MobileVehicleEntity && player.getVehicle().getFirstPassenger() == player) {
var options = Minecraft.getInstance().options;
if (key == options.keyLeft.getKey().getValue()) {

View file

@ -121,7 +121,7 @@ public class VehicleHudOverlay {
private static boolean shouldRenderCrossHair(Player player) {
if (player == null) return false;
return !player.isSpectator()
&& (player.getVehicle() != null && player.getVehicle() instanceof IArmedVehicleEntity);
&& (player.getVehicle() != null && player.getVehicle() instanceof VehicleEntity);
}
private static String getVehicleAmmoType(ItemStack stack, IArmedVehicleEntity iVehicle) {

View file

@ -1,6 +1,7 @@
package com.atsuishio.superbwarfare.network.message;
import com.atsuishio.superbwarfare.entity.MobileVehicleEntity;
import com.atsuishio.superbwarfare.init.ModItems;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.network.NetworkEvent;
@ -53,6 +54,17 @@ public class VehicleMovementMessage {
mobileVehicleEntity.downInputDown = message.clicked;
break;
}
if (player.getMainHandItem().is(ModItems.MONITOR.get())) {
if (player.getMainHandItem().getOrCreateTag().getBoolean("Using") && player.getMainHandItem().getOrCreateTag().getBoolean("Linked")) {
mobileVehicleEntity.leftInputDown = false;
mobileVehicleEntity.rightInputDown = false;
mobileVehicleEntity.forwardInputDown = false;
mobileVehicleEntity.backInputDown = false;
mobileVehicleEntity.upInputDown = false;
mobileVehicleEntity.downInputDown = false;
}
}
}
}
});