Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Freeze player mid-air while jumping #46

Closed
thomasrudin opened this issue Sep 3, 2019 · 4 comments
Closed

Freeze player mid-air while jumping #46

thomasrudin opened this issue Sep 3, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@thomasrudin
Copy link
Contributor

Prevents the "falling through the floor" issue after the jump
Related: #32

@thomasrudin thomasrudin added the enhancement New feature or request label Sep 3, 2019
@tuedel
Copy link
Contributor

tuedel commented Sep 16, 2019

Wouldn't that require players to have the fly mode toggled on beforehand?
It might be a better solution to just set gravity to 0 for a moment for the players in question.

@thomasrudin
Copy link
Contributor Author

Wouldn't that require players to have the fly mode toggled on beforehand?
It might be a better solution to just set gravity to 0 for a moment for the players in question.

You are right 😞 ...
Currently there is the hacky solution which moves the player +1 node in y-direction (62520e1#diff-7e84b1b4ef436fa578e06f0e58252390R110) but thats just annoying on multiple jumps...

Setting the gravity to 0 during the jump would not solve the problem: the jump is executed in a single serverstep, so no information is changed/sent to the client...

Another solution would be to move the player to the jumped position in the next serverstep, i have to experiment with that...

@technix
Copy link

technix commented Dec 14, 2019

On our server, we use this solution:
https://gist.github.com/technix/3862c9eeb54cfb822d71fda5d091b269

  • temporary disable gravity and player movement before jump
  • re-enable gravity and player movement 3 sec after jump
  • sometimes player still falls through, so place player into right position 3 sec after jump
  • disallow jump if gravity is not enabled yet - i.e. immediately after jump

The only downside is that player is not allowed to move immediately after jump and have to wait 3 sec until quantum spacetime continuum settles down :)

@thomasrudin thomasrudin changed the title Grant temporary fly priv during jump Freeze player mid-air while jumping Jan 31, 2020
@thomasrudin
Copy link
Contributor Author

thomasrudin commented Jan 31, 2020

New concept/proposal:

  • register new invisible climable = 1 node
  • fill target area with "buffer" node
  • Use player:send_mapblock() to send "buffered" target area to player
  • Execute jump (deferred?)

OR

  • re-teleport player after a timeout (1 or 2 seconds) to same position again

EDIT: nevermind, used your idea @technix, thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants