PrismarineJS / prismarine-physics

Provide the physics engine for minecraft entities
MIT License
35 stars 39 forks source link

Fix jumping in water #28

Open Karang opened 3 years ago

Karang commented 3 years ago

When holding jump in water, it doesnt give the same result as a player:

Player:

68.13436523348093 <= jump=true
68.23519531160593
68.42513671785593
68.67269531160593
68.95711913973093
69.09969726473093
68.92635742098093
68.48934570223093
68.24789062410593
68.21273437410593
68.32650390535593
68.52108398348093
68.77132812410593
69.01766601473093
68.69515624910593
68.55428710848093
68.58993163973093
68.73885742098093
68.96029296785593
69.04940429598093
68.84237304598093
68.54989257723093
68.49642578035593
68.53548828035593
68.50374999910593
68.46859374910593
68.42806640535593
68.38412109285593
68.33797851473093
68.29037109285593
68.24203124910593
68.19295898348093
68.14364257723093
68.09408203035593
68.04427734285593
68                               <= jump=false

Bot:

68 68                                 <= jump=true
68 68.035
68 68.098
68 68.1834
68 68.28672
68 68.404376
68 68.5335008
68 68.67180064
68 68.777440512
68 68.80256758656
68 68.7487921196288
68 68.61769216203622
68 68.41081420359549
68 68.16967380432358
68 68.01176148490605
68 68
68 68.035
68 68.098
68 68.1834
68 68.28672
68 68.404376
68 68.5335008
68 68.67180064
68 68.777440512
68 68.80256758656
68 68.7487921196288
68 68.61769216203622
68 68.41081420359549
68 68.16967380432358
68 68.01176148490605
68 68                                 <= jump=false
Karang commented 3 years ago

There seem to be a difference between 1.12 and 1.13+ behavior. In 1.13+ it is possible to place a block bellow the player when jumping in water. In 1.12 it is not possible. Current prismarine-physic is based on 1.12, we must also handle newer versions.