Override JNA to 5.8.0
This fixes LabyMod 1.8.9 crashing.
This commit is contained in:
1 parent
aee11c3a22
commit
7fb5b55d8b
7 files changed
+67
-8
No files matched your search
@@ -124,16 +124,17 @@ public class PLaunchApp {
|
||||
File outLib;
|
||||
String libPathURL;
|
||||
|
||||
Tools.preProcessLibraries(mVersion.libraries);
|
||||
for (final DependentLibrary libItem : mVersion.libraries) {
|
||||
if (
|
||||
// Support for text2speech is not planned, so skip it for now.
|
||||
libItem.name.startsWith("com.mojang.text2speech") ||
|
||||
libItem.name.startsWith("net.java.jinput") ||
|
||||
libItem.name.startsWith("org.lwjgl")
|
||||
) { // Black list
|
||||
if (libItem._skip) {
|
||||
currProgress++;
|
||||
UIKit.updateProgressSafe(currProgress / maxProgress, "Ignored " + libItem.name);
|
||||
UIKit.updateProgressSafe(currProgress / maxProgress, "Skipped " + libItem.name);
|
||||
// Thread.sleep(100);
|
||||
|
||||
String[] libInfo = libItem.name.split(":");
|
||||
String libArtifact = Tools.artifactToPath(libInfo[0], libInfo[1], libInfo[2]);
|
||||
outLib = new File(Tools.DIR_HOME_LIBRARY + "/" + libArtifact);
|
||||
outLib.delete();
|
||||
} else {
|
||||
String[] libInfo = libItem.name.split(":");
|
||||
String libArtifact = Tools.artifactToPath(libInfo[0], libInfo[1], libInfo[2]);
|
||||
|
||||
@@ -394,10 +394,36 @@ public final class Tools
|
||||
act.startActivity(browserIntent);
|
||||
}
|
||||
*/
|
||||
|
||||
public static void preProcessLibraries(DependentLibrary[] libraries) {
|
||||
// Ignore some libraries since they are unsupported (jinput, text2speech) or unused (LWJGL)
|
||||
// Support for text2speech is not planned, so skip it for now.
|
||||
for (int i = 0; i < libraries.length; i++) {
|
||||
DependentLibrary libItem = libraries[i];
|
||||
if (libItem.name.startsWith("com.mojang.text2speech") ||
|
||||
libItem.name.startsWith("net.java.jinput") ||
|
||||
libItem.name.startsWith("net.java.dev.jna:platform:") ||
|
||||
libItem.name.startsWith("org.lwjgl") ||
|
||||
libItem.name.startsWith("tv.twitch")) {
|
||||
libItem._skip = true;
|
||||
} else if (libItem.name.startsWith("net.java.dev.jna:jna:")) {
|
||||
// Special handling for LabyMod 1.8.9 and Forge 1.12.2(?)
|
||||
// we have libjnidispatch 5.8.0 in Frameworks directory
|
||||
System.out.println("Library " + libItem.name + " has been changed to version 5.8.0");
|
||||
libItem.name = "net.java.dev.jna:jna:5.8.0";
|
||||
libItem.downloads.artifact.path = "net/java/dev/jna/jna/5.8.0/jna-5.8.0.jar";
|
||||
libItem.downloads.artifact.url = "https://libraries.minecraft.net/net/java/dev/jna/jna/5.8.0/jna-5.8.0.jar";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static String[] generateLibClasspath(JMinecraftVersionList.Version info) {
|
||||
List<String> libDir = new ArrayList<String>();
|
||||
|
||||
for (DependentLibrary libItem: info.libraries) {
|
||||
preProcessLibraries(info.libraries);
|
||||
for (DependentLibrary libItem : info.libraries) {
|
||||
if (libItem._skip) continue;
|
||||
|
||||
String[] libInfos = libItem.name.split(":");
|
||||
libDir.add(Tools.DIR_HOME_LIBRARY + "/" + Tools.artifactToPath(libInfos[0], libInfos[1], libInfos[2]));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package net.kdt.pojavlaunch.value;
|
||||
|
||||
public class DependentLibrary {
|
||||
public boolean _skip; // internal
|
||||
|
||||
public String name;
|
||||
public LibraryDownloads downloads;
|
||||
public String url;
|
||||
|
||||
Reference in new issue
Block a user