diff options
| author | BuildTools <james.jenour@protonmail.com> | 2021-02-05 03:52:39 +0800 |
|---|---|---|
| committer | BuildTools <james.jenour@protonmail.com> | 2021-02-05 03:52:39 +0800 |
| commit | c40f8e737c62c8dadef294f8621716529d354796 (patch) | |
| tree | 3f0fb8be376d09e4fa1a7d95da0624359d8f67b1 /src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java | |
| parent | 5ea3130efceca3148334a613471cec7f22acdf8c (diff) | |
| download | notenoughupdates-c40f8e737c62c8dadef294f8621716529d354796.tar.gz notenoughupdates-c40f8e737c62c8dadef294f8621716529d354796.tar.bz2 notenoughupdates-c40f8e737c62c8dadef294f8621716529d354796.zip | |
PRE15
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.java | 12 |
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); |
