From c8a7dfb175a667ba2a3aef5bfa1cafeb5df9ae8d Mon Sep 17 00:00:00 2001 From: DoKM Date: Mon, 23 Aug 2021 15:49:18 +0200 Subject: Stop pet exp display showing on itemlist pet --- .../io/github/moulberry/notenoughupdates/NEUEventListener.java | 5 +++++ src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java | 7 +++++++ 2 files changed, 12 insertions(+) (limited to 'src') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java index 29013ea5..c499ce0f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java @@ -2335,6 +2335,11 @@ public class NEUEventListener { private List petToolTipXPExtend(ItemTooltipEvent event) { List tooltipText = new ArrayList(); if (NotEnoughUpdates.INSTANCE.config.tooltipTweaks.petExtendExp) { + if(event.itemStack.getTagCompound().hasKey("ItemList")){ + if(event.itemStack.getTagCompound().getBoolean("ItemList")){ + return tooltipText; + } + } //7 is just a random number i chose, prob no pets with less lines than 7 if (event.toolTip.size() > 7) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java index e2e582fa..2208b53c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java @@ -1987,7 +1987,14 @@ public class NEUOverlay extends Gui { //Render tooltip JsonObject json = tooltipToDisplay.get(); if(json != null) { + ItemStack stack = manager.jsonToStack(json); + { + NBTTagCompound tag = stack.getTagCompound(); + tag.setBoolean("ItemList", true); + stack.setTagCompound(tag); + } + List text = stack.getTooltip(Minecraft.getMinecraft().thePlayer, false); String internalname = json.get("internalname").getAsString(); -- cgit