diff options
author | IlmarsXd <ilmars500@gmail.com> | 2023-06-05 23:15:11 +0300 |
---|---|---|
committer | IlmarsXd <ilmars500@gmail.com> | 2023-06-05 23:15:11 +0300 |
commit | 89bf4d23a30c02b341df0048bc0717142af1a9ff (patch) | |
tree | 3dbdaa7eb6bd52fbc6f3dad38a73cfe1c54359ee /src/main/kotlin/dulkirmod/features | |
parent | b220e76e12724a91507e894ac018e1ad6b695c9a (diff) | |
download | DulkirMod-89bf4d23a30c02b341df0048bc0717142af1a9ff.tar.gz DulkirMod-89bf4d23a30c02b341df0048bc0717142af1a9ff.tar.bz2 DulkirMod-89bf4d23a30c02b341df0048bc0717142af1a9ff.zip |
Some cleanup
Diffstat (limited to 'src/main/kotlin/dulkirmod/features')
3 files changed, 23 insertions, 64 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, diff --git a/src/main/kotlin/dulkirmod/features/MemoryLeakFix.kt b/src/main/kotlin/dulkirmod/features/MemoryLeakFix.kt index 8c891ba..6c8199b 100644 --- a/src/main/kotlin/dulkirmod/features/MemoryLeakFix.kt +++ b/src/main/kotlin/dulkirmod/features/MemoryLeakFix.kt @@ -2,13 +2,10 @@ package dulkirmod.features import dulkirmod.DulkirMod.Companion.mc import dulkirmod.config.DulkirConfig -import dulkirmod.utils.WorldRenderUtils import net.minecraft.entity.Entity import net.minecraft.entity.item.EntityArmorStand -import net.minecraftforge.client.event.RenderLivingEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import net.minecraftforge.fml.common.gameevent.TickEvent -import java.awt.Color object MemoryLeakFix { private var lastClear = System.currentTimeMillis() diff --git a/src/main/kotlin/dulkirmod/features/rift/IchorHighlight.kt b/src/main/kotlin/dulkirmod/features/rift/IchorHighlight.kt index 580a8b9..4060e32 100644 --- a/src/main/kotlin/dulkirmod/features/rift/IchorHighlight.kt +++ b/src/main/kotlin/dulkirmod/features/rift/IchorHighlight.kt @@ -19,7 +19,7 @@ object IchorHighlight { if (TabListUtils.area != "The Rift") return val entity = event.entity - val (x, y, z) = WorldRenderUtils.fixRenderPos(event.x, event.y + 3, event.z) + val (x, y, z) = WorldRenderUtils.fixRenderPos(event.x, event.y, event.z) if (entity is EntityArmorStand) { if (entity.getEquipmentInSlot(4) != null && entity.getEquipmentInSlot(4).item === Items.skull) { @@ -35,7 +35,7 @@ object IchorHighlight { WorldRenderUtils.drawCustomBox( x - .5, 1.0, - y - 2, + y + 1, 1.0, z - .5, 1.0, |