diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-02-21 14:19:20 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-02-21 14:19:20 +0100 |
commit | 8251b5a124d2bc567e3764964e5f451c4d4bd634 (patch) | |
tree | ae0898c1fb850187eda5dc7b7f3382697a2ff5e9 /src/main | |
parent | e76fc4f40e5edf01527472f6cecdd59fd008c647 (diff) | |
download | skyhanni-8251b5a124d2bc567e3764964e5f451c4d4bd634.tar.gz skyhanni-8251b5a124d2bc567e3764964e5f451c4d4bd634.tar.bz2 skyhanni-8251b5a124d2bc567e3764964e5f451c4d4bd634.zip |
Queue full support
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt | 2 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorTimer.kt | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt index c3d26c90f..6567397cc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt @@ -66,6 +66,8 @@ class GardenVisitorFeatures { private fun update() { display.clear() + if (!SkyHanniMod.feature.garden.visitorNeedsDisplay) return + val requiredItems = mutableMapOf<String, Int>() val newVisitors = mutableListOf<String>() for ((visitorName, visitor) in visitors) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorTimer.kt index 9ca5c4b13..6f39c3b63 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorTimer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorTimer.kt @@ -23,11 +23,14 @@ class GardenVisitorTimer { var visitorsAmount = 0 var millis = 15 * 60_000L + var queueFull = false for (line in event.tabList) { var matcher = patternNextVisitor.matcher(line) if (matcher.matches()) { val rawTime = matcher.group(1) millis = TimeUtils.getMillis(rawTime) + } else if (line == " Next Visitor: §r§c§lQueue Full!") { + queueFull = true } matcher = patternVisitors.matcher(line) @@ -48,7 +51,8 @@ class GardenVisitorTimer { val visitorLabel = if (visitorsAmount == 1) "visitor" else "visitors" val formatDuration = TimeUtils.formatDuration(millis) - render = "§b$visitorsAmount $visitorLabel §f(Next in §e$formatDuration$extraSpeed§f)" + val next = if (queueFull) "§cQueue Full!" else "Next in §e$formatDuration$extraSpeed" + render = "§b$visitorsAmount $visitorLabel §f($next§f)" } @SubscribeEvent |