diff --git a/gradle.properties b/gradle.properties index 39d2400a4..0aa53e4f0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,7 +16,7 @@ mod_id=superbwarfare mod_name=Superb Warfare mod_license=GNU General Public License v3.0 mod_description=A Warfare Mod -mod_version=0.7.0 +mod_version=0.7.1 mod_authors=Atsuishio, Roki27, Light_Quanta # dependencies jei_version=19.21.0.247 diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Bmp2Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Bmp2Entity.java index 43778a9d1..a227c2cbd 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Bmp2Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Bmp2Entity.java @@ -199,6 +199,10 @@ public class Bmp2Entity extends ContainerMobileVehicleEntity implements GeoEntit this.handleAmmo(); } + double fluidFloat; + fluidFloat = 0.052 * getSubmergedHeight(this); + this.setDeltaMovement(this.getDeltaMovement().add(0.0, fluidFloat, 0.0)); + if (this.onGround()) { float f0 = 0.54f + 0.25f * Mth.abs(90 - (float) calculateAngle(this.getDeltaMovement(), this.getViewVector(1))) / 90; this.setDeltaMovement(this.getDeltaMovement().add(this.getViewVector(1).normalize().scale(0.05 * this.getDeltaMovement().horizontalDistance()))); 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 78f2cc500..0d9caa153 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Yx100Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Yx100Entity.java @@ -244,7 +244,16 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti } if (this.level() instanceof ServerLevel) { - if (reloadCoolDown > 0 && this.entityData.get(AMMO) > 0) { + boolean hasCreativeAmmo = false; + + if (this.getFirstPassenger() instanceof Player player) { + hasCreativeAmmo = InventoryTool.hasCreativeAmmoBox(player); + } + + if (reloadCoolDown > 0 && ( + (entityData.get(LOADED_AMMO_TYPE) == 0 && (hasCreativeAmmo || countItem(ModItems.AP_5_INCHES.get()) > 0)) || + (entityData.get(LOADED_AMMO_TYPE) == 1 && (hasCreativeAmmo || countItem(ModItems.HE_5_INCHES.get()) > 0)) + )) { reloadCoolDown--; } this.handleAmmo(); @@ -308,14 +317,18 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti && (hasCreativeAmmo || hasItem(getWeapon(0).ammo)) ) { - if (entityData.get(LOADED_AMMO_TYPE) == 0) { + if (entityData.get(LOADED_AMMO_TYPE) == 0 && entityData.get(LOADED_AP) == 0) { this.entityData.set(LOADED_AP, 1); - } else if (entityData.get(LOADED_AMMO_TYPE) == 1) { - this.entityData.set(LOADED_HE, 1); + if (!hasCreativeAmmo) { + consumeItem(ModItems.AP_5_INCHES.get(), 1); + } } - if (!hasCreativeAmmo) { - consumeItem(getWeapon(0).ammo, 1); + if (entityData.get(LOADED_AMMO_TYPE) == 1 && entityData.get(LOADED_HE) == 0) { + this.entityData.set(LOADED_HE, 1); + if (!hasCreativeAmmo) { + consumeItem(ModItems.HE_5_INCHES.get(), 1); + } } } } @@ -966,14 +979,14 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti if (typeIndex != 2) { if (entityData.get(LOADED_AP) > 0 && typeIndex == 1) { if (this.getFirstPassenger() instanceof Player player && !InventoryTool.hasCreativeAmmoBox(player)) { - this.insertItem(getWeapon(0).ammo, 1); + this.insertItem(ModItems.AP_5_INCHES.get(), 1); } entityData.set(LOADED_AP, 0); } if (entityData.get(LOADED_HE) > 0 && typeIndex == 0) { if (this.getFirstPassenger() instanceof Player player && !InventoryTool.hasCreativeAmmoBox(player)) { - this.insertItem(getWeapon(0).ammo, 1); + this.insertItem(ModItems.HE_5_INCHES.get(), 1); } entityData.set(LOADED_HE, 0); }