From 7c2d4ed566246513bc438272e436627412147d62 Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Fri, 11 Oct 2024 12:42:33 -0400 Subject: Backend: Detekt Fixes Part 6 (#2657) Co-authored-by: Cal Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt | 8 +++++--- .../skyhanni/features/mining/glacitemineshaft/CorpseTracker.kt | 10 ++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/mining') diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt index ad2baedbe..0012ed8b0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt @@ -366,9 +366,11 @@ object TunnelsMaps { private fun toCompactGemstoneName(it: Map.Entry>): Renderable = Renderable.clickAndHover( Renderable.string( - (it.key.getFirstColorCode()?.let { "§$it" } ?: "") + ("ROUGH_".plus( - it.key.removeColor().removeSuffix("stone"), - ).asInternalName().itemName.takeWhile { it != ' ' }.removeColor()), + (it.key.getFirstColorCode()?.let { "§$it" } ?: "") + ( + "ROUGH_".plus( + it.key.removeColor().removeSuffix("stone"), + ).asInternalName().itemName.takeWhile { it != ' ' }.removeColor() + ), horizontalAlign = RenderUtils.HorizontalAlignment.CENTER, ), tips = listOf(it.key), diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseTracker.kt index 3e81a01a9..bc5e32440 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseTracker.kt @@ -45,7 +45,11 @@ object CorpseTracker { } override fun getDescription(timesGained: Long): List { - val divisor = 1.coerceAtLeast(getSelectedBucket()?.let { corpsesLooted[it]?.toInt() } ?: corpsesLooted.sumAllValues().toInt()) + val divisor = 1.coerceAtLeast( + getSelectedBucket()?.let { + corpsesLooted[it]?.toInt() + } ?: corpsesLooted.sumAllValues().toInt() + ) val percentage = timesGained.toDouble() / divisor val dropRate = LorenzUtils.formatPercentage(percentage.coerceAtMost(1.0)) return listOf( @@ -85,7 +89,9 @@ object CorpseTracker { if (bucketData.getCorpseCount() == 0L) return@buildList var profit = tracker.drawItems(bucketData, { true }, this) - val applicableKeys: List = bucketData.getSelectedBucket()?.let { listOf(it) } ?: enumValues().toList() + val applicableKeys: List = bucketData.getSelectedBucket()?.let { + listOf(it) + } ?: enumValues().toList() .filter { bucketData.corpsesLooted[it] != null } var totalKeyCost = 0.0 var totalKeyCount = 0 -- cgit