mirror of
https://github.com/FabricMC/fabric.git
synced 2025-03-23 21:40:02 -04:00
Hot fix for resource loader. (#1239)
This commit is contained in:
parent
73b29211a6
commit
91ea196a60
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
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue