Name custom (Nexo) items in memos + market records#2
Merged
Conversation
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>
Coverage report
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The Treasury transaction memo and the market sale/shop records named items from the raw vanilla material —
TreasuryListenerused the sign's item line, andMarketRecordsused the non-eventMaterialUtil.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 firesItemStringQueryEvent— 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,ItemUtilfalls back to the vanilla code, so vanilla behaviour is unchanged. No Nexo dependency is added to ChestShop (load-bearing rule 6).MarketRecords—itemKey/itemName/isCustomgo throughItemUtilwith a vanilla fallback;isCustomnow 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 viaItemUtil, 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 — includingChestShopSalesTrackerE2ETest, which asserts thechestshop_sale/chestshop_shoprows 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.🤖 Generated with Claude Code