Skip to content

Commit

Permalink
Improvement: /shtps wording (#3045)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidArthurCole authored Dec 13, 2024
1 parent 090e307 commit bdba2ce
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ object TpsCounter {
private var display: String? = null

private val timeSinceWorldSwitch get() = LorenzUtils.lastWorldSwitch.passedSince()
private val tilCalculated: String get() =
"§fCalculating... §7(${(10.seconds - timeSinceWorldSwitch).inWholeSeconds}s)"

@SubscribeEvent
fun onSecondPassed(event: SecondPassedEvent) {
Expand Down Expand Up @@ -73,8 +75,8 @@ object TpsCounter {
}

private fun tpsCommand() {
val tps = tps ?: return ChatUtils.chat("§eTPS: §fCalculating...")
ChatUtils.chat("§eTPS: ${getColor(tps)}$tps")
val tpsMessage = tps?.let { "${getColor(it)}$it" } ?: tilCalculated
ChatUtils.chat("§eTPS: $tpsMessage")
}

@SubscribeEvent
Expand Down

0 comments on commit bdba2ce

Please sign in to comment.