aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDoKM <mcazzyman@gmail.com>2021-09-21 22:01:25 +0200
committerDoKM <mcazzyman@gmail.com>2021-09-21 22:01:25 +0200
commitcf875e94e8eb0b827e1a7b6c8e24c3f562db3c0c (patch)
treec32e974b62efb574254e81458455c289227c3f5d /src
parent75f6f7ba851fb0f7645da41c26b9c0eb2286512b (diff)
downloadNotEnoughUpdates-cf875e94e8eb0b827e1a7b6c8e24c3f562db3c0c.tar.gz
NotEnoughUpdates-cf875e94e8eb0b827e1a7b6c8e24c3f562db3c0c.tar.bz2
NotEnoughUpdates-cf875e94e8eb0b827e1a7b6c8e24c3f562db3c0c.zip
Add support for the new arrows in neu pv
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java11
1 files changed, 6 insertions, 5 deletions
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 c5bfc057..a2f78e22 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
@@ -1910,14 +1910,15 @@ public class GuiProfileViewer extends GuiScreen {
}
- public int countItemsInInventory(String internalname, JsonObject inventoryInfo, String... invsToSearch) {
+ public int countItemsInInventory(String internalname, JsonObject inventoryInfo, boolean specific, String... invsToSearch) {
int count = 0;
for(String inv : invsToSearch) {
JsonArray invItems = inventoryInfo.get(inv).getAsJsonArray();
for(int i=0; i<invItems.size(); i++) {
if(invItems.get(i) == null || !invItems.get(i).isJsonObject()) continue;
JsonObject item = invItems.get(i).getAsJsonObject();
- if(item.get("internalname").getAsString().equals(internalname)) {
+ if((specific && item.get("internalname").getAsString().equals(internalname)) ||
+ (!specific && item.get("internalname").getAsString().contains(internalname))) {
if(item.has("count")) {
count += item.get("count").getAsInt();
} else {
@@ -2276,13 +2277,13 @@ public class GuiProfileViewer extends GuiScreen {
}
if(arrowCount == -1) {
- arrowCount = countItemsInInventory("ARROW", inventoryInfo, "quiver");
+ arrowCount = countItemsInInventory("ARROW", inventoryInfo, false,"quiver");
}
if(greenCandyCount == -1) {
- greenCandyCount = countItemsInInventory("GREEN_CANDY", inventoryInfo, "candy_inventory_contents");
+ greenCandyCount = countItemsInInventory("GREEN_CANDY", inventoryInfo, true,"candy_inventory_contents");
}
if(purpleCandyCount == -1) {
- purpleCandyCount = countItemsInInventory("PURPLE_CANDY", inventoryInfo, "candy_inventory_contents");
+ purpleCandyCount = countItemsInInventory("PURPLE_CANDY", inventoryInfo, true, "candy_inventory_contents");
}
Utils.drawItemStackWithText(NotEnoughUpdates.INSTANCE.manager.jsonToStack(