aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/DamageIndicator.java13
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt52
2 files changed, 44 insertions, 21 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/DamageIndicator.java b/src/main/java/at/hannibal2/skyhanni/config/features/DamageIndicator.java
index 9a3bcdc87..c8a9dd750 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/DamageIndicator.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/DamageIndicator.java
@@ -25,7 +25,7 @@ public class DamageIndicator {
@Expose
@ConfigOption(
name = "Boss Name",
- desc = "Change how the boss name should be displayed")
+ desc = "Change how the boss name should be displayed.")
@ConfigEditorDropdown(values = {"Disabled", "Full Name", "Short Name"})
public int bossName = 1;
@@ -63,17 +63,22 @@ public class DamageIndicator {
public List<Integer> bossesToShow = new ArrayList<>(Arrays.asList(0, 1, 2, 5, 6, 7, 8, 9, 18, 19));
@Expose
- @ConfigOption(name = "Hide Damage Splash", desc = "Hiding damage splashes near the damage indicator")
+ @ConfigOption(name = "Hide Damage Splash", desc = "Hiding damage splashes near the damage indicator.")
@ConfigEditorBoolean
public boolean hideDamageSplash = false;
@Expose
- @ConfigOption(name = "Damage Over Time", desc = "Show damage and health over time below the damage indicator")
+ @ConfigOption(name = "Damage Over Time", desc = "Show damage and health over time below the damage indicator.")
@ConfigEditorBoolean
public boolean showDamageOverTime = false;
@Expose
- @ConfigOption(name = "Health During Laser", desc = "Show the health of Voidgloom Seraph 4 during the laser phase")
+ @ConfigOption(name = "Health During Laser", desc = "Show the health of Voidgloom Seraph 4 during the laser phase.")
@ConfigEditorBoolean
public boolean showHealthDuringLaser = false;
+
+ @Expose
+ @ConfigOption(name = "Hide Nametag", desc = "Hide the vanilla nametag of damage indicator bosses.")
+ @ConfigEditorBoolean
+ public boolean hideVanillaNametag = false;
}
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 10d991bd6..762c75a01 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt
@@ -69,7 +69,8 @@ class DamageIndicatorManager {
fun getDistanceTo(vararg types: BossType): Double {
val playerLocation = LocationUtils.playerLocation()
- val list = data.values.filter { it.bossType in types }.map { it.entity.getLorenzVec().distance(playerLocation) }
+ val list =
+ data.values.filter { it.bossType in types }.map { it.entity.getLorenzVec().distance(playerLocation) }
return if (list.isEmpty()) {
Double.MAX_VALUE
} else {
@@ -101,7 +102,9 @@ class DamageIndicatorManager {
//TODO config to define between 100ms and 5 sec
for (uuid in data.filter {
val waitForRemoval = if (it.value.dead && !noDeathDisplay(it.value.bossType)) 4_000 else 100
- (System.currentTimeMillis() > it.value.timeLastTick + waitForRemoval) || (it.value.dead && noDeathDisplay(it.value.bossType)) }.map { it.key }) { data.remove(uuid)
+ (System.currentTimeMillis() > it.value.timeLastTick + waitForRemoval) || (it.value.dead && noDeathDisplay(it.value.bossType))
+ }.map { it.key }) {
+ data.remove(uuid)
}
var playerLocation = LocationUtils.playerLocation()
@@ -707,28 +710,43 @@ class DamageIndicatorManager {
@SubscribeEvent(priority = EventPriority.HIGH)
fun onRenderLiving(event: RenderLivingEvent.Specials.Pre<EntityLivingBase>) {
val entity = event.entity
- if (!isDamageSplash(entity)) return
- val name = entity.customNameTag.removeColor().replace(",", "")
-
- if (SkyHanniMod.feature.misc.fixSkytilsDamageSplash) {
- entity.customNameTag = entity.customNameTag.replace(",", "")
- }
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 (isDamageSplash(entity)) {
+ val name = entity.customNameTag.removeColor().replace(",", "")
+
+ if (SkyHanniMod.feature.misc.fixSkytilsDamageSplash) {
+ entity.customNameTag = entity.customNameTag.replace(",", "")
}
- if (entityData.bossType == BossType.DUMMY) {
+ 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
+ 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
+ }
+ }
+ } else {
+ if (entityData != null) {
+ if (isEnabled()) {
+ if (SkyHanniMod.feature.damageIndicator.hideVanillaNametag) {
+ val name = entity.name
+ if (name.contains("Plaesmaflux")) return
+ if (name.contains("Overflux")) return
+ if (name.contains("Mana Flux")) return
+ if (name.contains("Radiant")) return
+ event.isCanceled = true
+ }
+ }
}
}
}