aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorLorenz <lo.scherf@gmail.com>2022-08-22 06:21:23 +0200
committerLorenz <lo.scherf@gmail.com>2022-08-22 06:21:23 +0200
commit051e05241f2418de1f4e0c3feec211b40e95fb88 (patch)
tree33261e8b9f26bb95e5020e30b7de9972c0d02bcd /src/main/java/at
parent7755f9d4bc5404b2e61dc5da8b6d390fadc93252 (diff)
downloadskyhanni-051e05241f2418de1f4e0c3feec211b40e95fb88.tar.gz
skyhanni-051e05241f2418de1f4e0c3feec211b40e95fb88.tar.bz2
skyhanni-051e05241f2418de1f4e0c3feec211b40e95fb88.zip
fixed dummy for damage indicator logics
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossFinder.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt27
2 files changed, 23 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossFinder.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossFinder.kt
index 671ed8e21..2f151abf4 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossFinder.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossFinder.kt
@@ -10,6 +10,7 @@ import at.hannibal2.skyhanni.utils.hasNameTagWith
import net.minecraft.client.Minecraft
import net.minecraft.client.entity.EntityOtherPlayerMP
import net.minecraft.entity.Entity
+import net.minecraft.entity.EntityLiving
import net.minecraft.entity.EntityLivingBase
import net.minecraft.entity.boss.EntityDragon
import net.minecraft.entity.boss.EntityWither
@@ -266,6 +267,8 @@ class BossFinder {
return EntityResult(bossType = BossType.SLAYER_ZOMBIE_5)
}
}
+ }
+ if (entity is EntityLiving) {
if (entity.hasNameTagWith(2, "Dummy §a10M§c❤")) {
return EntityResult(bossType = BossType.DUMMY)
}
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 830c372e3..072661329 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt
@@ -485,8 +485,10 @@ class DamageIndicatorManager {
val damage = lastHealth - health
val healing = health - lastHealth
if (damage > 0) {
- val damageCounter = entityData.damageCounter
- damageCounter.currentDamage += damage
+ if (entityData.bossType != BossType.DUMMY) {
+ val damageCounter = entityData.damageCounter
+ damageCounter.currentDamage += damage
+ }
}
if (healing > 0) {
//Hide auto heal every 10 ticks (with rounding errors)
@@ -543,6 +545,8 @@ class DamageIndicatorManager {
bossFinder?.handleNewEntity(event.entity)
}
+ private val dummyDamageCache = mutableListOf<UUID>()
+
@SubscribeEvent(priority = EventPriority.HIGH)
fun onRenderLiving(event: RenderLivingEvent.Specials.Pre<EntityLivingBase>) {
val entity = event.entity
@@ -556,13 +560,22 @@ class DamageIndicatorManager {
entity.customNameTag = entity.customNameTag.replace(",", "")
}
- if (SkyHanniMod.feature.damageIndicator.hideDamageSplash) {
- if (data.values.any {
- val distance = it.entity.getLorenzVec().distance(entity.getLorenzVec())
- distance < 4.5
- }) {
+ val entityData = data.values.find {
+ val distance = it.entity.getLorenzVec().distance(entity.getLorenzVec())
+ distance < 4.5
+ }
+ if (entityData != null) {
+ if (SkyHanniMod.feature.damageIndicator.hideDamageSplash) {
event.isCanceled = true
}
+ if (entityData.bossType == BossType.DUMMY) {
+
+ val uuid = entity.uniqueID
+ if (dummyDamageCache.contains(uuid)) return
+ dummyDamageCache.add(uuid)
+ val dmg = name.toCharArray().filter { Character.isDigit(it) }.joinToString("").toLong()
+ entityData.damageCounter.currentDamage += dmg
+ }
}
}
} \ No newline at end of file