Jump to content

Recommended Posts

Posted

When viewed in-game, they show as 'tile.MultiBlock_UN.name'.

Here is the code for my Block:

 

  Reveal hidden contents

 

And the code for my ItemBlock:

 

  Reveal hidden contents

 

And the code for registering the names in the Language Registry:

 

  Reveal hidden contents

 

If I helped please press the Thank You button.

 

Check out my mods at http://www.curse.com/users/The_Fireplace/projects

Posted

There seems to be an error in the method you are using to register the different sub-Names. You could use LanguageRegistry.instance().addStringLocalization("tile.MultiBlock_UN.name", "en_US", "Solidified Knowledge");

 

But then they would all have the same Name...

 

Make sure you add an extra Localization for every sub block. This could be done when You are adding them to their Creative Tab.

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Posted

To register subtype names using the LanguageRegistry, you actually have to create an instance of each ItemStack with the appropriate metadata/damage value, and register the name for it:

for (int i = 0; i < numSubBlocksYouHave; ++i) {
ItemStack stack = new ItemStack(yourBlock, 1, i);
// easiest if you have a static array of Strings for the names
// otherwise you can't use a for loop very well
LanguageRegistry.addName(stack, yourBlock.names[i]);
}

In 1.6.4, in most cases you can also just use the vanilla ItemBlockWithMetadata directly, unless you need some special handling of onItemUse or the like.

 

You may want to consider switching to a language file, though, since that's the way of the future.

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.