Jump to content

Language Registry applies last use to all


miscsubbin

Recommended Posts

I have 4 blocks I'm adding and when I use "LanguageRegistry.addName" for each block, the last usage is applied to all.

 

LanguageRegistry.addName(block1, "Block 1");
LanguageRegistry.addName(block2, "Block 2");
LanguageRegistry.addName(block3, "Block 3");
LanguageRegistry.addName(block4, "Block 4");

 

Is what I have, but when you mouse over the block in game, the tooltip reads "Block 4" for all of them. I've tried rearranging them, and it's always the last one that is used for all of them. What's going on here?

Link to comment
Share on other sites

I have 4 blocks I'm adding and when I use "LanguageRegistry.addName" for each block, the last usage is applied to all.

 

LanguageRegistry.addName(block1, "Block 1");
LanguageRegistry.addName(block2, "Block 2");
LanguageRegistry.addName(block3, "Block 3");
LanguageRegistry.addName(block4, "Block 4");

 

Is what I have, but when you mouse over the block in game, the tooltip reads "Block 4" for all of them. I've tried rearranging them, and it's always the last one that is used for all of them. What's going on here?

Link to comment
Share on other sites

Both, but UnlocalizedName for in-code identification of a block (e.g. you set "myBlock" and it becomes "tile.myBlock") and LanguageRegistry for title shown to a player (e.g. "My Block").

mnn.getNativeLang() != English

If I helped you please click on the "thank you" button.

Link to comment
Share on other sites

Both, but UnlocalizedName for in-code identification of a block (e.g. you set "myBlock" and it becomes "tile.myBlock") and LanguageRegistry for title shown to a player (e.g. "My Block").

mnn.getNativeLang() != English

If I helped you please click on the "thank you" button.

Link to comment
Share on other sites

If you want to get unlocalized name without "tile." prefix use getUnlocalizedName2() instead of getUnlocalizedName(). But as mnn suggested use LangRegistry for shown name and unlocalized name as internal reference. (I use it in custom renderers so I don't have to keep reference to ID.)

Creator of easy custom renderer library without tile entity. https://github.com/skore13/renderLib

Link to comment
Share on other sites

If you want to get unlocalized name without "tile." prefix use getUnlocalizedName2() instead of getUnlocalizedName(). But as mnn suggested use LangRegistry for shown name and unlocalized name as internal reference. (I use it in custom renderers so I don't have to keep reference to ID.)

Creator of easy custom renderer library without tile entity. https://github.com/skore13/renderLib

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.