diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-05 13:31:02 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-05 13:31:02 +0100 |
commit | 1aed35c84c55688222818d2333059f9790db3c36 (patch) | |
tree | b3a628ff47d34130e6ff4251d0faf487a005be3f /src/main/java/at/hannibal2/skyhanni | |
parent | bb8c07cdaa0264120e0f934d99370a7321842ee6 (diff) | |
download | skyhanni-1aed35c84c55688222818d2333059f9790db3c36.tar.gz skyhanni-1aed35c84c55688222818d2333059f9790db3c36.tar.bz2 skyhanni-1aed35c84c55688222818d2333059f9790db3c36.zip |
using visitorDrops.visitorRarities directly from the config instead of accessing the local field. hopefully this will prevent partial config resets in the future.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt | 7 |
1 files changed, 3 insertions, 4 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 c4b7fc0a3..6a9d53e15 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 @@ -29,7 +29,6 @@ object GardenVisitorDropStatistics { private var acceptedVisitors = 0 var deniedVisitors = 0 private var totalVisitors = 0 - private var visitorRarities = mutableListOf<Long>() var coinsSpent = 0L var lastAccept = 0L @@ -117,6 +116,7 @@ object GardenVisitorDropStatistics { private fun setRarities(rarity: String) { acceptedVisitors += 1 val currentRarity = VisitorRarity.valueOf(rarity) + val visitorRarities = GardenAPI.config?.visitorDrops?.visitorRarities ?: return val temp = visitorRarities[currentRarity.ordinal] + 1 visitorRarities[currentRarity.ordinal] = temp saveAndUpdate() @@ -128,6 +128,7 @@ object GardenVisitorDropStatistics { //1 addAsSingletonList(format(totalVisitors, "Total", "§e", "")) //2 + val visitorRarities = hidden.visitorRarities if (visitorRarities.isNotEmpty()) { addAsSingletonList( "§a${visitorRarities[0].addSeparators()}§f-" + @@ -197,7 +198,6 @@ object GardenVisitorDropStatistics { hidden.acceptedVisitors = acceptedVisitors hidden.deniedVisitors = deniedVisitors totalVisitors = acceptedVisitors + deniedVisitors - hidden.visitorRarities = visitorRarities hidden.coinsSpent = coinsSpent hidden.rewardsCount = rewardsCount display = formatDisplay(drawDisplay(hidden)) @@ -215,7 +215,6 @@ object GardenVisitorDropStatistics { acceptedVisitors = hidden.acceptedVisitors deniedVisitors = hidden.deniedVisitors totalVisitors = acceptedVisitors + deniedVisitors - visitorRarities = hidden.visitorRarities coinsSpent = hidden.coinsSpent rewardsCount = hidden.rewardsCount saveAndUpdate() @@ -243,4 +242,4 @@ object GardenVisitorDropStatistics { enum class VisitorRarity { UNCOMMON, RARE, LEGENDARY, SPECIAL, -}
\ No newline at end of file +} |