diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-03-24 23:54:35 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-03-24 23:54:35 +0100 |
commit | c243e0fdce709c61caf04356c94bc04fac37a0d6 (patch) | |
tree | 4d612f3b0bca073d0b2a9e06524ef3063a07db3a | |
parent | 5e45db646c7ee0942aab282643e94943a153f639 (diff) | |
download | skyhanni-c243e0fdce709c61caf04356c94bc04fac37a0d6.tar.gz skyhanni-c243e0fdce709c61caf04356c94bc04fac37a0d6.tar.bz2 skyhanni-c243e0fdce709c61caf04356c94bc04fac37a0d6.zip |
Hide elite farming leaderboard eta time when not farming
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/EliteFarmingWeight.kt | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/EliteFarmingWeight.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/EliteFarmingWeight.kt index b62bffb25..612bebfbc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/EliteFarmingWeight.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/EliteFarmingWeight.kt @@ -160,7 +160,9 @@ class EliteFarmingWeight { val weightUntilOvertake = nextPlayerWeight - totalWeight if (weightUntilOvertake < 0) { if (!hasPassedNext) { - LorenzUtils.chat("§e[SkyHanni] You passed §b$nextName §ein the Farming Weight Leaderboard!") + if (weightPerSecond != -1.0) { + LorenzUtils.chat("§e[SkyHanni] You passed §b$nextName §ein the Farming Weight Leaderboard!") + } if (leaderboardPosition == -1) { leaderboardPosition = 1000 } else { @@ -174,13 +176,14 @@ class EliteFarmingWeight { if (nextPlayerWeight == 0.0) { return "§cRejoin the garden to show ETA!" } - val timeTillOvertake = (weightUntilOvertake / weightPerSecond) * 1000 - val timeFormat = TimeUtils.formatDuration(timeTillOvertake.toLong()) - - val format = LorenzUtils.formatDouble(weightUntilOvertake, 2) - - // TODO Maybe add next player name? - return "§e$format §7(§b$timeFormat§7) §7behind §b$nextName" + val timeFormat = if (weightPerSecond != -1.0) { + val timeTillOvertake = (weightUntilOvertake / weightPerSecond) * 1000 + val format = TimeUtils.formatDuration(timeTillOvertake.toLong()) + " §7(§b$format§7)" + } else "" + + val weightFormat = LorenzUtils.formatDouble(weightUntilOvertake, 2) + return "§e$weightFormat$timeFormat §7behind §b$nextName" } private fun isEnabled() = GardenAPI.inGarden() && config.eliteFarmingWeightDisplay |