Skip to content

Commit

Permalink
Dont load hidden system files like thumbs.db and .ds_store in resourc…
Browse files Browse the repository at this point in the history
…e packs
  • Loading branch information
LatvianModder committed Oct 16, 2023
1 parent 3482d65 commit 42560eb
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ public Map<ResourceLocation, GeneratedData> getGenerated() {
}

for (var path : Files.walk(dir).filter(Files::isRegularFile).filter(Files::isReadable).toList()) {
var pathStr = dir.relativize(path).toString().replace('\\', '/');
var pathStr = dir.relativize(path).toString().replace('\\', '/').toLowerCase();
int sindex = pathStr.lastIndexOf('/');
var fileName = sindex == -1 ? pathStr : pathStr.substring(sindex + 1);

if (pathStr.endsWith(".zip")) {
if (fileName.endsWith(".zip") || fileName.equals(".ds_store") || fileName.equals("thumbs.db") || fileName.equals("desktop.ini") || Files.isHidden(path)) {
continue;
}

Expand Down

0 comments on commit 42560eb

Please sign in to comment.