添加载具武器HUD判断条件
This commit is contained in:
parent
39878127c6
commit
12755bf701
1 changed files with 14 additions and 1 deletions
|
@ -497,6 +497,19 @@ public class VehicleHudOverlay {
|
|||
}
|
||||
}
|
||||
|
||||
private static void renderWeaponInfo(GuiGraphics guiGraphics, Entity vehicle, int w, int h) {
|
||||
private static void renderWeaponInfo(GuiGraphics guiGraphics, Entity entity, int w, int h) {
|
||||
if (!(entity instanceof WeaponVehicleEntity weaponVehicle)) return;
|
||||
if (!(weaponVehicle instanceof VehicleEntity vehicle)) return;
|
||||
|
||||
Player player = Minecraft.getInstance().player;
|
||||
if (player == null) return;
|
||||
|
||||
int index = vehicle.getSeatIndex(player);
|
||||
if (index == -1) return;
|
||||
|
||||
var weapons = weaponVehicle.getAvailableWeapons(index);
|
||||
if (weapons.isEmpty()) return;
|
||||
|
||||
// TODO 实现载具武器HUD
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue