diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/HelicopterEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/HelicopterEntity.java index d88e76e1a..7ca4c4ebe 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/HelicopterEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/HelicopterEntity.java @@ -7,6 +7,8 @@ public interface HelicopterEntity extends ArmedVehicleEntity { float getRotY(float tickDelta); float getRotZ(float tickDelta); + float getPower(); + int getDecoy(); } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/WeaponVehicleEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/WeaponVehicleEntity.java index 4081e43bf..eded5a885 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/WeaponVehicleEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/WeaponVehicleEntity.java @@ -41,7 +41,6 @@ public interface WeaponVehicleEntity extends ArmedVehicleEntity { * @param index 武器槽位 * @param type 武器类型 */ - default void setWeaponType(int index, int type) { } } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/weapon/VehicleWeapon.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/weapon/VehicleWeapon.java new file mode 100644 index 000000000..f5028543d --- /dev/null +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/weapon/VehicleWeapon.java @@ -0,0 +1,65 @@ +package com.atsuishio.superbwarfare.entity.vehicle.weapon; + +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; + +public class VehicleWeapon { + + // 武器的图标 + public ResourceLocation icon; + // 武器的名称 + public Component name; + // 武器使用的弹药类型 + public ItemStack ammo; + // 装弹类型 + public AmmoType ammoType = AmmoType.INDIRECT; + // 最大装弹量(对直接读取备弹的武器无效) + public int maxAmmo; + // 当前弹药量(对直接读取备弹的武器无效) + public int currentAmmo; + // 备弹量 + public int backupAmmo; + + public VehicleWeapon icon(ResourceLocation icon) { + this.icon = icon; + return this; + } + + public VehicleWeapon name(Component name) { + this.name = name; + return this; + } + + public VehicleWeapon name(String name) { + this.name = Component.literal(name); + return this; + } + + public VehicleWeapon ammo(ItemStack ammo) { + this.ammo = ammo; + return this; + } + + public VehicleWeapon direct() { + this.ammoType = AmmoType.DIRECT; + this.maxAmmo = 0; + this.currentAmmo = 0; + return this; + } + + /** + * 载具武器的装弹类型 + * INDIRECT - 需要先进行上弹,再发射 + * DIRECT - 直接读取载具存储的弹药 + */ + public enum AmmoType { + INDIRECT, + DIRECT + } + + public VehicleWeapon maxAmmo(int maxAmmo) { + this.maxAmmo = maxAmmo; + return this; + } +}