Skip to content

Commit

Permalink
fix: seconds translation when reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
chatasma committed Jul 7, 2024
1 parent c904ffa commit a9ae275
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import net.kyori.adventure.key.Key.key
import net.kyori.adventure.sound.Sound
import net.kyori.adventure.sound.Sound.sound
import net.kyori.adventure.text.Component
import net.kyori.adventure.text.Component.space
import net.kyori.adventure.text.Component.text
import net.kyori.adventure.text.Component.*
import net.kyori.adventure.text.TextComponent
import net.kyori.adventure.text.event.HoverEvent.showText
import net.kyori.adventure.text.format.NamedTextColor
Expand Down Expand Up @@ -69,10 +68,10 @@ class ReportCommands {
val timeSinceReport: Duration = Duration.between(lastReport, Instant.now())
val secondsRemaining: Long = REPORT_COOLDOWN_SECONDS - timeSinceReport.getSeconds()
if (secondsRemaining > 0) {
val secondsComponent: TextComponent = text(secondsRemaining.toString())
val secondsComponent: TextComponent = text(secondsRemaining.toString() + " ")
val secondsLeftComponent: TextComponent = text()
.append(secondsComponent)
.append(text(if (secondsRemaining != 1L) "misc.seconds" else "misc.second")).build()
.append(translatable(if (secondsRemaining != 1L) "misc.seconds" else "misc.second")).build()
matchPlayer.sendWarning(text("Please wait ").append(secondsLeftComponent).append(text(" before running that command again")))
return
}
Expand Down

0 comments on commit a9ae275

Please sign in to comment.