From a3b833cafaac3efe3685cdc234f0a3973d3a87ae Mon Sep 17 00:00:00 2001 From: Sollace Date: Sun, 11 Oct 2020 11:15:07 +0200 Subject: [PATCH] Fixed inverted flight controls when flying as a pegasus --- .../minelittlepony/unicopia/entity/player/PlayerPhysics.java | 4 +++- .../unicopia/mixin/client/MixinKeyboardInput.java | 2 +- 2 files changed, 4 insertions(+), 2 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 45a8489e..c1cceca8 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java @@ -253,7 +253,9 @@ public class PlayerPhysics extends EntityPhysics implements Tickable, Moti velocity.y += (direction.y * 2.45 + Math.abs(direction.y) * 10) * getGravitySignum(); if (player.isSneaking()) { - velocity.y += (0.4 - 0.25) * getGravitySignum(); + if (!isGravityNegative()) { + velocity.y += 0.4 - 0.25; + } if (pony.sneakingChanged()) { velocity.y += 0.75 * getGravitySignum(); } diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/client/MixinKeyboardInput.java b/src/main/java/com/minelittlepony/unicopia/mixin/client/MixinKeyboardInput.java index dfede2a1..84196fe7 100644 --- a/src/main/java/com/minelittlepony/unicopia/mixin/client/MixinKeyboardInput.java +++ b/src/main/java/com/minelittlepony/unicopia/mixin/client/MixinKeyboardInput.java @@ -25,7 +25,7 @@ abstract class MixinKeyboardInput extends Input { movementSideways = -movementSideways; - if (player.getMaster().abilities.flying || player.getPhysics().isFlying()) { + if (player.getMaster().abilities.flying && !player.getPhysics().isFlying()) { tmp = jumping; jumping = sneaking; sneaking = tmp;