From fe03e4d479e37169c31afd0c1e2746f628c08cc2 Mon Sep 17 00:00:00 2001 From: Lorenz Date: Fri, 19 Aug 2022 14:56:27 +0200 Subject: fixing custom damage splash form skytils, fixing 'hide damage splash next to damage indicator' --- .../features/damageindicator/DamageIndicatorManager.kt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features') 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 a95b1eda9..799d95b69 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt @@ -543,25 +543,27 @@ class DamageIndicatorManager { bossFinder?.handleNewEntity(event.entity) } - @SubscribeEvent(priority = EventPriority.HIGHEST) + @SubscribeEvent(priority = EventPriority.HIGH) fun onRenderLiving(e: RenderLivingEvent.Specials.Pre) { - if (!SkyHanniMod.feature.damageIndicator.hideDamageSplash) return - val entity = e.entity if (entity.ticksExisted > 300 || entity !is EntityArmorStand) return if (!entity.hasCustomName()) return if (entity.isDead) return - val strippedName = entity.customNameTag.removeColor() + val strippedName = entity.customNameTag.removeColor().replace(",", "") val damageMatcher = damagePattern.matcher(strippedName) - if (damageMatcher.matches()) { + if (!damageMatcher.matches()) return + + if (SkyHanniMod.feature.misc.fixSkytilsDamageSplash) { + entity.customNameTag = entity.customNameTag.replace(",", "") + } + + if (SkyHanniMod.feature.damageIndicator.hideDamageSplash) { if (data.values.any { val distance = it.entity.getLorenzVec().distance(entity.getLorenzVec()) - val found = distance < 4.5 - found + distance < 4.5 }) { e.isCanceled = true } } } - } \ No newline at end of file -- cgit