aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorkr45732 <52721908+kr45732@users.noreply.github.com>2023-06-19 12:36:22 -0400
committerGitHub <noreply@github.com>2023-06-19 18:36:22 +0200
commitf7168033b41ee84a58adbd005b6ba8898b38cb5a (patch)
treedf9237c0febdb2de33e788ed07f2ed27a6becb50 /src/main
parentef63f49a0127f13cd78a2a682491ac1d685e201a (diff)
downloadNotEnoughUpdates-f7168033b41ee84a58adbd005b6ba8898b38cb5a.tar.gz
NotEnoughUpdates-f7168033b41ee84a58adbd005b6ba8898b38cb5a.tar.bz2
NotEnoughUpdates-f7168033b41ee84a58adbd005b6ba8898b38cb5a.zip
Fix dojo & social (#719)
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/CrimsonIslePage.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/SkyblockProfiles.java8
2 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/CrimsonIslePage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/CrimsonIslePage.java
index ab2f9d59..41835979 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/CrimsonIslePage.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/CrimsonIslePage.java
@@ -212,7 +212,7 @@ public class CrimsonIslePage extends GuiProfileViewerPage {
int totalPoints = 0;
int idx = 0;
for (Map.Entry<String, String> dojoTest : apiDojoTestNames.entrySet()) {
- int curPoints = Utils.getElementAsInt(data.get("dojo.dojo_points_" + dojoTest.getKey()), 0);
+ int curPoints = Utils.getElementAsInt(Utils.getElement(data, "dojo.dojo_points_" + dojoTest.getKey()), 0);
totalPoints += curPoints;
Utils.renderAlignedString(
dojoTest.getValue() + ": ",
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/SkyblockProfiles.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/SkyblockProfiles.java
index 614e03f1..fc836362 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/SkyblockProfiles.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/SkyblockProfiles.java
@@ -629,8 +629,9 @@ public class SkyblockProfiles {
/**
* NOTE: will NOT return null if skills api is disabled, use {@link SkyblockProfile#skillsApiEnabled()} instead
* This can still return null if the leveling constant is not up-to-date
+ *
* @return Map containing skills, slayers, HOTM, dungeons & dungeon classes
- */
+ */
public Map<String, ProfileViewer.Level> getLevelingInfo() {
if (levelingInfo != null) {
return levelingInfo;
@@ -649,7 +650,10 @@ public class SkyblockProfiles {
float skillExperience = 0;
if (skillName.equals("social")) {
// Get the coop's social skill experience since social is a shared skill
- for (Map.Entry<String, JsonElement> memberProfileJson : outerProfileJson.entrySet()) {
+ for (Map.Entry<String, JsonElement> memberProfileJson : Utils
+ .getElement(outerProfileJson, "members")
+ .getAsJsonObject()
+ .entrySet()) {
skillExperience += Utils.getElementAsFloat(
Utils.getElement(memberProfileJson.getValue(), "experience_skill_social2"),
0