Skip to content

Commit

Permalink
Fix loading custom player head textures in 1.21 worlds.
Browse files Browse the repository at this point in the history
  • Loading branch information
leMaik committed Sep 4, 2024
1 parent 17753e8 commit 8f9f0c1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions chunky/src/java/se/llbit/chunky/block/minecraft/Head.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ public static Optional<MinecraftSkin> getSkinFromProfileTag(CompoundTag profileT
Tag properties = profileTag.get("properties");
if (properties.isCompoundTag()) {
return MinecraftSkin.getSkinFromEncodedTextures(properties.get("value").stringValue());
} else if (properties.isList()) {
for (Tag property : properties.asList()) {
if (property.get("name").stringValue("").equals("textures")) {
return MinecraftSkin.getSkinFromEncodedTextures(property.get("value").stringValue());
}
}
}
int[] uuidInts = profileTag.get("id").intArray();
return MojangApi.fetchProfile(UuidUtil.intsToUuid(uuidInts).toString()).getSkin();
Expand Down

0 comments on commit 8f9f0c1

Please sign in to comment.