diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-10 11:14:33 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-10 11:14:33 +0200 |
commit | c33364944f8f288cded166f47375df96f988448e (patch) | |
tree | c6137310c11da6fdeba7af9951978b2297840cb7 /src/main/java/at | |
parent | 2cb19471d4a2aee483372b7fa1ecd30dca00c6f2 (diff) | |
download | skyhanni-c33364944f8f288cded166f47375df96f988448e.tar.gz skyhanni-c33364944f8f288cded166f47375df96f988448e.tar.bz2 skyhanni-c33364944f8f288cded166f47375df96f988448e.zip |
code cleanup
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestTimeNeeded.kt | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestTimeNeeded.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestTimeNeeded.kt index 5bf3331f2..2cfde32ba 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestTimeNeeded.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestTimeNeeded.kt @@ -72,8 +72,7 @@ class JacobContestTimeNeeded { val timeInMinutes = amount.toDouble() / speedForFormular / 60 val formatDuration = TimeUtils.formatDuration((timeInMinutes * 60 * 1000).toLong()) val color = if (timeInMinutes < 20) "§b" else "§c" - var line: String - var marking: String = "" + var marking = "" var bracketText = "${bracket.displayName} $color$formatDuration" var blocksPerSecond = crop.getLatestBlocksPerSecond() if (blocksPerSecond == null) { @@ -84,23 +83,22 @@ class JacobContestTimeNeeded { if (blocksPerSecond < 15.0) { marking += "§4§l !" blocksPerSecond = 19.9 - lowBPSWarning = listOf("§cYour Blocks/second is too low,", "§cshowing 19.9 Blocks/second instead!") + lowBPSWarning = + listOf("§cYour Blocks/second is too low,", "§cshowing 19.9 Blocks/second instead!") } else { marking += " " lowBPSWarning = listOf("§aYour Blocks/second is good :)") } } - if (timeInMinutes < 20) { - line = "§9${crop.cropName} §b$formatDuration" + marking + val line = if (timeInMinutes < 20) { + "§9${crop.cropName} §b$formatDuration" + marking } else { - line = - "§9${crop.cropName} §cNo ${currentBracket.displayName} §cMedal!" + marking val cropFF = crop.getLatestTrueFarmingFortune() ?: 0.0 val cropsPerSecond = amount.toDouble() / blocksPerSecond / 60 val ffNeeded = cropsPerSecond * 100 / 20 / crop.baseDrops val missing = (ffNeeded - cropFF).toInt() bracketText += " §7(${missing.addSeparators()} more FF needed!)" - + "§9${crop.cropName} §cNo ${currentBracket.displayName} §cMedal!" + marking } brackets.add(bracketText) if (bracket == currentBracket) { |