summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/nether
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-02-02 20:38:55 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-02-02 20:38:55 +0100
commitee0ae23560e911fbec5e5262feaaa58dc5d52e7a (patch)
treeecd2221d199c8768aae9442c4c81922b0e0352f1 /src/main/java/at/hannibal2/skyhanni/features/nether
parent6173d681603839168db97e3fbd2cb74c2e7a2897 (diff)
downloadskyhanni-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/nether')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/MilleniaAgedBlazeColor.kt59
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt2
2 files changed, 1 insertions, 60 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/MilleniaAgedBlazeColor.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/MilleniaAgedBlazeColor.kt
deleted file mode 100644
index 8a9cad4fa..000000000
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/MilleniaAgedBlazeColor.kt
+++ /dev/null
@@ -1,59 +0,0 @@
-package at.hannibal2.skyhanni.features.nether
-
-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.EntityBlaze
-import net.minecraftforge.event.world.WorldEvent
-import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
-import net.minecraftforge.fml.common.gameevent.TickEvent
-
-class MilleniaAgedBlazeColor {
-
- private var tick = 0
- private val blazes = mutableListOf<EntityBlaze>()
-
- @SubscribeEvent
- fun onTick(event: TickEvent.ClientTickEvent) {
- if (!isEnabled()) return
-
- if (tick++ % 60 == 0) {
- Minecraft.getMinecraft().theWorld.loadedEntityList.filterIsInstance<EntityBlaze>()
- .filter { it !in blazes && it.hasMaxHealth(30_000_000) }.forEach { blazes.add(it) }
- }
- }
-
- @SubscribeEvent
- fun onRenderMobColored(event: RenderMobColoredEvent) {
- if (!isEnabled()) return
- val entity = event.entity
-
- if (entity in blazes) {
- event.color = LorenzColor.DARK_RED.toColor().withAlpha(60)
- }
- }
-
- @SubscribeEvent
- fun onResetEntityHurtTime(event: ResetEntityHurtEvent) {
- if (!isEnabled()) return
- val entity = event.entity
-
- if (entity in blazes) {
- event.shouldReset = true
- }
- }
-
- @SubscribeEvent
- fun onWorldChange(event: WorldEvent.Load) {
- blazes.clear()
- }
-
- private fun isEnabled() =
- LorenzUtils.inSkyBlock && LorenzUtils.skyBlockIsland == IslandType.CRIMSON_ISLE && SkyHanniMod.feature.misc.milleniaAgedBlazeColor
-} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt
index ef3f965a1..4e9382d8f 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt
@@ -64,7 +64,7 @@ class AshfangBlazes {
val entityId = event.entity.entityId
if (entityId !in blazeArmorStand.keys.map { it.entityId }) return
- if (event.health % 10_000_000 != 0F) {
+ if (event.health % 10_000_000 != 0) {
blazeArmorStand.keys.removeIf { it.entityId == entityId }
}
}