1
0
forked from Clones/Controlify

🐛 Fix toggle sneak enabling when dismounting or landing after flight

This commit is contained in:
isXander
2023-08-19 20:04:18 +01:00
parent c8e100b2bc
commit fa848e7179

View File

@ -11,6 +11,7 @@ import org.jetbrains.annotations.Nullable;
public class ControllerPlayerMovement extends Input {
private final Controller<?, ?> controller;
private final LocalPlayer player;
private boolean wasFlying, wasPassenger;
public ControllerPlayerMovement(Controller<?, ?> controller, LocalPlayer player) {
this.controller = controller;
@ -69,6 +70,12 @@ public class ControllerPlayerMovement extends Input {
this.shiftKeyDown = !this.shiftKeyDown;
}
}
if ((!player.getAbilities().flying && wasFlying && player.onGround()) || (!player.isPassenger() && wasPassenger)) {
this.shiftKeyDown = false;
}
this.wasFlying = player.getAbilities().flying;
this.wasPassenger = player.isPassenger();
}
public static void updatePlayerInput(@Nullable LocalPlayer player) {