From e27166d40aacc9989ba54822229ab9454d7b16ac Mon Sep 17 00:00:00 2001 From: The Judge Date: Sat, 15 Jul 2023 14:05:34 -0700 Subject: [PATCH] Fix illegal state exception --- lib/src/main/java/pojlib/install/Installer.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/src/main/java/pojlib/install/Installer.java b/lib/src/main/java/pojlib/install/Installer.java index f4c21976..cf864a6c 100644 --- a/lib/src/main/java/pojlib/install/Installer.java +++ b/lib/src/main/java/pojlib/install/Installer.java @@ -44,6 +44,9 @@ public static String installLibraries(VersionInfo versionInfo, String gameDir) t StringJoiner classpath = new StringJoiner(File.pathSeparator); for (VersionInfo.Library library : versionInfo.libraries) { + if(library.name.contains("lwjgl")) { + continue; + } for (int i = 0; i < 5; i++) { if (i == 4) throw new RuntimeException(String.format("Library download of %s failed after 5 retries", library.name)); @@ -63,17 +66,15 @@ public static String installLibraries(VersionInfo versionInfo, String gameDir) t VersionInfo.Library.Artifact artifact = library.downloads.artifact; libraryFile = new File(gameDir + "/libraries/", artifact.path); sha1 = artifact.sha1; - if (!libraryFile.exists() && !artifact.path.contains("lwjgl")) { + if (!libraryFile.exists()) { Logger.getInstance().appendToLog("Downloading: " + library.name); DownloadUtils.downloadFile(artifact.url, libraryFile); } } - if (!libraryFile.getAbsolutePath().contains("lwjgl")) { - if(DownloadUtils.compareSHA1(libraryFile, sha1)) { - classpath.add(libraryFile.getAbsolutePath()); - break; - } + if(DownloadUtils.compareSHA1(libraryFile, sha1)) { + classpath.add(libraryFile.getAbsolutePath()); + break; } } }