aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/EliteFarmingWeight.kt19
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