aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-15 13:24:21 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-15 13:24:21 +0200
commit90e445a956f3e149d1197cc514738602857e0a91 (patch)
tree82279409afd965d8626caf1a2e2458628b15a1ce /src/main/java/at/hannibal2
parent31d5b6023ea95bbdcbc68de9651eeec0eb8ff28c (diff)
downloadskyhanni-90e445a956f3e149d1197cc514738602857e0a91.tar.gz
skyhanni-90e445a956f3e149d1197cc514738602857e0a91.tar.bz2
skyhanni-90e445a956f3e149d1197cc514738602857e0a91.zip
Arachne boss highlighter no longer requires damage indicator to be enabled
Diffstat (limited to 'src/main/java/at/hannibal2')
-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