Skip to content

Commit 2242590

Browse files
committed
Fix illegal state exception
1 parent a85b73c commit 2242590

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

lib/src/main/java/pojlib/install/Installer.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ public static String installLibraries(VersionInfo versionInfo, String gameDir) t
4444

4545
StringJoiner classpath = new StringJoiner(File.pathSeparator);
4646
for (VersionInfo.Library library : versionInfo.libraries) {
47+
if(library.name.contains("lwjgl")) {
48+
continue;
49+
}
4750
for (int i = 0; i < 5; i++) {
4851
if (i == 4) throw new RuntimeException(String.format("Library download of %s failed after 5 retries", library.name));
4952

@@ -63,17 +66,15 @@ public static String installLibraries(VersionInfo versionInfo, String gameDir) t
6366
VersionInfo.Library.Artifact artifact = library.downloads.artifact;
6467
libraryFile = new File(gameDir + "/libraries/", artifact.path);
6568
sha1 = artifact.sha1;
66-
if (!libraryFile.exists() && !artifact.path.contains("lwjgl")) {
69+
if (!libraryFile.exists()) {
6770
Logger.getInstance().appendToLog("Downloading: " + library.name);
6871
DownloadUtils.downloadFile(artifact.url, libraryFile);
6972
}
7073
}
7174

72-
if (!libraryFile.getAbsolutePath().contains("lwjgl")) {
73-
if(DownloadUtils.compareSHA1(libraryFile, sha1)) {
74-
classpath.add(libraryFile.getAbsolutePath());
75-
break;
76-
}
75+
if(DownloadUtils.compareSHA1(libraryFile, sha1)) {
76+
classpath.add(libraryFile.getAbsolutePath());
77+
break;
7778
}
7879
}
7980
}

0 commit comments

Comments
 (0)