Jump to content

Recommended Posts

Posted

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?

Posted

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?

Posted

You're not setting proper internal names of your blocks (use setUnlocalizedName).

mnn.getNativeLang() != English

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

Posted

You're not setting proper internal names of your blocks (use setUnlocalizedName).

mnn.getNativeLang() != English

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

Posted

Ok, I did that and it almost works. However, now it says "tile.Block Name" in the tooltips. Should I be using LanguageRegistry, or just the setUnlocalizedName? I'm currently doing both.

Posted

Ok, I did that and it almost works. However, now it says "tile.Block Name" in the tooltips. Should I be using LanguageRegistry, or just the setUnlocalizedName? I'm currently doing both.

Posted

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.

Posted

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.

Posted

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

Posted

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

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.