diff options
author | Luna <me@alexia.lol> | 2024-04-15 20:19:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-15 20:19:53 +0200 |
commit | dbb991ade8850d7902c20509a3bde6d9726af156 (patch) | |
tree | 16d044cd270cdd1345218840206ed4f892e57727 /src/main/java/at/hannibal2/skyhanni | |
parent | 36ed19738ead00d673a4b46c584329a2f4eb122d (diff) | |
download | skyhanni-dbb991ade8850d7902c20509a3bde6d9726af156.tar.gz skyhanni-dbb991ade8850d7902c20509a3bde6d9726af156.tar.bz2 skyhanni-dbb991ade8850d7902c20509a3bde6d9726af156.zip |
Feature: Different color for Zealots holding Chests (#1347)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/combat/MobsConfig.java | 6 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/combat/mobs/MobHighlight.kt | 18 |
2 files changed, 22 insertions, 2 deletions
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 @@ -31,6 +31,12 @@ public class MobsConfig { 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", desc = "Highlight Special Zealots (the ones that drop Summoning Eyes) in the End." 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( |