From 59b63813d81f92a7586f3ae38a22adb035ce35ce Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 1 Oct 2022 17:30:44 +0200 Subject: added MilleniaAgedBlazeColor --- CHANGELOG.md | 5 +- FEATURES.md | 1 + .../java/at/hannibal2/skyhanni/SkyHanniMod.java | 2 + .../hannibal2/skyhanni/config/features/Misc.java | 6 +++ .../features/end/VoidlingExtremistColor.kt | 17 ++----- .../features/nether/MilleniaAgedBlazeColor.kt | 58 ++++++++++++++++++++++ 6 files changed, 75 insertions(+), 14 deletions(-) create mode 100644 src/main/java/at/hannibal2/skyhanni/features/nether/MilleniaAgedBlazeColor.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index 18707744a..a2a57449d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,12 +6,13 @@ + Option to remove the wrong dagger messages from chat. + Hide particles and fireballs near blaze slayer bosses and demons. + Added Option to hide blaze particles. ++ Highlight millenia aged blaze color in red ### Changes + Removed more blaze slayer item drop message spam. + Showing number next to custom hellion shield from damage indicator -+ All particles next to ashfang are now hidden when particles are disabled for ashfang. -+ All particles around blaze slayer are hidden ++ All particles next to ashfang are now hidden when clear ashfang view is enabled ++ All particles around blaze slayer are hidden when blaze particles is enabled ## Version 0.11 diff --git a/FEATURES.md b/FEATURES.md index 8d1706f61..bb4ad18a3 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -135,6 +135,7 @@ - Gui element showing the real time. - Highlight the voidling extremist in pink color. - Highlight corrupted mobs in purple color. +- Highlight millenia aged blaze color in red - Option to hide all damage splashes, from anywhere in Skyblock. - Hide armor or just helmet of other player or yourself - Display the active non-god potion effects. diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java index b70587509..4c1d19168 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java @@ -25,6 +25,7 @@ import at.hannibal2.skyhanni.features.inventory.*; import at.hannibal2.skyhanni.features.itemabilities.FireVeilWandParticles; import at.hannibal2.skyhanni.features.itemabilities.abilitycooldown.ItemAbilityCooldown; import at.hannibal2.skyhanni.features.minion.MinionFeatures; +import at.hannibal2.skyhanni.features.nether.MilleniaAgedBlazeColor; import at.hannibal2.skyhanni.features.nether.ashfang.*; import at.hannibal2.skyhanni.features.slayer.EndermanSlayerBeacon; import at.hannibal2.skyhanni.features.slayer.HideMobNames; @@ -130,6 +131,7 @@ public class SkyHanniMod { registerEvent(new WikiCommand()); registerEvent(new SummoningMobManager()); registerEvent(new VoidlingExtremistColor()); + registerEvent(new MilleniaAgedBlazeColor()); registerEvent(new CorruptedMobHighlight()); registerEvent(new MarkedPlayerManager()); registerEvent(new HighlightSlayerMiniboss()); diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java index 52e512a35..5420aec36 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java @@ -51,6 +51,12 @@ public class Misc { @ConfigAccordionId(id = 2) public boolean voidlingExtremistColor = false; + @Expose + @ConfigOption(name = "Millenia Aged Blaze Color", desc = "Highlight the millenia aged blaze in red color") + @ConfigEditorBoolean + @ConfigAccordionId(id = 2) + public boolean milleniaAgedBlazeColor = false; + @Expose @ConfigOption(name = "Corrupted Mob Highlight", desc = "Highlight corrupted mobs in purple color") @ConfigEditorBoolean diff --git a/src/main/java/at/hannibal2/skyhanni/features/end/VoidlingExtremistColor.kt b/src/main/java/at/hannibal2/skyhanni/features/end/VoidlingExtremistColor.kt index 7e5f95f64..f020590e7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/end/VoidlingExtremistColor.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/end/VoidlingExtremistColor.kt @@ -22,8 +22,9 @@ class VoidlingExtremistColor { fun onTick(event: TickEvent.ClientTickEvent) { if (!isEnabled()) return - if (tick++ % 20 == 0) { - find() + if (tick++ % 60 == 0) { + Minecraft.getMinecraft().theWorld.loadedEntityList.filterIsInstance() + .filter { it !in extremists && it.hasMaxHealth(8_000_000) }.forEach { extremists.add(it) } } } @@ -52,14 +53,6 @@ class VoidlingExtremistColor { extremists.clear() } - private fun find() { - Minecraft.getMinecraft().theWorld.loadedEntityList.filterIsInstance() - .filter { it !in extremists && it.hasMaxHealth(8_000_000) }.forEach { extremists.add(it) } - } - - private fun isEnabled(): Boolean { - - return LorenzUtils.inSkyblock && LorenzUtils.skyBlockIsland == "The End" && - SkyHanniMod.feature.misc.voidlingExtremistColor - } + private fun isEnabled(): Boolean = + LorenzUtils.inSkyblock && LorenzUtils.skyBlockIsland == "The End" && SkyHanniMod.feature.misc.milleniaAgedBlazeColor } \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/MilleniaAgedBlazeColor.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/MilleniaAgedBlazeColor.kt new file mode 100644 index 000000000..123e7a54b --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/MilleniaAgedBlazeColor.kt @@ -0,0 +1,58 @@ +package at.hannibal2.skyhanni.features.nether + +import at.hannibal2.skyhanni.SkyHanniMod +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() + + @SubscribeEvent + fun onTick(event: TickEvent.ClientTickEvent) { + if (!isEnabled()) return + + if (tick++ % 60 == 0) { + Minecraft.getMinecraft().theWorld.loadedEntityList.filterIsInstance() + .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 == "Crimson Isle" && SkyHanniMod.feature.misc.milleniaAgedBlazeColor +} \ No newline at end of file -- cgit