Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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?

  • Author

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?

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.

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.

  • Author

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.

  • Author

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.

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.

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.

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

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.