From 48f355050be191880abdeb64485541cc5b1a5815 Mon Sep 17 00:00:00 2001 From: Sollace Date: Thu, 22 Sep 2022 12:47:02 +0200 Subject: [PATCH] Made it a little easier for pegasi to hover --- .../unicopia/entity/player/PlayerPhysics.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java index e44f7cce..25b3f0b5 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java @@ -517,9 +517,11 @@ public class PlayerPhysics extends EntityPhysics implements Tickab 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()) { @@ -531,6 +533,11 @@ public class PlayerPhysics extends EntityPhysics implements Tickab } else { velocity.y -= 0.1 * getGravitySignum(); } + + if (velocity.y < 0 && entity.getVelocity().horizontalLength() < 0.1) { + velocity.y *= 0.01; + } + } private void applyTurbulance(MutableVector velocity) {