Jump to content

[1.7.10] Lore is not Cooperating


Selim_042

Recommended Posts

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");
            }
        }
    }

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.