This commit is contained in:
huanghongxun
2020-01-14 10:58:15 +08:00
parent acda1952ca
commit f3434fe2a8
2 changed files with 8 additions and 5 deletions

View File

@@ -127,7 +127,7 @@ public abstract class VersionList<T extends RemoteVersion> {
* @param remoteVersion the version of the remote version.
* @return the specific remote version, null if it is not found.
*/
public final Optional<T> getVersion(String gameVersion, String remoteVersion) {
public Optional<T> getVersion(String gameVersion, String remoteVersion) {
lock.readLock().lock();
try {
T result = null;

View File

@@ -31,10 +31,7 @@ import org.jackhuang.hmcl.util.io.NetworkUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.*;
import static org.jackhuang.hmcl.util.Lang.mapOf;
import static org.jackhuang.hmcl.util.Pair.pair;
@@ -113,6 +110,12 @@ public final class ForgeBMCLVersionList extends VersionList<ForgeRemoteVersion>
};
}
@Override
public Optional<ForgeRemoteVersion> getVersion(String gameVersion, String remoteVersion) {
remoteVersion = StringUtils.substringAfter(remoteVersion, "-", remoteVersion);
return super.getVersion(gameVersion, remoteVersion);
}
@Immutable
public static final class ForgeVersion implements Validation {