Only cache verified files and copy cached files to current directory
This commit is contained in:
@@ -72,6 +72,11 @@ public class DefaultDependencyManager extends AbstractDependencyManager {
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Task checkLibraryCompletionAsync(Version version) {
|
||||
return new GameLibrariesTask(this, version);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Task installLibraryAsync(String gameVersion, Version version, String libraryId, String libraryVersion) {
|
||||
VersionList<?> versionList = getVersionList(libraryId);
|
||||
|
||||
@@ -36,12 +36,20 @@ public interface DependencyManager {
|
||||
|
||||
/**
|
||||
* Check if the game is complete.
|
||||
* Check libraries, assets, logging files and so on.
|
||||
* Check libraries, assets files and so on.
|
||||
*
|
||||
* @return the task to check game completion.
|
||||
*/
|
||||
Task checkGameCompletionAsync(Version version);
|
||||
|
||||
/**
|
||||
* Check if the game is complete.
|
||||
* Check libraries, assets files and so on.
|
||||
*
|
||||
* @return the task to check game completion.
|
||||
*/
|
||||
Task checkLibraryCompletionAsync(Version version);
|
||||
|
||||
/**
|
||||
* The builder to build a brand new game then libraries such as Forge, LiteLoader and OptiFine.
|
||||
*/
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
package org.jackhuang.hmcl.download.forge;
|
||||
|
||||
import org.jackhuang.hmcl.download.DefaultDependencyManager;
|
||||
import org.jackhuang.hmcl.download.game.GameLibrariesTask;
|
||||
import org.jackhuang.hmcl.game.Library;
|
||||
import org.jackhuang.hmcl.game.SimpleVersionProvider;
|
||||
import org.jackhuang.hmcl.game.Version;
|
||||
@@ -114,7 +113,7 @@ public final class ForgeInstallTask extends TaskResult<Version> {
|
||||
.resolve(provider).setJar(null)
|
||||
.setId(version.getId()).setLogging(Collections.emptyMap()));
|
||||
|
||||
dependencies.add(new GameLibrariesTask(dependencyManager, installProfile.getVersionInfo()));
|
||||
dependencies.add(dependencyManager.checkLibraryCompletionAsync(installProfile.getVersionInfo()));
|
||||
}
|
||||
|
||||
if (!installer.delete())
|
||||
|
||||
@@ -82,7 +82,7 @@ public final class LiteLoaderInstallTask extends TaskResult<Version> {
|
||||
.setLogging(Collections.emptyMap())
|
||||
);
|
||||
|
||||
dependencies.add(new GameLibrariesTask(dependencyManager, tempVersion));
|
||||
dependencies.add(dependencyManager.checkLibraryCompletionAsync(tempVersion));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
package org.jackhuang.hmcl.download.optifine;
|
||||
|
||||
import org.jackhuang.hmcl.download.DefaultDependencyManager;
|
||||
import org.jackhuang.hmcl.download.game.GameLibrariesTask;
|
||||
import org.jackhuang.hmcl.game.LibrariesDownloadInfo;
|
||||
import org.jackhuang.hmcl.game.Library;
|
||||
import org.jackhuang.hmcl.game.LibraryDownloadInfo;
|
||||
@@ -92,7 +91,7 @@ public final class OptiFineInstallTask extends TaskResult<Version> {
|
||||
.setMainClass("net.minecraft.launchwrapper.Launch")
|
||||
);
|
||||
|
||||
dependencies.add(new GameLibrariesTask(dependencyManager, version.setLibraries(libraries)));
|
||||
dependencies.add(dependencyManager.checkLibraryCompletionAsync(version.setLibraries(libraries)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user