diff --git a/common/src/main/java/com/unlikepaladin/pfm/client/PathPackRPWrapper.java b/common/src/main/java/com/unlikepaladin/pfm/client/PathPackRPWrapper.java index 598a18ebf..34cdb2acb 100644 --- a/common/src/main/java/com/unlikepaladin/pfm/client/PathPackRPWrapper.java +++ b/common/src/main/java/com/unlikepaladin/pfm/client/PathPackRPWrapper.java @@ -10,7 +10,9 @@ import java.io.IOException; import java.io.InputStream; +import java.util.ArrayList; import java.util.Collection; +import java.util.HashSet; import java.util.Set; import java.util.function.Predicate; import java.util.function.Supplier; @@ -44,7 +46,7 @@ public InputStream open(ResourceType type, Identifier id) throws IOException { public Collection findResources(ResourceType type, String namespace, String prefix, int maxDepth, Predicate pathFilter) { if (PFMRuntimeResources.ready) return delegate.get().findResources(type, namespace, prefix, maxDepth, pathFilter); - return null; + return new ArrayList<>(); } @Override @@ -56,7 +58,9 @@ public boolean contains(ResourceType type, Identifier id) { @Override public Set getNamespaces(ResourceType type) { - return delegate.get().getNamespaces(type); + if (PFMRuntimeResources.ready) + return delegate.get().getNamespaces(type); + return new HashSet<>(); } @Nullable @@ -65,6 +69,8 @@ public T parseMetadata(ResourceMetadataReader metaReader) throws IOExcept if (metaReader.getKey().equals("pack")) { return (T) packResourceMetadata; } + if (PFMRuntimeResources.ready) + return delegate.get().parseMetadata(metaReader); return null; }