diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Yx100Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Yx100Entity.java index 58e68ad19..76231a033 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Yx100Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Yx100Entity.java @@ -126,7 +126,8 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti .fireTime(0) .durability(60) .velocity(40) - .sound(ModSounds.INTO_MISSILE.get()), + .sound(ModSounds.INTO_MISSILE.get()) + .ammo(ModItems.AP_5_INCHES.get()), // HE new CannonShellWeapon() .hitDamage(100) @@ -136,7 +137,8 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti .fireTime(2) .durability(1) .velocity(25) - .sound(ModSounds.INTO_CANNON.get()), + .sound(ModSounds.INTO_CANNON.get()) + .ammo(ModItems.HE_5_INCHES.get()), }, new VehicleWeapon[]{ // 机枪 @@ -144,7 +146,8 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti .damage(VehicleConfig.SPEEDBOAT_GUN_DAMAGE.get()) .headShot(2) .zoom(false) - .bypassArmorRate(0.4f), + .bypassArmorRate(0.4f) + .ammo(ModItems.HEAVY_AMMO.get()), } }; } 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 index 9ba4cdb3a..4d3612bab 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/weapon/VehicleWeapon.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/weapon/VehicleWeapon.java @@ -3,7 +3,7 @@ package com.atsuishio.superbwarfare.entity.vehicle.weapon; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.sounds.SoundEvent; -import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Item; public abstract class VehicleWeapon { @@ -12,7 +12,7 @@ public abstract class VehicleWeapon { // 武器的名称 public Component name; // 武器使用的弹药类型 - public ItemStack ammo; + public Item ammo; // 装弹类型 public AmmoType ammoType = AmmoType.INDIRECT; // 最大装弹量(对直接读取备弹的武器无效) @@ -39,7 +39,7 @@ public abstract class VehicleWeapon { return this; } - public VehicleWeapon ammo(ItemStack ammo) { + public VehicleWeapon ammo(Item ammo) { this.ammo = ammo; return this; }