Skip to content

Commit

Permalink
fix: inline NetworkPlayerInfo.text to prevent bad mixins from altering
Browse files Browse the repository at this point in the history
data
  • Loading branch information
My-Name-Is-Jeff committed Jan 21, 2024
1 parent e0de502 commit 8bf84fc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/kotlin/gg/skytils/skytilsmod/utils/TabListUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@ import com.google.common.collect.ComparisonChain
import com.google.common.collect.Ordering
import gg.skytils.skytilsmod.Skytils.Companion.mc
import net.minecraft.client.network.NetworkPlayerInfo
import net.minecraft.scoreboard.ScorePlayerTeam
import net.minecraft.world.WorldSettings

val NetworkPlayerInfo.text: String
get() = mc.ingameGUI.tabList.getPlayerName(this)
get() = displayName?.formattedText ?: ScorePlayerTeam.formatPlayerName(
playerTeam,
gameProfile.name
)


object TabListUtils {
private val playerInfoOrdering = object : Ordering<NetworkPlayerInfo>() {
Expand All @@ -39,6 +44,7 @@ object TabListUtils {
p2.playerTeam?.registeredName ?: ""
).compare(p1.gameProfile.name, p2.gameProfile.name).result()
}

p1 == null -> -1
else -> 0
}
Expand Down

0 comments on commit 8bf84fc

Please sign in to comment.