Skip to content

Commit bd0ec9a

Browse files
Totally fix windows issue. Support 1.19.2 on master. v0.1.3
1 parent d52fd72 commit bd0ec9a

File tree

5 files changed

+32
-11
lines changed

5 files changed

+32
-11
lines changed

fabric-loader

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit 97fe7ddb5df618e4b56b815e683ab0b00dd11edc
1+
Subproject commit cc4ff16af7ca5f5a96cfbb8eaf18ef3a9adc9174

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ mcVersion=1.19
99

1010
# Toki info
1111
gameVersion=1.19.4
12-
tokiVersion=0.1.2.1
12+
tokiVersion=0.1.3
1313
spigotMappingsRef=177811e1fa90f674897a302820f3ed84e4d65688
1414
mojangMappingsRef=bc44f6dd84cd2f3ad8c0caad850eaca9e82067e3
1515

paperclip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit 6806aeb2e6e0900c4c8072f4f6b79b43feda8573
1+
Subproject commit f20c077e76200acd461149381a796a6956548700

patches/fabricloader/0002-Implement-Paper-support.patch

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ index b3b4659f38248abb999b1057cf7d8a8dfa2cc198..048c484893f3d5e31548f44145dcf4b5
6060
if (envType == EnvType.CLIENT && targetClass.contains("Applet")) {
6161
targetClass = "net.fabricmc.loader.impl.game.minecraft.applet.AppletMain";
6262
diff --git a/minecraft/src/main/java/net/fabricmc/loader/impl/game/minecraft/patch/EntrypointPatch.java b/minecraft/src/main/java/net/fabricmc/loader/impl/game/minecraft/patch/EntrypointPatch.java
63-
index 8858165dcc7a0cc6fabf0ddd61544f3a07295afc..ace57703416fd91dc1feaf3a66988f35bfab3bc0 100644
63+
index 8858165dcc7a0cc6fabf0ddd61544f3a07295afc..35862bbedf9f164013d34434d72216d35c369152 100644
6464
--- a/minecraft/src/main/java/net/fabricmc/loader/impl/game/minecraft/patch/EntrypointPatch.java
6565
+++ b/minecraft/src/main/java/net/fabricmc/loader/impl/game/minecraft/patch/EntrypointPatch.java
6666
@@ -107,7 +107,7 @@ public class EntrypointPatch extends GamePatch {
@@ -90,12 +90,17 @@ index 8858165dcc7a0cc6fabf0ddd61544f3a07295afc..ace57703416fd91dc1feaf3a66988f35
9090
return false;
9191
}
9292

93-
@@ -396,7 +396,7 @@ public class EntrypointPatch extends GamePatch {
93+
@@ -396,7 +396,12 @@ public class EntrypointPatch extends GamePatch {
9494
return false;
9595
}
9696

9797
- return constructorType.getArgumentTypes()[0].getDescriptor().equals("Ljava/lang/Thread;");
98-
+ return constructorType.getArgumentTypes()[0].getDescriptor().equals("Ljoptsimple/OptionSet;") && constructorType.getArgumentTypes()[2].getDescriptor().equals("Ljava/lang/Thread;"); // Toki - change constructor finding
98+
+ // Toki start
99+
+ // 1.19.3 and higher
100+
+ return constructorType.getArgumentTypes()[0].getDescriptor().equals("Ljoptsimple/OptionSet;") && constructorType.getArgumentTypes()[2].getDescriptor().equals("Ljava/lang/Thread;")
101+
+ // 1.19.2 support
102+
+ || constructorType.getArgumentTypes()[0].getDescriptor().equals("Ljoptsimple/OptionSet;") && constructorType.getArgumentTypes()[3].getDescriptor().equals("Ljava/lang/Thread;");
103+
+ // Toki end
99104
}
100105

101106
return false;

patches/paperclip/0002-Implement-Fabric-Loader.patch

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ index 5be37ca9af3dc2d0286c654880ec262d9fcb57af..8acc8f57c82fa3f814359fa36ac70920
6262
+// Toki end
6363
diff --git a/java17/src/main/java/io/papermc/paperclip/FabricInstaller.java b/java17/src/main/java/io/papermc/paperclip/FabricInstaller.java
6464
new 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

Comments
 (0)