Skip to content

Commit

Permalink
Fix exporting player heads with false skin name data
Browse files Browse the repository at this point in the history
  • Loading branch information
mmdanggg2 committed Jul 3, 2024
1 parent 9ac167e commit 57ea682
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/org/jmc/models/Head.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 57ea682

Please sign in to comment.