diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-09-30 00:50:29 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-09-30 00:50:29 +0200 |
commit | d3f8382cddb0f95be9c6d656c75068bee5f52d9f (patch) | |
tree | 252196bf97b807f348db2d17da02bf8e3596ccea /src/main/java | |
parent | fb14b8b167d735760af2ff36de0fc173786833c7 (diff) | |
download | skyhanni-d3f8382cddb0f95be9c6d656c75068bee5f52d9f.tar.gz skyhanni-d3f8382cddb0f95be9c6d656c75068bee5f52d9f.tar.bz2 skyhanni-d3f8382cddb0f95be9c6d656c75068bee5f52d9f.zip |
fixed damage indicator
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/NonGodPotEffectDisplay.kt | 4 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt | 26 |
2 files changed, 20 insertions, 10 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/NonGodPotEffectDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/NonGodPotEffectDisplay.kt index 86c7b96eb..7f449b0ba 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/NonGodPotEffectDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/NonGodPotEffectDisplay.kt @@ -134,6 +134,7 @@ class NonGodPotEffectDisplay { if (!lines.any { it.contains("§a§lActive Effects") }) return checkFooter = false + var effectsCount = 0 for (line in lines) { if (line.startsWith("§2Mushed Glowy Tonic I")) { val duration = readDuration(line.split("§f")[1]) @@ -143,9 +144,10 @@ class NonGodPotEffectDisplay { val matcher = patternEffectsCount.matcher(line) if (matcher.matches()) { val group = matcher.group(1) - totalEffectsCount = group.toInt() + effectsCount = group.toInt() } } + totalEffectsCount = effectsCount } } 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 6cdcc6eb2..ec7c23ed1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt @@ -97,6 +97,8 @@ class DamageIndicatorManager { data.remove(uuid) } + var playerLocation = LocationUtils.playerLocation() + for (data in data.values) { //TODO test end stone protector in hole? - maybe change eye pos @@ -120,7 +122,7 @@ class DamageIndicatorManager { } val partialTicks = event.partialTicks - + var tooClose = false val location = if (data.dead && data.deathLocation != null) { data.deathLocation!! } else { @@ -130,12 +132,23 @@ class DamageIndicatorManager { RenderUtils.interpolate(entity.posZ, entity.lastTickPosZ, partialTicks) ) if (data.dead) data.deathLocation = loc - loc + val distance = loc.distance(playerLocation) + Minecraft.getMinecraft().renderManager + tooClose = distance < 5 && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 + if (tooClose) { + loc.add(0.0, -1.0, 0.0) + } else { + loc + } } -// if (!data.healthLineHidden) { RenderUtils.drawLabel(location, healthText, partialTicks, true, 6f) -// } + + if (data.nameAbove.isNotEmpty()) { + RenderUtils.drawLabel(location, data.nameAbove, partialTicks, true, 3.9f, if (tooClose) -9.0f else -18.0f) + } + + if (tooClose) continue var bossName = when (SkyHanniMod.feature.damageIndicator.bossName) { 0 -> "" @@ -152,11 +165,6 @@ class DamageIndicatorManager { } //TODO fix scaling problem - if (data.nameAbove.isNotEmpty()) { -// RenderUtils.drawLabel(location, data.nameAbove, partialTicks, true, 3.9f, -9.0f) - RenderUtils.drawLabel(location, data.nameAbove, partialTicks, true, 3.9f, -18.0f) - } - // val debug = Minecraft.getMinecraft().thePlayer.isSneaking // RenderUtils.drawLabel(location, bossName, partialTicks, true, 3.9f, -9.0f, debug = debug) RenderUtils.drawLabel(location, bossName, partialTicks, true, 3.9f, -9.0f) |