Skip to content

Commit

Permalink
修复导入部分整合包失败的问题 (#2989)
Browse files Browse the repository at this point in the history
* 修复导入部分整合包失败的问题

* update

* update
  • Loading branch information
Glavo authored Apr 14, 2024
1 parent a33377d commit a8bb5c1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,14 @@ public Optional<T> getVersion(String gameVersion, String remoteVersion) {
lock.readLock().lock();
try {
T result = null;
for (T it : versions.get(gameVersion))
TreeSet<T> remoteVersions = versions.get(gameVersion);
for (T it : remoteVersions)
if (remoteVersion.equals(it.getSelfVersion()))
result = it;
if (result == null)
for (T it : remoteVersions)
if (remoteVersion.equals(it.getFullVersion()))
result = it;
return Optional.ofNullable(result);
} finally {
lock.readLock().unlock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ public OptiFineRemoteVersion(String gameVersion, String selfVersion, List<String
super(LibraryAnalyzer.LibraryType.OPTIFINE.getPatchId(), gameVersion, selfVersion, null, snapshot ? Type.SNAPSHOT : Type.RELEASE, urls);
}

@Override
public String getFullVersion() {
return getGameVersion() + "_" + getSelfVersion();
}

@Override
public Task<Version> getInstallTask(DefaultDependencyManager dependencyManager, Version baseVersion) {
return new OptiFineInstallTask(dependencyManager, baseVersion, this);
Expand Down

0 comments on commit a8bb5c1

Please sign in to comment.