TheGreyGhost / MinecraftByExample

Working sample code for the basic concepts in Minecraft and Forge.
Other
1.25k stars 190 forks source link

Tutorial 01-1.12.2. Not picking lang name #57

Closed Xaunther closed 4 years ago

Xaunther commented 4 years ago

Hello, and sorry if this is not the proper place to post this. I was following your nice tutorial to start on modded minecraft. I was able to complete the first task, except for the language file. I am following the example step by step, but I changed the names a bit so that I can learn better what's going on.

The thing is I am registering the simple block as

blockSimple =new BlockSimple();
blockSimple.setUnlocalizedName("xfbe01_block_simple");
blockSimple.setRegistryName("xfbe01_block_simple");
ForgeRegistries.BLOCKS.register(blockSimple);
// We also need to create and register an ItemBlock for this block otherwise it won't appear in the inventory
itemBlockSimple = new ItemBlock(blockSimple);
itemBlockSimple.setRegistryName(blockSimple.getRegistryName());
ForgeRegistries.ITEMS.register(itemBlockSimple);

So the corresponding lang file (en_US.lang) contains:

tile.xfbe01_block_simple.name=XFBE01 Block Simple

No errors appear when I run minecraft, it's simply that the displayed name of the block is tile.xfbe01_block_simple.name. I've checked that the language is set to english (US), I've tried with different names... I've tried in Linux and in Windows... but I never get to pick up the name provided in the lang file.

Do you have any idea on this? You can see my whole file structure at https://github.com/Xaunther/XauntherFBE. I just ran out of ideas to solve it...

Thanks!

TheGreyGhost commented 4 years ago

Howdy I deleted the resources\pack.mcmeta file and it works properly now. You could ask further questions in this forum https://www.minecraftforge.net/forum/forum/70-modder-support/ Lots of helpful folks there who will usually reply a lot faster than I can

Cheers TGG

Xaunther commented 4 years ago

Owww, I guess when I copied that file I wasn't looking at the right branch... Thank you very much for the solution and the advice!