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

handle clicks outside inventory and non modifying clicks #661

Merged

Conversation

lukashermansson
Copy link
Contributor

Objective

Fixes some re-syncs because the validation did not accept the now specific cases (all of the affected modifications where cases where the user did not modify the inventory)

Cases like:

  • user clicks without an item on the cursor outside the inventory
  • user clicks on the margin area without an item held
  • user clicks on an empty slot when not holding anything
  • user uses hotbar keybinds on an empty slot to an empty hotbar slot

This causes unneccery re-syncs to the client and also unneccery logs indicating some illegal client packets, while these packets are totaly fine

Solution

adjusted packet validation logic to allow these cases, but also check for "conservation of mass" when these special magic slot ids shows up
modified the handling code to basically ignore these changes, (I guess there is room for improvement here, as some event would probably be nice to publish in these cases?)

@dyc3 dyc3 merged commit b1f18a7 into valence-rs:main Oct 12, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants