From dbb991ade8850d7902c20509a3bde6d9726af156 Mon Sep 17 00:00:00 2001 From: Luna Date: Mon, 15 Apr 2024 20:19:53 +0200 Subject: Feature: Different color for Zealots holding Chests (#1347) --- .../skyhanni/config/features/combat/MobsConfig.java | 6 ++++++ .../skyhanni/features/combat/mobs/MobHighlight.kt | 18 ++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'src/main/java/at/hannibal2') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/combat/MobsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/combat/MobsConfig.java index 88e115702..abda26077 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/combat/MobsConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/combat/MobsConfig.java @@ -30,6 +30,12 @@ public class MobsConfig { @FeatureToggle public boolean zealotBruiserHighlighter = false; + @Expose + @ConfigOption(name = "Zealot with Chest", desc = "Highlight Zealots holding a Chest in a different color.") + @ConfigEditorBoolean + @FeatureToggle + public boolean chestZealotHighlighter = false; + @Expose @ConfigOption( name = "Special Zealots", diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/MobHighlight.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/MobHighlight.kt index f10d4ef2c..9303fc45e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/MobHighlight.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/MobHighlight.kt @@ -5,6 +5,7 @@ import at.hannibal2.skyhanni.events.EntityHealthUpdateEvent import at.hannibal2.skyhanni.events.EntityMaxHealthUpdateEvent import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper import at.hannibal2.skyhanni.utils.ColorUtils.withAlpha +import at.hannibal2.skyhanni.utils.EntityUtils.getBlockInHand import at.hannibal2.skyhanni.utils.EntityUtils.hasNameTagWith import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils @@ -15,6 +16,7 @@ import net.minecraft.entity.EntityLivingBase import net.minecraft.entity.monster.EntityCaveSpider import net.minecraft.entity.monster.EntityEnderman import net.minecraft.entity.monster.EntitySpider +import net.minecraft.init.Blocks import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class MobHighlight { @@ -59,9 +61,10 @@ class MobHighlight { } if (entity is EntityEnderman) { + val isZealot = maxHealth == 13_000 || maxHealth == 13_000 * 4 // runic + val isBruiser = maxHealth == 65_000 || maxHealth == 65_000 * 4 // runic + if (config.zealotBruiserHighlighter) { - val isZealot = maxHealth == 13_000 || maxHealth == 13_000 * 4 // runic - val isBruiser = maxHealth == 65_000 || maxHealth == 65_000 * 4 // runic if (isZealot || isBruiser) { RenderLivingEntityHelper.setEntityColorWithNoHurtTime( entity, @@ -71,6 +74,17 @@ class MobHighlight { } } + if (config.chestZealotHighlighter) { + val isHoldingChest = (entity as? EntityEnderman)?.getBlockInHand()?.block == Blocks.ender_chest + if ((isZealot || isBruiser) && isHoldingChest) { + RenderLivingEntityHelper.setEntityColorWithNoHurtTime( + entity, + LorenzColor.GREEN.toColor().withAlpha(127) + ) + { config.chestZealotHighlighter } + } + } + // Special Zealots are not impacted by derpy if (config.specialZealotHighlighter && maxHealth.ignoreDerpy() == 2_000) { RenderLivingEntityHelper.setEntityColorWithNoHurtTime( -- cgit