Skip to content

Commit 4964ccc

Browse files
committed
Ensure files in assets/ are not counted as namespaces
1 parent f70fb21 commit 4964ccc

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

common/src/main/java/org/embeddedt/modernfix/resources/PackResourcesCacheEngine.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,17 @@ private static boolean isValidCachedResourcePath(Path path) {
147147

148148
public Set<String> getNamespaces(PackType type) {
149149
awaitLoad();
150-
if(PackTypeHelper.isVanillaPackType(type))
151-
return this.root.getChild(type.getDirectory()).children.keySet();
152-
else
150+
if(PackTypeHelper.isVanillaPackType(type)) {
151+
var namespaceToNodeMap = this.root.getChild(type.getDirectory()).children;
152+
var results = new ObjectOpenHashSet<String>();
153+
for (var entry : namespaceToNodeMap.entrySet()) {
154+
// Entries without children are files, not folders
155+
if (!entry.getValue().children.isEmpty()) {
156+
results.add(entry.getKey());
157+
}
158+
}
159+
return results;
160+
} else
153161
return null;
154162
}
155163

0 commit comments

Comments
 (0)