aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt46
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mobs/MobHighlight.kt66
2 files changed, 55 insertions, 57 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt
index f151c6bd5..c981beac3 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt
@@ -1,18 +1,18 @@
package at.hannibal2.skyhanni.features.damageindicator
-import at.hannibal2.skyhanni.SkyHanniMod
-import at.hannibal2.skyhanni.events.withAlpha
import at.hannibal2.skyhanni.features.dungeon.DungeonData
import at.hannibal2.skyhanni.features.dungeon.DungeonLividFinder
import at.hannibal2.skyhanni.features.rift.RiftAPI
-import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper
-import at.hannibal2.skyhanni.utils.*
+import at.hannibal2.skyhanni.utils.EntityUtils
import at.hannibal2.skyhanni.utils.EntityUtils.hasBossHealth
import at.hannibal2.skyhanni.utils.EntityUtils.hasMaxHealth
import at.hannibal2.skyhanni.utils.EntityUtils.hasNameTagWith
import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer
+import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.baseMaxHealth
+import at.hannibal2.skyhanni.utils.LorenzVec
import at.hannibal2.skyhanni.utils.StringUtils.matchRegex
+import at.hannibal2.skyhanni.utils.getLorenzVec
import net.minecraft.client.entity.EntityOtherPlayerMP
import net.minecraft.entity.Entity
import net.minecraft.entity.EntityLiving
@@ -374,55 +374,17 @@ class MobFinder {
if (entity.hasNameTagWith(1, "[§7Lv300§8] §cArachne") ||
entity.hasNameTagWith(1, "[§7Lv300§8] §lArachne")
) {
- val maxHealth = entity.baseMaxHealth
- if (maxHealth == 12) {
- markArachneMinis(entity)
- return null
- }
- if (maxHealth == 4000) {
- markArachneMinis(entity)
- return null
- }
- markArachne(entity)
return EntityResult(bossType = BossType.ARACHNE_SMALL)
}
if (entity.hasNameTagWith(1, "[§7Lv500§8] §cArachne") ||
entity.hasNameTagWith(1, "[§7Lv500§8] §lArachne")
) {
- val maxHealth = entity.baseMaxHealth
- if (maxHealth == 12) {
- markArachneMinis(entity)
- return null
- }
- if (maxHealth == 20000) {
- markArachneMinis(entity)
- return null
- }
- markArachne(entity)
return EntityResult(bossType = BossType.ARACHNE_BIG)
}
return null
}
- private val arachneBossHighlighter get() = SkyHanniMod.feature.mobs.arachneBossHighlighter
-
- private fun markArachneMinis(entity: EntityLivingBase) {
- if (arachneBossHighlighter) {
- RenderLivingEntityHelper.setEntityColor(entity, LorenzColor.GOLD.toColor().withAlpha(50))
- { arachneBossHighlighter }
- RenderLivingEntityHelper.setNoHurtTime(entity) { arachneBossHighlighter }
- }
- }
-
- private fun markArachne(entity: EntityLivingBase) {
- if (arachneBossHighlighter) {
- RenderLivingEntityHelper.setEntityColor(entity, LorenzColor.RED.toColor().withAlpha(50))
- { arachneBossHighlighter }
- RenderLivingEntityHelper.setNoHurtTime(entity) { arachneBossHighlighter }
- }
- }
-
private fun checkExtraF6GiantsDelay(entity: EntityGiantZombie): Long {
val uuid = entity.uniqueID
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mobs/MobHighlight.kt b/src/main/java/at/hannibal2/skyhanni/features/mobs/MobHighlight.kt
index 8c58c70a3..accf478bd 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/mobs/MobHighlight.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/mobs/MobHighlight.kt
@@ -5,15 +5,18 @@ import at.hannibal2.skyhanni.events.EntityHealthUpdateEvent
import at.hannibal2.skyhanni.events.EntityMaxHealthUpdateEvent
import at.hannibal2.skyhanni.events.withAlpha
import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper
+import at.hannibal2.skyhanni.utils.EntityUtils.hasNameTagWith
import at.hannibal2.skyhanni.utils.LorenzColor
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.baseMaxHealth
import net.minecraft.client.entity.EntityOtherPlayerMP
+import net.minecraft.entity.EntityLivingBase
import net.minecraft.entity.monster.EntityEnderman
import net.minecraft.entity.monster.EntitySpider
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class MobHighlight {
+ private val config get() = SkyHanniMod.feature.mobs
@SubscribeEvent
fun onEntityHealthUpdate(event: EntityHealthUpdateEvent) {
@@ -21,11 +24,11 @@ class MobHighlight {
val entity = event.entity
val baseMaxHealth = entity.baseMaxHealth
- if (SkyHanniMod.feature.mobs.corruptedMobHighlight) {
+ if (config.corruptedMobHighlight) {
if (event.health == baseMaxHealth * 3) {
RenderLivingEntityHelper.setEntityColor(entity, LorenzColor.DARK_PURPLE.toColor().withAlpha(127))
- { SkyHanniMod.feature.mobs.corruptedMobHighlight }
- RenderLivingEntityHelper.setNoHurtTime(entity) { SkyHanniMod.feature.mobs.corruptedMobHighlight }
+ { config.corruptedMobHighlight }
+ RenderLivingEntityHelper.setNoHurtTime(entity) { config.corruptedMobHighlight }
}
}
}
@@ -36,36 +39,69 @@ class MobHighlight {
val entity = event.entity
val maxHealth = event.maxHealth
- if (SkyHanniMod.feature.mobs.arachneKeeperHighlight) {
+ if (config.arachneKeeperHighlight) {
if (maxHealth == 3_000 && entity is EntitySpider) {
RenderLivingEntityHelper.setEntityColor(entity, LorenzColor.DARK_BLUE.toColor().withAlpha(127))
- { SkyHanniMod.feature.mobs.arachneKeeperHighlight }
- RenderLivingEntityHelper.setNoHurtTime(entity) { SkyHanniMod.feature.mobs.arachneKeeperHighlight }
+ { config.arachneKeeperHighlight }
+ RenderLivingEntityHelper.setNoHurtTime(entity) { config.arachneKeeperHighlight }
}
}
- if (SkyHanniMod.feature.mobs.corleoneHighlighter) {
+ if (config.corleoneHighlighter) {
if (maxHealth == 1_000_000 && entity is EntityOtherPlayerMP && entity.name == "Team Treasurite") {
RenderLivingEntityHelper.setEntityColor(entity, LorenzColor.DARK_PURPLE.toColor().withAlpha(127))
- { SkyHanniMod.feature.mobs.corleoneHighlighter }
- RenderLivingEntityHelper.setNoHurtTime(entity) { SkyHanniMod.feature.mobs.corleoneHighlighter }
+ { config.corleoneHighlighter }
+ RenderLivingEntityHelper.setNoHurtTime(entity) { config.corleoneHighlighter }
}
}
- if (SkyHanniMod.feature.mobs.zealotBruiserHighlighter) {
+ if (config.zealotBruiserHighlighter) {
if ((maxHealth == 65_000 || maxHealth == 13_000) && entity is EntityEnderman) {
RenderLivingEntityHelper.setEntityColor(entity, LorenzColor.DARK_AQUA.toColor().withAlpha(127))
- { SkyHanniMod.feature.mobs.zealotBruiserHighlighter }
- RenderLivingEntityHelper.setNoHurtTime(entity) { SkyHanniMod.feature.mobs.zealotBruiserHighlighter }
+ { config.zealotBruiserHighlighter }
+ RenderLivingEntityHelper.setNoHurtTime(entity) { config.zealotBruiserHighlighter }
}
}
- if (SkyHanniMod.feature.mobs.specialZealotHighlighter) {
+ if (config.specialZealotHighlighter) {
if (maxHealth == 2_000 && entity is EntityEnderman) {
RenderLivingEntityHelper.setEntityColor(entity, LorenzColor.DARK_RED.toColor().withAlpha(50))
- { SkyHanniMod.feature.mobs.specialZealotHighlighter }
- RenderLivingEntityHelper.setNoHurtTime(entity) { SkyHanniMod.feature.mobs.specialZealotHighlighter }
+ { config.specialZealotHighlighter }
+ RenderLivingEntityHelper.setNoHurtTime(entity) { config.specialZealotHighlighter }
}
}
+
+ if (config.arachneBossHighlighter) {
+ if (entity is EntitySpider) {
+ checkArachne(entity)
+ }
+ }
+ }
+
+ private fun checkArachne(entity: EntitySpider) {
+ if (!entity.hasNameTagWith(1, "[§7Lv300§8] §cArachne") &&
+ !entity.hasNameTagWith(1, "[§7Lv300§8] §lArachne") &&
+ !entity.hasNameTagWith(1, "[§7Lv500§8] §cArachne") &&
+ !entity.hasNameTagWith(1, "[§7Lv500§8] §lArachne")
+ ) return
+
+ val maxHealth = entity.baseMaxHealth
+ if (maxHealth == 12 || maxHealth == 4000 || maxHealth == 20000) {
+ markArachneMinis(entity)
+ } else {
+ markArachne(entity)
+ }
+ }
+
+ private fun markArachneMinis(entity: EntityLivingBase) {
+ RenderLivingEntityHelper.setEntityColor(entity, LorenzColor.GOLD.toColor().withAlpha(50))
+ { config.arachneBossHighlighter }
+ RenderLivingEntityHelper.setNoHurtTime(entity) { config.arachneBossHighlighter }
+ }
+
+ private fun markArachne(entity: EntityLivingBase) {
+ RenderLivingEntityHelper.setEntityColor(entity, LorenzColor.RED.toColor().withAlpha(50))
+ { config.arachneBossHighlighter }
+ RenderLivingEntityHelper.setNoHurtTime(entity) { config.arachneBossHighlighter }
}
} \ No newline at end of file