aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/apis
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-06-02 17:22:43 +0200
committernea <nea@nea.moe>2023-06-02 17:22:43 +0200
commitf249df8f67114b14e3d75a955ace1d28ba6cb937 (patch)
tree8dbc1c813b6bb2b9cc9674e5e9e85bb4088b08f1 /src/main/kotlin/moe/nea/firmament/apis
parentccf1d1d0e97983509b29c276caa058b8c8284a66 (diff)
downloadfirmament-f249df8f67114b14e3d75a955ace1d28ba6cb937.tar.gz
firmament-f249df8f67114b14e3d75a955ace1d28ba6cb937.tar.bz2
firmament-f249df8f67114b14e3d75a955ace1d28ba6cb937.zip
Refactor skill page
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/apis')
-rw-r--r--src/main/kotlin/moe/nea/firmament/apis/Profiles.kt7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/apis/Profiles.kt b/src/main/kotlin/moe/nea/firmament/apis/Profiles.kt
index 2e483ee..4fd5704 100644
--- a/src/main/kotlin/moe/nea/firmament/apis/Profiles.kt
+++ b/src/main/kotlin/moe/nea/firmament/apis/Profiles.kt
@@ -11,6 +11,7 @@ import kotlinx.serialization.Serializable
import kotlinx.serialization.UseSerializers
import kotlin.reflect.KProperty1
import net.minecraft.util.DyeColor
+import net.minecraft.util.Formatting
import moe.nea.firmament.repo.RepoManager
import moe.nea.firmament.util.LegacyFormattingCode
import moe.nea.firmament.util.json.DashlessUUIDSerializer
@@ -130,6 +131,12 @@ data class PlayerData(
) {
val rankPlusDyeColor = LegacyFormattingCode.values().find { it.name == rankPlusColor } ?: LegacyFormattingCode.GOLD
val rankData get() = RepoManager.neuRepo.constants.misc.ranks[if (monthlyPackageRank == "NONE" || monthlyPackageRank == null) packageRank else monthlyPackageRank]
+ fun getDisplayName() = rankData?.let {
+ ("§${it.color}[${it.tag}${rankPlusDyeColor.modern}" +
+ "${it.plus ?: ""}§${it.color}] $playerName")
+ } ?: "${Formatting.GRAY}${playerName}"
+
+
}
@Serializable