diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-02-10 01:08:41 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-02-10 01:08:41 +0100 |
commit | 9034699b2f0cd35691b41b43ebca67ea4febb17f (patch) | |
tree | 3852b8867f0e8b7de68270519dfdc49a99c14795 /src/main/java/at/hannibal2/skyhanni/features | |
parent | 41b0af964703aeb0d85117d71a8fb677d9b0f8b8 (diff) | |
download | skyhanni-9034699b2f0cd35691b41b43ebca67ea4febb17f.tar.gz skyhanni-9034699b2f0cd35691b41b43ebca67ea4febb17f.tar.bz2 skyhanni-9034699b2f0cd35691b41b43ebca67ea4febb17f.zip |
Added colors for the missing slayer area bosses (Golden Ghoul, Old Wolf and Spider Keeper)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/HighlightAreaMiniBoss.kt | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/HighlightAreaMiniBoss.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/HighlightAreaMiniBoss.kt index 66e6ceca3..385b895cb 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/HighlightAreaMiniBoss.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/HighlightAreaMiniBoss.kt @@ -4,11 +4,15 @@ import at.hannibal2.skyhanni.SkyHanniMod 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.hasMaxHealth import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils +import net.minecraft.entity.EntityLiving import net.minecraft.entity.monster.EntityBlaze import net.minecraft.entity.monster.EntityEnderman -import net.minecraft.entity.monster.EntityMob +import net.minecraft.entity.monster.EntitySpider +import net.minecraft.entity.monster.EntityZombie +import net.minecraft.entity.passive.EntityWolf import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class HighlightAreaMiniBoss { @@ -17,22 +21,27 @@ class HighlightAreaMiniBoss { fun onEntityHealthUpdate(event: EntityMaxHealthUpdateEvent) { if (!isEnabled()) return - for (bossType in AreaMiniBossType.values()) { - val clazz = bossType.clazz - val entity = event.entity + val entity = event.entity + val maxHealth = event.maxHealth - if (!clazz.isInstance(entity)) continue - if (event.maxHealth != bossType.health) continue + for (bossType in AreaMiniBossType.values()) { + if (!bossType.clazz.isInstance(entity)) continue - RenderLivingEntityHelper.setEntityColor(entity, bossType.color) - RenderLivingEntityHelper.setNoHurtTime(entity) + if (entity.hasMaxHealth(bossType.health, false, maxHealth)) { + RenderLivingEntityHelper.setEntityColor(entity, bossType.color) + RenderLivingEntityHelper.setNoHurtTime(entity) + } } } private fun isEnabled(): Boolean = LorenzUtils.inSkyBlock && SkyHanniMod.feature.misc.highlightAreaMinisBoss - enum class AreaMiniBossType(val clazz: Class<out EntityMob>, val health: Int, val color: Int) { + enum class AreaMiniBossType(val clazz: Class<out EntityLiving>, val health: Int, val color: Int) { + GOLDEN_GHOUL(EntityZombie::class.java, 45_000, LorenzColor.YELLOW.toColor().withAlpha(127)), +// OLD_WOLF(EntityWolf::class.java, 15_000, LorenzColor.RED.toColor().withAlpha(60)), + OLD_WOLF(EntityWolf::class.java, 15_000, LorenzColor.GOLD.toColor().withAlpha(60)), + KEEPER(EntitySpider::class.java, 3000, LorenzColor.GREEN.toColor().withAlpha(60)), ENDERMAN(EntityEnderman::class.java, 8_000_000, LorenzColor.LIGHT_PURPLE.toColor().withAlpha(127)), BLAZE(EntityBlaze::class.java, 30_000_000, LorenzColor.DARK_RED.toColor().withAlpha(60)), ; |