diff options
| author | NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> | 2022-11-02 15:59:07 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-02 16:59:07 +0100 |
| commit | a6b5448d962792e647d9ea67067dec8360925997 (patch) | |
| tree | bb5e3802c9c38f4a8999b888eedae6dd7424a740 /src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PlayerStats.java | |
| parent | 7c59b2081814cf5ad0eccdf8371dbee410ae85f3 (diff) | |
| download | notenoughupdates-a6b5448d962792e647d9ea67067dec8360925997.tar.gz notenoughupdates-a6b5448d962792e647d9ea67067dec8360925997.tar.bz2 notenoughupdates-a6b5448d962792e647d9ea67067dec8360925997.zip | |
Added the extra MP that abicases give to pv (#409)
Made the abicase give the extra powder
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PlayerStats.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PlayerStats.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PlayerStats.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PlayerStats.java index b0cc930a..c5a17aef 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PlayerStats.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PlayerStats.java @@ -657,7 +657,7 @@ public class PlayerStats { * @return the amount of Magical Power or -1 * @see io.github.moulberry.notenoughupdates.profileviewer.ProfileViewer.Profile#getInventoryInfo(String) */ - public static int getMagicalPower(JsonObject inventoryInfo) { + public static int getMagicalPower(JsonObject inventoryInfo, JsonObject profileInfo) { if (inventoryInfo == null || !inventoryInfo.has("talisman_bag") || !inventoryInfo.get("talisman_bag").isJsonArray()) { return -1; } @@ -705,6 +705,16 @@ public class PlayerStats { break; } } + if (entry.getKey().equals("ABICASE")) { + if (profileInfo.has("nether_island_player_data") && + profileInfo.get("nether_island_player_data").getAsJsonObject().has("abiphone") && profileInfo.get( + "nether_island_player_data").getAsJsonObject().get("abiphone").getAsJsonObject().has("active_contacts")) { // BatChest + int contact = + profileInfo.get("nether_island_player_data").getAsJsonObject().get("abiphone").getAsJsonObject().get( + "active_contacts").getAsJsonArray().size(); + powderAmount += Math.floor(contact / 2); + } + } switch (entry.getValue()) { case 0: case 6: |
