From 02da989e0fef644e2b29f22823b71e4f13e518f0 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 19 Nov 2023 02:13:03 +0100 Subject: Added support for mythic in Visitor Drop Statistics. --- .../features/garden/visitor/GardenVisitorDropStatistics.kt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/main/java') 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(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) { + 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" -- cgit