Skip to content

Commit b17c95c

Browse files
authored
Fix client download
1 parent 0514fde commit b17c95c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/mcp/java/net/minecraftforge/gradle/mcp/function/AbstractFileDownloadFunction.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ public File execute(MCPEnvironment environment) throws Exception {
5959
// Check if file exists in local installer cache
6060
if (info.type.equals("jar") && info.side.equals("client")) {
6161
File localPath = new File(Utils.getMCDir() + File.separator + "versions" + File.separator + info.version + File.separator + info.version + ".jar");
62-
if (HashUtil.sha1(localPath).equals(info.hash)) {
62+
if (localPath.exists() && HashUtil.sha1(localPath).equals(info.hash)) {
6363
FileUtils.copyFile(localPath, download);
64+
} else {
65+
FileUtils.copyURLToFile(new URL(info.url), download);
6466
}
6567
} else {
6668
FileUtils.copyURLToFile(new URL(info.url), download);

0 commit comments

Comments
 (0)