diff options
| author | Lulonaut <67191924+Lulonaut@users.noreply.github.com> | 2022-06-22 14:41:15 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-22 14:41:15 +0200 |
| commit | f34220a92af85a33d979edb24ac5c3e698498fe3 (patch) | |
| tree | d36bcc12b1fd4116003c1c36cb09666f0e3f36c1 /src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java | |
| parent | 439fc22ff04b0f5b0201c2d982bceb18d82fd553 (diff) | |
| download | notenoughupdates-f34220a92af85a33d979edb24ac5c3e698498fe3.tar.gz notenoughupdates-f34220a92af85a33d979edb24ac5c3e698498fe3.tar.bz2 notenoughupdates-f34220a92af85a33d979edb24ac5c3e698498fe3.zip | |
bug fixes (#172)
* yikes
* cookie warning
* better wording in docs
* edit items in parent that are the bounds of the item list
* totalCount not updating when not present
* unplayable
* comment?
* outdated repo notification
* more notification
* crash
* more crash
* cookie bug
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java index 40445298..b1e76dcc 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -958,6 +958,7 @@ public class GuiProfileViewer extends GuiScreen { List<Integer> configList = NotEnoughUpdates.INSTANCE.config.profileViewer.pageLayout; for (int i = 0; i < configList.size(); i++) { ProfileViewerPage page = ProfileViewerPage.getById(configList.get(i)); + if (page == null) continue; if (page.stack == null || (page == ProfileViewerPage.BINGO && !showBingoPage)) { ignoredTabs++; continue; @@ -1324,7 +1325,7 @@ public class GuiProfileViewer extends GuiScreen { dungeonLevelTextField.setCustomBorderColour(0xffffffff); floorLevelTo = Integer.parseInt(dungeonLevelTextField.getText()); - JsonArray levelingArray = Utils.getElement(leveling, "catacombs").getAsJsonArray(); + JsonArray levelingArray = Utils.getElementOrDefault(leveling, "catacombs", new JsonArray()).getAsJsonArray(); float remaining = -((levelObjCata.level % 1) * levelObjCata.maxXpForLevel); @@ -1373,7 +1374,7 @@ public class GuiProfileViewer extends GuiScreen { profileInfo, "dungeons.dungeon_types.catacombs.experience" ), 0); - levelObjCata = ProfileViewer.getLevel(Utils.getElement(leveling, "catacombs").getAsJsonArray(), + levelObjCata = ProfileViewer.getLevel(Utils.getElementOrDefault(leveling, "catacombs", new JsonArray()).getAsJsonArray(), cataXp, 99, false ); levelObjCata.totalXp = cataXp; @@ -1852,7 +1853,7 @@ public class GuiProfileViewer extends GuiScreen { "dungeons.player_classes." + skillName.toLowerCase() + ".experience" ), 0); ProfileViewer.Level levelObj = - ProfileViewer.getLevel(Utils.getElement(leveling, "catacombs").getAsJsonArray(), + ProfileViewer.getLevel(Utils.getElementOrDefault(leveling, "catacombs", new JsonArray()).getAsJsonArray(), cataXp, 50, false ); levelObjClasses.put(skillName, levelObj); @@ -3616,7 +3617,7 @@ public class GuiProfileViewer extends GuiScreen { ProfileViewer.Level levelObjhotm = levelObjhotms.get(profileId); if (levelObjhotm == null) { float hotmXp = Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.experience"), 0); - levelObjhotm = ProfileViewer.getLevel(Utils.getElement(leveling, "HOTM").getAsJsonArray(), + levelObjhotm = ProfileViewer.getLevel(Utils.getElementOrDefault(leveling, "HOTM", new JsonArray()).getAsJsonArray(), hotmXp, 7, false ); levelObjhotms.put(profileId, levelObjhotm); |
