aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/util
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-09-25 19:24:16 +0200
committernea <nea@nea.moe>2023-09-25 19:24:46 +0200
commit139089d9beb134465737c4afff3b1303bf481aa1 (patch)
treeca2582bee8d9988afe9ca4f6ed70b043d47aaf3a /src/main/kotlin/moe/nea/firmament/util
parent2bd3ed1e238d75c4a185656ac6fd857ac6897a99 (diff)
downloadFirmament-139089d9beb134465737c4afff3b1303bf481aa1.tar.gz
Firmament-139089d9beb134465737c4afff3b1303bf481aa1.tar.bz2
Firmament-139089d9beb134465737c4afff3b1303bf481aa1.zip
Port to 1.20.2
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/util')
-rw-r--r--src/main/kotlin/moe/nea/firmament/util/ScoreboardUtil.kt3
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))