Repository navigation
fix(tomes): stop the Extraction Tome destroying low-durability and stacked items - #322
Merged
Merged
Conversation
…acked items The Extraction Tome promises to preserve the source item, but three paths broke that promise: - The flat 50-point durability cost drove small-durability items to 1 durability (a golden sword always came back at 1/32), so they broke on their next use. The cost is now a share of max durability, tomes.extractionTomeItemDamagePercent (default 0.05, at least one point), with the existing never-break clamp kept. A v11 to v12 config migration drops the old flat key. - A stacked left input was claimed, but vanilla's take clears the whole left slot while only one stripped item is restored. The handler now declines stacks. - The take hook awarded the salvage advancement before restoring the item, so a throwing trigger would strand it. The restore now runs first. Adds gametests that drive the real take path (click and shift-click), the stacked-input decline, and the small-durability case, plus unit tests for the percentage math and the migration. Updates the config, guide, and SPEC docs. Closes #321
Contributor
|
Reviewed at Code Review — c2084c1Verdict: APPROVE — 0 must-fix, 1 optional
Acceptance criteria
🟡 Optional
|
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 Extraction Tome promises to keep the source item, but a player reported losing one. A gametest that drives the real anvil take path showed the restore itself works (click, shift-click, Q-drop, rename-then-take, close-after-take). The loss comes from three other paths, fixed here:
tomes.extractionTomeItemDamagePercent(default0.05, at least one point) scales with the item: diamond sword 78, iron sword 12, golden sword 1. The never-break clamp is unchanged. A v11 → v12 config migration drops the oldextractionTomeItemDamagekey; a flat value has no meaningful percentage equivalent, so the new key starts at its default.AnvilMenuMixin#meridian$restoreLeftwrote the item back after firing the salvage advancement, so a throwing trigger would have stranded it.Tests: new gametests take the result through
AnvilMenu#clicked(click and shift-click) and cover the stacked decline and the golden-sword case; the existing gametests only inspected the preview slot. Unit tests cover the percentage math and the migration.Docs:
site/pages/config.json(setting row, examples,configVersion12),site/pages/guide.json(salvage tome summary), anddesign/SPEC.md.Closes #321