Fix behavior for contained paths with non-vanilla PackTypes

This commit is contained in:
embeddedt 2023-04-21 13:40:21 -04:00
parent 9e95be14f3
commit 5958e10eff
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -56,9 +56,7 @@ public abstract class ModFileResourcePackMixin {
this.rootListingByNamespaceAndType = new EnumMap<>(PackType.class);
this.containedPaths = new HashSet<>();
for(PackType type : PackType.values()) {
if(!PackTypeHelper.isVanillaPackType(type))
continue;
Set<String> namespaces = this.namespacesByType.get(type);
Set<String> namespaces = PackTypeHelper.isVanillaPackType(type) ? this.namespacesByType.get(type) : this.getNamespaces(type);
HashMap<String, List<CachedResourcePath>> rootListingForNamespaces = new HashMap<>();
for(String namespace : namespaces) {
try {
@ -82,7 +80,8 @@ public abstract class ModFileResourcePackMixin {
rootListingForNamespaces.put(namespace, Collections.emptyList());
}
}
this.rootListingByNamespaceAndType.put(type, rootListingForNamespaces);
if(PackTypeHelper.isVanillaPackType(type))
this.rootListingByNamespaceAndType.put(type, rootListingForNamespaces);
}
}