1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
package at.hannibal2.skyhanni.features.slayer
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.events.EntityMaxHealthUpdateEvent
import at.hannibal2.skyhanni.events.withAlpha
import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager
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.EntityCreature
import net.minecraft.entity.monster.EntityBlaze
import net.minecraft.entity.monster.EntityEnderman
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 HighlightSlayerMiniBoss {
@SubscribeEvent
fun onEntityHealthUpdate(event: EntityMaxHealthUpdateEvent) {
if (!isEnabled()) return
val entity = event.entity
if (DamageIndicatorManager.isBoss(entity)) return
val maxHealth = event.maxHealth
for (bossType in SlayerMiniBossType.values()) {
if (!bossType.clazz.isInstance(entity)) continue
if (bossType.health.any { entity.hasMaxHealth(it, false, maxHealth) }) {
RenderLivingEntityHelper.setEntityColor(entity, LorenzColor.AQUA.toColor().withAlpha(127))
{ SkyHanniMod.feature.slayer.slayerMinibossHighlight }
RenderLivingEntityHelper.setNoHurtTime(entity) { SkyHanniMod.feature.slayer.slayerMinibossHighlight }
}
}
}
private fun isEnabled() = LorenzUtils.inSkyBlock &&
SkyHanniMod.feature.slayer.slayerMinibossHighlight &&
!LorenzUtils.inDungeons &&
!LorenzUtils.inKuudraFight
enum class SlayerMiniBossType(val clazz: Class<out EntityCreature>, vararg val health: Int) {
REVENANT(EntityZombie::class.java, 24_000, 90_000, 360_000, 600_000, 2_400_000),
TARANTULA(EntitySpider::class.java, 54_000, 144_000, 576_000),
SVEN(EntityWolf::class.java, 45_000, 120_000, 450_000),
VOIDLING(EntityEnderman::class.java, 8_400_000, 17_500_000, 52_500_000),
INFERNAL(EntityBlaze::class.java, 12_000_000, 25_000_000),
;
}
}
|