修复XY100吃炮弹的问题,修复BMP2沉底的问题,改版本号

This commit is contained in:
Atsuishio 2025-04-03 01:31:13 +08:00 committed by Light_Quanta
parent 47c9225e3d
commit 682b7c3bc5
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959
3 changed files with 26 additions and 9 deletions

View file

@ -16,7 +16,7 @@ mod_id=superbwarfare
mod_name=Superb Warfare mod_name=Superb Warfare
mod_license=GNU General Public License v3.0 mod_license=GNU General Public License v3.0
mod_description=A Warfare Mod mod_description=A Warfare Mod
mod_version=0.7.0 mod_version=0.7.1
mod_authors=Atsuishio, Roki27, Light_Quanta mod_authors=Atsuishio, Roki27, Light_Quanta
# dependencies # dependencies
jei_version=19.21.0.247 jei_version=19.21.0.247

View file

@ -199,6 +199,10 @@ public class Bmp2Entity extends ContainerMobileVehicleEntity implements GeoEntit
this.handleAmmo(); this.handleAmmo();
} }
double fluidFloat;
fluidFloat = 0.052 * getSubmergedHeight(this);
this.setDeltaMovement(this.getDeltaMovement().add(0.0, fluidFloat, 0.0));
if (this.onGround()) { if (this.onGround()) {
float f0 = 0.54f + 0.25f * Mth.abs(90 - (float) calculateAngle(this.getDeltaMovement(), this.getViewVector(1))) / 90; 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()))); this.setDeltaMovement(this.getDeltaMovement().add(this.getViewVector(1).normalize().scale(0.05 * this.getDeltaMovement().horizontalDistance())));

View file

@ -244,7 +244,16 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti
} }
if (this.level() instanceof ServerLevel) { 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--; reloadCoolDown--;
} }
this.handleAmmo(); this.handleAmmo();
@ -308,14 +317,18 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti
&& (hasCreativeAmmo || hasItem(getWeapon(0).ammo)) && (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); this.entityData.set(LOADED_AP, 1);
} else if (entityData.get(LOADED_AMMO_TYPE) == 1) { if (!hasCreativeAmmo) {
this.entityData.set(LOADED_HE, 1); consumeItem(ModItems.AP_5_INCHES.get(), 1);
}
} }
if (entityData.get(LOADED_AMMO_TYPE) == 1 && entityData.get(LOADED_HE) == 0) {
this.entityData.set(LOADED_HE, 1);
if (!hasCreativeAmmo) { if (!hasCreativeAmmo) {
consumeItem(getWeapon(0).ammo, 1); consumeItem(ModItems.HE_5_INCHES.get(), 1);
}
} }
} }
} }
@ -966,14 +979,14 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti
if (typeIndex != 2) { if (typeIndex != 2) {
if (entityData.get(LOADED_AP) > 0 && typeIndex == 1) { if (entityData.get(LOADED_AP) > 0 && typeIndex == 1) {
if (this.getFirstPassenger() instanceof Player player && !InventoryTool.hasCreativeAmmoBox(player)) { 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); entityData.set(LOADED_AP, 0);
} }
if (entityData.get(LOADED_HE) > 0 && typeIndex == 0) { if (entityData.get(LOADED_HE) > 0 && typeIndex == 0) {
if (this.getFirstPassenger() instanceof Player player && !InventoryTool.hasCreativeAmmoBox(player)) { 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); entityData.set(LOADED_HE, 0);
} }