地形适应一定要在地面上
This commit is contained in:
parent
770a150892
commit
d192fc9ef8
4 changed files with 5 additions and 6 deletions
|
@ -196,7 +196,6 @@ public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.onGround()) {
|
if (this.onGround()) {
|
||||||
this.terrainCompat(2.7f, 2.7f);
|
|
||||||
this.setDeltaMovement(this.getDeltaMovement().multiply(0.8, 1, 0.8));
|
this.setDeltaMovement(this.getDeltaMovement().multiply(0.8, 1, 0.8));
|
||||||
} else {
|
} else {
|
||||||
setZRot(getRoll() * (backInputDown ? 0.9f : 0.99f));
|
setZRot(getRoll() * (backInputDown ? 0.9f : 0.99f));
|
||||||
|
@ -212,6 +211,7 @@ public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity
|
||||||
|
|
||||||
releaseDecoy();
|
releaseDecoy();
|
||||||
lowHealthWarning();
|
lowHealthWarning();
|
||||||
|
this.terrainCompat(2.7f, 2.7f);
|
||||||
|
|
||||||
this.refreshDimensions();
|
this.refreshDimensions();
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,7 +142,6 @@ public class SpeedboatEntity extends ContainerMobileVehicleEntity implements Geo
|
||||||
this.setDeltaMovement(this.getDeltaMovement().add(0.0, fluidFloat, 0.0));
|
this.setDeltaMovement(this.getDeltaMovement().add(0.0, fluidFloat, 0.0));
|
||||||
|
|
||||||
if (this.onGround()) {
|
if (this.onGround()) {
|
||||||
this.terrainCompat(2f, 3f);
|
|
||||||
this.setDeltaMovement(this.getDeltaMovement().multiply(0.2, 0.85, 0.2));
|
this.setDeltaMovement(this.getDeltaMovement().multiply(0.2, 0.85, 0.2));
|
||||||
} else if (isInWater()) {
|
} 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);
|
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);
|
turretAngle(40, 40);
|
||||||
lowHealthWarning();
|
lowHealthWarning();
|
||||||
inertiaRotate(2);
|
inertiaRotate(2);
|
||||||
|
this.terrainCompat(2f, 3f);
|
||||||
|
|
||||||
this.refreshDimensions();
|
this.refreshDimensions();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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().add(this.getViewVector(1).scale((forward ? 0.24 : -0.24) * this.getDeltaMovement().length())));
|
||||||
this.setDeltaMovement(this.getDeltaMovement().multiply(f, f, f));
|
this.setDeltaMovement(this.getDeltaMovement().multiply(f, f, f));
|
||||||
|
|
||||||
if (onGround()) {
|
|
||||||
this.terrainCompat(1f, 1.2f);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.isInWater() && this.tickCount % 4 == 0) {
|
if (this.isInWater() && this.tickCount % 4 == 0) {
|
||||||
this.setDeltaMovement(this.getDeltaMovement().multiply(0.6, 0.6, 0.6));
|
this.setDeltaMovement(this.getDeltaMovement().multiply(0.6, 0.6, 0.6));
|
||||||
if (lastTickSpeed > 0.4) {
|
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.setDeltaMovement(this.getDeltaMovement().add(0.0, 0.01, 0.0));
|
||||||
this.refreshDimensions();
|
this.refreshDimensions();
|
||||||
}
|
}
|
||||||
|
|
|
@ -230,6 +230,8 @@ public abstract class MobileVehicleEntity extends EnergyVehicleEntity implements
|
||||||
|
|
||||||
// 地形适应测试
|
// 地形适应测试
|
||||||
public void terrainCompat(float w, float l) {
|
public void terrainCompat(float w, float l) {
|
||||||
|
if (!onGround()) return;
|
||||||
|
|
||||||
Matrix4f transform = this.getWheelsTransform(1);
|
Matrix4f transform = this.getWheelsTransform(1);
|
||||||
|
|
||||||
// 点位
|
// 点位
|
||||||
|
|
Loading…
Add table
Reference in a new issue