aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com>2022-11-02 15:59:07 +0000
committerGitHub <noreply@github.com>2022-11-02 16:59:07 +0100
commita6b5448d962792e647d9ea67067dec8360925997 (patch)
treebb5e3802c9c38f4a8999b888eedae6dd7424a740
parent7c59b2081814cf5ad0eccdf8371dbee410ae85f3 (diff)
downloadNotEnoughUpdates-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
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/InventoriesPage.java3
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PlayerStats.java12
2 files changed, 13 insertions, 2 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/InventoriesPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/InventoriesPage.java
index b4f1da30..a981183a 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/InventoriesPage.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/InventoriesPage.java
@@ -127,6 +127,7 @@ public class InventoriesPage extends GuiProfileViewerPage {
ProfileViewer.Profile profile = GuiProfileViewer.getProfile();
String profileId = GuiProfileViewer.getProfileId();
JsonObject inventoryInfo = profile.getInventoryInfo(profileId);
+ JsonObject profileInformation = profile.getProfileInformation(profileId);
if (inventoryInfo == null) return;
int invNameIndex = 0;
@@ -153,7 +154,7 @@ public class InventoriesPage extends GuiProfileViewerPage {
getInstance().tooltipToDisplay = entry.getValue().getTooltip(Minecraft.getMinecraft().thePlayer, false);
if (Objects.equals(entry.getKey(), "talisman_bag")) {
StringBuilder magicalPowerString = new StringBuilder(EnumChatFormatting.DARK_GRAY + "Magical Power: ");
- int magicalPower = PlayerStats.getMagicalPower(inventoryInfo);
+ int magicalPower = PlayerStats.getMagicalPower(inventoryInfo, profileInformation);
getInstance()
.tooltipToDisplay.add(
magicalPower == -1
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: