File tree Expand file tree Collapse file tree
station-api-base/src/main/java/net/modificationstation/stationapi/api/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313import net .fabricmc .loader .api .ModContainer ;
1414import net .fabricmc .loader .api .Version ;
1515import net .fabricmc .loader .api .metadata .ModMetadata ;
16+ import net .fabricmc .loader .impl .util .FileSystemUtil ;
1617import net .modificationstation .stationapi .api .util .exception .MissingModException ;
1718import org .apache .logging .log4j .Level ;
1819import org .apache .logging .log4j .LogManager ;
2526import java .io .IOException ;
2627import java .net .URI ;
2728import java .net .URISyntaxException ;
28- import java .nio .file .FileSystems ;
2929import java .nio .file .Files ;
3030import java .nio .file .Path ;
3131import java .nio .file .Paths ;
@@ -77,7 +77,9 @@ public final class Namespace implements Comparable<@NotNull Namespace> {
7777 // i'm so sorry
7878 if (Files .isRegularFile (callerPath )) { // regular case
7979 final URI callerRoot ;
80- try (val fs = FileSystems .newFileSystem (callerPath )) {
80+ try {
81+ // do NOT close - the same FileSystem may be used by Fabric Loader!
82+ val fs = FileSystemUtil .getJarFileSystem (callerPath , false ).get ();
8183 callerRoot = fs .getPath ("/" ).toUri ();
8284 } catch (IOException e ) {
8385 throw new RuntimeException (e );
You can’t perform that action at this time.
0 commit comments