Unique duplicated libraries in minecraft json file
This commit is contained in:
@@ -62,7 +62,7 @@ public final class LauncherHelper {
|
|||||||
if (account == null)
|
if (account == null)
|
||||||
throw new IllegalStateException("No account");
|
throw new IllegalStateException("No account");
|
||||||
|
|
||||||
Version version = repository.getVersion(selectedVersion);
|
Version version = repository.getResolvedVersion(selectedVersion);
|
||||||
VersionSetting setting = profile.getVersionSetting(selectedVersion);
|
VersionSetting setting = profile.getVersionSetting(selectedVersion);
|
||||||
|
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
|
|||||||
@@ -56,8 +56,16 @@ public class LibrariesUniqueTask extends TaskResult<Version> {
|
|||||||
multimap.removeKey(id);
|
multimap.removeKey(id);
|
||||||
versionMap.put(id, number);
|
versionMap.put(id, number);
|
||||||
multimap.put(id, library);
|
multimap.put(id, library);
|
||||||
} else if (number.compareTo(otherNumber) == 0) {
|
} else if (number.compareTo(otherNumber) == 0) { // same library id.
|
||||||
multimap.put(id, library);
|
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 {
|
} else {
|
||||||
versionMap.put(id, number);
|
versionMap.put(id, number);
|
||||||
|
|||||||
Reference in New Issue
Block a user