aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java
index 227d94bd..f13f562e 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java
@@ -355,6 +355,8 @@ public class ProfileViewer {
JsonObject inventoryInfo = getInventoryInfo(profileId);
JsonObject profileInfo = getProfileInformation(profileId);
+ HashMap<String, Long> mostExpensiveInternal = new HashMap<>();
+
long networth = 0;
for(Map.Entry<String, JsonElement> entry : inventoryInfo.entrySet()) {
if(entry.getValue().isJsonArray()) {
@@ -393,7 +395,7 @@ public class ProfileViewer {
if(internalname2 != null) {
if(manager.auctionManager.isVanillaItem(internalname2)) continue;
- JsonObject bzInfo2 = manager.auctionManager.getBazaarInfo(internalname);
+ JsonObject bzInfo2 = manager.auctionManager.getBazaarInfo(internalname2);
int auctionPrice2;
if(bzInfo2 != null) {
@@ -406,6 +408,8 @@ public class ProfileViewer {
}
int count2 = items.getCompoundTagAt(j).getByte("Count");
+
+ mostExpensiveInternal.put(internalname2, auctionPrice2 * count2 + mostExpensiveInternal.getOrDefault(internalname2, 0L));
networth += auctionPrice2 * count2;
}
}
@@ -417,6 +421,7 @@ public class ProfileViewer {
if(element.getAsJsonObject().has("count")) {
count = element.getAsJsonObject().get("count").getAsInt();
}
+ mostExpensiveInternal.put(internalname, auctionPrice * count + mostExpensiveInternal.getOrDefault(internalname, 0L));
networth += auctionPrice * count;
}
}
@@ -424,6 +429,11 @@ public class ProfileViewer {
}
if(networth == 0) return -1;
+ //System.out.println(profileId);
+ for(Map.Entry<String, Long> entry : mostExpensiveInternal.entrySet()) {
+ //System.out.println(entry.getKey() + ":" + entry.getValue());
+ }
+
networth = (int)(networth*1.3f);
JsonObject petsInfo = getPetsInfo(profileId);