This commit is contained in:
Lukas Rieger (Blue) 2024-03-20 22:05:51 +01:00
commit 2689cd10e0
No known key found for this signature in database
GPG Key ID: AA33883B1BBA03E6
1 changed files with 5 additions and 2 deletions

View File

@ -140,13 +140,16 @@ public class TextureVariable {
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));
}
}
}
}