Skip to content

Commit 1d20026

Browse files
committed
fix windows filesystem bug thingy (#24)
1 parent e239171 commit 1d20026

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/main/java/com/falsepattern/lib/mixin/IMixinPlugin.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,18 @@ static File findJarOf(final ITargetedMod mod) {
6666
e.printStackTrace();
6767
}
6868
if (result == null) {
69-
try {
70-
result = Arrays.stream(Launch.classLoader.getURLs())
71-
.map(URL::getPath)
72-
.map(Paths::get)
73-
.filter(mod::isMatchingJar)
74-
.map(Path::toFile)
75-
.findFirst()
76-
.orElse(null);
77-
} catch (Exception e) {
78-
e.printStackTrace();
69+
File found = null;
70+
for (URL url : Launch.classLoader.getURLs()) {
71+
try {
72+
String file = url.getFile();
73+
Path path = Paths.get(file);
74+
if (mod.isMatchingJar(path)) {
75+
found = path.toFile();
76+
break;
77+
}
78+
} catch (Exception ignored) {}
7979
}
80+
result = found;
8081
}
8182
return result;
8283
}

0 commit comments

Comments
 (0)