From e88d096f7530110685e06f595e4f63239f8ca437 Mon Sep 17 00:00:00 2001 From: Lorenz Date: Mon, 15 Aug 2022 15:58:05 +0200 Subject: show dead when dead --- .../at/hannibal2/skyhanni/damageindicator/BossDamageIndicator.kt | 9 +++++++-- .../java/at/hannibal2/skyhanni/damageindicator/BossFinder.kt | 2 +- .../java/at/hannibal2/skyhanni/damageindicator/EntityData.kt | 3 ++- 3 files changed, 10 insertions(+), 4 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/damageindicator/BossDamageIndicator.kt b/src/main/java/at/hannibal2/skyhanni/damageindicator/BossDamageIndicator.kt index 0ad303929..6f7c6350d 100644 --- a/src/main/java/at/hannibal2/skyhanni/damageindicator/BossDamageIndicator.kt +++ b/src/main/java/at/hannibal2/skyhanni/damageindicator/BossDamageIndicator.kt @@ -51,7 +51,8 @@ class BossDamageIndicator { val player = Minecraft.getMinecraft().thePlayer - for (uuid in data.filter { System.currentTimeMillis() > it.value.timeLastTick + 100 }.map { it.key }) { + //TODO config to define between 100ms and 5 sec + for (uuid in data.filter { System.currentTimeMillis() > it.value.timeLastTick + if (it.value.dead) 3_000 else 100 }.map { it.key }) { data.remove(uuid) } @@ -308,7 +309,11 @@ class BossDamageIndicator { } } } - val color = percentageColor(calcHealth, calcMaxHealth) +// } + if (health == 0) { + customHealthText = "§cDead" + entityData.dead = true + } if (SkyHanniMod.feature.misc.damageIndicatorHealingMessage) { if (data.containsKey(entity.uniqueID)) { diff --git a/src/main/java/at/hannibal2/skyhanni/damageindicator/BossFinder.kt b/src/main/java/at/hannibal2/skyhanni/damageindicator/BossFinder.kt index 7239b501a..fdd892e41 100644 --- a/src/main/java/at/hannibal2/skyhanni/damageindicator/BossFinder.kt +++ b/src/main/java/at/hannibal2/skyhanni/damageindicator/BossFinder.kt @@ -518,4 +518,4 @@ fun EntityLiving.hasNameTagWith( if (result) consumer(it) result } -} +} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/damageindicator/EntityData.kt b/src/main/java/at/hannibal2/skyhanni/damageindicator/EntityData.kt index 0f85b8733..572ee69fc 100644 --- a/src/main/java/at/hannibal2/skyhanni/damageindicator/EntityData.kt +++ b/src/main/java/at/hannibal2/skyhanni/damageindicator/EntityData.kt @@ -14,5 +14,6 @@ class EntityData( var timeLastTick: Long = 0, var healthLineHidden: Boolean = false, var namePrefix: String = "", - var nameSuffix: String = "" + var nameSuffix: String = "", + var dead: Boolean = false ) \ No newline at end of file -- cgit