From 59a7994ecc435c469baa8c843dc8c8ed7b71107b Mon Sep 17 00:00:00 2001 From: Lorenz Date: Wed, 17 Aug 2022 00:09:29 +0200 Subject: fixing ashfang reset cooldown --- .../misc/nether/ashfang/AshfangNextResetCooldown.kt | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/misc/nether/ashfang/AshfangNextResetCooldown.kt b/src/main/java/at/hannibal2/skyhanni/misc/nether/ashfang/AshfangNextResetCooldown.kt index 41ad05908..7f8373448 100644 --- a/src/main/java/at/hannibal2/skyhanni/misc/nether/ashfang/AshfangNextResetCooldown.kt +++ b/src/main/java/at/hannibal2/skyhanni/misc/nether/ashfang/AshfangNextResetCooldown.kt @@ -13,21 +13,17 @@ import java.text.DecimalFormat class AshfangNextResetCooldown { - var spawnTime = 1L + private var spawnTime = 1L @SubscribeEvent fun renderOverlay(event: ClientTickEvent) { if (!isEnabled()) return - if (spawnTime == -1L) { - val spawned = Minecraft.getMinecraft().theWorld.loadedEntityList.any { - it is EntityArmorStand && (it.name.contains("§c§8Ashfang Follower§r") || - it.name.contains("§c§9Ashfang Acolyte§r") || - it.name.contains("§c§cAshfang Underling§r")) - } - if (spawned) { - spawnTime = System.currentTimeMillis() - } + 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")) + }) { + spawnTime = System.currentTimeMillis() } } @@ -36,8 +32,7 @@ class AshfangNextResetCooldown { if (!isEnabled()) return if (spawnTime == -1L) return - val remainingTime = spawnTime + 45_000 - System.currentTimeMillis() - + val remainingTime = spawnTime + 46_100 - System.currentTimeMillis() if (remainingTime > 0) { val remaining = (remainingTime.toFloat() / 1000) val format = DecimalFormat("0.0").format(remaining + 0.1) -- cgit