Repository navigation
Cache missing texture metadata and use the default player-head texture - #347
Merged
Merged
Conversation
…fault player-head texture Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
InventivetalentDev
marked this pull request as ready for review
October 21, 2026 19:13
…ead textures lazily, serve the embed test list Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # AGENTS.md
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.
What
Missing texture metadata and entity textures are cached, and placed player heads load one default texture instead of probing for one.
Caching.MISSING(false) is stored in place of a missing asset.ModelTextures.getMetastores it in memory and in the persistent metadata cache;Entities.resolveTexturestores it in memory. Both still returnundefinedto callers.AssetLoader.persistentScope === ""),getMetareads the hosted_list.jsonof the texture's directory first and skips the.mcmetarequest when the file is not listed. When the list is missing or fails to load, and for added sources such as resource packs, it requests the file as before.minecraft:player_headpart without atextureLocationusesPlayerHeadTextures' default skin,entity/player/slim/steve, the texture vanilla returns fromDefaultPlayerSkin.getDefaultSkin(). Profiles in block-entity data are not read.BlockObjectloadsPlayerHeadTextureson first use, so block consumers don't bundle the skin code.BlockObject.createBlockEntitiesplaces each entity right after it is added, so earlier parts no longer sit at the origin while later parts load.Why
The in-memory loading caches drop
undefinedresults, andPersistentCache.getOrLoadnever stores them, so every lookup of a missing.mcmetaor entity texture sent the request again. Most block textures have no.mcmeta, and each placed player head probed about four texture paths that do not exist. A small structure with six heads produced 30 404 responses.Risk
Medium.
Caching.textureMetaCacheandCaching.entityTextureCachenow holdT | false. TypeScript callers that read these public caches directly must handlefalse. A wrong entry in a hosted_list.jsonwould hide that texture's animation until the in-memory and persistent caches are cleared.Dependencies
Testing
yarn workspace minerender typecheck,yarn build:lib: pass.yarn test: 836 tests pass, including the newTextureMeta.test.ts(memory and persistent miss caching, list skip, listed file, failed list falls back to the file, added source skips the list), single probes inEntityLoading.test.ts, and theslim/stevekey and placement order inBlockEntities.test.ts.yarn build:embed, thenyarn test:embed:browser: 7 tests pass.yarn test:embed: 15 tests pass. The browser test's asset fixtures now serve the block texture directory's_list.json, because the test rejects every request it has no fixture for.Note
AI-assisted.