Resolve resource domains from bracketed folder names - #27
Closed
Eldrinn-Elantey wants to merge 2 commits into
Closed
Resolve resource domains from bracketed folder names#27Eldrinn-Elantey wants to merge 2 commits into
Eldrinn-Elantey wants to merge 2 commits into
Conversation
Author
|
Wrong approach, per glowblueman/attempt0's feedback in Discord: the bracketed folder names are load-bearing, not decorative. Minecraft merges .lang translations by iterating getResourceDomains() and loading each reported name's lang file separately, which is how a mod's own folder and an addon's separate contribution to the same real domain both get merged today. Reporting the extracted domain instead of the bracket name (as this PR did) collapses multiple contributing folders down to one reported domain, so only one of them would ever get resolved, silently dropping the other's translations. The actual fix belongs in GTNH-Translations, scoped to the new markdown tooltip delivery path only, not the shared .lang mechanism this PR touched. |
This was referenced Jul 26, 2026
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.
Load folders are named "[]" for readability, but the game asks for resources by the bare mod domain (ResourceLocation("gregtech", ...)), not by that display name.
The old .lang loading path happened to work anyway because Minecraft scans getResourceDomains() and tries each reported name as if it were a real domain, so the bracketed string round-tripped by accident. Any resource requested directly by its real domain (textures, models, or GregTech's new markdown tooltip files) never matched, since getResourcePath() resolved straight off the raw domain string.
Builds a domain -> folder map once (extracting the domain out of the brackets), rebuilt on every getResourceDomains() call since Minecraft calls that on every resource manager reload. getResourcePath() now resolves through that map, falling back to the old direct behavior if a domain has no matching folder.