Skip to content

Fix shulker box selling: purple variant undetected, contents wiped on deposit failure - #14

Closed
Faboit1 with Copilot wants to merge 1 commit into
mainfrom
copilot/implement-selling-shulker-boxes
Closed

Fix shulker box selling: purple variant undetected, contents wiped on deposit failure#14
Faboit1 with Copilot wants to merge 1 commit into
mainfrom
copilot/implement-selling-shulker-boxes

Conversation

Copilot AI commented May 20, 2026

Copy link
Copy Markdown

Two bugs prevented shulker box selling from working correctly: the default purple SHULKER_BOX material was never recognised as a shulker, and contents were stripped from the box before the economy deposit — meaning a failed deposit returned an empty box with no payment.

Changes

  • SellManager.isShulkerBox — extend match to cover SHULKER_BOX in addition to the 16 colour-prefixed variants (*_SHULKER_BOX):

    // Before
    return item != null && item.getType().name().endsWith("_SHULKER_BOX");
    
    // After
    String name = item.getType().name();
    return name.equals("SHULKER_BOX") || name.endsWith("_SHULKER_BOX");
  • GUIListener.onClose — transactional shulker return

    • Clone the shulker before calling sellShulkerContents.
    • Defer returnItem until after the deposit resolves.
    • On success → return the modified shulker (sold items removed).
    • On failure → return the original clone (contents intact, no item loss).
  • README.md — added; covers features, requirements, install, commands, permissions, config reference, shulker box behaviour, and build instructions.

- Fix isShulkerBox to match SHULKER_BOX (the default purple shulker box
  was never recognized because the check used endsWith("_SHULKER_BOX"))
- Fix GUIListener.onClose: clone shulker before selling its contents and
  only return the modified box after a successful deposit; on deposit
  failure the original clone (full contents intact) is returned instead
- Add README.md with full feature overview, install steps, commands,
  permissions, config reference, and build instructions

Agent-Logs-Url: https://github.com/Faboit1/sell-plugin/sessions/c172a735-65a5-4363-8864-5b461c4f774b

Co-authored-by: Faboit1 <177459774+Faboit1@users.noreply.github.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.

2 participants