aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt11
1 files changed, 5 insertions, 6 deletions
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 799d95b69..317260901 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt
@@ -544,14 +544,13 @@ class DamageIndicatorManager {
}
@SubscribeEvent(priority = EventPriority.HIGH)
- fun onRenderLiving(e: RenderLivingEvent.Specials.Pre<EntityLivingBase>) {
- val entity = e.entity
+ fun onRenderLiving(event: RenderLivingEvent.Specials.Pre<EntityLivingBase>) {
+ val entity = event.entity
if (entity.ticksExisted > 300 || entity !is EntityArmorStand) return
if (!entity.hasCustomName()) return
if (entity.isDead) return
- val strippedName = entity.customNameTag.removeColor().replace(",", "")
- val damageMatcher = damagePattern.matcher(strippedName)
- if (!damageMatcher.matches()) return
+ val name = entity.customNameTag.removeColor().replace(",", "")
+ if (!damagePattern.matcher(name).matches()) return
if (SkyHanniMod.feature.misc.fixSkytilsDamageSplash) {
entity.customNameTag = entity.customNameTag.replace(",", "")
@@ -562,7 +561,7 @@ class DamageIndicatorManager {
val distance = it.entity.getLorenzVec().distance(entity.getLorenzVec())
distance < 4.5
}) {
- e.isCanceled = true
+ event.isCanceled = true
}
}
}