diff options
Diffstat (limited to 'src/main/kotlin/dulkirmod/utils/ScoreBoardUtils.kt')
-rw-r--r-- | src/main/kotlin/dulkirmod/utils/ScoreBoardUtils.kt | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/main/kotlin/dulkirmod/utils/ScoreBoardUtils.kt b/src/main/kotlin/dulkirmod/utils/ScoreBoardUtils.kt new file mode 100644 index 0000000..7b6c96d --- /dev/null +++ b/src/main/kotlin/dulkirmod/utils/ScoreBoardUtils.kt @@ -0,0 +1,21 @@ +package dulkirmod.utils + +import dulkirmod.DulkirMod +import net.minecraft.scoreboard.Score +import net.minecraft.scoreboard.ScorePlayerTeam + +object ScoreBoardUtils { + fun getLines() : MutableList<String> { + val scoreboard = DulkirMod.mc.thePlayer.worldScoreboard + val sidebarObjective = scoreboard.getObjectiveInDisplaySlot(1) + val scores: List<Score> = ArrayList(scoreboard.getSortedScores(sidebarObjective)) + val lines: MutableList<String> = ArrayList() + for (i in scores.indices.reversed()) { + val score = scores[i] + val scoreplayerteam1 = scoreboard.getPlayersTeam(score.playerName) + val line = ScorePlayerTeam.formatPlayerName(scoreplayerteam1, score.playerName) + lines.add(line) + } + return lines + } +}
\ No newline at end of file |