File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
src/main/java/com/falsepattern/lib/mixin Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -66,17 +66,18 @@ static File findJarOf(final ITargetedMod mod) {
66
66
e .printStackTrace ();
67
67
}
68
68
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 ) {}
79
79
}
80
+ result = found ;
80
81
}
81
82
return result ;
82
83
}
You can’t perform that action at this time.
0 commit comments