Skip to content

Commit

Permalink
Merge branch 'architectury-1.18.1' into architectury-1.18.2
Browse files Browse the repository at this point in the history
  • Loading branch information
UnlikePaladin committed Nov 12, 2023
2 parents 75ff16f + 37f286f commit 4c9dc86
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -44,7 +46,7 @@ public InputStream open(ResourceType type, Identifier id) throws IOException {
public Collection<Identifier> findResources(ResourceType type, String namespace, String prefix, int maxDepth, Predicate<String> pathFilter) {
if (PFMRuntimeResources.ready)
return delegate.get().findResources(type, namespace, prefix, maxDepth, pathFilter);
return null;
return new ArrayList<>();
}

@Override
Expand All @@ -56,7 +58,9 @@ public boolean contains(ResourceType type, Identifier id) {

@Override
public Set<String> getNamespaces(ResourceType type) {
return delegate.get().getNamespaces(type);
if (PFMRuntimeResources.ready)
return delegate.get().getNamespaces(type);
return new HashSet<>();
}

@Nullable
Expand All @@ -65,6 +69,8 @@ public <T> T parseMetadata(ResourceMetadataReader<T> metaReader) throws IOExcept
if (metaReader.getKey().equals("pack")) {
return (T) packResourceMetadata;
}
if (PFMRuntimeResources.ready)
return delegate.get().parseMetadata(metaReader);
return null;
}

Expand Down

0 comments on commit 4c9dc86

Please sign in to comment.