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

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.

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

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.