Merge 1.16 into 1.18
This commit is contained in:
commit
0a8a88047c
|
|
@ -65,7 +65,7 @@ public abstract class ModNioResourcePackMixin implements ICachingResourcePack {
|
||||||
|
|
||||||
@Inject(method = "hasResource", at = @At(value = "INVOKE", target = "Lnet/fabricmc/fabric/impl/resource/loader/ModNioResourcePack;getPath(Ljava/lang/String;)Ljava/nio/file/Path;"), cancellable = true)
|
@Inject(method = "hasResource", at = @At(value = "INVOKE", target = "Lnet/fabricmc/fabric/impl/resource/loader/ModNioResourcePack;getPath(Ljava/lang/String;)Ljava/nio/file/Path;"), cancellable = true)
|
||||||
private void useCacheForExistence(String path, CallbackInfoReturnable<Boolean> cir) {
|
private void useCacheForExistence(String path, CallbackInfoReturnable<Boolean> cir) {
|
||||||
if(cacheEngine != null)
|
if(cacheEngine != null && (path.startsWith("assets/") || path.startsWith("data/")))
|
||||||
cir.setReturnValue(this.cacheEngine.hasResource(path));
|
cir.setReturnValue(this.cacheEngine.hasResource(path));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ public abstract class ModFileResourcePackMixin implements ICachingResourcePack {
|
||||||
@Inject(method = "hasResource(Ljava/lang/String;)Z", at = @At(value = "HEAD"), cancellable = true)
|
@Inject(method = "hasResource(Ljava/lang/String;)Z", at = @At(value = "HEAD"), cancellable = true)
|
||||||
private void useCacheForExistence(String path, CallbackInfoReturnable<Boolean> cir) {
|
private void useCacheForExistence(String path, CallbackInfoReturnable<Boolean> cir) {
|
||||||
PackResourcesCacheEngine engine = this.generateResourceCache();
|
PackResourcesCacheEngine engine = this.generateResourceCache();
|
||||||
if(engine != null)
|
if(engine != null && (path.startsWith("assets/") || path.startsWith("data/")))
|
||||||
cir.setReturnValue(engine.hasResource(path));
|
cir.setReturnValue(engine.hasResource(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user