diff options
| author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-02-02 20:38:55 +0100 |
|---|---|---|
| committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-02-02 20:38:55 +0100 |
| commit | ee0ae23560e911fbec5e5262feaaa58dc5d52e7a (patch) | |
| tree | ecd2221d199c8768aae9442c4c81922b0e0352f1 /src/main/java/at/hannibal2/skyhanni/features/end | |
| parent | 6173d681603839168db97e3fbd2cb74c2e7a2897 (diff) | |
| download | skyhanni-ee0ae23560e911fbec5e5262feaaa58dc5d52e7a.tar.gz skyhanni-ee0ae23560e911fbec5e5262feaaa58dc5d52e7a.tar.bz2 skyhanni-ee0ae23560e911fbec5e5262feaaa58dc5d52e7a.zip | |
Created EntityMaxHealthUpdateEvent, started with better logic for colored mobs.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/end')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/end/VoidlingExtremistColor.kt | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/end/VoidlingExtremistColor.kt b/src/main/java/at/hannibal2/skyhanni/features/end/VoidlingExtremistColor.kt deleted file mode 100644 index c9b02bf5d..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/end/VoidlingExtremistColor.kt +++ /dev/null @@ -1,59 +0,0 @@ -package at.hannibal2.skyhanni.features.end - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.data.IslandType -import at.hannibal2.skyhanni.events.RenderMobColoredEvent -import at.hannibal2.skyhanni.events.ResetEntityHurtEvent -import at.hannibal2.skyhanni.events.withAlpha -import at.hannibal2.skyhanni.utils.EntityUtils.hasMaxHealth -import at.hannibal2.skyhanni.utils.LorenzColor -import at.hannibal2.skyhanni.utils.LorenzUtils -import net.minecraft.client.Minecraft -import net.minecraft.entity.monster.EntityEnderman -import net.minecraftforge.event.world.WorldEvent -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import net.minecraftforge.fml.common.gameevent.TickEvent - -class VoidlingExtremistColor { - - private var tick = 0 - private val extremists = mutableListOf<EntityEnderman>() - - @SubscribeEvent - fun onTick(event: TickEvent.ClientTickEvent) { - if (!isEnabled()) return - - if (tick++ % 60 == 0) { - Minecraft.getMinecraft().theWorld.loadedEntityList.filterIsInstance<EntityEnderman>() - .filter { it !in extremists && it.hasMaxHealth(8_000_000) }.forEach { extremists.add(it) } - } - } - - @SubscribeEvent - fun onRenderMobColored(event: RenderMobColoredEvent) { - if (!isEnabled()) return - val entity = event.entity - - if (entity in extremists) { - event.color = LorenzColor.LIGHT_PURPLE.toColor().withAlpha(127) - } - } - - @SubscribeEvent - fun onResetEntityHurtTime(event: ResetEntityHurtEvent) { - if (!isEnabled()) return - val entity = event.entity - - if (entity in extremists) { - event.shouldReset = true - } - } - - @SubscribeEvent - fun onWorldChange(event: WorldEvent.Load) { - extremists.clear() - } - - private fun isEnabled(): Boolean = - LorenzUtils.inSkyBlock && LorenzUtils.skyBlockIsland == IslandType.THE_END && SkyHanniMod.feature.misc.voidlingExtremistColor -}
\ No newline at end of file |
