Skip to content

Commit

Permalink
add data_url alias for source in model textures
Browse files Browse the repository at this point in the history
  • Loading branch information
iam4722202468 committed Jan 14, 2025
1 parent 6c278d6 commit af0a0d3
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public static Map<String, TextureData> generate(JsonArray textures, Map<String,
public static Map.Entry<String, TextureData> parseLayer(String id, JsonValue texture, Map<String, JsonObject> mcmetas, int height, int width) {
JsonObject textureObj = texture.asJsonObject();

byte[] data = Base64.getDecoder().decode(textureObj.getString("source").substring("data:image/png;base64,".length()));
String source = textureObj.getString("source", textureObj.getString("data_url", "data:image/png;base64,"));
byte[] data = Base64.getDecoder().decode(source.substring("data:image/png;base64,".length()));
String name = textureObj.getString("name");

JsonValue uuid = textureObj.get("uuid");
Expand Down

0 comments on commit af0a0d3

Please sign in to comment.