Skip to content

Commit

Permalink
Totally fix windows issue. Support 1.19.2 on master. v0.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
maestro-denery committed May 4, 2023
1 parent d52fd72 commit bd0ec9a
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 11 deletions.
2 changes: 1 addition & 1 deletion fabric-loader
Submodule fabric-loader updated from 97fe7d to cc4ff1
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mcVersion=1.19

# Toki info
gameVersion=1.19.4
tokiVersion=0.1.2.1
tokiVersion=0.1.3
spigotMappingsRef=177811e1fa90f674897a302820f3ed84e4d65688
mojangMappingsRef=bc44f6dd84cd2f3ad8c0caad850eaca9e82067e3

Expand Down
2 changes: 1 addition & 1 deletion paperclip
Submodule paperclip updated from 6806ae to f20c07
11 changes: 8 additions & 3 deletions patches/fabricloader/0002-Implement-Paper-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ index b3b4659f38248abb999b1057cf7d8a8dfa2cc198..048c484893f3d5e31548f44145dcf4b5
if (envType == EnvType.CLIENT && targetClass.contains("Applet")) {
targetClass = "net.fabricmc.loader.impl.game.minecraft.applet.AppletMain";
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
index 8858165dcc7a0cc6fabf0ddd61544f3a07295afc..ace57703416fd91dc1feaf3a66988f35bfab3bc0 100644
index 8858165dcc7a0cc6fabf0ddd61544f3a07295afc..35862bbedf9f164013d34434d72216d35c369152 100644
--- 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
@@ -107,7 +107,7 @@ public class EntrypointPatch extends GamePatch {
Expand Down Expand Up @@ -90,12 +90,17 @@ index 8858165dcc7a0cc6fabf0ddd61544f3a07295afc..ace57703416fd91dc1feaf3a66988f35
return false;
}

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

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

return false;
Expand Down
26 changes: 21 additions & 5 deletions patches/paperclip/0002-Implement-Fabric-Loader.patch
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ index 5be37ca9af3dc2d0286c654880ec262d9fcb57af..8acc8f57c82fa3f814359fa36ac70920
+// Toki end
diff --git a/java17/src/main/java/io/papermc/paperclip/FabricInstaller.java b/java17/src/main/java/io/papermc/paperclip/FabricInstaller.java
new file mode 100644
index 0000000000000000000000000000000000000000..e2946a39b5d4b1772756f655a09a6bcdffedaf4a
index 0000000000000000000000000000000000000000..15702855d4d6a650f2a3d2579cf9922ecb5e678f
--- /dev/null
+++ b/java17/src/main/java/io/papermc/paperclip/FabricInstaller.java
@@ -0,0 +1,259 @@
@@ -0,0 +1,275 @@
+/*
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
+ *
Expand Down Expand Up @@ -285,20 +285,36 @@ index 0000000000000000000000000000000000000000..e2946a39b5d4b1772756f655a09a6bcd
+
+ public static void setupRemappingClasspath(URL[] libraries, LaunchData launchData) {
+ final List<File> remapClasspath = new ArrayList<>();
+ remapClasspath.addAll(Arrays.stream(libraries).map(lib -> new File(lib.getPath())).toList());
+ remapClasspath.addAll(Arrays.stream(libraries).map(lib -> {
+ try {
+ return new File(lib.toURI());
+ } catch (URISyntaxException e) {
+ throw new RuntimeException("Error while setting up remapping classpath: ", e);
+ }
+ }).toList());
+ final List<Path> classPath = new ArrayList<>();
+ try {
+ readManifest(launchData.launchJar(), classPath);
+ remapClasspath.addAll(classPath.stream().map(Path::toFile).toList());
+ } catch (IOException e) {
+ throw new RuntimeException("Something went wrong while reading server launch jar manifest for the remap classpath", e);
+ }
+ remapClasspath.add(new File(Paperclip.versions.stream().findFirst().get().getPath()));
+ try {
+ remapClasspath.add(new File(Paperclip.versions.stream().findFirst().get().toURI()));
+ } catch (URISyntaxException e) {
+ throw new RuntimeException("Error while setting up remapping classpath: ", e);
+ }
+ System.setProperty("fabric.remapClasspathFile", remapClasspath.stream().map(File::getAbsolutePath).collect(Collectors.joining(File.pathSeparator)));
+ }
+
+ public static void setLibraryURLs(final URL[] libraries) {
+ final String s = Json.make(Arrays.stream(libraries).map(URL::getPath).toList()).toString();
+ final String s = Json.make(Arrays.stream(libraries).map(url -> {
+ try {
+ return Path.of(url.toURI()).toAbsolutePath().toString();
+ } catch (final Throwable e) {
+ throw new RuntimeException("Couldn't setup library URLs for the Fabric loader: ", e);
+ }
+ }).toList()).toString();
+ System.setProperty("toki.libraries", s); // Used in MinecraftGameProvider#unlockClassPath
+ }
+
Expand Down

0 comments on commit bd0ec9a

Please sign in to comment.