From 57ea682d1982878c9595d2440a6b418d52889b97 Mon Sep 17 00:00:00 2001 From: James Horsley Date: Wed, 3 Jul 2024 20:31:20 +0100 Subject: [PATCH] Fix exporting player heads with false skin name data --- src/org/jmc/models/Head.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/org/jmc/models/Head.java b/src/org/jmc/models/Head.java index a68304a..2763c69 100644 --- a/src/org/jmc/models/Head.java +++ b/src/org/jmc/models/Head.java @@ -181,8 +181,11 @@ public static void addPlayerHead(ChunkProcessor obj, Transform rt, @CheckForNull private static @Nonnull NamespaceID getPlayerTexture(String texDataB64, @CheckForNull String name) { NamespaceID texID; String url = extractPlayerTextureUrl(texDataB64); - if (name == null) { - name = url.substring(url.lastIndexOf('/') + 1); + String skinID = url.substring(url.lastIndexOf('/') + 1); + if (name == null || name.isEmpty()) { + name = skinID; + } else { + name += "_" + skinID; } texID = new NamespaceID("jmc2obj", "head/player_" + name); synchronized (addedMaterials) {