From d192fc9ef8ed1292b970a8108177b09718f66d33 Mon Sep 17 00:00:00 2001 From: Atsuishio <842960157@qq.com> Date: Wed, 9 Apr 2025 01:09:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=BD=A2=E9=80=82=E5=BA=94=E4=B8=80?= =?UTF-8?q?=E5=AE=9A=E8=A6=81=E5=9C=A8=E5=9C=B0=E9=9D=A2=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../atsuishio/superbwarfare/entity/vehicle/Ah6Entity.java | 2 +- .../superbwarfare/entity/vehicle/SpeedboatEntity.java | 2 +- .../atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java | 5 +---- .../entity/vehicle/base/MobileVehicleEntity.java | 2 ++ 4 files changed, 5 insertions(+), 6 deletions(-) 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); // 点位