Posted June 8, 201510 yr 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"); } } }
June 8, 201510 yr 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.
June 8, 201510 yr 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.
June 8, 201510 yr 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.
June 8, 201510 yr 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.
June 8, 201510 yr Can you throw in a System.err.println(); to check if the addInformation method is being called?
June 8, 201510 yr 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.
June 8, 201510 yr 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.