aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-09-23 18:50:18 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-09-23 18:50:18 +0200
commit926d5b7980284a182db401cb24d7d013509a0d48 (patch)
tree01ba3ee8de86629222d7836e4f9138c1b7d463a6 /src/main
parent18c03f57b947fd3cfd124cc4775b671e3eebd833 (diff)
downloadskyhanni-926d5b7980284a182db401cb24d7d013509a0d48.tar.gz
skyhanni-926d5b7980284a182db401cb24d7d013509a0d48.tar.bz2
skyhanni-926d5b7980284a182db401cb24d7d013509a0d48.zip
added colored blaze slayer
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt35
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/damageindicator/EntityData.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerWeaponHelper.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/SwordMode.kt12
4 files changed, 42 insertions, 11 deletions
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 0ab45e022..a8237e4b1 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt
@@ -2,9 +2,7 @@ package at.hannibal2.skyhanni.features.damageindicator
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.data.ScoreboardData
-import at.hannibal2.skyhanni.events.BossHealthChangeEvent
-import at.hannibal2.skyhanni.events.DamageIndicatorFinalBossEvent
-import at.hannibal2.skyhanni.events.LorenzChatEvent
+import at.hannibal2.skyhanni.events.*
import at.hannibal2.skyhanni.features.dungeon.DungeonData
import at.hannibal2.skyhanni.features.slayer.blaze.SwordMode
import at.hannibal2.skyhanni.test.LorenzTest
@@ -80,7 +78,7 @@ class DamageIndicatorManager {
@SubscribeEvent
fun onWorldRender(event: RenderWorldLastEvent) {
- if (!SkyHanniMod.feature.damageIndicator.enabled) return
+ if (!isEnabled()) return
GlStateManager.disableDepth()
GlStateManager.disableCull()
@@ -248,6 +246,7 @@ class DamageIndicatorManager {
entityData.namePrefix = ""
entityData.nameSuffix = ""
+ entityData.color = null
val customHealthText = if (health == 0L) {
entityData.dead = true
"§cDead"
@@ -346,6 +345,7 @@ class DamageIndicatorManager {
for (swordMode in SwordMode.values()) {
if (entity.hasNameTagWith(3, swordMode.name)) {
entityData.namePrefix = swordMode.formattedName + " "
+ entityData.color = swordMode.color
return ""
}
}
@@ -630,4 +630,31 @@ class DamageIndicatorManager {
}
}
}
+
+ @SubscribeEvent
+ fun onRenderMobColored(event: RenderMobColoredEvent) {
+ if (!isEnabled()) return
+ val entity = event.entity
+
+ data.values
+ .filter { it.entity == entity }
+ .forEach { data ->
+ data.color?.let {
+ event.color = it.toColor().withAlpha(80)
+ }
+ }
+ }
+
+ @SubscribeEvent
+ fun onResetEntityHurtTime(event: ResetEntityHurtEvent) {
+ if (!isEnabled()) return
+ val entity = event.entity
+ if (data.values.any { it.entity == entity && it.color != null }) {
+ event.shouldReset = true
+ }
+ }
+
+ fun isEnabled(): Boolean {
+ return LorenzUtils.inSkyblock && SkyHanniMod.feature.damageIndicator.enabled
+ }
} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/EntityData.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/EntityData.kt
index 7271daf33..4212b4521 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/EntityData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/EntityData.kt
@@ -1,5 +1,6 @@
package at.hannibal2.skyhanni.features.damageindicator
+import at.hannibal2.skyhanni.utils.LorenzColor
import at.hannibal2.skyhanni.utils.LorenzVec
import net.minecraft.entity.EntityLivingBase
@@ -17,6 +18,7 @@ class EntityData(
// var healthLineHidden: Boolean = false,
var namePrefix: String = "",
var nameSuffix: String = "",
+ var color: LorenzColor? = null,
var dead: Boolean = false,
var deathLocation: LorenzVec? = null,
) \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerWeaponHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerWeaponHelper.kt
index 475df5ce9..4e9659ee6 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerWeaponHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerWeaponHelper.kt
@@ -53,9 +53,9 @@ class BlazeSlayerWeaponHelper {
var inactiveAbility = ""
for (mode in sword.modes) {
if (mode.active) {
- activeAbility = mode.color + "§l" + mode
+ activeAbility = mode.chatColor + "§l" + mode
} else {
- inactiveAbility = " §7/ " + mode.color + mode.toString().lowercase()
+ inactiveAbility = " §7/ " + mode.chatColor + mode.toString().lowercase()
}
}
if (activeAbility == "") return ""
diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/SwordMode.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/SwordMode.kt
index deeb24244..b2dfc9e28 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/SwordMode.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/SwordMode.kt
@@ -1,9 +1,11 @@
package at.hannibal2.skyhanni.features.slayer.blaze
-enum class SwordMode(val formattedName: String, val color: String, var active: Boolean = false) {
- AURIC("§e§lAURIC", "§e"),
- ASHEN("§8§lASHEN", "§8"),
- SPIRIT("§f§lSPIRIT", "§f"),
- CRYSTAL("§b§lCRYSTAL", "§b"),
+import at.hannibal2.skyhanni.utils.LorenzColor
+
+enum class SwordMode(val formattedName: String, val color: LorenzColor, val chatColor: String = color.getChatColor(), var active: Boolean = false) {
+ AURIC("§e§lAURIC", LorenzColor.YELLOW),
+ ASHEN("§8§lASHEN", LorenzColor.DARK_GRAY),
+ SPIRIT("§f§lSPIRIT", LorenzColor.WHITE),
+ CRYSTAL("§b§lCRYSTAL", LorenzColor.AQUA),
;
} \ No newline at end of file