diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Ah6Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Ah6Entity.java index a80bc235a..7d0343fb7 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Ah6Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Ah6Entity.java @@ -196,7 +196,6 @@ public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity } if (this.onGround()) { - this.terrainCompat(2.7f, 2.7f); this.setDeltaMovement(this.getDeltaMovement().multiply(0.8, 1, 0.8)); } else { setZRot(getRoll() * (backInputDown ? 0.9f : 0.99f)); @@ -212,6 +211,7 @@ public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity releaseDecoy(); lowHealthWarning(); + this.terrainCompat(2.7f, 2.7f); this.refreshDimensions(); } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/SpeedboatEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/SpeedboatEntity.java index eb74ff5ea..8c32b6cea 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/SpeedboatEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/SpeedboatEntity.java @@ -142,7 +142,6 @@ public class SpeedboatEntity extends ContainerMobileVehicleEntity implements Geo this.setDeltaMovement(this.getDeltaMovement().add(0.0, fluidFloat, 0.0)); if (this.onGround()) { - this.terrainCompat(2f, 3f); this.setDeltaMovement(this.getDeltaMovement().multiply(0.2, 0.85, 0.2)); } else if (isInWater()) { float f = (float) (0.75f - (0.04f * java.lang.Math.min(getSubmergedHeight(this), this.getBbHeight())) + 0.09f * Mth.abs(90 - (float) calculateAngle(this.getDeltaMovement(), this.getViewVector(1))) / 90); @@ -165,6 +164,7 @@ public class SpeedboatEntity extends ContainerMobileVehicleEntity implements Geo turretAngle(40, 40); lowHealthWarning(); inertiaRotate(2); + this.terrainCompat(2f, 3f); this.refreshDimensions(); } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java index e04f505fe..c262eac35 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java @@ -121,10 +121,6 @@ public class Tom6Entity extends MobileVehicleEntity implements GeoEntity { this.setDeltaMovement(this.getDeltaMovement().add(this.getViewVector(1).scale((forward ? 0.24 : -0.24) * this.getDeltaMovement().length()))); this.setDeltaMovement(this.getDeltaMovement().multiply(f, f, f)); - if (onGround()) { - this.terrainCompat(1f, 1.2f); - } - if (this.isInWater() && this.tickCount % 4 == 0) { this.setDeltaMovement(this.getDeltaMovement().multiply(0.6, 0.6, 0.6)); if (lastTickSpeed > 0.4) { @@ -132,6 +128,7 @@ public class Tom6Entity extends MobileVehicleEntity implements GeoEntity { } } + this.terrainCompat(1f, 1.2f); this.setDeltaMovement(this.getDeltaMovement().add(0.0, 0.01, 0.0)); this.refreshDimensions(); } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/MobileVehicleEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/MobileVehicleEntity.java index 851d7fa01..fbbbfbdc7 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/MobileVehicleEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/MobileVehicleEntity.java @@ -230,6 +230,8 @@ public abstract class MobileVehicleEntity extends EnergyVehicleEntity implements // 地形适应测试 public void terrainCompat(float w, float l) { + if (!onGround()) return; + Matrix4f transform = this.getWheelsTransform(1); // 点位