From 8b5aa13ca77573d6702d7d06f85dd3b98c9c08fb Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Tue, 11 Mar 2025 02:53:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/overlay/VehicleHudOverlay.java | 71 ++----------------- 1 file changed, 4 insertions(+), 67 deletions(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/client/overlay/VehicleHudOverlay.java b/src/main/java/com/atsuishio/superbwarfare/client/overlay/VehicleHudOverlay.java index 51ba1f473..c86ebca73 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/overlay/VehicleHudOverlay.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/overlay/VehicleHudOverlay.java @@ -3,7 +3,10 @@ package com.atsuishio.superbwarfare.client.overlay; import com.atsuishio.superbwarfare.ModUtils; import com.atsuishio.superbwarfare.client.RenderHelper; import com.atsuishio.superbwarfare.config.client.DisplayConfig; -import com.atsuishio.superbwarfare.entity.vehicle.*; +import com.atsuishio.superbwarfare.entity.vehicle.Bmp2Entity; +import com.atsuishio.superbwarfare.entity.vehicle.Lav150Entity; +import com.atsuishio.superbwarfare.entity.vehicle.SpeedboatEntity; +import com.atsuishio.superbwarfare.entity.vehicle.Yx100Entity; import com.atsuishio.superbwarfare.entity.vehicle.base.*; import com.atsuishio.superbwarfare.entity.vehicle.weapon.HeliRocketWeapon; import com.atsuishio.superbwarfare.entity.vehicle.weapon.LaserWeapon; @@ -110,51 +113,6 @@ public class VehicleHudOverlay { renderWeaponInfo(guiGraphics, vehicle, w, h); poseStack.popPose(); - -// if (vehicle instanceof ArmedVehicleEntity iVehicle && iVehicle.getAmmoCount(player) != -1 && iVehicle.isDriver(player)) { -// boolean iCharge = iVehicle instanceof EnergyVehicleEntity; -// -// // 渲染当前弹药量 -// poseStack.pushPose(); -// poseStack.scale(1.5f, 1.5f, 1f); -// float v = h / 1.5f - (iCharge ? 42 : 29) / 1.5f; -// -// if (InventoryTool.hasCreativeAmmoBox(player) -// && !(iVehicle instanceof CannonEntity -// || (iVehicle instanceof Ah6Entity ah6Entity && ah6Entity.getWeaponIndex(0) == 1)) -// ) { -// event.getGuiGraphics().drawString( -// Minecraft.getInstance().font, -// "∞", -// w / 1.5f - 41 / 1.5f, -// v, -// 0xFFFFFF, -// true -// ); -// } else { -// event.getGuiGraphics().drawString( -// Minecraft.getInstance().font, -// iVehicle.getAmmoCount(player) + "", -// w / 1.5f - 41 / 1.5f, -// v, -// 0xFFFFFF, -// true -// ); -// } -// -// poseStack.popPose(); -// ItemStack stack = player.getMainHandItem(); -// -// // 渲染弹药类型 -// event.getGuiGraphics().drawString( -// Minecraft.getInstance().font, -// getVehicleAmmoType(stack, iVehicle), -// w - 90, -// h - (iCharge ? 38 : 26), -// 0xFFFFFF, -// true -// ); -// } } private static boolean shouldRenderHud(Player player) { @@ -162,27 +120,6 @@ public class VehicleHudOverlay { return !player.isSpectator() && (player.getVehicle() != null && player.getVehicle() instanceof VehicleEntity); } - private static String getVehicleAmmoType(ItemStack stack, ArmedVehicleEntity iVehicle) { - if (stack.getItem() == ModItems.AP_5_INCHES.get() && iVehicle instanceof CannonEntity) { - return Component.translatable("des.superbwarfare.tips.ammo_type.ap").getString(); - } - if (stack.getItem() == ModItems.HE_5_INCHES.get() && iVehicle instanceof CannonEntity) { - return Component.translatable("des.superbwarfare.tips.ammo_type.he").getString(); - } - if (iVehicle instanceof SpeedboatEntity) { - return Component.translatable("des.superbwarfare.tips.ammo_type.cal50").getString(); - } - if (iVehicle instanceof Ah6Entity ah6Entity) { - if (ah6Entity.getWeaponIndex(0) == 0) { - return Component.translatable("des.superbwarfare.tips.ammo_type.20mm_cannon").getString(); - } else { - return Component.translatable("des.superbwarfare.tips.ammo_type.rocket").getString(); - } - - } - return ""; - } - private static int getArmorPlateCompatHeight(Player player) { ItemStack stack = player.getItemBySlot(EquipmentSlot.CHEST); if (stack == ItemStack.EMPTY) return 0;