diff options
author | DoKM <mcazzyman@gmail.com> | 2021-07-31 22:16:37 +0200 |
---|---|---|
committer | DoKM <mcazzyman@gmail.com> | 2021-07-31 22:16:37 +0200 |
commit | 841f23740c6e23a030a64286c5c3c4ee337700cf (patch) | |
tree | c41721d682733e1b653937651a50fdf6ac14c274 /src/main/java/io | |
parent | 733dd2d84b022a758fd0de68103c1c15f2f653d4 (diff) | |
download | NotEnoughUpdates-841f23740c6e23a030a64286c5c3c4ee337700cf.tar.gz NotEnoughUpdates-841f23740c6e23a030a64286c5c3c4ee337700cf.tar.bz2 NotEnoughUpdates-841f23740c6e23a030a64286c5c3c4ee337700cf.zip |
Remove description and tooltip from Backpack/personalvault in pv
Diffstat (limited to 'src/main/java/io')
3 files changed, 29 insertions, 2 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java b/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java index ff618f10..9c2c1ef9 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java @@ -20,6 +20,9 @@ public class ItemPriceInformation { } public static boolean addToTooltip(List<String> tooltip, String internalname, ItemStack stack, boolean useStackSize) { + if(stack.getTagCompound().hasKey("disableNeuTooltip") && stack.getTagCompound().getBoolean("disableNeuTooltip")){ + return false; + } JsonObject auctionInfo = NotEnoughUpdates.INSTANCE.manager.auctionManager.getItemAuctionInfo(internalname); JsonObject bazaarInfo = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo(internalname); float lowestBinAvg = NotEnoughUpdates.INSTANCE.manager.auctionManager.getItemAvgBin(internalname); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java index 4eb1858a..0e3a1836 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -1651,14 +1651,15 @@ public class GuiProfileViewer extends GuiScreen { invNameToDisplayMap.put("inv_contents", Utils.createItemStack(Item.getItemFromBlock(Blocks.chest), EnumChatFormatting.GRAY+"Inventory")); invNameToDisplayMap.put("ender_chest_contents", Utils.createItemStack(Item.getItemFromBlock(Blocks.ender_chest), EnumChatFormatting.GRAY+"Ender Chest")); //invNameToDisplayMap.put("backpack_contents", Utils.createItemStack(Item.getItemFromBlock(Blocks.dropper), EnumChatFormatting.GRAY+"Backpacks")); - invNameToDisplayMap.put("backpack_contents", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("JUMBO_BACKPACK")).setStackDisplayName(EnumChatFormatting.GRAY+"Backpacks")); - invNameToDisplayMap.put("personal_vault_contents", NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("IRON_CHEST")).setStackDisplayName(EnumChatFormatting.GRAY+"Personal vault")); + invNameToDisplayMap.put("backpack_contents", Utils.editItemStackInfo(NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("JUMBO_BACKPACK")),EnumChatFormatting.GRAY+"Backpacks", true)); + invNameToDisplayMap.put("personal_vault_contents", Utils.editItemStackInfo(NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("IRON_CHEST")),EnumChatFormatting.GRAY+"Personal vault", true)); invNameToDisplayMap.put("talisman_bag", Utils.createItemStack(Items.golden_apple, EnumChatFormatting.GRAY+"Accessory Bag")); invNameToDisplayMap.put("wardrobe_contents", Utils.createItemStack(Items.leather_chestplate, EnumChatFormatting.GRAY+"Wardrobe")); invNameToDisplayMap.put("fishing_bag", Utils.createItemStack(Items.fish, EnumChatFormatting.GRAY+"Fishing Bag")); invNameToDisplayMap.put("potion_bag", Utils.createItemStack(Items.potionitem, EnumChatFormatting.GRAY+"Potion Bag")); } + public int countItemsInInventory(String internalname, JsonObject inventoryInfo, String... invsToSearch) { int count = 0; for(String inv : invsToSearch) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java index c40101ca..a4af51ca 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java @@ -610,6 +610,29 @@ public class Utils { return stack; } + public static ItemStack editItemStackInfo(ItemStack itemStack, String displayName, boolean disableNeuToolTips, String... lore){ + NBTTagCompound tag = itemStack.getTagCompound(); + NBTTagCompound display = tag.getCompoundTag("display"); + NBTTagList Lore = new NBTTagList(); + + for(String line : lore) { + Lore.appendTag(new NBTTagString(line)); + } + + display.setString("Name", displayName); + display.setTag("Lore", Lore); + + tag.setTag("display", display); + tag.setInteger("HideFlags", 254); + if(disableNeuToolTips){ + tag.setBoolean("disableNeuTooltip", true); + } + + itemStack.setTagCompound(tag); + + return itemStack; + } + public static void drawStringF(String str, FontRenderer fr, float x, float y, boolean shadow, int colour) { fr.drawString(str, x, y, colour, shadow); } |