From f7168033b41ee84a58adbd005b6ba8898b38cb5a Mon Sep 17 00:00:00 2001 From: kr45732 <52721908+kr45732@users.noreply.github.com> Date: Mon, 19 Jun 2023 12:36:22 -0400 Subject: Fix dojo & social (#719) --- .../moulberry/notenoughupdates/profileviewer/CrimsonIslePage.java | 2 +- .../notenoughupdates/profileviewer/SkyblockProfiles.java | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src/main') 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 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 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 memberProfileJson : outerProfileJson.entrySet()) { + for (Map.Entry memberProfileJson : Utils + .getElement(outerProfileJson, "members") + .getAsJsonObject() + .entrySet()) { skillExperience += Utils.getElementAsFloat( Utils.getElement(memberProfileJson.getValue(), "experience_skill_social2"), 0 -- cgit