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) {
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 }
You can’t perform that action at this time.
0 commit comments