Unique duplicated libraries in minecraft json file
This commit is contained in:
@@ -62,7 +62,7 @@ public final class LauncherHelper {
|
||||
if (account == null)
|
||||
throw new IllegalStateException("No account");
|
||||
|
||||
Version version = repository.getVersion(selectedVersion);
|
||||
Version version = repository.getResolvedVersion(selectedVersion);
|
||||
VersionSetting setting = profile.getVersionSetting(selectedVersion);
|
||||
|
||||
Platform.runLater(() -> {
|
||||
|
||||
@@ -56,7 +56,15 @@ public class LibrariesUniqueTask extends TaskResult<Version> {
|
||||
multimap.removeKey(id);
|
||||
versionMap.put(id, number);
|
||||
multimap.put(id, library);
|
||||
} else if (number.compareTo(otherNumber) == 0) {
|
||||
} else if (number.compareTo(otherNumber) == 0) { // same library id.
|
||||
boolean flag = false;
|
||||
// prevent from duplicated libraries
|
||||
for (Library otherLibrary : multimap.get(id))
|
||||
if (library.equals(otherLibrary)) {
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
if (!flag)
|
||||
multimap.put(id, library);
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user