forked from SteamWar/SteamWar
Format code
This commit is contained in:
@@ -26,7 +26,7 @@ import de.steamwar.tntleague.game.TNTLeagueTeam
|
||||
import de.steamwar.tntleague.message
|
||||
import org.bukkit.entity.Player
|
||||
|
||||
data class TNTLeagueScoreboard(val p: Player): ScoreboardCallback {
|
||||
data class TNTLeagueScoreboard(val p: Player) : ScoreboardCallback {
|
||||
override fun getData(): HashMap<String, Int> {
|
||||
val lines = mutableListOf<String>()
|
||||
|
||||
@@ -40,8 +40,12 @@ data class TNTLeagueScoreboard(val p: Player): ScoreboardCallback {
|
||||
|
||||
when (val team = TNTLeagueGame.getTeam(p)) {
|
||||
is TNTLeagueTeam -> lines.add(message.parse("SCOREBOARD_COINS", p, team.coins))
|
||||
else -> lines.add(message.parse("SCOREBOARD_COINS", p,
|
||||
"§${TNTLeagueGame.blueTeam.color}${TNTLeagueGame.blueTeam.coins}§8:§${TNTLeagueGame.redTeam.color}${TNTLeagueGame.redTeam.coins}"))
|
||||
else -> lines.add(
|
||||
message.parse(
|
||||
"SCOREBOARD_COINS", p,
|
||||
"§${TNTLeagueGame.blueTeam.color}${TNTLeagueGame.blueTeam.coins}§8:§${TNTLeagueGame.redTeam.color}${TNTLeagueGame.redTeam.coins}"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
lines.add("§3")
|
||||
@@ -59,5 +63,6 @@ data class TNTLeagueScoreboard(val p: Player): ScoreboardCallback {
|
||||
.foldIndexed(HashMap()) { index, acc, component -> acc.also { it[component] = index } }
|
||||
}
|
||||
|
||||
override fun getTitle(): String = message.parse("PREFIX", p).dropLast(1)
|
||||
override fun getTitle(): String =
|
||||
message.parse("PREFIX", p).dropLast(1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user