Skip to content

Conversation

@y5nw
Copy link
Contributor

@y5nw y5nw commented Dec 25, 2025

Fixes #16780 by implementing the alternative solution.

This only affects the situation where fly mode is enabled but the player does not have the fly privilege. Sneak toggling remains disabled if the player has fly privilege and enables fly mode.

This PR is Ready for Review.

How to test

  • Revoke fly mode of the player.
  • Enable fly mode.
  • Enable sneak toggling.
  • Enable sneaking.
  • Oberserve that the player is sneaking.
  • Grant fly mode to the player.
  • Observe that the player is no longer sneaking.

@y5nw y5nw added Trivial The change is a trivial bug fix, documentation or maintenance change, as per the Git Guidelines Bugfix 🐛 PRs that fix a bug @ Client / Controls / Input labels Dec 25, 2025
@Xeno333
Copy link
Contributor

Xeno333 commented Dec 25, 2025

Flight can exist without fly priv. And the setting doesn't correspond to the priv.

@y5nw
Copy link
Contributor Author

y5nw commented Dec 25, 2025

Flight can exist without fly priv.

I am not aware of this. Do you have an example where free_move can be used by a player without the fly privilege?

Flight-related behavior that is specific to mods (e.g. controlling aircrafts) is IMO out of scope for consideration here as the same could also be said about other mods that use the sneak key for other purposes than sneaking.

And the setting doesn't correspond to the priv.

Elaborate?

@Xeno333
Copy link
Contributor

Xeno333 commented Dec 25, 2025

Most common is modded clients

@y5nw
Copy link
Contributor Author

y5nw commented Dec 26, 2025

Most common is modded clients

How are modded clients relevant here? For what reason would the authors of such clients be unable to revert this change themselves?

@SmallJoker
Copy link
Member

SmallJoker commented Dec 26, 2025

Couldn't we simply set free_move = false if the player lacks such privilege? Or would that be game-breaking where mods/games only briefly revoke privileges (e.g. within one or two server steps)?

EDIT: I am asking because this kind of check does exist in multiple places, and it seems error-prone when it's necessary to always check both at once.

@y5nw
Copy link
Contributor Author

y5nw commented Dec 26, 2025

EDIT: I am asking because this kind of check does exist in multiple places, and it seems error-prone when it's necessary to always check both at once.

Alternatively one can write a helper function to check whether flying is enabled by the client and allowed by the server, but IMO that belongs to a different PR.

@4Arcturus
Copy link

I just tested this, and seems to work as intended. I will close my issue tomorrow.

@y5nw
Copy link
Contributor Author

y5nw commented Dec 27, 2025

I will close my issue tomorrow.

You do not need to do that manually.

  • This PR is not merged yet.
  • The linked issue will be automatically closed when this PR is merged.

@4Arcturus
Copy link

I see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugfix 🐛 PRs that fix a bug @ Client / Controls / Input Trivial The change is a trivial bug fix, documentation or maintenance change, as per the Git Guidelines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow toggle sneaking in fly mode

4 participants