修复导入部分整合包失败的问题
This commit is contained in:
parent
d507998e79
commit
98760d9dd4
|
@ -129,9 +129,14 @@ public abstract class VersionList<T extends RemoteVersion> {
|
||||||
lock.readLock().lock();
|
lock.readLock().lock();
|
||||||
try {
|
try {
|
||||||
T result = null;
|
T result = null;
|
||||||
for (T it : versions.get(gameVersion))
|
TreeSet<T> remoteVersions = versions.get(gameVersion);
|
||||||
|
for (T it : remoteVersions)
|
||||||
if (remoteVersion.equals(it.getSelfVersion()))
|
if (remoteVersion.equals(it.getSelfVersion()))
|
||||||
result = it;
|
result = it;
|
||||||
|
if (result == null)
|
||||||
|
for (T it : remoteVersions)
|
||||||
|
if (remoteVersion.equals(it.getFullVersion()))
|
||||||
|
result = it;
|
||||||
return Optional.ofNullable(result);
|
return Optional.ofNullable(result);
|
||||||
} finally {
|
} finally {
|
||||||
lock.readLock().unlock();
|
lock.readLock().unlock();
|
||||||
|
|
|
@ -31,6 +31,11 @@ public class OptiFineRemoteVersion extends RemoteVersion {
|
||||||
super(LibraryAnalyzer.LibraryType.OPTIFINE.getPatchId(), gameVersion, selfVersion, null, snapshot ? Type.SNAPSHOT : Type.RELEASE, urls);
|
super(LibraryAnalyzer.LibraryType.OPTIFINE.getPatchId(), gameVersion, selfVersion, null, snapshot ? Type.SNAPSHOT : Type.RELEASE, urls);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getFullVersion() {
|
||||||
|
return getGameVersion() + "_" + getSelfVersion();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Task<Version> getInstallTask(DefaultDependencyManager dependencyManager, Version baseVersion) {
|
public Task<Version> getInstallTask(DefaultDependencyManager dependencyManager, Version baseVersion) {
|
||||||
return new OptiFineInstallTask(dependencyManager, baseVersion, this);
|
return new OptiFineInstallTask(dependencyManager, baseVersion, this);
|
||||||
|
|
Loading…
Reference in New Issue