diff options
author | David Cole <40234707+DavidArthurCole@users.noreply.github.com> | 2024-10-11 12:42:33 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-11 18:42:33 +0200 |
commit | 7c2d4ed566246513bc438272e436627412147d62 (patch) | |
tree | edf8d3d01a49bd7c4f5993bae6367613c32fcaac /src/main/java/at/hannibal2/skyhanni/features/rift | |
parent | 0671e35163d55ab0f940aa6806a0d7bfb2876429 (diff) | |
download | skyhanni-7c2d4ed566246513bc438272e436627412147d62.tar.gz skyhanni-7c2d4ed566246513bc438272e436627412147d62.tar.bz2 skyhanni-7c2d4ed566246513bc438272e436627412147d62.zip |
Backend: Detekt Fixes Part 6 (#2657)
Co-authored-by: Cal <cwolfson58@gmail.com>
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/rift')
7 files changed, 51 insertions, 39 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt index 48fa8d03f..af82198bf 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt @@ -21,7 +21,7 @@ object RiftAPI { val farmingTool by lazy { "FARMING_WAND".asInternalName() } - private val blowgun by lazy { "BERBERIS_BLOWGUN".asInternalName() } + private val blowgun by lazy { "BERBERIS_BLOWGUN".asInternalName() } val ItemStack?.isBlowgun: Boolean get() = this?.getInternalName() == blowgun diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/VoltHighlighter.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/VoltHighlighter.kt index 50887554d..6b94919ee 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/VoltHighlighter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/VoltHighlighter.kt @@ -56,7 +56,8 @@ object VoltHighlighter { if (config.voltMoodMeter) RenderLivingEntityHelper.setEntityColorWithNoHurtTime( - entity, when (state) { + entity, + when (state) { VoltState.FRIENDLY -> 0x8000FF00.toInt() VoltState.DOING_LIGHTNING -> 0x800000FF.toInt() VoltState.HOSTILE -> 0x80FF0000.toInt() diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/WoodenButtonsHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/WoodenButtonsHelper.kt index 92e6c2014..516ecfd90 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/WoodenButtonsHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/WoodenButtonsHelper.kt @@ -131,7 +131,8 @@ object WoodenButtonsHelper { blockState.getValue(BlockButtonWood.POWERED) == true && buttonLocation.canBeSeen(1..3) && lastHitButton != buttonLocation && - !hitButtons.contains(buttonLocation)) { + !hitButtons.contains(buttonLocation) + ) { lastHitButton = buttonLocation addLastHitButton() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingMetalSuitProgress.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingMetalSuitProgress.kt index 9c65a273e..913cfc4bf 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingMetalSuitProgress.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingMetalSuitProgress.kt @@ -46,14 +46,18 @@ object LivingMetalSuitProgress { if (config.compactWhenMaxed && isMaxed) return@buildList for ((stack, progress) in progressMap.entries.reversed()) { - add(buildList { - add(" §7- ") - add(stack) - add("${stack.displayName}: ") - add(progress?.let { - drawProgressBar(progress) + " §b${LorenzUtils.formatPercentage(progress)}" - } ?: "§cStart upgrading it!") - }) + add( + buildList { + add(" §7- ") + add(stack) + add("${stack.displayName}: ") + add( + progress?.let { + drawProgressBar(progress) + " §b${LorenzUtils.formatPercentage(progress)}" + } ?: "§cStart upgrading it!" + ) + } + ) } } @@ -63,9 +67,12 @@ object LivingMetalSuitProgress { val old = progressMap progressMap = buildMap { for (armor in InventoryUtils.getArmor().filterNotNull()) { - put(armor, armor.getLivingMetalProgress()?.toDouble()?.let { - it.coerceAtMost(100.0) / 100 - }) + put( + armor, + armor.getLivingMetalProgress()?.toDouble()?.let { + it.coerceAtMost(100.0) / 100 + } + ) } } if (old != progressMap) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt index ccb432f61..11de17b14 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt @@ -90,7 +90,7 @@ object RiftBloodEffigies { val split = hearts.split("§").drop(1) for ((index, s) in split.withIndex()) { - val time = effigiesTimes[index]!! + val time = effigiesTimes[index] ?: continue if (time.isInPast()) { if (s == "7") { @@ -131,7 +131,7 @@ object RiftBloodEffigies { for ((index, location) in locations.withIndex()) { val name = "Effigy #${index + 1}" - val duration = effigiesTimes[index]!! + val duration = effigiesTimes[index] ?: continue if (duration.isFarPast()) { if (config.unknownTime) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt index 6fadfce8f..86ae6d096 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt @@ -124,7 +124,8 @@ object EnigmaSoulWaypoints { it, "$name Enigma Soul", config.color.toChromaColor(), - condition = { config.showPathFinder }) + condition = { config.showPathFinder } + ) } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt index 50ce7f2dc..022a808d0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt @@ -134,29 +134,31 @@ object ShowMotesNpcSellPrice { val sorted = itemMap.toList().sortedByDescending { it.second.second }.toMap().toMutableMap() for ((internalName, pair) in sorted) { - newDisplay.add(buildList { - val (index, value) = pair - add(" §7- ") - val stack = internalName.getItemStack() - add(stack) - val price = value.formatPrice() - val valuePer = stack.motesNpcPrice() ?: continue - val tips = buildList { - add("§6Item: ${stack.displayName}") - add("§6Value per: §d$valuePer Motes") - add("§6Total in chest: §d${(value / valuePer).toInt()}") - add("") - add("§6Total value: §d$price coins") - } - add( - Renderable.hoverTips( - "§6${stack.displayName}: §b$price", - tips, - highlightsOnHoverSlots = index, - stack = stack + newDisplay.add( + buildList { + val (index, value) = pair + add(" §7- ") + val stack = internalName.getItemStack() + add(stack) + val price = value.formatPrice() + val valuePer = stack.motesNpcPrice() ?: continue + val tips = buildList { + add("§6Item: ${stack.displayName}") + add("§6Value per: §d$valuePer Motes") + add("§6Total in chest: §d${(value / valuePer).toInt()}") + add("") + add("§6Total value: §d$price coins") + } + add( + Renderable.hoverTips( + "§6${stack.displayName}: §b$price", + tips, + highlightsOnHoverSlots = index, + stack = stack + ) ) - ) - }) + } + ) } val total = itemMap.values.fold(0.0) { acc, pair -> acc + pair.second }.formatPrice() newDisplay.addAsSingletonList("§7Total price: §b$total") |