Repository navigation
Reject feature and structure types the game no longer has - #263
ItsMeBrianD wants to merge 1 commit into
Conversation
vanilla-mcdoc still has feature_config cases for types the game dropped or renamed (glow_lichen became multiface_growth in 1.19; also random_patch, flower, no_bonemeal_flower, emerald_ore, ice_patch, no_surface_ore, and the structure types village, pillager_outpost, bastion_remnant). Each became a helper, so GlowLichen(...) passed mms check and wrote a feature the game rejects. The schema re-validation missed it for the same reason: both used hasDispatchKey, which accepted any dispatcher case. When a dispatched struct's key field names a registry the spec pack has (from mcmeta, the game's own list), that registry now decides the valid keys. A stale name whose mcdoc case is the same type as one live key gets "this version calls it MultifaceGrowth(...)". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AX3Tt34s2brddqiaMJbZyW
|
No actionable comments were generated in the recent review. WalkthroughDispatcher key checks now use a known key registry to filter valid keys. When a stale dispatcher key has a unique live replacement, diagnostics can report the renamed key or helper. Test fixtures and expected output cover stale and current type names. ChangesDispatcher key validation and diagnostics
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk:
|
Requested by Brian · project thread
Problem
GlowLichen(...)passedmms checkbut wrote"type": "minecraft:glow_lichen", which the game rejects. The 26.3 feature type ismultiface_growth(renamed in 1.19). vanilla-mcdoc still has aminecraft:feature_config[glow_lichen]case, tagged only#[since="1.17"], and every dispatcher case turns into a helper.The schema re-validation missed it for the same reason. Both the helper lookup and
sema.ValidatecallhasDispatchKey, and that function accepted any dispatcher case even when the game's registry doesn't list it.The same thing happened with other stale cases. Feature types:
random_patch,flower,no_bonemeal_flower,emerald_ore,ice_patch,no_surface_ore. Structure types:village,pillager_outpost,bastion_remnant.Fix
When a dispatched struct's key field is
#[id=...]of a registry the spec pack has (taken from mcmeta, the game's own list), that registry now decides which keys are valid. Dispatcher cases outside it are ignored, both for helpers and for the rawtype = ...form. Nothing is hard-coded: the registry and the mcdoc case types already sit in the spec pack.For a better message: when a stale case uses the same mcdoc type as exactly one live key, the error names that key. For example,
'GlowLichen' does not make a ConfiguredFeature; this version calls it MultifaceGrowth(...). Fixing the helper would only have duplicatedMultifaceGrowth, so the helper is dropped rather than repaired.Unchanged: the raw
type = glow_lichenform still reports two errors on one span (the case-key error and the id check). That was already the case for any unknown type.Tests
sema/testdata/stale_types.mms.go test ./...inengine/passes, including the example goldens.Generated by Claude Code
Summary by CodeRabbit