Repository navigation
Treat shelves as containers in pipes #1376
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
583f880
Treat shelves as containers in pipes and inventory checks
RasmusKD 02ad3f1
Collapse the duplicated container family into one predicate
RasmusKD 468ccb1
Detach pulled stacks from their slot, and resync shelf displays
RasmusKD 4bd190e
One sync point for display containers, and it fixes chiseled bookshelves
RasmusKD 78acd2d
Reattach the hasGenericInventory javadoc, and check the switch before…
RasmusKD b88fedc
Enumerate the shulker colours; only the shelf family stays a tag lookup
RasmusKD 968bad0
Pass the caller's state into syncDisplayedContainer
RasmusKD 78b7d10
Copper chests join the container family
RasmusKD be7268d
Drop the display resync, the desync was a Paper bug fixed by Paper 13567
RasmusKD File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I'm a little confused by this bit here, this should theoretically be a no-op. What's it actually doing?
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.
Data-wise it is, the point is the side effect: update() ends with chunkSource.blockChanged(pos), which resends the block entity to clients. Vanilla only rebroadcasts shelf contents on player interaction, so without this line clients keep rendering the moved items until the chunk reloads. A/B tested on a live server: same setup, without the line the shelf keeps showing the items after they left, with it the display clears immediately.
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.
But wouldn't the initial update that's actually setting the block contents do that too? This feels like it's a Paper bug that should be reported there, as-is this would substantially increase the overhead of the inventory interactions
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.
You were right, it was a Paper bug. Removing items through the Bukkit inventory skipped the client update, fixed in PaperMC/Paper#13567 a couple of weeks ago. Verified on a current build and removed the resync from this PR.