diff --git a/.gitignore b/.gitignore index 89a91bf97..1ccd5382b 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ NVIDIA # test /hmcl.json +/.hmcl.json diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/game/Version.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/game/Version.java index 7e090fb46..bcc491533 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/game/Version.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/game/Version.java @@ -163,7 +163,7 @@ public class Version implements Comparable, Validation { } public String getJar() { - return jar == null ? id : jar; + return jar; } public String getInheritsFrom() { @@ -275,14 +275,14 @@ public class Version implements Comparable, Validation { if (inheritsFrom == null) { if (isRoot()) - thisVersion = new Version(id).setPatches(patches); + thisVersion = new Version(id).setPatches(patches).setJar(id); else - thisVersion = this; + thisVersion = this.jar == null ? this.setJar(id) : this; } else { // To maximize the compatibility. if (!resolvedSoFar.add(id)) { Logging.LOG.log(Level.WARNING, "Found circular dependency versions: " + resolvedSoFar); - thisVersion = this; + thisVersion = this.jar == null ? this.setJar(id) : this; } else { // It is supposed to auto install an version in getVersion. thisVersion = merge(provider.getVersion(inheritsFrom).resolve(provider, resolvedSoFar), false);