diff options
author | inglettronald <71849533+inglettronald@users.noreply.github.com> | 2023-06-05 17:18:52 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-05 17:18:52 -0500 |
commit | e209c2c0e3148bfec9cae51b5561c0918c88f479 (patch) | |
tree | 3dbdaa7eb6bd52fbc6f3dad38a73cfe1c54359ee /src/main/kotlin/dulkirmod/features/BlazeSlayerFeatures.kt | |
parent | b220e76e12724a91507e894ac018e1ad6b695c9a (diff) | |
parent | 89bf4d23a30c02b341df0048bc0717142af1a9ff (diff) | |
download | DulkirMod-e209c2c0e3148bfec9cae51b5561c0918c88f479.tar.gz DulkirMod-e209c2c0e3148bfec9cae51b5561c0918c88f479.tar.bz2 DulkirMod-e209c2c0e3148bfec9cae51b5561c0918c88f479.zip |
Merge pull request #19 from IlmarsXd/cleanup
Some cleanup
Diffstat (limited to 'src/main/kotlin/dulkirmod/features/BlazeSlayerFeatures.kt')
-rw-r--r-- | src/main/kotlin/dulkirmod/features/BlazeSlayerFeatures.kt | 80 |
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, |