Skip to content

Commit a100622

Browse files
committed
Only apply resource pack speedup on paths starting with assets or data
Related: #354
1 parent c6e01f8 commit a100622

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

forge/src/main/java/org/embeddedt/modernfix/forge/mixin/perf/resourcepacks/ForgePathPackResourcesMixin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.nio.file.LinkOption;
2525
import java.nio.file.Path;
2626
import java.util.Collection;
27+
import java.util.Objects;
2728
import java.util.Set;
2829

2930
@Mixin(PathPackResources.class)
@@ -87,7 +88,7 @@ private void useCacheForNamespaces(PackType type, CallbackInfoReturnable<Set<Str
8788
@Redirect(method = "getRootResource", at = @At(value = "INVOKE", target = "Ljava/nio/file/Files;exists(Ljava/nio/file/Path;[Ljava/nio/file/LinkOption;)Z"))
8889
private boolean useCacheForExistence(Path path, LinkOption[] options, String[] originalPaths) {
8990
// the cache only stores things with a namespace and pack type
90-
if(originalPaths.length < 3)
91+
if(originalPaths.length < 3 || (!Objects.equals(originalPaths[0], "assets") && !Objects.equals(originalPaths[0], "data")))
9192
return Files.exists(path, options);
9293
else
9394
return this.generateResourceCache().hasResource(originalPaths);

0 commit comments

Comments
 (0)