Skip to content

Commit

Permalink
fix: UUIDと名前を指定したときに頭のテクスチャが正しくないのを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
rito528 committed Dec 24, 2023
1 parent f6e7dee commit 1c04d7b
Showing 1 changed file with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,6 @@ class SkullItemStackBuilder(private val owner: SkullOwnerReference)
meta.setOwningPlayer(Bukkit.getOfflinePlayer(uuid))
val gameProfile = new GameProfile(uuid, name)

val textureUrl =
s"http://textures.minecraft.net/texture/${uuid.toString.replaceAll("-", "")}"

val encodedData = Base64.encodeBase64(
String.format("{textures:{SKIN:{url:\"%s\"}}}", textureUrl).getBytes
)

gameProfile
.getProperties
.put("textures", new Property("textures", new String(encodedData)))

val profileField = meta.getClass.getDeclaredField("profile")
profileField.setAccessible(true)
profileField.set(meta, gameProfile)
Expand Down

0 comments on commit 1c04d7b

Please sign in to comment.