aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/features/BlazeSlayerFeatures.kt
diff options
context:
space:
mode:
authorIlmarsXd <ilmars500@gmail.com>2023-06-05 23:15:11 +0300
committerIlmarsXd <ilmars500@gmail.com>2023-06-05 23:15:11 +0300
commit89bf4d23a30c02b341df0048bc0717142af1a9ff (patch)
tree3dbdaa7eb6bd52fbc6f3dad38a73cfe1c54359ee /src/main/kotlin/dulkirmod/features/BlazeSlayerFeatures.kt
parentb220e76e12724a91507e894ac018e1ad6b695c9a (diff)
downloadDulkirMod-89bf4d23a30c02b341df0048bc0717142af1a9ff.tar.gz
DulkirMod-89bf4d23a30c02b341df0048bc0717142af1a9ff.tar.bz2
DulkirMod-89bf4d23a30c02b341df0048bc0717142af1a9ff.zip
Some cleanup
Diffstat (limited to 'src/main/kotlin/dulkirmod/features/BlazeSlayerFeatures.kt')
-rw-r--r--src/main/kotlin/dulkirmod/features/BlazeSlayerFeatures.kt80
1 files changed, 21 insertions, 59 deletions
diff --git a/src/main/kotlin/dulkirmod/features/BlazeSlayerFeatures.kt b/src/main/kotlin/dulkirmod/features/BlazeSlayerFeatures.kt
index edf3114..48cddb8 100644
--- a/src/main/kotlin/dulkirmod/features/BlazeSlayerFeatures.kt
+++ b/src/main/kotlin/dulkirmod/features/BlazeSlayerFeatures.kt
@@ -13,6 +13,13 @@ object BlazeSlayerFeatures {
private val minibosses = "(Flare Demon)|(Kindleheart Demon)|(Burningsoul Demon)".toRegex()
+ private val phaseColors = listOf(
+ "CRYSTAL ♨" to Color(15, 247, 236, 200),
+ "ASHEN ♨" to Color(40, 40, 40, 200),
+ "AURIC ♨" to Color(206, 219, 57, 200),
+ "SPIRIT ♨" to Color(255, 255, 255, 200)
+ )
+
@SubscribeEvent
fun onRenderLiving(event: RenderLivingEvent.Post<*>) {
if (!(DulkirConfig.attunementDisplay || DulkirConfig.minibossHitbox)) return
@@ -22,63 +29,18 @@ object BlazeSlayerFeatures {
if (event.entity is EntityArmorStand && event.entity.hasCustomName()) {
val name = Utils.stripColorCodes(event.entity.customNameTag)
val (x, y, z) = WorldRenderUtils.fixRenderPos(event.x, event.y, event.z)
- when {
- name.contains("CRYSTAL ♨") -> {
- WorldRenderUtils.drawCustomBox(
- x - .5,
- 1.0,
- y - 2,
- 1.5,
- z - .5,
- 1.0,
- Color(15, 247, 236, 255),
- 3f,
- phase = false
- )
- }
-
- name.contains("ASHEN ♨") -> {
- WorldRenderUtils.drawCustomBox(
- x - .5,
- 1.0,
- y - 2,
- 1.5,
- z - .5,
- 1.0,
- Color(0, 0, 0, 255),
- 3f,
- phase = false
- )
- }
-
- name.contains("AURIC ♨") -> {
- WorldRenderUtils.drawCustomBox(
- x - .5,
- 1.0,
- y - 2,
- 1.5,
- z - .5,
- 1.0,
- Color(206, 219, 57, 255),
- 3f,
- phase = false
- )
- }
-
- name.contains("SPIRIT ♨") -> {
- WorldRenderUtils.drawCustomBox(
- x - .5,
- 1.0,
- y - 2,
- 1.5,
- z - .5,
- 1.0,
- Color(255, 255, 255, 255),
- 3f,
- phase = false
- )
- }
- }
+ val color = phaseColors.firstOrNull { name.contains(it.first) }?.second ?: return
+ WorldRenderUtils.drawCustomBox(
+ x - 0.5,
+ 1.0,
+ y - 2,
+ 1.5,
+ z - 0.5,
+ 1.0,
+ color,
+ 3f,
+ phase = false
+ )
}
}
@@ -90,11 +52,11 @@ object BlazeSlayerFeatures {
if (name.contains(minibosses)) {
WorldRenderUtils.drawCustomBox(
- x - .5,
+ x - 0.5,
1.0,
y - 1.5,
1.5,
- z - .5,
+ z - 0.5,
1.0,
Color(7, 227, 21, 255),
3f,