From 2178deb82a1cc3305113db1fbeee939cd7272d2e Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Sat, 28 Sep 2024 15:23:23 -0400 Subject: Backend: Detekt Fixes Part 3 (#2606) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../at/hannibal2/skyhanni/features/combat/BestiaryData.kt | 4 ++-- .../combat/damageindicator/DamageIndicatorManager.kt | 5 +++-- .../skyhanni/features/combat/damageindicator/MobFinder.kt | 14 +++++++------- 3 files changed, 12 insertions(+), 11 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/combat') diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt index 957f1ecd0..3b2b93680 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt @@ -441,8 +441,8 @@ object BestiaryData { return true } else if (name == "Search Results") { val loreList = stack.getLore() - if (loreList.size >= 2 && loreList[0].startsWith("§7Query: §a") - && loreList[1].startsWith("§7Results: §a") + if (loreList.size >= 2 && loreList[0].startsWith("§7Query: §a") && + loreList[1].startsWith("§7Results: §a") ) { return true } diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt index 0391e40a3..4f0dad4b8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt @@ -67,6 +67,8 @@ import kotlin.time.Duration import kotlin.time.Duration.Companion.seconds @SkyHanniModule +// TODO cut class into smaller pieces +@Suppress("LargeClass") object DamageIndicatorManager { private var mobFinder: MobFinder? = null @@ -75,7 +77,6 @@ object DamageIndicatorManager { private val enderSlayerHitsNumberPattern = ".* §[5fd]§l(?\\d+) Hits?".toPattern() - private var data = mapOf() private val damagePattern = "[✧✯]?(\\d+[⚔+✧❤♞☄✷ﬗ✯]*)".toPattern() @@ -288,7 +289,7 @@ object DamageIndicatorManager { BossType.SLAYER_BLAZE_QUAZII_3, BossType.SLAYER_BLAZE_QUAZII_4, - // TODO f3/m3 4 guardians, f2/m2 4 boss room fighters + // TODO f3/m3 4 guardians, f2/m2 4 boss room fighters -> true else -> false diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/MobFinder.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/MobFinder.kt index 975e3b4f8..399040179 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/MobFinder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/MobFinder.kt @@ -88,11 +88,11 @@ class MobFinder { else -> { when (entity) { /* - * Note that the order does matter here. - * For example, if you put EntityZombie before EntityPigZombie, - * EntityPigZombie will never be reached because EntityPigZombie extends EntityZombie. - * Please take this into consideration if you are to modify this. - */ + * Note that the order does matter here. + * For example, if you put EntityZombie before EntityPigZombie, + * EntityPigZombie will never be reached because EntityPigZombie extends EntityZombie. + * Please take this into consideration if you are to modify this. + */ is EntityOtherPlayerMP -> tryAddEntityOtherPlayerMP(entity) is EntityIronGolem -> tryAddEntityIronGolem(entity) is EntityPigZombie -> tryAddEntityPigZombie(entity) @@ -392,8 +392,8 @@ class MobFinder { } private fun tryAddEntityMagmaCube(entity: EntityLivingBase) = when { - entity.hasNameTagWith(15, "§e﴾ §8[§7Lv500§8] §l§4§lMagma Boss§r ") - && entity.hasMaxHealth(200_000_000, true) -> { + entity.hasNameTagWith(15, "§e﴾ §8[§7Lv500§8] §l§4§lMagma Boss§r ") && + entity.hasMaxHealth(200_000_000, true) -> { EntityResult(bossType = BossType.NETHER_MAGMA_BOSS, ignoreBlocks = true) } -- cgit