Merge 1.19.4 into 1.20

This commit is contained in:
embeddedt 2023-06-22 13:42:57 -04:00
commit 63bcdb1019
No known key found for this signature in database
GPG Key ID: A69433EC199B5613
2 changed files with 12 additions and 0 deletions

View File

@ -57,6 +57,13 @@ public class CachedResourcePath {
pathComponents = components;
}
/**
* DOES NOT INTERN!
*/
public CachedResourcePath(String[] pathComponents) {
this.pathComponents = pathComponents;
}
@Override
public int hashCode() {
return Arrays.hashCode(pathComponents);

View File

@ -133,6 +133,11 @@ public class PackResourcesCacheEngine {
return this.containedPaths.contains(new CachedResourcePath(path));
}
public boolean hasResource(String[] paths) {
awaitLoad();
return this.containedPaths.contains(new CachedResourcePath(paths));
}
public Collection<ResourceLocation> getResources(PackType type, String resourceNamespace, String pathIn, int maxDepth, Predicate<ResourceLocation> filter) {
if(!PackTypeHelper.isVanillaPackType(type))
throw new IllegalArgumentException("Only vanilla PackTypes are supported");