feat: justice for z (#2056)

This commit is contained in:
DeidaraMC 2024-03-27 15:40:10 -04:00 committed by GitHub
parent f034296f28
commit 621f38c6a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -56,8 +56,9 @@ public final class PhysicsUtils {
double gravity = entityFlying ? 0 : aerodynamics.gravity();
double gravityDrag = entityFlying ? 0.6 : aerodynamics.verticalAirResistance();
double x = currentVelocity.x() * drag, z = currentVelocity.z() * drag;
double y = !entityNoGravity ? ((currentVelocity.y() - gravity) * gravityDrag) : currentVelocity.y();
double x = currentVelocity.x() * drag;
double y = entityNoGravity ? currentVelocity.y() : (currentVelocity.y() - gravity) * gravityDrag;
double z = currentVelocity.z() * drag;
return new Vec(Math.abs(x) < Vec.EPSILON ? 0 : x, Math.abs(y) < Vec.EPSILON ? 0 : y, Math.abs(z) < Vec.EPSILON ? 0 : z);
}