diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java index 6f4167f2d0..6460e1ed61 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java @@ -60,6 +60,7 @@ import io.github.moulberry.notenoughupdates.overlays.RancherBootOverlay; import io.github.moulberry.notenoughupdates.overlays.TextOverlay; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer; +import io.github.moulberry.notenoughupdates.util.ItemUtils; import io.github.moulberry.notenoughupdates.util.NotificationHandler; import io.github.moulberry.notenoughupdates.util.RequestFocusListener; import io.github.moulberry.notenoughupdates.util.SBInfo; @@ -408,7 +409,7 @@ public void onGuiBackgroundDraw(GuiScreenEvent.BackgroundDrawnEvent event) { GL11.glTranslatef(0, 0, 10); } if (hoverInv) { - renderDungeonChestOverlay(event.gui); + renderDungKuudraChestOverlay(event.gui); if (NotEnoughUpdates.INSTANCE.config.accessoryBag.enableOverlay) { AccessoryBagOverlay.renderOverlay(); } @@ -625,7 +626,7 @@ public void onGuiScreenDrawPost(GuiScreenEvent.DrawScreenEvent.Post event) { } if (NotificationHandler.shouldRenderOverlay(event.gui) && neu.isOnSkyblock() && !hoverInv) { - renderDungeonChestOverlay(event.gui); + renderDungKuudraChestOverlay(event.gui); if (NotEnoughUpdates.INSTANCE.config.accessoryBag.enableOverlay) { AccessoryBagOverlay.renderOverlay(); } @@ -734,7 +735,7 @@ public void onGuiScreenDrawPost(GuiScreenEvent.DrawScreenEvent.Post event) { } } - private void renderDungeonChestOverlay(GuiScreen gui) { + private void renderDungKuudraChestOverlay(GuiScreen gui) { if (NotEnoughUpdates.INSTANCE.config.dungeons.profitDisplayLoc == 3) return; if (gui instanceof GuiChest && NotEnoughUpdates.INSTANCE.config.dungeons.profitDisplayLoc != 2) { try { @@ -771,7 +772,9 @@ private void renderDungeonChestOverlay(GuiScreen gui) { HashMap itemValues = new HashMap<>(); for (int i = 0; i < 5; i++) { ItemStack item = lower.getStackInSlot(11 + i); - String internal = neu.manager.getInternalNameForItem(item); + if (ItemUtils.isSoulbound(item)) continue; + + String internal = neu.manager.createItemResolutionQuery().withItemStack(item).resolveInternalName(); String displayName = item.getDisplayName(); Matcher matcher = ESSENCE_PATTERN.matcher(displayName); if (neu.config.dungeons.useEssenceCostFromBazaar && matcher.matches()) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java index adf09161dc..c7c7d4b645 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java @@ -120,4 +120,8 @@ public static String fixEnchantId(String enchId, boolean useId) { return enchId; } + public static boolean isSoulbound(ItemStack item) { + return ItemUtils.getLore(item).stream() + .anyMatch(line -> line.equals("§8§l* §8Co-op Soulbound §8§l*") || line.equals("§8§l* Soulbound §8§l*")); + } }