Reset player velocity on select teleports.

Sets the player fall-distance to 0 before performing a player teleport
during "move player" steps. This should cancel out the any fall damage
that may have built up before the teleport was initiated.

Fixes #698

Co-authored-by: Andreas Troelsen <[email protected]>
This commit is contained in:
sepulzera
2022-02-12 16:24:44 +01:00
committed by Andreas Troelsen
co-authored by Andreas Troelsen
parent 9164b125bd
commit be6be4bb98
2 changed files with 3 additions and 0 deletions
@@ -19,11 +19,13 @@ abstract class MovePlayerStep extends PlayerStep {
public void run() {
location = player.getLocation();
player.setFallDistance(0);
player.teleport(destination.get());
}
@Override
public void undo() {
player.setFallDistance(0);
player.teleport(location);
}
}