Jump to content

Recommended Posts

Posted

Hello, I am experiencing a very weird + annoying bug in my dev. environment(I have not tested it anywhere else.). Some Items show up with the wrong in game names... more specificly a String from an ArrayList that is only being called once later in load function.

 

width=800 height=428yR2XqYp.png?1 [/img]

 

Did I write something wrong ? Is there a known bug with forge that mixes item naming properties ?

 

Thanks in advence,

Mickey695.

Posted

In your LanguageRegistry for pizza slices dont use an itemstack; use the item or block itself. To do that, change it to:

LanguageRegistry.addName(new ItemStack(pizzaSlice, 1, i).getItem(), ItemPizzaSlice.sliceName[i]) 

hope this helps

 

no... a.) language registry works just fine with item stacks. b.) you are omitting the item damage, which is what he is trying to use.

 

You can NOT use the LanguageRegistry for this, you have to override this method in the item class:

@Override
public String getItemDisplayName(ItemStack itemStack)
{
	return "This is the Item Name";
}

 

language registry works from the unlocalized names of the item, and adds the localization if it exists, what you are adding with the language registry is a specific localization for that which it will use by default (I think anyways)

 

Alternatively you may be able to override the following method and keep your existing code, this should also be more friendly when you come to add localization to your mod, i.e. you add support for names in other languages.

@Override
public String getUnlocalizedName(ItemStack par1ItemStack)
{
	return "This is the unlocalized name";
}

 

the reason you are getting the last string in the array is because that is the last one you registered for that specific unlocalized name

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.