diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-10-01 18:00:11 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-10-01 18:00:11 +0200 |
commit | ad998ebd56c43097154d970e2f34898a53d6444d (patch) | |
tree | 25b4668de2a32e4a30e080f6cfe268907643419c | |
parent | 10789e74936e192f577eb73a568d78b5d8752205 (diff) | |
download | skyhanni-ad998ebd56c43097154d970e2f34898a53d6444d.tar.gz skyhanni-ad998ebd56c43097154d970e2f34898a53d6444d.tar.bz2 skyhanni-ad998ebd56c43097154d970e2f34898a53d6444d.zip |
hide vanilla names near damage indicator
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | FEATURES.md | 1 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/DamageIndicator.java | 13 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt | 52 |
4 files changed, 46 insertions, 21 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index a2a57449d..31ecfb45c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ + Hide particles and fireballs near blaze slayer bosses and demons. + Added Option to hide blaze particles. + Highlight millenia aged blaze color in red ++ Hide the vanilla nametag of damage indicator bosses. ### Changes + Removed more blaze slayer item drop message spam. diff --git a/FEATURES.md b/FEATURES.md index bb4ad18a3..a4849a981 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -101,6 +101,7 @@ - Show the laser phase cooldown during the Voidgloom Seraph 4 fight. - Option to show the health of Voidgloom Seraph 4 during the laser phase (useful when trying to phase skip) - Show when Revenant Horror 5 is about to BOOM. +- Hide the vanilla nametag of damage indicator bosses. ## Slayer + Hide poor slayer drop chat messages. 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 + } + } } } } |