Merge 1.20.4 into 1.20.5

This commit is contained in:
embeddedt 2024-02-02 20:38:33 -05:00
commit 46fc1e8539
No known key found for this signature in database
GPG Key ID: A69433EC199B5613
2 changed files with 10 additions and 2 deletions

View File

@ -56,6 +56,12 @@ public class ModernFixClient {
ModernFix.LOGGER.error("Could not instantiate integration {}", className, e);
}
}
if(ModernFixMixinPlugin.instance.isOptionEnabled("perf.dynamic_resources.FireIntegrationHook")) {
for(ModernFixClientIntegration integration : ModernFixClient.CLIENT_INTEGRATIONS) {
integration.onDynamicResourcesStatusChange(true);
}
}
}
public void resetWorldLoadStateMachine() {

View File

@ -60,7 +60,7 @@ public class PackResourcesCacheEngine {
String namespace = pair.getFirst();
Path root = pair.getSecond();
String[] prefix = new String[] { type.getDirectory(), namespace };
try (Stream<Path> stream = Files.walk(root)) {
try (Stream<Path> stream = Files.find(root, Integer.MAX_VALUE, (p, a) -> a.isRegularFile())) {
stream
.map(path -> root.relativize(path.toAbsolutePath()))
.filter(PackResourcesCacheEngine::isValidCachedResourcePath)
@ -154,8 +154,10 @@ public class PackResourcesCacheEngine {
if((cachePath.getNameCount() - 2) > maxDepth)
continue;
String fullPath = cachePath.getFullPath(2);
if(!fullPath.startsWith(testPath))
String fullTestPath = fullPath.endsWith("/") ? fullPath : (fullPath + "/");
if(!fullTestPath.startsWith(testPath)) {
continue;
}
ResourceLocation foundResource = new ResourceLocation(resourceNamespace, fullPath);
if(!filter.test(foundResource))
continue;