summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/nether
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-07-23 23:45:24 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-07-23 23:45:24 +0200
commitf43bac23acf79325f9f4de060b69c5c0b1d870eb (patch)
treef05971f36500a18091762a4b29f0b0415c25558f /src/main/java/at/hannibal2/skyhanni/features/nether
parenta21c3298d2ae7790b3d3770ee4a135c1817f3018 (diff)
downloadskyhanni-f43bac23acf79325f9f4de060b69c5c0b1d870eb.tar.gz
skyhanni-f43bac23acf79325f9f4de060b69c5c0b1d870eb.tar.bz2
skyhanni-f43bac23acf79325f9f4de060b69c5c0b1d870eb.zip
Using EntityUtils.getEntities everywhere
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/nether')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt7
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazingSouls.kt12
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt12
4 files changed, 17 insertions, 22 deletions
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 4e9382d8f..074fc191b 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
@@ -7,10 +7,10 @@ import at.hannibal2.skyhanni.events.ResetEntityHurtEvent
import at.hannibal2.skyhanni.events.withAlpha
import at.hannibal2.skyhanni.features.damageindicator.BossType
import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager
+import at.hannibal2.skyhanni.utils.EntityUtils
import at.hannibal2.skyhanni.utils.EntityUtils.getAllNameTagsWith
import at.hannibal2.skyhanni.utils.LorenzColor
import at.hannibal2.skyhanni.utils.LorenzUtils
-import net.minecraft.client.Minecraft
import net.minecraft.entity.EntityLivingBase
import net.minecraft.entity.item.EntityArmorStand
import net.minecraft.entity.monster.EntityBlaze
@@ -37,7 +37,7 @@ class AshfangBlazes {
}
if (nearAshfang) {
- for (entity in Minecraft.getMinecraft().theWorld.loadedEntityList.filterIsInstance<EntityBlaze>()
+ for (entity in EntityUtils.getAllEntities<EntityBlaze>()
.filter { it !in blazeColor.keys }) {
val list = entity.getAllNameTagsWith(2, "Ashfang")
if (list.size == 1) {
@@ -70,8 +70,7 @@ class AshfangBlazes {
}
private fun checkNearAshfang() {
- nearAshfang = Minecraft.getMinecraft().theWorld.loadedEntityList
- .any { it is EntityArmorStand && it.name.contains("Ashfang") }
+ nearAshfang = EntityUtils.getAllEntities<EntityArmorStand>().any { it.name.contains("Ashfang") }
}
@SubscribeEvent
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
index 5649cc481..b9ecf3200 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazingSouls.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazingSouls.kt
@@ -4,13 +4,9 @@ import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.features.damageindicator.BossType
import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager
import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled
+import at.hannibal2.skyhanni.utils.*
import at.hannibal2.skyhanni.utils.EntityUtils.hasSkullTexture
-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
@@ -28,9 +24,9 @@ class AshfangBlazingSouls {
fun onTick(event: TickEvent.ClientTickEvent) {
if (!isEnabled()) return
- Minecraft.getMinecraft().theWorld.loadedEntityList.filter {
- it is EntityArmorStand && it !in souls && it.hasSkullTexture(texture)
- }.forEach { souls.add(it as EntityArmorStand) }
+ EntityUtils.getAllEntities<EntityArmorStand>()
+ .filter { it !in souls && it.hasSkullTexture(texture)
+ }.forEach { souls.add(it) }
}
@SubscribeEvent
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 be68a1583..da9d134e6 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
@@ -6,7 +6,6 @@ import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager
import at.hannibal2.skyhanni.utils.*
import at.hannibal2.skyhanni.utils.EntityUtils.hasSkullTexture
import at.hannibal2.skyhanni.utils.RenderUtils.drawString
-import net.minecraft.client.Minecraft
import net.minecraft.entity.item.EntityArmorStand
import net.minecraftforge.client.event.RenderWorldLastEvent
import net.minecraftforge.event.world.WorldEvent
@@ -24,10 +23,9 @@ class AshfangGravityOrbs {
fun onTick(event: TickEvent.ClientTickEvent) {
if (!isEnabled()) return
- Minecraft.getMinecraft().theWorld.loadedEntityList
- .filter {
- it is EntityArmorStand && it !in orbs && it.hasSkullTexture(texture)
- }.forEach { orbs.add(it as EntityArmorStand) }
+ EntityUtils.getAllEntities<EntityArmorStand>()
+ .filter { it !in orbs && it.hasSkullTexture(texture) }
+ .forEach { orbs.add(it) }
}
@SubscribeEvent
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 73bebe98e..e21e23f07 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
@@ -4,11 +4,11 @@ import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.features.damageindicator.BossType
import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager
+import at.hannibal2.skyhanni.utils.EntityUtils
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.RenderUtils.renderString
import at.hannibal2.skyhanni.utils.TimeUnit
import at.hannibal2.skyhanni.utils.TimeUtils
-import net.minecraft.client.Minecraft
import net.minecraft.entity.item.EntityArmorStand
import net.minecraftforge.event.world.WorldEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -22,9 +22,8 @@ class AshfangNextResetCooldown {
fun renderOverlay(event: ClientTickEvent) {
if (!isEnabled()) return
- if (Minecraft.getMinecraft().theWorld.loadedEntityList.any {
- it is EntityArmorStand && it.posY > 145 &&
- (it.name.contains("§c§9Ashfang Acolyte§r") || it.name.contains("§c§cAshfang Underling§r"))
+ if (EntityUtils.getAllEntities<EntityArmorStand>().any {
+ it.posY > 145 && (it.name.contains("§c§9Ashfang Acolyte§r") || it.name.contains("§c§cAshfang Underling§r"))
}) {
spawnTime = System.currentTimeMillis()
}
@@ -38,7 +37,10 @@ class AshfangNextResetCooldown {
val remainingTime = spawnTime + 46_100 - System.currentTimeMillis()
if (remainingTime > 0) {
val format = TimeUtils.formatDuration(remainingTime, TimeUnit.SECOND, showMilliSeconds = true)
- SkyHanniMod.feature.ashfang.nextResetCooldownPos.renderString("§cAshfang next reset in: §a$format", posLabel = "Ashfang Reset Cooldown")
+ SkyHanniMod.feature.ashfang.nextResetCooldownPos.renderString(
+ "§cAshfang next reset in: §a$format",
+ posLabel = "Ashfang Reset Cooldown"
+ )
} else {
spawnTime = -1
}