diff options
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/util')
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/ScoreboardUtil.kt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/util/ScoreboardUtil.kt b/src/main/kotlin/moe/nea/firmament/util/ScoreboardUtil.kt index afbdd82..b437357 100644 --- a/src/main/kotlin/moe/nea/firmament/util/ScoreboardUtil.kt +++ b/src/main/kotlin/moe/nea/firmament/util/ScoreboardUtil.kt @@ -8,6 +8,7 @@ package moe.nea.firmament.util import java.util.Optional import net.minecraft.scoreboard.Scoreboard +import net.minecraft.scoreboard.ScoreboardDisplaySlot import net.minecraft.scoreboard.Team import net.minecraft.text.StringVisitable import net.minecraft.text.Style @@ -16,7 +17,7 @@ import net.minecraft.util.Formatting fun getScoreboardLines(): List<Text> { val scoreboard = MC.player?.scoreboard ?: return listOf() - val activeObjective = scoreboard.getObjectiveForSlot(Scoreboard.SIDEBAR_DISPLAY_SLOT_ID) ?: return listOf() + val activeObjective = scoreboard.getObjectiveForSlot(ScoreboardDisplaySlot.SIDEBAR) ?: return listOf() return scoreboard.getAllPlayerScores(activeObjective).reversed().take(15).map { val team = scoreboard.getPlayerTeam(it.playerName) Team.decorateName(team, Text.literal(it.playerName)) |