aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/combat
diff options
context:
space:
mode:
authorDavid Cole <40234707+DavidArthurCole@users.noreply.github.com>2024-09-28 15:23:23 -0400
committerGitHub <noreply@github.com>2024-09-28 21:23:23 +0200
commit2178deb82a1cc3305113db1fbeee939cd7272d2e (patch)
treeb711c96d4af599588f3bd32b5d4229f8c24251b2 /src/main/java/at/hannibal2/skyhanni/features/combat
parent633b8f0bdd9b05f553b1bc521a83b4b7de238125 (diff)
downloadskyhanni-2178deb82a1cc3305113db1fbeee939cd7272d2e.tar.gz
skyhanni-2178deb82a1cc3305113db1fbeee939cd7272d2e.tar.bz2
skyhanni-2178deb82a1cc3305113db1fbeee939cd7272d2e.zip
Backend: Detekt Fixes Part 3 (#2606)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/combat')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/MobFinder.kt14
3 files changed, 12 insertions, 11 deletions
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(?<hits>\\d+) Hits?".toPattern()
-
private var data = mapOf<UUID, EntityData>()
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)
}