diff options
author | Cow <cow@volloeko.de> | 2021-07-06 20:24:21 +0200 |
---|---|---|
committer | Cow <cow@volloeko.de> | 2021-07-06 20:24:21 +0200 |
commit | 65e5ee4b431cc7513e53d61827249148b06de79a (patch) | |
tree | c55e9c7ebd0c7e37a7a81de0df10b79f67e39930 /src/main/java/de/cowtipper/cowlection/data/HySkyBlockStats.java | |
parent | c0c7011643a6ffa7c549ad4eff662309644b244c (diff) | |
download | Cowlection-65e5ee4b431cc7513e53d61827249148b06de79a.tar.gz Cowlection-65e5ee4b431cc7513e53d61827249148b06de79a.tar.bz2 Cowlection-65e5ee4b431cc7513e53d61827249148b06de79a.zip |
Added 'lowest BINs' support to Chest Tracker & Analyzer
Diffstat (limited to 'src/main/java/de/cowtipper/cowlection/data/HySkyBlockStats.java')
-rw-r--r-- | src/main/java/de/cowtipper/cowlection/data/HySkyBlockStats.java | 18 |
1 files changed, 15 insertions, 3 deletions
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<Pet> 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); } |