删除无用代码

This commit is contained in:
17146 2025-03-11 02:53:36 +08:00
parent bdf2998d3d
commit 8b5aa13ca7

View file

@ -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;