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.

[Solved] All blocks getting the same name (forgot set.UnlocalizedName)

Featured Replies

Posted

Hi!

 

I'm just playing around with some power blocks for the fun of it.

I have created three blocks and set them up as normal blocks.

 

public final static Block blockGenerator = new BlockGenerator(450);
public final static Block blockPowered = new BlockPowered(555);
public final static Block blockCable = new BlockCable(632);

And inn the Load method I do the following:

GameRegistry.registerBlock(blockPowered, "poweredBlock");
	LanguageRegistry.addName(blockPowered, "Powered Block");

	GameRegistry.registerBlock(blockCable, "CableBlock");
	LanguageRegistry.addName(blockCable, "A simple Cable");

	GameRegistry.registerBlock(blockGenerator, "GenBlock");
	LanguageRegistry.addName(blockGenerator, "Generator Block");

 

However in the game, the tooltips for all 3 is the same as the last one "Generator Block".

If I rearrange them, the result it that it's always the last name to be called with the .addName method which is given to all 3 of them.

Why would this be? O.o

If you guys dont get it.. then well ya.. try harder...

  • Author

I guess I just have to use setUnlocalizedName() methods inside my blocks now, hopefully that will work :)

 

Edit: Well just by using the set on one of them the problem got solved and they all got names as they where named inn .addName()

I guess I just have to start using setUnlocalizedName() from now on :)

If you guys dont get it.. then well ya.. try harder...

Guest
This topic is now closed to further replies.

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.