Skip to content

Commit

Permalink
Fix NamespaceResourceManagerMixin
Browse files Browse the repository at this point in the history
  • Loading branch information
FirstMegaGame4 committed Dec 27, 2023
1 parent ae3570b commit 96e0794
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.llamalad7.mixinextras.sugar.Share;
import com.llamalad7.mixinextras.sugar.ref.LocalRef;
import fr.firstmegagame4.env.json.api.EnvJson;
import fr.firstmegagame4.env.json.impl.EnvJsonInitializer;
import fr.firstmegagame4.env.json.impl.EnvJsonUtils;
import fr.firstmegagame4.env.json.impl.resource.EntryListDuckInterface;
import fr.firstmegagame4.env.json.impl.resource.ResourceDuckInterface;
Expand Down Expand Up @@ -119,8 +118,7 @@ private ResourcePack.ResultConsumer mutateBiConsumer(ResourcePack.ResultConsumer
Identifier envJsonIdentifier = EnvJsonUtils.getEnvJsonPath(identifier);
ResourceResult resourceResult = envJsonMap.get().get(envJsonIdentifier);
if (resourceResult != null && resourceResult.packIndex() >= result.invokePackIndex()) {
Identifier metadataIdentifier = NamespaceResourceManagerMixin.getMetadataPath(identifier);
ResultAccess access = (ResultAccess) results.get(identifier);
ResultAccess access = (ResultAccess) results.get(NamespaceResourceManagerMixin.getMetadataPath(identifier));
InputSupplier<ResourceMetadata> metadataSupplier;
if (access != null && access.invokePackIndex() >= result.invokePackIndex()) {
metadataSupplier = NamespaceResourceManagerMixin.getMetadataSupplier(access.invokeSupplier());
Expand All @@ -129,7 +127,7 @@ private ResourcePack.ResultConsumer mutateBiConsumer(ResourcePack.ResultConsumer
}
ResourceDuckInterface ducked = (ResourceDuckInterface) NamespaceResourceManagerMixin.createResource(result.invokePack(), identifier, result.invokeSupplier(), metadataSupplier);
ducked.env_json$initEnvJsonSupplier(EnvJsonUtils.getEnvJsonSupplier(resourceResult.supplier()));
resources.put(metadataIdentifier, (Resource) ducked);
resources.put(identifier, (Resource) ducked);
}
else {
action.accept(identifier, result);
Expand Down

0 comments on commit 96e0794

Please sign in to comment.