Made it a little easier for pegasi to hover

This commit is contained in:
Sollace 2022-09-22 12:47:02 +02:00
parent 2f5c191bd2
commit 48f355050b

View file

@ -517,9 +517,11 @@ public class PlayerPhysics extends EntityPhysics<PlayerEntity> implements Tickab
Vec3d direction = entity.getRotationVec(1).normalize().multiply(thrustStrength); Vec3d direction = entity.getRotationVec(1).normalize().multiply(thrustStrength);
velocity.x += direction.x; if (entity.getVelocity().horizontalLength() > 0.1) {
velocity.z += direction.z; velocity.x += direction.x;
velocity.y += (direction.y * 2.45 + Math.abs(direction.y) * 10) * getGravitySignum() - heavyness / 5F; velocity.z += direction.z;
velocity.y += (direction.y * 2.45 + Math.abs(direction.y) * 10) * getGravitySignum() - heavyness / 5F;
}
if (entity.isSneaking()) { if (entity.isSneaking()) {
if (!isGravityNegative()) { if (!isGravityNegative()) {
@ -531,6 +533,11 @@ public class PlayerPhysics extends EntityPhysics<PlayerEntity> implements Tickab
} else { } else {
velocity.y -= 0.1 * getGravitySignum(); velocity.y -= 0.1 * getGravitySignum();
} }
if (velocity.y < 0 && entity.getVelocity().horizontalLength() < 0.1) {
velocity.y *= 0.01;
}
} }
private void applyTurbulance(MutableVector velocity) { private void applyTurbulance(MutableVector velocity) {