This commit is contained in:
Atsuishio 2025-04-13 02:54:26 +08:00 committed by Light_Quanta
parent da7bb84159
commit b398fa1b23
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959

View file

@ -242,8 +242,9 @@ public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity
Entity passenger4 = getNthEntity(3); Entity passenger4 = getNthEntity(3);
float diffX; float diffX;
float diffY; float diffY;
float diffZ;
if (getHealth() > 0) {
if (passenger == null) { if (passenger == null) {
this.leftInputDown = false; this.leftInputDown = false;
this.rightInputDown = false; this.rightInputDown = false;
@ -323,6 +324,19 @@ public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity
engineStartOver = false; engineStartOver = false;
} }
} }
} else {
this.entityData.set(POWER, Math.max(this.entityData.get(POWER) - 0.0001f, 0.01f));
float destroy = 0;
destroy += 9f;
diffX = 45 - this.getXRot();
diffZ = -20 - this.getRoll();
this.setXRot(this.getXRot() + diffX * 0.1f * this.entityData.get(PROPELLER_ROT));
this.setYRot(this.getYRot() + destroy);
this.setZRot(this.getRoll() + diffZ * 0.1f * this.entityData.get(PROPELLER_ROT));
setDeltaMovement(getDeltaMovement().add(0, -0.06, 0));
}
this.entityData.set(DELTA_ROT, this.entityData.get(DELTA_ROT) * 0.9f); this.entityData.set(DELTA_ROT, this.entityData.get(DELTA_ROT) * 0.9f);
this.entityData.set(PROPELLER_ROT, Mth.lerp(0.18f, this.entityData.get(PROPELLER_ROT), this.entityData.get(POWER))); this.entityData.set(PROPELLER_ROT, Mth.lerp(0.18f, this.entityData.get(PROPELLER_ROT), this.entityData.get(POWER)));
@ -338,10 +352,6 @@ public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity
Vector3f direction = getRightDirection().mul(-Math.sin(this.getRoll() * Mth.DEG_TO_RAD) * this.entityData.get(PROPELLER_ROT)); Vector3f direction = getRightDirection().mul(-Math.sin(this.getRoll() * Mth.DEG_TO_RAD) * this.entityData.get(PROPELLER_ROT));
setDeltaMovement(getDeltaMovement().add(new Vec3(direction.x, direction.y, direction.z).scale(3))); setDeltaMovement(getDeltaMovement().add(new Vec3(direction.x, direction.y, direction.z).scale(3)));
// if (passenger instanceof Player player) {
// player.displayClientMessage(Component.literal(this.getRoll() + ""), true);
// }
Vector3f directionZ = getForwardDirection().mul(-Math.cos((this.getXRot() + 90) * Mth.DEG_TO_RAD) * this.entityData.get(PROPELLER_ROT)); Vector3f directionZ = getForwardDirection().mul(-Math.cos((this.getXRot() + 90) * Mth.DEG_TO_RAD) * this.entityData.get(PROPELLER_ROT));
setDeltaMovement(getDeltaMovement().add(new Vec3(directionZ.x, directionZ.y, directionZ.z).scale(3))); setDeltaMovement(getDeltaMovement().add(new Vec3(directionZ.x, directionZ.y, directionZ.z).scale(3)));
@ -469,6 +479,7 @@ public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity
@Override @Override
public void destroy() { public void destroy() {
if (!onGround()) return;
if (this.crash) { if (this.crash) {
crashPassengers(); crashPassengers();
} else { } else {