aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLulonaut <lulonaut@tutanota.de>2023-07-06 01:51:36 +0200
committerGitHub <noreply@github.com>2023-07-06 09:51:36 +1000
commit3ee496ecb794c4b7073d77e2074644104d0a5eeb (patch)
tree402549bbd83a0566cc5cd7706aaecbddcd44dd43 /src
parent1fbb1b2407ed207ab6d52f1c4a8644d93ad267c4 (diff)
downloadNotEnoughUpdates-3ee496ecb794c4b7073d77e2074644104d0a5eeb.tar.gz
NotEnoughUpdates-3ee496ecb794c4b7073d77e2074644104d0a5eeb.tar.bz2
NotEnoughUpdates-3ee496ecb794c4b7073d77e2074644104d0a5eeb.zip
Fix Magical Power calculation (#754)
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewerUtils.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewerUtils.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewerUtils.java
index 8a04e0ff..d8f7d17e 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewerUtils.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewerUtils.java
@@ -106,6 +106,9 @@ public class ProfileViewerUtils {
));
Set<String> ignoredTalismans = new HashSet<>();
+
+ // While there are several crab hats, only one of them counts towards the magical power
+ boolean countedCrabHat = false;
int powerAmount = 0;
for (Map.Entry<String, Integer> entry : accessories.entrySet()) {
if (ignoredTalismans.contains(entry.getKey())) continue;
@@ -127,6 +130,7 @@ public class ProfileViewerUtils {
break;
}
}
+
if (entry.getKey().equals("ABICASE")) {
if (profileInfo != null && profileInfo.has("nether_island_player_data")) {
JsonObject data = profileInfo.get("nether_island_player_data").getAsJsonObject();
@@ -136,6 +140,12 @@ public class ProfileViewerUtils {
}
}
}
+
+ if (entry.getKey().startsWith("PARTY_HAT")) {
+ if (countedCrabHat) continue;
+ countedCrabHat = true;
+ }
+
switch (entry.getValue()) {
case 0:
case 6: