aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/cowtipper/cowlection/data/HySkyBlockStats.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/cowtipper/cowlection/data/HySkyBlockStats.java')
-rw-r--r--src/main/java/de/cowtipper/cowlection/data/HySkyBlockStats.java25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/main/java/de/cowtipper/cowlection/data/HySkyBlockStats.java b/src/main/java/de/cowtipper/cowlection/data/HySkyBlockStats.java
index 9b51f02..fb38fe7 100644
--- a/src/main/java/de/cowtipper/cowlection/data/HySkyBlockStats.java
+++ b/src/main/java/de/cowtipper/cowlection/data/HySkyBlockStats.java
@@ -49,19 +49,18 @@ public class HySkyBlockStats {
if (profiles == null) {
return null;
}
- Profile lastSavedProfile = null;
- long latestSave = -1;
for (Profile profile : profiles) {
- long lastProfileSave = profile.getMember(uuid).last_save;
- if (latestSave < lastProfileSave) {
- lastSavedProfile = profile;
- latestSave = lastProfileSave;
+ if (profile.selected) {
+ return profile;
}
}
- return lastSavedProfile;
+ // no selected profile
+ return null;
}
public static class Profile {
+ public boolean selected;
+ private long last_save;
private String cute_name;
private Map<String, Member> members;
private String game_mode;
@@ -87,7 +86,10 @@ public class HySkyBlockStats {
} else if ("ironman".equals(game_mode)) {
return EnumChatFormatting.GRAY + "♲";
}
- return "";
+ }
+
+ public Pair<String, String> getFancyLastSave() {
+ return (last_save > 0) ? Utils.getDurationAsWords(last_save) : null;
}
public double getCoinBank() {
@@ -127,7 +129,6 @@ public class HySkyBlockStats {
}
public static class Member {
- private long last_save;
private long first_join;
private double coin_purse;
private NbtData inv_armor;
@@ -158,10 +159,6 @@ public class HySkyBlockStats {
return Utils.getDurationAsWords(first_join);
}
- public Pair<String, String> getFancyLastSave() {
- return Utils.getDurationAsWords(last_save);
- }
-
public double getCoinPurse() {
return coin_purse;
}
@@ -477,7 +474,7 @@ public class HySkyBlockStats {
*/
public String getSummary(boolean isMasterFloor) {
String floorCompletion;
- if (tier_completions != null) {
+ if (tier_completions != null && tier_completions.size() > 0) {
int highestTierCompletions = tier_completions.get(String.valueOf(highest_tier_completed));
floorCompletion = "" + highestTierCompletions + EnumChatFormatting.GRAY + "x " + EnumChatFormatting.YELLOW + "Floor " + (MooConfig.useRomanNumerals() ? Utils.convertArabicToRoman(highest_tier_completed) : highest_tier_completed);
} else {