Attempt to fix IllegalStateException in findResource

This commit is contained in:
JFronny 2021-10-16 11:55:01 +02:00
parent 94d4a0e4af
commit 4fbb9b1dfb
No known key found for this signature in database
GPG Key ID: BEC5ACBBD4EE17E5

View File

@ -30,7 +30,10 @@ public class FileFilterEventImpl {
// Warning: the Identifiers here DON'T CONTAIN THE TYPE!
// Therefore, it needs to be added when calling a method that generates a ResourcePath!
if (skip(pack)) return previous;
previous.removeIf(s -> FileExclusionProvider.fileHidden(pack, type.getDirectory() + "/" + s.getNamespace() + "/" + s.getPath()) && !FileFallbackProvider.fileVisible(pack, namespace));
previous.removeIf(s -> {
String fileName = type.getDirectory() + "/" + s.getNamespace() + "/" + s.getPath();
return FileExclusionProvider.fileHidden(pack, fileName) && !FileFallbackProvider.fileVisible(pack, fileName);
});
// Completion of the path is handled separately here
FileFallbackProvider.addFallbackResources(pack, previous, namespace, type);
return previous;