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

Im trying to do this 'ingot.batmanplusplus:Tetsu.name=Tetsu Ingot'

here is my class file

   

public static class UnlocalItem extends Item {

	private static String unlocal;
	private static String pre;

	/**
     * Sets the unlocalized name of this item to the string passed as the parameter, prefixed by 'something'
     */
	//This Could End Badly
    public static Item setUnlocal(String unlocalizedName) {
        unlocal = unlocalizedName;
        
        return setUnlocal(unlocal);
    }

    /**
     * Translates the unlocalized name of this item, but without the .name suffix, so the translation fails and the
     * unlocalized name itself is returned.
     */
    public String getUnlocalInefficiently(ItemStack stack) {
        String s = this.getUnlocal(stack);
        return s == null ? "" : StatCollector.translateToLocal(s);
    }

    /**
     * Returns the unlocalized name of this item.
     */
    public static String getUnlocal(String prefix) {
    	pre = prefix;
        return pre + unlocal;
    }

    /**
     * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have
     * different names based on their damage or NBT.
     */
    public String getUnlocal(ItemStack stack) {
        return pre + this.unlocal;
    }
    
    /**
     * Gets the localized name of this block. Used for the statistics page.
     */
    @Override
    public String getItemStackDisplayName(ItemStack stack)
    {
        return ("" + StatCollector.translateToLocal(this.getUnlocalInefficiently(stack) + ".name")).trim();
    }
}

 

but I keep getting 'ingot.batmanplusplus:Tetsunull.name' instead

My Thought is that its theunlocalizedName from Item, but how is that bleedng through

 

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

You're welcome.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Not To Sound Rude But, Do I Really Need One?

 

If you can solve it on your own, no.  If you're asking for help, yes.

 

Any time you do something unusual, you need to have good understanding of how to do it, plus it needs to be worth the effort and risk.

 

Remember that these names are strings, so if you have a lot of them that are similar, you can probably code up some way to created the string for you.  Or you can just create them all once in a txt file and have that as a resource.

 

Basically, is the time it takes to type up all your names really longer than the time to code and debug an alternate solution?

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.