aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-19 02:13:03 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-19 02:13:03 +0100
commit02da989e0fef644e2b29f22823b71e4f13e518f0 (patch)
tree56c557a96afbe9f402230d141eb2795a6f5aa559 /src/main/java
parent85d0e7f20a9f0785a57d9c0b01fbd6698f617fd2 (diff)
downloadskyhanni-02da989e0fef644e2b29f22823b71e4f13e518f0.tar.gz
skyhanni-02da989e0fef644e2b29f22823b71e4f13e518f0.tar.bz2
skyhanni-02da989e0fef644e2b29f22823b71e4f13e518f0.zip
Added support for mythic in Visitor Drop Statistics.
Diffstat (limited to 'src/main/java')
-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"