Repository navigation
Load entity models from the nearest published version - #341
Merged
Merged
Conversation
The entity-models dataset is published for a few versions only (1.16.5, 1.17.1, 1.20.1, 1.21.11, 26.1.2). For any other version, block entities such as the bell body, chests and signs fell back to their block models, and special items could not find their geometry. Entities.getDatasetRoot now probes <root>/entity-models/version.json and, for an unpublished release, selects the nearest published one from entity-models/versions.json with the same rule as MineRenderData.resolve. Model files, entity lists, animations and the block-entity index load from that root; textures keep the requested version. Snapshots keep their own version. The shared selection code moves to DatasetVersions.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DatasetVersions moves into an underscore directory, so the generated barrels never export parseRelease and nearestRelease. Roots whose last segment isn't a release, such as snapshots or custom hosts, skip the version.json request, since its answer can't change the result. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
On versions without a published
entity-modelsdataset, block entities now render. A 26.3 bell shows its bell body instead of only the frame, and chests, signs, beds and skulls render too. MineRender loads their geometry from the nearest published release (26.3 uses 26.1.2), the same wayMineRenderDataalready falls back for registry data. Textures still come from the requested version.Why
minecraft-entity-modelsis published for 1.16.5, 1.17.1, 1.20.1, 1.21.11 and 26.1.2 only. For any other version,BlockEntities.getIndexgot a 404 and returned an empty index, so every block entity was drawn as its plain block model, and special items could not find their geometry. mcasset.cloud hits this on 26.3: https://mcasset.cloud/26.3/assets/minecraft/blockstates/bell.json shows only the frame.Changes
Entities.getDatasetRoot(root?)(new, public):<root>/entity-models/version.json(one request per version, cached); a published version returns the root unchanged.entity-models/versions.json.getModelFile,getAnimations,getEntityListandBlockEntities.getIndexuse it. Texture code is unchanged, so textures keep the caller's root.assets/_versions/DatasetVersions.ts:parseReleaseandnearestReleasemoved here unchanged fromMineRenderData.ts, which now uses them. The underscore directory keeps them out of the generated barrels, so they stay internal. Its behaviour and messages are the same.Caching.entityDatasetVersionCache: caches the chosen version per root and clears with the other caches.getIndexstill turns that into{}with its existing warning.reference/concepts.mdand the AGENTS.md Entities paragraph.Selection examples:
Testing
yarn workspace minerender typecheckyarn test: 803 passedyarn build:lib && yarn test:package: 11 passedgetIndexreturns{}.version.jsonrequest only. They either answer it as published, shift a count or key index by one, or seed the version cache. No assertion was relaxed.assets.mcasset.cloud: 26.3 resolves to 26.1.2, the bell is in the index, and the bell model loads with a 26.3 texture root. 1.21.11 is unchanged.🤖 Generated with Claude Code