Skip to content

Commit

Permalink
Fix illegal state exception
Browse files Browse the repository at this point in the history
  • Loading branch information
thejudge156 committed Jul 15, 2023
1 parent efcd5ed commit e27166d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/src/main/java/pojlib/install/Installer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand All @@ -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;
}
}
}
Expand Down

0 comments on commit e27166d

Please sign in to comment.