Skip to content

Fix three minor ShelfBlock issues - #14148

Open
okcoder123 wants to merge 1 commit into
PaperMC:mainfrom
okcoder123:shelf-offhand-and-cleanup
Open

Fix three minor ShelfBlock issues#14148
okcoder123 wants to merge 1 commit into
PaperMC:mainfrom
okcoder123:shelf-offhand-and-cleanup

Conversation

@okcoder123

Copy link
Copy Markdown

A few small QoL/cleanup ShelfBlock fixes:

  • swapHotbar checks the hotbar slot with a bounds check of <= inventory.getContainerSize() which should be < because otherwise it is off by one. ATM it isn't reachable because the slot stays under the container size, but could cause hazards in future if not handled.
  • Replaced the unchecked (ShelfBlockEntity) cast and the null check in the same loop with an instanceof pattern match
  • useItemOn ignored the off hand which blocked proper handling of offhand use of the Shelf like in vanilla, so changed to match and have vanilla parity.

@okcoder123
okcoder123 requested a review from a team as a code owner August 6, 2026 06:45
@github-project-automation github-project-automation Bot moved this to Awaiting review in Paper PR Queue Aug 6, 2026
@okcoder123
okcoder123 force-pushed the shelf-offhand-and-cleanup branch from d598ae4 to 1a89241 Compare August 6, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Awaiting review

Development

Successfully merging this pull request may close these issues.

1 participant