Skip to content

Fix: opening a shulker opens the all-shulkers list instead of contents - #280

Open
JoelYoung01 wants to merge 2 commits into
tr7zw:mainfrom
JoelYoung01:fix/restore-client-shulker-container-provider
Open

Fix: opening a shulker opens the all-shulkers list instead of contents#280
JoelYoung01 wants to merge 2 commits into
tr7zw:mainfrom
JoelYoung01:fix/restore-client-shulker-container-provider

Conversation

@JoelYoung01

Copy link
Copy Markdown

Summary

  • Restore the client ShulkerContainerProvider registration removed in the network rework (Network rework/26.2 #274), so right/middle-clicking a shulker in the inventory UI opens that box's contents again.
  • Share shulker item ids via ShulkerHelper.getShulkerItems() for client + server providers.
  • Pass AvailableSlot.slot() from inventory secondary-click so hotbar shulkers use the correct slot index.

Fixes #279

Test plan

  • ./gradlecw :26.2-fabric:compileClientJava compileJava test succeeds
  • In-game on 26.2 with shulker support enabled: open inventory UI, right/middle-click a filled shulker → contents grid appears
  • Left-click still swaps the shulker itself into hand
  • With showHotbar on, secondary-click a hotbar shulker opens that box
  • With disableShulkers enabled, secondary-click does not open container contents

Made with Cursor

…ntents.

The network rework left only a server-side provider, so secondary-click fell through to the all-shulkers list. Also pass AvailableSlot.slot() so hotbar shulkers resolve correctly.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@JoelYoung01, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4de3b9fe-f0b6-4226-af9f-882b7d29028c

📥 Commits

Reviewing files that changed from the base of the PR and between bc6a02a and 2367665.

📒 Files selected for processing (1)
  • src/main/java/dev/tr7zw/itemswapper/util/ShulkerHelper.java

Walkthrough

The client now registers shulker content handling and uses shared shulker recognition. Shulker contents are scanned or enumerated when enabled. Secondary-click navigation passes the stored inventory slot.

Changes

Shulker navigation

Layer / File(s) Summary
Shared shulker recognition
src/main/java/dev/tr7zw/itemswapper/util/ShulkerHelper.java, src/main/java/dev/tr7zw/itemswapper/server/provider/ShulkerContainerProvider.java
ShulkerHelper exposes recognized shulker items. The server provider uses the helper for item handlers and container validation.
Client shulker provider
src/client/java/dev/tr7zw/itemswapper/provider/ShulkerContainerProvider.java, src/client/java/dev/tr7zw/itemswapper/ItemSwapperSharedMod.java
The client provider scans matching shulker contents, enumerates contained stacks, checks shulker availability, and is registered during late initialization.
Stored slot navigation
src/client/java/dev/tr7zw/itemswapper/overlay/logic/InventoryAbstractWidget.java
Secondary-click navigation passes AvailableSlot.slot() instead of deriving a slot from the widget ID.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: tr7zw

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the primary fix: opening a shulker now shows its contents instead of the all-shulkers list.
Description check ✅ Passed The description directly explains the shulker provider, shared item handling, slot correction, testing, and linked bug fix.
Linked Issues check ✅ Passed The changes restore client provider registration and correct slot handling, addressing issue #279 requirements.
Out of Scope Changes check ✅ Passed All changes support the linked issue or the implementation needed to share shulker handling across providers.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/client/java/dev/tr7zw/itemswapper/provider/ShulkerContainerProvider.java`:
- Around line 20-28: Update ShulkerContainerProvider.getItemHandlers() to check
areShulkersEnabled() before registering shulker items; return no handlers when
shulkers are disabled and preserve ShulkerHelper.getShulkerItems() when enabled,
matching the routing behavior in ItemGroupManager.getNextPage().

In `@src/main/java/dev/tr7zw/itemswapper/util/ShulkerHelper.java`:
- Around line 82-84: Update ShulkerHelper.getShulkerItems() so it no longer
exposes the mutable canonical shulkers set; return an immutable snapshot or
view, such as Set.copyOf(shulkers), while preserving the existing set contents.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7ff4babf-78f0-4e13-8029-89e12ac2daf6

📥 Commits

Reviewing files that changed from the base of the PR and between a401730 and bc6a02a.

📒 Files selected for processing (5)
  • src/client/java/dev/tr7zw/itemswapper/ItemSwapperSharedMod.java
  • src/client/java/dev/tr7zw/itemswapper/overlay/logic/InventoryAbstractWidget.java
  • src/client/java/dev/tr7zw/itemswapper/provider/ShulkerContainerProvider.java
  • src/main/java/dev/tr7zw/itemswapper/server/provider/ShulkerContainerProvider.java
  • src/main/java/dev/tr7zw/itemswapper/util/ShulkerHelper.java

Comment thread src/main/java/dev/tr7zw/itemswapper/util/ShulkerHelper.java
Prevents callers from mutating the shared shulker item set used by isShulker() and both providers.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

[BUG] Clicking a shulker opens the all-shulkers list instead of its contents

1 participant