A forum user recently pointed out that he expected that a resource pack would be able to override a mod's lang file. See thread.
I investigated and the Locale class definitely loads mod lang resources after the resource packs. Since the localization key-value pairs are stored in a map (a field called properties), the last value added with the same key will prevail.
To confirm the lang file load order I extended the Locale class and simply modified it to add some console prints. My resource pack was jabelar_resource_pack.zip and my modid was examplemod. In both us_en.lang files I replaced the tile.stone.stone.name and in the pack called it "Stone Resource Pack" and in my mod I called it "Stone Mod".
You can see from the console log that the resource pack is loaded before the mod and also see that the final result is that stone get's my mod's lang key "Stone Mod".
[19:40:54] [main/INFO]: [CHAT] [Debug]: Reloaded resource packs
To really drive home the point, I printed out the ResourceManager.getResourceDomains() and it gives the following (it is a Set of Strings representing the domains/modid):
[09:14:52] [main/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.client.localization.ModLocale:loadLocaleDataFiles:50]: Will loop through following resource domains: [minecraft, realms, .mcassetsroot, fml, forge, examplemod]
`
So that is the order that the lang files will be parsed. (The resource packs are parsed during the minecraft domain.)
Is this the intended behavior? It seems more useful and expected that resource packs could be used to change mod's assets.
I'm pretty sure the intended behaviour is RP's override mod assets so this is a bug
EDIT: removed some misguided comments about Set inherent ordering. diesieben07 set me straight. It was just an observation anyway, not the cause of the actual issue.
LinkedHashSet does preserve iteration order.
LinkedHashSet does preserve iteration order.
Okay, yeah I guess I wasn't considering the typing/casting correctly. The prototype for the interface is for Set
The original problem still stands: the actual order has the mods at the end of the iteration, so they override any resource packs which are at the beginning of the iteration.
This issue has been automatically marked as stale because it has not had activity in a long time. If this issue is still relevant and should remain open, please reply with a short explanation (e.g. "I have checked the code and this issue is still relevant because ___." or "Here's a screenshot of this issue on the latest version"). Thank you for your contributions!
This issue has been automatically closed because it has not had activity in a long time. Please feel free to reopen it or create a new issue.
Most helpful comment
I'm pretty sure the intended behaviour is RP's override mod assets so this is a bug