aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/garden
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/garden')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt
index 0887b05bf..28deea65d 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt
@@ -118,6 +118,7 @@ object GardenVisitorDropStatistics {
acceptedVisitors += 1
val currentRarity = LorenzUtils.enumValueOf<VisitorRarity>(rarity)
val visitorRarities = GardenAPI.storage?.visitorDrops?.visitorRarities ?: return
+ fixRaritiesSize(visitorRarities)
val temp = visitorRarities[currentRarity.ordinal] + 1
visitorRarities[currentRarity.ordinal] = temp
saveAndUpdate()
@@ -130,12 +131,14 @@ object GardenVisitorDropStatistics {
addAsSingletonList(format(totalVisitors, "Total", "§e", ""))
//2
val visitorRarities = storage.visitorRarities
+ fixRaritiesSize(visitorRarities)
if (visitorRarities.isNotEmpty()) {
addAsSingletonList(
"§a${visitorRarities[0].addSeparators()}§f-" +
"§9${visitorRarities[1].addSeparators()}§f-" +
"§6${visitorRarities[2].addSeparators()}§f-" +
- "§c${visitorRarities[3].addSeparators()}"
+ "§d${visitorRarities[3].addSeparators()}§f-" +
+ "§c${visitorRarities[4].addSeparators()}"
)
} else {
addAsSingletonList("§c?")
@@ -181,6 +184,15 @@ object GardenVisitorDropStatistics {
addAsSingletonList(format(storage.gemstonePowder, "Gemstone Powder", "§d", "§d"))
}
+ // Adding the mythic rarity between legendary and special, if missing
+ private fun fixRaritiesSize(list: MutableList<Long>) {
+ if (list.size == 4) {
+ val legendary = list.last()
+ list[3] = 0L
+ list.add(legendary)
+ }
+ }
+
fun format(amount: Number, name: String, color: String, amountColor: String = color) =
if (config.displayNumbersFirst)
"$color${format(amount)} $name"