aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-09-22 17:47:39 +0200
committerGitHub <noreply@github.com>2022-09-22 17:47:39 +0200
commitc055595e0a35accf1a8a4742286a7b267037ac45 (patch)
treec0f4cf03e5d41010567c2b2cac02ffc0269e2ef7 /src/main/java/io
parentfc949693dac0acb9521867476605d98ff5bde5ec (diff)
downloadNotEnoughUpdates-c055595e0a35accf1a8a4742286a7b267037ac45.tar.gz
NotEnoughUpdates-c055595e0a35accf1a8a4742286a7b267037ac45.tar.bz2
NotEnoughUpdates-c055595e0a35accf1a8a4742286a7b267037ac45.zip
Coop Soulbound kuudra drops (#299)
Diffstat (limited to 'src/main/java/io')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java11
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java4
2 files changed, 11 insertions, 4 deletions
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 6f4167f2..6460e1ed 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.OverlayManager;
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 class RenderListener {
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 class RenderListener {
}
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 class RenderListener {
}
}
- 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 @@ public class RenderListener {
HashMap<String, Double> 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 adf09161..c7c7d4b6 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 class ItemUtils {
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*"));
+ }
}