Fix resource cache not being generated on Forge

This commit is contained in:
embeddedt 2023-05-02 21:03:40 -04:00
parent 215e8da87d
commit 3ad3da3680
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -48,6 +48,7 @@ public abstract class ModFileResourcePackMixin {
@Inject(method = "hasResource(Ljava/lang/String;)Z", at = @At(value = "HEAD"), cancellable = true)
private void useCacheForExistence(String path, CallbackInfoReturnable<Boolean> cir) {
this.generateResourceCache();
if(cacheEngine != null)
cir.setReturnValue(this.cacheEngine.hasResource(path));
}