From f365edf25f6c913dbeb8295add0a02ed2e09908d Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 30 Sep 2022 18:48:54 +0200 Subject: showing number next to hellion shield from damage indicator --- .../features/damageindicator/DamageIndicatorManager.kt | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/main/java/at') diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt index 7b8809df1..90be9e0d1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt @@ -384,10 +384,20 @@ class DamageIndicatorManager { } private fun checkBlazeSlayer(entity: EntityLiving, entityData: EntityData, health: Int, maxHealth: Int): String? { - val shield = HellionShield.values().firstOrNull { entity.hasNameTagWith(3, it.name) } - entity.setHellionShield(shield) - if (shield != null) { - entityData.nameAbove = shield.formattedName + val shields = HellionShield.values() + var found = false + for (shield in shields) { + val armorStand = entity.getNameTagWith(3, shield.name) + if (armorStand != null) { + val number = armorStand.name.split(" ♨")[1].substring(0, 1) + entity.setHellionShield(shield) + entityData.nameAbove = shield.formattedName + " $number" + found = true + break + } + } + if (!found) { + entity.setHellionShield(null) } if (!SkyHanniMod.feature.slayer.blazePhaseDisplay) return "" -- cgit