aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-10-03 09:13:36 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-10-03 09:13:36 +0200
commit81c5f5239c2fca68bd5879a22302879aa5e8a121 (patch)
tree8ccf5e92f823bb09703ceee0debabeb88048b472 /src/main/java
parentb484c399a8eb9080767ad61e9b1b46e6ce379c18 (diff)
downloadskyhanni-81c5f5239c2fca68bd5879a22302879aa5e8a121.tar.gz
skyhanni-81c5f5239c2fca68bd5879a22302879aa5e8a121.tar.bz2
skyhanni-81c5f5239c2fca68bd5879a22302879aa5e8a121.zip
code cleanup
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/jerry/HighlightJerries.kt24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/jerry/HighlightJerries.kt b/src/main/java/at/hannibal2/skyhanni/features/event/jerry/HighlightJerries.kt
index b850c40ff..fb2852cea 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/jerry/HighlightJerries.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/jerry/HighlightJerries.kt
@@ -10,19 +10,31 @@ import net.minecraft.entity.passive.EntityVillager
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class HighlightJerries {
+ private val config get() = SkyHanniMod.feature.event.jerry
+
+ //RED RED WHITE LIGHT_PURPLE are fallbacks in case Hypixel admins do a little trolling
+ private val listOfLorenzColors = listOf(
+ LorenzColor.RED,
+ LorenzColor.RED,
+ LorenzColor.WHITE,
+ LorenzColor.GREEN,
+ LorenzColor.BLUE,
+ LorenzColor.DARK_PURPLE,
+ LorenzColor.GOLD,
+ LorenzColor.LIGHT_PURPLE
+ )
@SubscribeEvent
fun onEntityHealthUpdate(event: EntityMaxHealthUpdateEvent) {
- if (!SkyHanniMod.feature.event.jerry.highlightJerries) return
+ if (!LorenzUtils.inSkyBlock) return
+ if (!config.highlightJerries) return
val entity = event.entity
val maxHealth = event.maxHealth
- val listOfLorenzColors = listOf<LorenzColor>(LorenzColor.RED, LorenzColor.RED, LorenzColor.WHITE, LorenzColor.GREEN, LorenzColor.BLUE, LorenzColor.DARK_PURPLE, LorenzColor.GOLD, LorenzColor.LIGHT_PURPLE)
- //RED RED WHITE LIGHT_PURPLE ARE FALLBACKS IN CASE HYPIXEL ADMINS DO A LITTLE TROLLING
- if (entity is EntityVillager && maxHealth < 7 && maxHealth > 2) {
- RenderLivingEntityHelper.setEntityColor(entity, listOfLorenzColors[maxHealth].toColor().withAlpha(20))
- { SkyHanniMod.feature.event.jerry.highlightJerries }
+ if (entity is EntityVillager && maxHealth in 3..6) {
+ val color = listOfLorenzColors[maxHealth].toColor().withAlpha(20)
+ RenderLivingEntityHelper.setEntityColor(entity, color) { config.highlightJerries }
}
}
} \ No newline at end of file