Skip to content

Commit 2699fe4

Browse files
committed
Merge 1.20 into 1.20.4
2 parents 16ef925 + e1d203b commit 2699fe4

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

common/src/main/java/org/embeddedt/modernfix/ModernFixClient.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ public ModernFixClient() {
5656
ModernFix.LOGGER.error("Could not instantiate integration {}", className, e);
5757
}
5858
}
59+
60+
if(ModernFixMixinPlugin.instance.isOptionEnabled("perf.dynamic_resources.FireIntegrationHook")) {
61+
for(ModernFixClientIntegration integration : ModernFixClient.CLIENT_INTEGRATIONS) {
62+
integration.onDynamicResourcesStatusChange(true);
63+
}
64+
}
5965
}
6066

6167
public void resetWorldLoadStateMachine() {

common/src/main/java/org/embeddedt/modernfix/resources/PackResourcesCacheEngine.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public PackResourcesCacheEngine(Function<PackType, Set<String>> namespacesRetrie
6060
String namespace = pair.getFirst();
6161
Path root = pair.getSecond();
6262
String[] prefix = new String[] { type.getDirectory(), namespace };
63-
try (Stream<Path> stream = Files.walk(root)) {
63+
try (Stream<Path> stream = Files.find(root, Integer.MAX_VALUE, (p, a) -> a.isRegularFile())) {
6464
stream
6565
.map(path -> root.relativize(path.toAbsolutePath()))
6666
.filter(PackResourcesCacheEngine::isValidCachedResourcePath)
@@ -154,8 +154,10 @@ public Collection<ResourceLocation> getResources(PackType type, String resourceN
154154
if((cachePath.getNameCount() - 2) > maxDepth)
155155
continue;
156156
String fullPath = cachePath.getFullPath(2);
157-
if(!fullPath.startsWith(testPath))
157+
String fullTestPath = fullPath.endsWith("/") ? fullPath : (fullPath + "/");
158+
if(!fullTestPath.startsWith(testPath)) {
158159
continue;
160+
}
159161
ResourceLocation foundResource = new ResourceLocation(resourceNamespace, fullPath);
160162
if(!filter.test(foundResource))
161163
continue;

0 commit comments

Comments
 (0)