aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/util/item/SkullItemData.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/util/item/SkullItemData.kt')
-rw-r--r--src/main/kotlin/moe/nea/firmament/util/item/SkullItemData.kt6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/util/item/SkullItemData.kt b/src/main/kotlin/moe/nea/firmament/util/item/SkullItemData.kt
index 39088ec..4b72c5e 100644
--- a/src/main/kotlin/moe/nea/firmament/util/item/SkullItemData.kt
+++ b/src/main/kotlin/moe/nea/firmament/util/item/SkullItemData.kt
@@ -42,11 +42,13 @@ data class MinecraftTexturesPayloadKt(
fun GameProfile.setTextures(textures: MinecraftTexturesPayloadKt) {
val json = Firmament.json.encodeToString(textures)
val encoded = java.util.Base64.getEncoder().encodeToString(json.encodeToByteArray())
- properties.put(PlayerSkinProvider.TEXTURES, Property(PlayerSkinProvider.TEXTURES, encoded))
+ properties.put(propertyTextures, Property(propertyTextures, encoded))
}
+private val propertyTextures = "textures"
+
fun decodeProfileTextureProperty(property: Property): MinecraftTexturesPayloadKt? {
- assertTrueOr(property.name == PlayerSkinProvider.TEXTURES) { return null }
+ assertTrueOr(property.name == propertyTextures) { return null }
return try {
var encodedF: String = property.value
while (encodedF.length % 4 != 0 && encodedF.last() == '=') {