-
-
Notifications
You must be signed in to change notification settings - Fork 144
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
Rough click slot packet validation #293
Conversation
add some more checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting some validation failures when splitting stacks with right clicks and shift-clicking stacks to/from the chest in the chest example.
Co-authored-by: Ryan Johnson <[email protected]>
Co-authored-by: Ryan Johnson <[email protected]>
I'm getting |
Ugh, that's really annoying. Do we extract data for what nbt data an item is supposed to have? |
Not yet. |
Would you be opposed to loosening the assertions on nbt data so we can defer this problem for later? |
How about we leave it as a TODO for now. Maybe make note of it in the issue. |
Still getting the |
Also doesn't look like the item count check is working properly.
(I added a stack of 77 apples to the inventory) |
I'm not able to reproduce that. I am getting different issues though, like I can't manually set a stack of 100 apples, it just shows up as 64 in the client. If i apply it to the cursor item instead, it works? Not sure what's up with that. Can you list out all the steps to repro using the playground I added to the PR? |
I made an edit to the playground. When you click on the apple stacks in the player's inventory you'll see the issues manifest. |
Ok, I fixed the issue you were talking about, but from now on I think we should consider behavior related to overfull stacks (eg stacks that have |
Yeah agree. We could clamp the stack size in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Still seeing the refresh when clicking on one of the apple stacks in the player inventory for the fist time. It only happens when the chest is not open. Guessing a variable wasn't initialized properly somewhere.
I can repro this bug with the item dupe check turned off, so it's unrelated to this PR. I'll open another issue for it. See #304 |
Description
This adds some validation for incoming inventory packets that makes it so that you can't just spawn items by sending malicious packets. It adds type 1 and type 2 validations as outlined in #292.
This also adds some new helpers,
InventoryWindow
andInventoryWindowMut
.fixes #292
Playground
Test Plan
Steps:
cargo test