aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-26 21:53:44 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-26 21:53:44 +0100
commit132633476381c7a0e6c5211837f9cff8171c3c3b (patch)
treee5f8aa7a8505a5dca40ccda0ecf139e1c136f289 /src
parent61cf4dc20a1337e74ed2ca33df1ec3ed53d9e270 (diff)
downloadskyhanni-132633476381c7a0e6c5211837f9cff8171c3c3b.tar.gz
skyhanni-132633476381c7a0e6c5211837f9cff8171c3c3b.tar.bz2
skyhanni-132633476381c7a0e6c5211837f9cff8171c3c3b.zip
fixed error
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/fishing/FishingTimer.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/SeaCreatureTracker.kt13
2 files changed, 8 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingTimer.kt
index 79fdc21f3..8f6988de7 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingTimer.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingTimer.kt
@@ -136,7 +136,7 @@ class FishingTimer {
val barnTimerAlertTime = config.alertTime * 1_000
val color = if (duration > barnTimerAlertTime) "§c" else "§e"
val timeFormat = TimeUtils.formatDuration(duration, biggestUnit = TimeUnit.MINUTE)
- val name = StringUtils.optionalPlural(currentCount, "sea creature", "sea creatures")
+ val name = StringUtils.canBePlural(currentCount, "sea creature", "sea creatures")
val text = "$color$timeFormat §8(§e$currentCount §b$name§8)"
config.pos.renderString(text, posLabel = "BarnTimer")
diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/SeaCreatureTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/SeaCreatureTracker.kt
index 1dfd03e79..6a1e1a382 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/SeaCreatureTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/SeaCreatureTracker.kt
@@ -114,6 +114,12 @@ object SeaCreatureTracker {
)
}
+ return if (currentCategory == nameAll) {
+ { true }
+ } else filterCurrentCategory()
+ }
+
+ private fun filterCurrentCategory(): (String) -> Boolean {
val items = SeaCreatureManager.allVariants[currentCategory] ?: run {
ErrorManager.logErrorStateWithData(
"Sea Creature Tracker can not find all sea creature variants",
@@ -123,12 +129,7 @@ object SeaCreatureTracker {
)
return { true }
}
- val filter: (String) -> Boolean = if (currentCategory == nameAll) {
- { true }
- } else {
- { it in items }
- }
- return filter
+ return { it in items }
}
@SubscribeEvent