Ensure files in assets/ are not counted as namespaces
This commit is contained in:
parent
f70fb212f7
commit
4964cccff9
|
|
@ -147,9 +147,17 @@ public class PackResourcesCacheEngine {
|
||||||
|
|
||||||
public Set<String> getNamespaces(PackType type) {
|
public Set<String> getNamespaces(PackType type) {
|
||||||
awaitLoad();
|
awaitLoad();
|
||||||
if(PackTypeHelper.isVanillaPackType(type))
|
if(PackTypeHelper.isVanillaPackType(type)) {
|
||||||
return this.root.getChild(type.getDirectory()).children.keySet();
|
var namespaceToNodeMap = this.root.getChild(type.getDirectory()).children;
|
||||||
else
|
var results = new ObjectOpenHashSet<String>();
|
||||||
|
for (var entry : namespaceToNodeMap.entrySet()) {
|
||||||
|
// Entries without children are files, not folders
|
||||||
|
if (!entry.getValue().children.isEmpty()) {
|
||||||
|
results.add(entry.getKey());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return results;
|
||||||
|
} else
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user