Repository navigation
Let players see the recipes of alloys they have forged - #51
Conversation
/alloy recipes lists the alloys this account has forged, each name clickable. /alloy recipe <name>, or /alloy recipe with an alloy in hand, shows its base and catalysts. Hits, stats and forge odds stay hidden. An alloy the player hasn't forged gets "You don't know the recipe" whether or not it exists, and tab completion offers only their own alloys. A new alloy whose naming prompt timed out was never recorded for its discoverer, so they could not see its recipe. The timeout now records it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A second discovery, a restart or a timeout before naming could lose the discoverer's record. Naming now moves every player's record from the generated id to the chosen one. A timed-out discovery is credited to the player as they are now (they may have relogged). A combo that no longer makes the alloy is not shown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Alloy ids change when an alloy is named and generated ids can be reused, so keying knowledge by id needed rename scans and changed when discovery events fire. Successful forges now record the station's combo in data/known-alloy-recipes/<uuid>.json; a player without a file starts from their existing forge history. The naming, timeout and event code is back to what main has. A combo the forge index no longer maps to the alloy is not shown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 45 minutes. View limit details
Summary
Merge Risk:
|
|
@coderabbitai review |
Action performed
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@coderabbitai review |
Action not completed
|
|
Independent review of 74acb6c (CodeRabbit was rate limited): APPROVE, no blocking findings. Notes kept as known limits: a history alloy that failed to load at a player's first seed is not re-seeded (no missing ids on Main); the known-recipe cache is main-thread only (Bukkit tab completion runs there); |
Why
Player suggestion (Discord, 5 for / 3 against): a way to see alloy recipes in game, instead of keeping them in a notepad or spreadsheet. fran's condition: only someone who has already forged the alloy can see it.
Change
/alloy recipeslists the alloys this account has forged. Each name can be clicked to show its recipe./alloy recipe <name>shows the base and catalysts./alloy recipewith an alloy in your main hand shows that alloy's recipe.How "forged it" is stored
base|catalyst,catalyst) indata/known-alloy-recipes/<uuid>.json.forged-alloyshistory. Main has 19 accounts with 177 entries, and all of them point at existing alloys.Performance
These are commands only: no listeners, no timers. Each forge does one small file write, and only the first time a combo is forged. A recipe lookup reads one index file and builds the base and catalyst items to get their names (at most 5).
Testing
AlloyRecipeCommandTest(list, recipe, held alloy, stale index, console, tab completion, seeding, unreadable file, failed save) and a forger test (successful forges teach the recipe, scrap doesn't).mvn verify: 176 tests; only the fourStationDatabaseCoverageTest/EdgeCoverageTestcases fail, and they fail on Windows on untouchedmaintoo.~/alloyrec-test/test.js, bots AlloyRecA/AlloyRecB), 21/21 PASS:iron_ingot|peridot,turquoise.limpsteel, and the held alloy showed the recipe.🤖 Generated with Claude Code