Skip to content

Use one authoritative EMC value when learning and extracting Stardew items #37

Description

@Exohayvan

Summary

Stardew item-object and item-ID EMC lookups use different fallbacks, allowing items missing from the generated EMC map to be learned and potentially extracted for 1 EMC.

Evidence

  • EmcValueRegistry.EmcValue(Item) falls back to the item's sell price.
  • EmcValueRegistry.EmcValue(string qualifiedItemId) falls back to exactly 1.
  • DissolverMenu learning accepts any qualified item ID without consuming the item or checking that it has a registered value.
  • Extraction uses the string lookup, while dissolving uses the item-object lookup.
  • The generated item sources do not cover every possible tool, special, dynamic, or third-party item type.

Impact

A missing-map item can be valued normally when dissolved but cost only 1 EMC to recreate, enabling cheap duplication and economy bypasses.

Reproduction / verification

  • Use a tool or third-party item absent from default-emc-values.yaml.
  • Learn it, extract it, and compare charged EMC with its dissolve value.
  • Repeat for zero-price, non-stackable, and modded items.

Proposed direction

Resolve item IDs through a single authoritative eligibility/value API. Reject unknown items unless explicitly allowed, and enforce creative-item policy before learning, dissolving, or extracting.

Acceptance criteria

  • The same item has the same EMC value in dissolve and extraction paths.
  • Unknown or unsupported items fail closed instead of defaulting to 1 EMC.
  • Creative-only policy is enforced consistently.
  • Tests cover missing, modded, non-stackable, and zero-price items.

Audit provenance

Candidate #11 from the read-only repository audit performed on 2026-07-20. This is separate from existing issues #3, #4, #25, and #27 unless explicitly linked later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2High: major functionality is broken or crashes with limited workaroundarea:emcEMC values, calculation, storage, or overridesloader:smapiStardew Valley SMAPI-specificstatus:backlogValid work that is not currently scheduledtype:bugA defect or incorrect behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions