Jump to content

Probable Bug Resource Packs Are unable To Override Modded Lang


jredfox

Recommended Posts

Code:
@eventhandler
public void preInit(FMLPreInitializationEvent event)
{
Item i = new Item();
i.setRegistryName("aa:b");
i.setUnlocalizedName("aa.b");
ForgeRegistries.ITEMS.register(i);
}

Mod Lang:
C:\Users\jredfox\Documents\MDK\1.12.2\src\main\resources\assets\a\lang\en_us.lang

Resource Pack Lang:
C:\Users\jredfox\Documents\MDK\1.12.2\run\resourcepacks\New folder\assets\minecraft\lang\en_us.lang

Also tried:
C:\Users\jredfox\Documents\MDK\1.12.2\run\resourcepacks\New folder\assets\a\lang\en_us.lang

 

RP Lang:
item.aa.b.name=Z
tile.stone.stone.name=22

 

Mod Lang:
item.aa.b.name=Test

 

Display even on rp reload displays "Test" not "Z" like it's suppose to. Environment is fresh mdk forge recommended. I know the lang of the resource pack was working because, I overriden the stone block and it was working for vanilla it displayed "22" not stone for vanilla objects.

You can try this with any modded block/item their lang cannot be overridden via a resource pack. This is a bug I was showing code to prove it. Stop closing valid bug reports on github before you even test if it's a bug. You can verify this in fresh forge. Resource packs which are suppose to load later do not override anything that is modded

Edited by jredfox
Link to comment
Share on other sites

So the Forge documentation on resources is here: https://mcforge.readthedocs.io/en/latest/concepts/resources/

 

It says:

Quote

 

When multiple resource packs are enabled, they are merged. Generally, files from resource packs at the top of the stack override those below; however, for certain files, such as localization files, data is actually merged contentwise. Mods actually define resource packs too, in their resources directories, but they are seen as subsets of the “Default” resource pack. Mod resource packs cannot be disabled, but they can be overriden by other resource packs.

 

 

So it is specifically saying that lang files are treated a bit differently. Are other resources also acting the same way?

 

Also I'm not sure when the lang file is applied to the item, but you're not registering your item in the proper order. You should not be doing it in pre-init, but rather you should be doing it in the registry event for items and you should access the registry passed through the event. I'm not sure it is related to your issue, but I could imagine that the order might matter for any "merging" of resources that happens.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

On 4/22/2018 at 11:20 AM, jabelar said:

So the Forge documentation on resources is here: https://mcforge.readthedocs.io/en/latest/concepts/resources/

 

It says:

 

So it is specifically saying that lang files are treated a bit differently. Are other resources also acting the same way?

 

Also I'm not sure when the lang file is applied to the item, but you're not registering your item in the proper order. You should not be doing it in pre-init, but rather you should be doing it in the registry event for items and you should access the registry passed through the event. I'm not sure it is related to your issue, but I could imagine that the order might matter for any "merging" of resources that happens.

the resource packs are inside of the resource pack folder thus it should be overriding the mods lang/textures/models.


Forge doesn't seem to be respecting vanilla

Link to comment
Share on other sites

8 hours ago, jredfox said:

the resource packs are inside of the resource pack folder thus it should be overriding the mods lang/textures/models.


Forge doesn't seem to be respecting vanilla

As I mentioned, Forge specifically says it does not do it that way for lang files. It should do it for textures, models, etc. I'm not sure why they treat lang files different than other resources in resource packs.

 

Also I mentioned that your problem may be that you are not registering your item at the proper time. That might be messing up the order of your lang file access. Did you try registering your item properly and see if it made a difference?

Edited by jabelar

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Also are you sure your lang files are named properly? Depending your pack.mcmeta version the lang file name has different capitalization.

 

What exactly is the contents of your pack.mcmeta, your mod's lang file name, and your resource pack file names?

Edited by jabelar

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

49 minutes ago, jabelar said:

Also are you sure your lang files are named properly? Depending your pack.mcmeta version the lang file name has different capitalization.

 

What exactly is the contents of your pack.mcmeta, your mod's lang file name, and your resource pack file names?

I stated I tried both the modid's name and minecraft name folder. I tried both for the resource pack lang to override nothing. the stone worked both times so i know it's trying to do something but, as for modded things for lang changing doesn't happen resource packs can't override.

 

pack.mcmeta was default

 

try this yourself It's reproducible in 1.12+ resource packs cannot override modded lang and for some reason they wouldn't take it as a bug on github?

Edited by jredfox
Link to comment
Share on other sites

2 minutes ago, jredfox said:

