降低A10水平飞时的转弯速度,修复AGM越飞越慢的bug
This commit is contained in:
parent
8567061d45
commit
c0f92a71e4
2 changed files with 6 additions and 4 deletions
|
@ -244,7 +244,7 @@ public class Agm65Entity extends FastThrowableProjectile implements GeoEntity, D
|
||||||
if (this.tickCount > 8) {
|
if (this.tickCount > 8) {
|
||||||
boolean lostTarget = (VectorTool.calculateAngle(getDeltaMovement(), toVec) > 80);
|
boolean lostTarget = (VectorTool.calculateAngle(getDeltaMovement(), toVec) > 80);
|
||||||
if (!lostTarget) {
|
if (!lostTarget) {
|
||||||
setDeltaMovement(getDeltaMovement().add(toVec.scale(1.4)).scale(0.25).add(entity.getDeltaMovement()));
|
setDeltaMovement(getDeltaMovement().add(toVec.scale(4)).scale(0.65).add(entity.getDeltaMovement().scale(0.2)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -538,9 +538,11 @@ public class A10Entity extends ContainerMobileVehicleEntity implements GeoEntity
|
||||||
this.consumeEnergy((int) (Mth.abs(this.entityData.get(POWER)) * VehicleConfig.A_10_MAX_ENERGY_COST.get()));
|
this.consumeEnergy((int) (Mth.abs(this.entityData.get(POWER)) * VehicleConfig.A_10_MAX_ENERGY_COST.get()));
|
||||||
}
|
}
|
||||||
|
|
||||||
float addY = Mth.clamp(Math.max((this.onGround() ? 0.1f : 0.2f) * (float) getDeltaMovement().length(), 0f) * diffY, -3.5f, 3.5f);
|
float rotSpeed = 1.5f + 2 * Mth.abs(VectorTool.calculateY(getRoll()));
|
||||||
float addX = Mth.clamp(Math.min((float) Math.max(getDeltaMovement().dot(getViewVector(1)) - 0.17, 0.01), 0.7f) * diffX, -3.5f, 3.5f);
|
|
||||||
float addZ = this.entityData.get(DELTA_ROT) - (this.onGround() ? 0 : 0.01f) * diffY * (float) getDeltaMovement().dot(getViewVector(1));
|
float addY = Mth.clamp(Math.max((this.onGround() ? 0.1f : 0.2f) * (float) getDeltaMovement().length(), 0f) * diffY, -rotSpeed, rotSpeed);
|
||||||
|
float addX = Mth.clamp(Math.min((float) Math.max(getDeltaMovement().dot(getViewVector(1)) - 0.17, 0.04), 0.7f) * diffX, -3.5f, 3.5f);
|
||||||
|
float addZ = this.entityData.get(DELTA_ROT) - (this.onGround() ? 0 : 0.004f) * diffY * (float) getDeltaMovement().dot(getViewVector(1));
|
||||||
|
|
||||||
float i = getXRot() / 80;
|
float i = getXRot() / 80;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue