diff options
| author | kr45732 <52721908+kr45732@users.noreply.github.com> | 2023-06-08 10:00:04 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-08 16:00:04 +0200 |
| commit | 8115922b37e375285c2a72dbdbb5d83fd942e27c (patch) | |
| tree | e0d6cb5228493e8bb032465cbb2dfd95b4946e43 /src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PetsPage.java | |
| parent | a6fb7bfb97d313b665085a52a660150f1da26065 (diff) | |
| download | notenoughupdates-8115922b37e375285c2a72dbdbb5d83fd942e27c.tar.gz notenoughupdates-8115922b37e375285c2a72dbdbb5d83fd942e27c.tar.bz2 notenoughupdates-8115922b37e375285c2a72dbdbb5d83fd942e27c.zip | |
PV Overhaul (#708)
Co-authored-by: Lulonaut <lulonaut@tutanota.de>
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PetsPage.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PetsPage.java | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PetsPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PetsPage.java index a56662e7..4eda3d9f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PetsPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PetsPage.java @@ -65,15 +65,23 @@ public class PetsPage extends GuiProfileViewerPage { int guiLeft = GuiProfileViewer.getGuiLeft(); int guiTop = GuiProfileViewer.getGuiTop(); - ProfileViewer.Profile profile = GuiProfileViewer.getProfile(); - String profileId = GuiProfileViewer.getProfileId(); - JsonObject petsInfo = profile.getPetsInfo(profileId); - if (petsInfo == null) return; JsonObject petsJson = Constants.PETS; - if (petsJson == null) return; + if (petsJson == null) { + return; + } + + SkyblockProfiles.SkyblockProfile selectedProfile = getSelectedProfile(); + if (selectedProfile == null) { + return; + } + + JsonObject petsInfo = selectedProfile.getPetsInfo(); + if (petsInfo == null) { + return; + } String location = null; - JsonObject status = profile.getPlayerStatus(); + JsonObject status = GuiProfileViewer.getProfile().getPlayerStatus(); if (status != null && status.has("mode")) { location = status.get("mode").getAsString(); } @@ -98,13 +106,13 @@ public class PetsPage extends GuiProfileViewerPage { } sortedPets.sort((pet1, pet2) -> { String tier1 = pet1.get("tier").getAsString(); - String tierNum1 = GuiProfileViewer.MINION_RARITY_TO_NUM.get(tier1); + String tierNum1 = GuiProfileViewer.RARITY_TO_NUM.get(tier1); if (tierNum1 == null) return 1; int tierNum1I = Integer.parseInt(tierNum1); float exp1 = pet1.get("exp").getAsFloat(); String tier2 = pet2.get("tier").getAsString(); - String tierNum2 = GuiProfileViewer.MINION_RARITY_TO_NUM.get(tier2); + String tierNum2 = GuiProfileViewer.RARITY_TO_NUM.get(tier2); if (tierNum2 == null) return -1; int tierNum2I = Integer.parseInt(tierNum2); float exp2 = pet2.get("exp").getAsFloat(); |
