Skip to content

Commit

Permalink
Made it a little easier for pegasi to hover
Browse files Browse the repository at this point in the history
  • Loading branch information
Sollace committed Sep 22, 2022
1 parent 2f5c191 commit 48f3550
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -517,9 +517,11 @@ private void applyThrust(MutableVector velocity) {

Vec3d direction = entity.getRotationVec(1).normalize().multiply(thrustStrength);

velocity.x += direction.x;
velocity.z += direction.z;
velocity.y += (direction.y * 2.45 + Math.abs(direction.y) * 10) * getGravitySignum() - heavyness / 5F;
if (entity.getVelocity().horizontalLength() > 0.1) {
velocity.x += direction.x;
velocity.z += direction.z;
velocity.y += (direction.y * 2.45 + Math.abs(direction.y) * 10) * getGravitySignum() - heavyness / 5F;
}

if (entity.isSneaking()) {
if (!isGravityNegative()) {
Expand All @@ -531,6 +533,11 @@ private void applyThrust(MutableVector velocity) {
} else {
velocity.y -= 0.1 * getGravitySignum();
}

if (velocity.y < 0 && entity.getVelocity().horizontalLength() < 0.1) {
velocity.y *= 0.01;
}

}

private void applyTurbulance(MutableVector velocity) {
Expand Down

0 comments on commit 48f3550

Please sign in to comment.