This PR enhances the velocity calculation by avoiding the use of Entity#getDeltaMovement, which was not returning the expected values.
Changes:
Velocity is now calculated by storing the position from the previous update call and determining the difference between the current and previous positions.
The velocity is set to zero only after at least one tick without a change in the player's position. This is required due to the update method frequently being called faster than the player's position updating, which leads to a velocity of zero for that tick.
Fixes #97
This PR enhances the velocity calculation by avoiding the use of
Entity#getDeltaMovement
, which was not returning the expected values.Changes:
update
call and determining the difference between the current and previous positions.update
method frequently being called faster than the player's position updating, which leads to a velocity of zero for that tick.https://github.com/TreyRuffy/BetterF3/assets/66334318/cc5e56aa-e902-4815-ac43-9bd1d9e17a4e