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

Separation of block interact disabling vs actual sneak/crouch #6548

Open
dktapps opened this issue Dec 1, 2024 · 0 comments
Open

Separation of block interact disabling vs actual sneak/crouch #6548

dktapps opened this issue Dec 1, 2024 · 0 comments
Labels
Category: Gameplay Related to Minecraft gameplay experience Type: Enhancement Contributes features or other improvements to PocketMine-MP

Comments

@dktapps
Copy link
Member

dktapps commented Dec 1, 2024

Problem description

There are currently two functions of player sneaking:

  1. to make the player appear to crouch & reduce their hitbox size
  2. to disable block interactions when right-clicking on stuff

These two things are no longer coupled to the same thing. There are now 4 states for this:

State Crouching Disable block interaction Note
Walking false false
Pressing shift while flying false true #5792
Being in a 1.5 block space but not pressing shift true false #5903
Pressing shift while walking true true

Proposed solution

There needs to be a separation of crouching from the player's desire to disable block interactions.

Unfortunately, this is difficult to do cleanly, as isSneaking is a Living function, meaning that it should refer to crouching, but the most common usages of sneaking in plugins will probably be to disable block interactions.

It's also difficult to choose a name for such a property. Player->disableBlockInteractions() is the best I can come up with, but I don't like it much.

Relates to #6544

Alternative solutions that don't require API changes

@dktapps dktapps added Category: Gameplay Related to Minecraft gameplay experience Type: Enhancement Contributes features or other improvements to PocketMine-MP labels Dec 1, 2024
dktapps pushed a commit that referenced this issue Dec 1, 2024
This binds internal sneaking to whether or not the player is currently pressing the shift key, which fixes #5792 and fixes #5903.

However, it does introduce visual issues with sneaking, as explained in #6548. This needs to be worked on separately. For now, it's better we trade 2 functional bugs for 1 visual bug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Gameplay Related to Minecraft gameplay experience Type: Enhancement Contributes features or other improvements to PocketMine-MP
Projects
None yet
Development

No branches or pull requests

1 participant