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

I have been trying to figure out my issue with my addInformation method for the past hour and a half or so, but I just can't figure it out.

Nothing at all shows up for lore on the item.

I am importing the java.util.List class, and this is my method:

public void addInformation(ItemStack itemStack, EntityPlayer player, List list) {
	list.add("Modules:");
	if (itemStack.stackTagCompound != null) {
		boolean gogglesOfRevealing = itemStack.stackTagCompound.getBoolean("gogglesOfRevealing");
            if ((gogglesOfRevealing == true) && (LoadConfig.enableGogglesOfRevealing)) {
            		list.add(" - Goggles of Revealing");
            		list.add("     " + EnumChatFormatting.DARK_PURPLE + "Vis discount: 5%");
            }
            boolean terminalGlasses = itemStack.stackTagCompound.getBoolean("terminalGlasses");
            if ((terminalGlasses == true) && (LoadConfig.enableTerminalGlasses)) {
            		list.add(" - Terminal Glasses");
            		Long guid = extractGuid(itemStack);
            		if (guid != null) list.add("     " + StatCollector.translateToLocalFormatted("openperipheral.misc.key", TerminalUtils.formatTerminalId(guid)));
            }
            boolean nightVision = itemStack.stackTagCompound.getBoolean("nightVision");
            if (nightVision == true) {
              		list.add(" - Night Vision");
            }
        }
    }

Please describe what you want in detail, and what you get with that code.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

  • Author

Well, that is looking at the NBT data of the item, and displaying lore dependant on what NBT is true.  But, not even the "Modules:" text that should be displayed not caring about NBT doesn't show.

Well, that is looking at the NBT data of the item, and displaying lore dependant on what NBT is true.  But, not even the "Modules:" text that should be displayed not caring about NBT doesn't show.

Then, first put @Override on the head of the method to check if your method is overriding the Item's method properly.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

  • Author

It does not Override properly, asks where it wants to create a new method at, then lists all the Interfaces that my class implements.  Might help to note that my item is a helmet, and extends the ItemArmor class rather than Item.

What you should override:

    public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_)

 

So you omitted a boolean!

 

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

  • Author

Can you throw in a System.err.println(); to check if the addInformation method is being called?

 

It appears it is not being called.

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.