Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
TBlueF committed Mar 20, 2024
2 parents b60b143 + 10fb88d commit 2689cd1
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,16 @@ public void write(JsonWriter out, TextureVariable value) throws IOException {
public TextureVariable read(JsonReader in) throws IOException {
String value = in.nextString();
if (value.isEmpty()) throw new IOException("Can't parse an empty String into a TextureVariable");

if (value.charAt(0) == '#') {
return new TextureVariable(value.substring(1));
} else {
if (!(value.contains(":") || value.contains("/"))) {
return new TextureVariable(value);
}

return new TextureVariable(new ResourcePath<>(value));
}
}

}

}

0 comments on commit 2689cd1

Please sign in to comment.