@@ -62,10 +62,10 @@ index 5be37ca9af3dc2d0286c654880ec262d9fcb57af..8acc8f57c82fa3f814359fa36ac70920
6262+ // Toki end
6363diff --git a/java17/src/main/java/io/papermc/paperclip/FabricInstaller.java b/java17/src/main/java/io/papermc/paperclip/FabricInstaller.java
6464new file mode 100644
65- index 0000000000000000000000000000000000000000..e2946a39b5d4b1772756f655a09a6bcdffedaf4a
65+ index 0000000000000000000000000000000000000000..15702855d4d6a650f2a3d2579cf9922ecb5e678f
6666--- /dev/null
6767+++ b/java17/src/main/java/io/papermc/paperclip/FabricInstaller.java
68- @@ -0,0 +1,259 @@
68+ @@ -0,0 +1,275 @@
6969+ /*
7070+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
7171+ *
@@ -285,20 +285,36 @@ index 0000000000000000000000000000000000000000..e2946a39b5d4b1772756f655a09a6bcd
285285+
286286+ public static void setupRemappingClasspath(URL[] libraries, LaunchData launchData) {
287287+ final List<File> remapClasspath = new ArrayList<>();
288- + remapClasspath.addAll(Arrays.stream(libraries).map(lib -> new File(lib.getPath())).toList());
288+ + remapClasspath.addAll(Arrays.stream(libraries).map(lib -> {
289+ + try {
290+ + return new File(lib.toURI());
291+ + } catch (URISyntaxException e) {
292+ + throw new RuntimeException("Error while setting up remapping classpath: ", e);
293+ + }
294+ + }).toList());
289295+ final List<Path> classPath = new ArrayList<>();
290296+ try {
291297+ readManifest(launchData.launchJar(), classPath);
292298+ remapClasspath.addAll(classPath.stream().map(Path::toFile).toList());
293299+ } catch (IOException e) {
294300+ throw new RuntimeException("Something went wrong while reading server launch jar manifest for the remap classpath", e);
295301+ }
296- + remapClasspath.add(new File(Paperclip.versions.stream().findFirst().get().getPath()));
302+ + try {
303+ + remapClasspath.add(new File(Paperclip.versions.stream().findFirst().get().toURI()));
304+ + } catch (URISyntaxException e) {
305+ + throw new RuntimeException("Error while setting up remapping classpath: ", e);
306+ + }
297307+ System.setProperty("fabric.remapClasspathFile", remapClasspath.stream().map(File::getAbsolutePath).collect(Collectors.joining(File.pathSeparator)));
298308+ }
299309+
300310+ public static void setLibraryURLs(final URL[] libraries) {
301- + final String s = Json.make(Arrays.stream(libraries).map(URL::getPath).toList()).toString();
311+ + final String s = Json.make(Arrays.stream(libraries).map(url -> {
312+ + try {
313+ + return Path.of(url.toURI()).toAbsolutePath().toString();
314+ + } catch (final Throwable e) {
315+ + throw new RuntimeException("Couldn't setup library URLs for the Fabric loader: ", e);
316+ + }
317+ + }).toList()).toString();
302318+ System.setProperty("toki.libraries", s); // Used in MinecraftGameProvider#unlockClassPath
303319+ }
304320+
0 commit comments