I stated I tried both the modid's name and minecraft name folder. I tried both for the resource pack lang to override nothing. the stone worked both times so i know it's trying to do something but, as for modded things for lang changing doesn't happen resource packs can't override.

 

pack.mcmeta was default

 

try this yourself It's reproducible in 1.12+ resource packs cannot override modded lang and for some reason they wouldn't take it as a bug on github?

I probably won't have time to try until the weekend but I will try to check it out.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

2 minutes ago, jabelar said:

I probably won't have time to try until the weekend but I will try to check it out.

ok maybe they will listen to you if you can verify. I report something that either needs to be done or is an actual bug/display bug they completely ignore me saying that's what the forge forums are for no this is a bug I am not asking what's wrong with my code the code is there so you can verify the authenticity of the bug. The code was also only 3 lines like above showing them how simple it is to reproduce.

They even moved this forum to modder support when I specified this was a forge forum issue not a mod issue when it's not. I didn't do anything it's their issue.

Edited by jredfox
Link to comment
Share on other sites

Okay, I've confirmed what you said -- the mod's lang file will take priority over any resource pack's lang file. I'll spend some time this weekend looking at the code to see if I understand why, and then will try to file an issue assuming I can't find a good reason for it to work this way.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

12 hours ago, jabelar said:

Okay, I've confirmed what you said -- the mod's lang file will take priority over any resource pack's lang file. I'll spend some time this weekend looking at the code to see if I understand why, and then will try to file an issue assuming I can't find a good reason for it to work this way.

The thing is people make resource packs for mods as well as vanilla so overriding lang would be just as important as overriding mods textures/sounds/models.

Link to comment
Share on other sites

Okay, so I had time to look at this further. I basically extended the Locale class to print out what it was doing and then used reflection to replace the one used in the game.

 

Here is what the prints showed about the order that resources are loaded:

 

Quote

[19:40:54] [main/INFO]: [CHAT] [Debug]: Reloaded resource packs
[19:40:54] [main/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Example Mod, jabelar_resource_pack.zip
[19:40:55] [main/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.client.localization.ModLocale:loadLocaleDataFiles:40]: loadLocaleDataFiles() for language list = [en_us]
[19:40:55] [main/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.client.localization.ModLocale:loadLocaleDataFiles:49]: Loading lang file = lang/en_us.lang
[19:40:55] [main/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.client.localization.ModLocale:loadLocaleDataFiles:54]: For resource domain =minecraft
[19:40:55] [main/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.client.localization.ModLocale:loadLocaleData:111]: For resource = Default
[19:40:55] [main/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.client.localization.ModLocale:loadLocaleData:111]: For resource = jabelar_resource_pack.zip
[19:40:55] [main/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.client.localization.ModLocale:loadLocaleDataFiles:54]: For resource domain =realms
[19:40:55] [main/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.client.localization.ModLocale:loadLocaleData:111]: For resource = Default
[19:40:55] [main/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.client.localization.ModLocale:loadLocaleDataFiles:54]: For resource domain =.mcassetsroot
[19:40:55] [main/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.client.localization.ModLocale:loadLocaleDataFiles:54]: For resource domain =fml
[19:40:55] [main/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.client.localization.ModLocale:loadLocaleDataFiles:54]: For resource domain =forge
[19:40:55] [main/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.client.localization.ModLocale:loadLocaleData:111]: For resource = FMLFileResourcePack:Forge Mod Loader
[19:40:55] [main/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.client.localization.ModLocale:loadLocaleData:111]: For resource = FMLFileResourcePack:Minecraft Forge
[19:40:55] [main/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.client.localization.ModLocale:loadLocaleDataFiles:54]: For resource domain =examplemod
[19:40:55] [main/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.client.localization.ModLocale:loadLocaleData:111]: For resource = FMLFileResourcePack:Example Mod
[19:40:55] [main/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.client.localization.ModLocale:loadLocaleDataFiles:68]: After loading, lang file value for stone = Stone Mod

 

My resource pack is jabelar_resource_pack.zip, and my mod is examplemod. If you look at the log, the order is confirmed that the mod resources are loaded after the resource packs. And you can see that the stone ends up with my mod name, not my resource pack name.

 

So it is pretty clear that the order is that mod resources load last. However, I agree with you that that isn't the most useful or obviously expected order -- why not let people make resource packs to further modify a mod? I suppose you could argue though that if a mod is taking the trouble to modify a vanilla resource then it isn't clear what the user would want to do.

 

But I'll ask the question in an Issue against MinecraftForge. Maybe it was purposeful. We'll see...

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.