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

Prevent players from swimming up waterfalls #43

Open
mworzala opened this issue Sep 15, 2022 · 0 comments · May be fixed by #46
Open

Prevent players from swimming up waterfalls #43

mworzala opened this issue Sep 15, 2022 · 0 comments · May be fixed by #46
Labels

Comments

@mworzala
Copy link
Collaborator

We need to determine if this is possible to do while still maintaining a good user experience. The ask is to prevent players from climbing a waterfall because there is desire to put a cave + parkour challenge there, but swimming up the waterfall defeats the purpose of the parkour.

There were two methods to do this surfaced:

  • Give the player a negative velocity while inside downwards flowing water enough that they cannot swim up
  • Negative velocity + 3 hunger to prevent swimming. This can be accomplished in vanilla with a bubble column.
    • Potentially instead of setting 3 hunger we can prevent swimming some other way
@mworzala mworzala added the spike label Sep 15, 2022
Nixotica added a commit that referenced this issue Sep 23, 2022
[Problem]

Players can swim up waterfalls in areas where we want waterfalls as decoration but also need to restrict access.

[Solution]

Well there is none so far, since we tested and setting a player's hunger to 6 or lower does not work, since it is not implemented in Minestom to stop players from swimming or sprinting in this state.

Also added some comments about potential structuring of handling these types of events when we have a solution.
@GreatWyrm GreatWyrm linked a pull request Sep 24, 2022 that will close this issue
Nixotica added a commit that referenced this issue Sep 27, 2022
[Problem]

Players can swim up waterfalls in areas where we want waterfalls as decoration but also need to restrict access.

[Solution]

Handle player position packets by checking if they are in a bubble column, cancel their ability to sprint (fast swim) if so.

[Testing]

This does work partially, however there must be some discrepancy with how a user's position is tracked when they are swimming already. If you load into the given test environment, and start swimming in the normal water, then move to the bubble column, it will sometimes not cancel your swimming. We could also potentially check within a radius of the 8 blocks around the player if that's the issue.

Another potential issue with this solution is players with high ping could navigate around this by not sending a position packet until they've climbed up the waterfall on client side, and then each packet gets sent and processed but won't return them to their original location.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant