mirror of https://github.com/kami-blue/client
[feature] Added color option to TabFriends
Closes #1559 Signed-off-by: Dominika <sokolov.dominika@gmail.com>
This commit is contained in:
parent
b9553fcce4
commit
978364f111
|
@ -2,9 +2,11 @@ package me.zeroeightsix.kami.module.modules.render
|
|||
|
||||
import me.zeroeightsix.kami.manager.managers.FriendManager
|
||||
import me.zeroeightsix.kami.module.Module
|
||||
import me.zeroeightsix.kami.setting.ModuleConfig.setting
|
||||
import me.zeroeightsix.kami.util.color.EnumTextColor
|
||||
import me.zeroeightsix.kami.util.text.format
|
||||
import net.minecraft.client.network.NetworkPlayerInfo
|
||||
import net.minecraft.scoreboard.ScorePlayerTeam
|
||||
import net.minecraft.util.text.TextFormatting
|
||||
|
||||
@Module.Info(
|
||||
name = "TabFriends",
|
||||
|
@ -13,10 +15,16 @@ import net.minecraft.util.text.TextFormatting
|
|||
showOnArray = false
|
||||
)
|
||||
object TabFriends : Module() {
|
||||
private val color = setting("Color", EnumTextColor.GREEN)
|
||||
|
||||
@JvmStatic
|
||||
fun getPlayerName(info: NetworkPlayerInfo): String {
|
||||
val name = info.displayName?.formattedText
|
||||
?: ScorePlayerTeam.formatPlayerName(info.playerTeam, info.gameProfile.name)
|
||||
return if (FriendManager.isFriend(name)) "${TextFormatting.GREEN}$name" else name
|
||||
val name = info.displayName?.formattedText ?: ScorePlayerTeam.formatPlayerName(info.playerTeam, info.gameProfile.name)
|
||||
|
||||
return if (FriendManager.isFriend(name)) {
|
||||
color.value format name
|
||||
} else {
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue