From 65e5ee4b431cc7513e53d61827249148b06de79a Mon Sep 17 00:00:00 2001 From: Cow Date: Tue, 6 Jul 2021 20:24:21 +0200 Subject: Added 'lowest BINs' support to Chest Tracker & Analyzer --- .../de/cowtipper/cowlection/data/HySkyBlockStats.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/main/java/de/cowtipper/cowlection/data/HySkyBlockStats.java') diff --git a/src/main/java/de/cowtipper/cowlection/data/HySkyBlockStats.java b/src/main/java/de/cowtipper/cowlection/data/HySkyBlockStats.java index 2fa802b..4bf5093 100644 --- a/src/main/java/de/cowtipper/cowlection/data/HySkyBlockStats.java +++ b/src/main/java/de/cowtipper/cowlection/data/HySkyBlockStats.java @@ -220,12 +220,16 @@ public class HySkyBlockStats { } public List getPets() { - pets.sort((p1, p2) -> ComparisonChain.start().compare(p2.active, p1.active).compare(p2.getRarity(), p1.getRarity()).compare(p2.exp, p1.exp).result()); + if (pets == null) { + pets = Collections.emptyList(); + } else { + pets.sort((p1, p2) -> ComparisonChain.start().compare(p2.active, p1.active).compare(p2.getRarity(), p1.getRarity()).compare(p2.exp, p1.exp).result()); + } return pets; } public Pet getActivePet() { - for (Pet pet : pets) { + for (Pet pet : getPets()) { if (pet.isActive()) { return pet; } @@ -234,7 +238,7 @@ public class HySkyBlockStats { } public Pet getPet(String type) { - for (Pet pet : pets) { + for (Pet pet : getPets()) { if (type.equals(pet.type)) { return pet; } @@ -298,6 +302,14 @@ public class HySkyBlockStats { return active; } + public String getType() { + return type; + } + + public double getExp() { + return exp; + } + public DataHelper.SkyBlockRarity getRarity() { return DataHelper.SkyBlockRarity.valueOf(tier); } -- cgit