Jump to content

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


Recommended Posts

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

Posted

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.

Announcements



×
×
  • Create New...

Important Information

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