From 9034699b2f0cd35691b41b43ebca67ea4febb17f Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 10 Feb 2023 01:08:41 +0100 Subject: Added colors for the missing slayer area bosses (Golden Ghoul, Old Wolf and Spider Keeper) --- CHANGELOG.md | 1 + .../features/misc/HighlightAreaMiniBoss.kt | 27 ++++++++++++++-------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb46f01d4..9bb3969ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ + Hide dead entities - Similar to Skytil's feature for inside dungeon, but for everywhere. + Hide Fireball particles and hide Fire Block particles. + Made **blaze slayer clear view** work with more particles. ++ Added colors for the missing slayer area bosses (Golden Ghoul, Old Wolf and Spider Keeper) ## Removals - Removed Blaze slayer Pillar warning + timer (The Feature caused lags and Soopy's approach is better) 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, val health: Int, val color: Int) { + enum class AreaMiniBossType(val clazz: Class, 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)), ; -- cgit