aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2
diff options
context:
space:
mode:
authorLorenz <lo.scherf@gmail.com>2022-08-19 14:56:27 +0200
committerLorenz <lo.scherf@gmail.com>2022-08-19 14:56:27 +0200
commitfe03e4d479e37169c31afd0c1e2746f628c08cc2 (patch)
tree464c4fcb38e28f6d3d2bf8e23d4c85aafdf6150f /src/main/java/at/hannibal2
parentd705f1f1a5e199563f23728a37fda83f054a3d8f (diff)
downloadskyhanni-fe03e4d479e37169c31afd0c1e2746f628c08cc2.tar.gz
skyhanni-fe03e4d479e37169c31afd0c1e2746f628c08cc2.tar.bz2
skyhanni-fe03e4d479e37169c31afd0c1e2746f628c08cc2.zip
fixing custom damage splash form skytils, fixing 'hide damage splash next to damage indicator'
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Misc.java5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt18
2 files changed, 15 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java
index 23487a20d..51c97f995 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java
@@ -29,6 +29,11 @@ public class Misc {
public boolean summonSoulDisplay = false;
@Expose
+ @ConfigOption(name = "Skytils Damage Splash", desc = "Fixing the custom damage splash feature from skytils.")
+ @ConfigEditorBoolean
+ public boolean fixSkytilsDamageSplash = true;
+
+ @Expose
@ConfigOption(name = "Config Button", desc = "Add a button to the pause menu to configure SkyHanni.")
@ConfigEditorBoolean
public boolean configButtonOnPause = true;
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 a95b1eda9..799d95b69 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt
@@ -543,25 +543,27 @@ class DamageIndicatorManager {
bossFinder?.handleNewEntity(event.entity)
}
- @SubscribeEvent(priority = EventPriority.HIGHEST)
+ @SubscribeEvent(priority = EventPriority.HIGH)
fun onRenderLiving(e: RenderLivingEvent.Specials.Pre<EntityLivingBase>) {
- if (!SkyHanniMod.feature.damageIndicator.hideDamageSplash) return
-
val entity = e.entity
if (entity.ticksExisted > 300 || entity !is EntityArmorStand) return
if (!entity.hasCustomName()) return
if (entity.isDead) return
- val strippedName = entity.customNameTag.removeColor()
+ val strippedName = entity.customNameTag.removeColor().replace(",", "")
val damageMatcher = damagePattern.matcher(strippedName)
- if (damageMatcher.matches()) {
+ if (!damageMatcher.matches()) return
+
+ if (SkyHanniMod.feature.misc.fixSkytilsDamageSplash) {
+ entity.customNameTag = entity.customNameTag.replace(",", "")
+ }
+
+ if (SkyHanniMod.feature.damageIndicator.hideDamageSplash) {
if (data.values.any {
val distance = it.entity.getLorenzVec().distance(entity.getLorenzVec())
- val found = distance < 4.5
- found
+ distance < 4.5
}) {
e.isCanceled = true
}
}
}
-
} \ No newline at end of file