Hot fix for resource loader. ()

This commit is contained in:
LambdAurora 2020-12-23 16:57:19 +01:00 committed by GitHub
parent 73b29211a6
commit 91ea196a60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions
fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric
impl/resource/loader
mixin/resource/loader

View file

@ -125,10 +125,12 @@ public abstract class GroupResourcePack implements ResourcePack {
return;
}
Identifier metadataId = NamespaceResourceManagerAccessor.fabric$accessor_getMetadataPath(id);
for (ModResourcePack pack : packs) {
if (pack.contains(manager.getType(), id)) {
InputStream inputStream = pack.contains(manager.getType(), id) ? manager.fabric$accessor_open(id, pack) : null;
resources.add(new ResourceImpl(pack.getName(), id, manager.fabric$accessor_open(id, pack), inputStream));
InputStream metadataInputStream = pack.contains(manager.getType(), metadataId) ? manager.fabric$accessor_open(metadataId, pack) : null;
resources.add(new ResourceImpl(pack.getName(), id, manager.fabric$accessor_open(id, pack), metadataInputStream));
}
}
}

View file

@ -35,4 +35,9 @@ public interface NamespaceResourceManagerAccessor {
@Invoker("open")
InputStream fabric$accessor_open(Identifier id, ResourcePack pack) throws IOException;
@Invoker("getMetadataPath")
static Identifier fabric$accessor_getMetadataPath(Identifier id) {
throw new UnsupportedOperationException("Invoker injection failed.");
}
}