aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-10-01 17:30:44 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-10-01 17:30:44 +0200
commit59b63813d81f92a7586f3ae38a22adb035ce35ce (patch)
tree9be7ef80e770a4116f16a71b13f0470ebe688d45 /src/main/java/at
parent943f219d5dfed40858e7d05c0fa9c938ea0db538 (diff)
downloadskyhanni-59b63813d81f92a7586f3ae38a22adb035ce35ce.tar.gz
skyhanni-59b63813d81f92a7586f3ae38a22adb035ce35ce.tar.bz2
skyhanni-59b63813d81f92a7586f3ae38a22adb035ce35ce.zip
added MilleniaAgedBlazeColor
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Misc.java6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/end/VoidlingExtremistColor.kt17
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/MilleniaAgedBlazeColor.kt58
4 files changed, 71 insertions, 12 deletions
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
@@ -52,6 +52,12 @@ public class Misc {
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
@ConfigAccordionId(id = 2)
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<EntityEnderman>()
+ .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<EntityEnderman>()
- .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<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 == "Crimson Isle" && SkyHanniMod.feature.misc.milleniaAgedBlazeColor
+} \ No newline at end of file