Skip to content

Name custom (Nexo) items in memos + market records#2

Merged
ParadauxIO merged 1 commit into
masterfrom
feat/nexo-aware-item-memos
May 30, 2026
Merged

Name custom (Nexo) items in memos + market records#2
ParadauxIO merged 1 commit into
masterfrom
feat/nexo-aware-item-memos

Conversation

@ParadauxIO
Copy link
Copy Markdown
Collaborator

The Treasury transaction memo and the market sale/shop records named items from the raw vanilla material — TreasuryListener used the sign's item line, and MarketRecords used the non-event MaterialUtil.getSignName + ItemMeta. For a custom item (e.g. Nexo) that loses the real identity: it records the base material, not the custom id.

Fix

Route item naming through ChestShop's own event-backed ItemUtil.getName(item, 0). That fires ItemStringQueryEvent — the same seam the server's custom-item bridge (Nexo / ItemBridge) hooks to name and parse its items — so a custom item resolves to its provider code. When no provider claims the item, ItemUtil falls back to the vanilla code, so vanilla behaviour is unchanged. No Nexo dependency is added to ChestShop (load-bearing rule 6).

  • MarketRecordsitemKey/itemName/isCustom go through ItemUtil with a vanilla fallback; isCustom now flags an item a provider named beyond the plain code; a custom item with no display name reads as its provider id rather than the base material.
  • TreasuryListener.buildTransferMessage — the memo names the traded stack via ItemUtil, falling back to the sign item line (so it's never worse than before).

Verification

Built (mvn package) and deployed to the dev server; all 17 ChestShop integration tests pass — including ChestShopSalesTrackerE2ETest, which asserts the chestshop_sale/chestshop_shop rows produced by the changed naming path. The custom-item integration test (NexoCustomItemShopTest, added in the integration-tests repo) skips cleanly on a server without Nexo.

Vendored upstream fork — change kept to ChestShop's own idioms (ItemUtil / ItemStringQueryEvent).

🤖 Generated with Claude Code

Both the Treasury transaction memo and the market sale/shop records named
items from the raw vanilla material (TreasuryListener used the sign's item
line; MarketRecords used the non-event MaterialUtil.getSignName + ItemMeta).
For a custom item (e.g. Nexo) that loses the real identity — it records the
base material, not the custom id.

Route item naming through ChestShop's own event-backed ItemUtil.getName(item, 0)
instead. That fires ItemStringQueryEvent — the same seam the server's
custom-item bridge (Nexo, ItemBridge) hooks to name/parse its items — so a
custom item resolves to its provider code. When no provider claims the item,
ItemUtil falls back to the vanilla code, so vanilla behaviour is unchanged.
No Nexo dependency is added here (load-bearing rule 6).

- MarketRecords: itemKey/itemName/isCustom go through ItemUtil with a vanilla
  fallback; isCustom now flags an item a provider named beyond the plain code;
  a custom item with no display name reads as its provider id, not the base
  material.
- TreasuryListener.buildTransferMessage: the memo names the traded stack via
  ItemUtil, falling back to the sign item line.

Verified end-to-end on the dev server: all 17 ChestShop integration tests pass
(incl. the sales-tracker E2E that exercises the changed naming path); the
custom-item test skips where Nexo is absent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Coverage report

Overall Project 24.1% -0.92%
Files changed 0%

File Coverage
MarketRecords.java 0% -25.15%

@ParadauxIO ParadauxIO merged commit 0dce9dc into master May 30, 2026
2 checks passed
@ParadauxIO ParadauxIO deleted the feat/nexo-aware-item-memos branch May 31, 2026 00:44
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.

1 participant