Closed sepulzera closed 2 years ago
Sets the player fall-distance to zero before performing a player teleport during "move player" steps. This should cancel out any already calculated, added fall-distance that might result in unintentional fall damage.
Fixes #698
Your attempt with resetting the velocity was a good first step, but not sufficient. After a quick google-search, I found some other examples that also resetted the fall-distance. (Like https://www.tabnine.com/web/assistant/code/rs/5c65732f1095a50001513a9a#L1830)
The combination of resetting both the velocity and fall-distance seems to work. No single death after 20 attempts.
Feel free to squash my commit with your previous one. I guess there is no need for keeping both commits/commit-messages.
I've merged this in manually to get things rolling. Thanks Frank!
Sets the player fall-distance to zero before performing a player teleport during "move player" steps. This should cancel out any already calculated, added fall-distance that might result in unintentional fall damage.
Fixes #698
Summary
Problem
Solution
Your attempt with resetting the velocity was a good first step, but not sufficient. After a quick google-search, I found some other examples that also resetted the fall-distance. (Like https://www.tabnine.com/web/assistant/code/rs/5c65732f1095a50001513a9a#L1830)
The combination of resetting both the velocity and fall-distance seems to work. No single death after 20 attempts.
Action
Feel free to squash my commit with your previous one. I guess there is no need for keeping both commits/commit-messages.