aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/nether
diff options
context:
space:
mode:
authorLorenz <lo.scherf@gmail.com>2022-08-24 11:34:36 +0200
committerLorenz <lo.scherf@gmail.com>2022-08-24 11:34:36 +0200
commit6c701a4b4ce53bf95f8bb70af9cd30d0467878a7 (patch)
treeb77a2d9a49ba8e363f1440ce13b091cafee74693 /src/main/java/at/hannibal2/skyhanni/features/nether
parentd79fc0ac187b4fc14228a5d83200d382e98b6bbe (diff)
downloadskyhanni-6c701a4b4ce53bf95f8bb70af9cd30d0467878a7.tar.gz
skyhanni-6c701a4b4ce53bf95f8bb70af9cd30d0467878a7.tar.bz2
skyhanni-6c701a4b4ce53bf95f8bb70af9cd30d0467878a7.zip
added Ashfang Blazing Souls display
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/nether')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazingSouls.kt63
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt4
4 files changed, 69 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazingSouls.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazingSouls.kt
new file mode 100644
index 000000000..734db29ea
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazingSouls.kt
@@ -0,0 +1,63 @@
+package at.hannibal2.skyhanni.features.nether.ashfang
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled
+import at.hannibal2.skyhanni.utils.ItemUtils.getSkullTexture
+import at.hannibal2.skyhanni.utils.LocationUtils
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.RenderUtils.drawString
+import at.hannibal2.skyhanni.utils.SpecialColour
+import at.hannibal2.skyhanni.utils.getLorenzVec
+import net.minecraft.client.Minecraft
+import net.minecraft.entity.item.EntityArmorStand
+import net.minecraftforge.client.event.RenderWorldLastEvent
+import net.minecraftforge.event.world.WorldEvent
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+import net.minecraftforge.fml.common.gameevent.TickEvent
+import java.awt.Color
+
+class AshfangBlazingSouls {
+
+ private val texture = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODI4N2IzOTdkYWY5NTE2YTBiZDc2ZjVmMWI3YmY5Nzk1MTVkZjNkNWQ4MzNlMDYzNWZhNjhiMzdlZTA4MjIxMiJ9fX0="
+ private val souls = mutableListOf<EntityArmorStand>()
+
+ @SubscribeEvent
+ fun onTick(event: TickEvent.ClientTickEvent) {
+ if (!isEnabled()) return
+
+ Minecraft.getMinecraft().theWorld.loadedEntityList
+ .filter { it ->
+ it is EntityArmorStand && it !in souls && it.inventory
+ .any { it != null && it.getSkullTexture() == texture }
+ }.forEach { souls.add(it as EntityArmorStand) }
+ }
+
+ @SubscribeEvent
+ fun onRenderWorld(event: RenderWorldLastEvent) {
+ if (!isEnabled()) return
+
+ val special = SkyHanniMod.feature.ashfang.blazingSoulsColor
+
+ val color = Color(SpecialColour.specialToChromaRGB(special), true)
+
+ val playerLocation = LocationUtils.playerLocation()
+ for (orb in souls) {
+ if (orb.isDead) continue
+ val orbLocation = orb.getLorenzVec()
+ event.drawWaypointFilled(orbLocation.add(-0.5, 1.25, -0.5), color)
+ if (orbLocation.distance(playerLocation) < 10) {
+ //TODO find way to dynamically change color
+ event.drawString(orbLocation.add(0.0, 2.5, 0.0), "§bBlazing Soul")
+ }
+ }
+ }
+
+ @SubscribeEvent
+ fun renderOverlay(event: WorldEvent.Load) {
+ souls.clear()
+ }
+
+ private fun isEnabled(): Boolean {
+ return LorenzUtils.inSkyblock && SkyHanniMod.feature.ashfang.blazingSouls
+ }
+} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt
index af36884ca..20a6c7bd5 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt
@@ -33,11 +33,11 @@ class AshfangFreezeCooldown {
if (remainingLong > 0) {
val remaining = (remainingLong.toFloat() / 1000)
val format = DecimalFormat("0.0").format(remaining + 0.1)
- SkyHanniMod.feature.abilities.ashfangFreezeCooldownPos.renderString("§cAshfang Freeze: §a${format}s")
+ SkyHanniMod.feature.ashfang.freezeCooldownPos.renderString("§cAshfang Freeze: §a${format}s")
}
}
private fun isEnabled(): Boolean {
- return LorenzUtils.inSkyblock && SkyHanniMod.feature.abilities.ashfangFreezeCooldown
+ return LorenzUtils.inSkyblock && SkyHanniMod.feature.ashfang.freezeCooldown
}
} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt
index ed1abeacb..59a128957 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt
@@ -37,7 +37,7 @@ class AshfangGravityOrbs {
fun onRenderWorld(event: RenderWorldLastEvent) {
if (!isEnabled()) return
- val special = SkyHanniMod.feature.abilities.ashfangGravityOrbsColor
+ val special = SkyHanniMod.feature.ashfang.gravityOrbsColor
val color = Color(SpecialColour.specialToChromaRGB(special), true)
@@ -59,6 +59,6 @@ class AshfangGravityOrbs {
}
private fun isEnabled(): Boolean {
- return LorenzUtils.inSkyblock && SkyHanniMod.feature.abilities.ashfangGravityOrbs
+ return LorenzUtils.inSkyblock && SkyHanniMod.feature.ashfang.gravityOrbs
}
} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt
index 7828b28b2..0f8d617d1 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt
@@ -36,7 +36,7 @@ class AshfangNextResetCooldown {
if (remainingTime > 0) {
val remaining = (remainingTime.toFloat() / 1000)
val format = DecimalFormat("0.0").format(remaining + 0.1)
- SkyHanniMod.feature.abilities.ashfangNextResetCooldownPos.renderString("§cAshfang next reset in: §a${format}s")
+ SkyHanniMod.feature.ashfang.nextResetCooldownPos.renderString("§cAshfang next reset in: §a${format}s")
} else {
spawnTime = -1
}
@@ -48,6 +48,6 @@ class AshfangNextResetCooldown {
}
private fun isEnabled(): Boolean {
- return LorenzUtils.inSkyblock && SkyHanniMod.feature.abilities.ashfangNextResetCooldown
+ return LorenzUtils.inSkyblock && SkyHanniMod.feature.ashfang.nextResetCooldown
}
} \ No newline at end of file