diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/combat')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/MobFinder.kt | 16 |
1 files changed, 4 insertions, 12 deletions
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 2824676bf..5a3249ea3 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 @@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.features.dungeon.DungeonAPI import at.hannibal2.skyhanni.features.dungeon.DungeonLividFinder import at.hannibal2.skyhanni.features.garden.GardenAPI +import at.hannibal2.skyhanni.features.garden.pests.PestType import at.hannibal2.skyhanni.features.rift.RiftAPI import at.hannibal2.skyhanni.utils.EntityUtils import at.hannibal2.skyhanni.utils.EntityUtils.hasBossHealth @@ -121,18 +122,9 @@ class MobFinder { private fun tryAddGardenPest(entity: EntityLivingBase): EntityResult? { if (!GardenAPI.inGarden()) return null - if (entity.hasNameTagWith(3, "Beetle")) return EntityResult(bossType = BossType.GARDEN_PEST_BEETLE) - if (entity.hasNameTagWith(3, "Cricket")) return EntityResult(bossType = BossType.GARDEN_PEST_CRICKET) - if (entity.hasNameTagWith(3, "Fly")) return EntityResult(bossType = BossType.GARDEN_PEST_FLY) - if (entity.hasNameTagWith(3, "Locust")) return EntityResult(bossType = BossType.GARDEN_PEST_LOCUST) - if (entity.hasNameTagWith(3, "Mite")) return EntityResult(bossType = BossType.GARDEN_PEST_MITE) - if (entity.hasNameTagWith(3, "Mosquito")) return EntityResult(bossType = BossType.GARDEN_PEST_MOSQUITO) - if (entity.hasNameTagWith(3, "Moth")) return EntityResult(bossType = BossType.GARDEN_PEST_MOTH) - if (entity.hasNameTagWith(3, "Rat")) return EntityResult(bossType = BossType.GARDEN_PEST_RAT) - if (entity.hasNameTagWith(3, "Slug")) return EntityResult(bossType = BossType.GARDEN_PEST_SLUG) - if (entity.hasNameTagWith(3, "Earthworm")) return EntityResult(bossType = BossType.GARDEN_PEST_EARTHWORM) - - return null + return PestType.entries + .firstOrNull { entity.hasNameTagWith(3, it.displayName) } + ?.let { EntityResult(bossType = it.damageIndicatorBoss) } } private fun tryAddDungeon(entity: EntityLivingBase) = when { |
