Skip to content

Commit b7c5c3e

Browse files
committed
change TextureAtlas default fallback of unknown type to "not included" instead of "included"
1 parent 22b7222 commit b7c5c3e

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

src/main/java/dev/kinau/resourcepackvalidator/atlas/TextureAtlas.java

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public TextureAtlas(File rootDir, Gson gson) {
3030
} else {
3131
this.data = new AtlasData();
3232
}
33-
data.sources().add(new AtlasSource("directory", "item", "", null, null));
34-
data.sources().add(new AtlasSource("directory", "block", "", null, null));
33+
data.sources().add(new AtlasSource("directory", "item", "", null, null, null));
34+
data.sources().add(new AtlasSource("directory", "block", "", null, null, null));
3535
} catch (Exception ex) {
3636
log.error("Could not load blocks atlas", ex);
3737
}
@@ -49,6 +49,14 @@ public static class AtlasData {
4949
private final List<AtlasSource> sources = new ArrayList<>();
5050
}
5151

52+
@Getter
53+
@Accessors(fluent = true)
54+
@ToString
55+
public static class AtlasFilterType {
56+
private String namespace;
57+
private String path;
58+
}
59+
5260
//TODO: Add "filter" and "unstitch" type and use inherited classes
5361
@Getter
5462
@Accessors(fluent = true)
@@ -63,6 +71,8 @@ public static class AtlasSource {
6371
private String resource;
6472
private String sprite;
6573

74+
private AtlasFilterType pattern;
75+
6676
public boolean isInAtlas(OverlayNamespace namespace, File file) {
6777
String path = file.getPath();
6878
String namespacePath = namespace.getAssetsDir().getPath();
@@ -94,9 +104,12 @@ public boolean isInAtlas(OverlayNamespace namespace, File file) {
94104
} else {
95105
return false;
96106
}
107+
} else if (type.equals("filter")) {
108+
// TODO filter atlas type
109+
return false;
97110
}
98-
System.out.println("FALLBACK");
99-
return true;
111+
log.warn("Detected unknown texture atlas type: {}, ignoring it", this.type);
112+
return false;
100113
}
101114
}
102115
}

0 commit comments

Comments
 (0)