aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/combat
diff options
context:
space:
mode:
authorLuna <me@alexia.lol>2024-04-15 20:19:53 +0200
committerGitHub <noreply@github.com>2024-04-15 20:19:53 +0200
commitdbb991ade8850d7902c20509a3bde6d9726af156 (patch)
tree16d044cd270cdd1345218840206ed4f892e57727 /src/main/java/at/hannibal2/skyhanni/features/combat
parent36ed19738ead00d673a4b46c584329a2f4eb122d (diff)
downloadskyhanni-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/features/combat')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/combat/mobs/MobHighlight.kt18
1 files changed, 16 insertions, 2 deletions
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(