aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
authorLorenz <lo.scherf@gmail.com>2022-08-17 00:09:29 +0200
committerLorenz <lo.scherf@gmail.com>2022-08-17 00:09:29 +0200
commit59a7994ecc435c469baa8c843dc8c8ed7b71107b (patch)
treed85e89a332d92ed1ffa96900e8af817753298881 /src/main/java/at/hannibal2/skyhanni
parentacc866dc2a5f1f55ea8307321e31f8f3a8742e5e (diff)
downloadskyhanni-59a7994ecc435c469baa8c843dc8c8ed7b71107b.tar.gz
skyhanni-59a7994ecc435c469baa8c843dc8c8ed7b71107b.tar.bz2
skyhanni-59a7994ecc435c469baa8c843dc8c8ed7b71107b.zip
fixing ashfang reset cooldown
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/misc/nether/ashfang/AshfangNextResetCooldown.kt19
1 files changed, 7 insertions, 12 deletions
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)