Merge remote-tracking branch 'FabricMC/dev/0.6' into dev/0.6
This commit is contained in:
commit
48d4243be6
3 changed files with 8 additions and 12 deletions
|
@ -31,8 +31,6 @@ import java.net.URL;
|
|||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.zip.ZipError;
|
||||
|
||||
import com.google.common.io.Files;
|
||||
|
@ -170,13 +168,11 @@ public class MinecraftProvider extends DependencyProvider {
|
|||
} else {
|
||||
getProject().getLogger().debug("Downloading Minecraft {} manifest", minecraftVersion);
|
||||
|
||||
String url = optionalVersion.get().url;
|
||||
// Find the sha1 of the json from the url, return true if it matches the local json
|
||||
Pattern sha1Pattern = Pattern.compile("\\b[0-9a-f]{5,40}\\b");
|
||||
Matcher matcher = sha1Pattern.matcher(url);
|
||||
ManifestVersion.Versions version = optionalVersion.get();
|
||||
String url = version.url;
|
||||
|
||||
if (matcher.find()) {
|
||||
HashedDownloadUtil.downloadIfInvalid(new URL(url), minecraftJson, matcher.group(), getProject().getLogger(), true);
|
||||
if (version.sha1 != null) {
|
||||
HashedDownloadUtil.downloadIfInvalid(new URL(url), minecraftJson, version.sha1, getProject().getLogger(), true);
|
||||
} else {
|
||||
// Use the etag if no hash found from url
|
||||
DownloadUtil.downloadIfChanged(new URL(url), minecraftJson, getProject().getLogger());
|
||||
|
|
|
@ -31,6 +31,6 @@ public class ManifestVersion {
|
|||
public List<Versions> versions = new ArrayList<>();
|
||||
|
||||
public static class Versions {
|
||||
public String id, url;
|
||||
public String id, url, sha1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,6 +45,9 @@ public abstract class AbstractRunTask extends JavaExec {
|
|||
super();
|
||||
setGroup("fabric");
|
||||
this.configProvider = config;
|
||||
|
||||
classpath(getProject().getConfigurations().getByName("runtimeClasspath"));
|
||||
classpath(this.getProject().getExtensions().getByType(LoomGradleExtension.class).getUnmappedModCollection());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -53,9 +56,6 @@ public abstract class AbstractRunTask extends JavaExec {
|
|||
config = configProvider.apply(getProject());
|
||||
}
|
||||
|
||||
classpath(getProject().getConfigurations().getByName("runtimeClasspath"));
|
||||
classpath(this.getProject().getExtensions().getByType(LoomGradleExtension.class).getUnmappedModCollection());
|
||||
|
||||
List<String> argsSplit = new ArrayList<>();
|
||||
String[] args = config.programArgs.split(" ");
|
||||
int partPos = -1;
|
||||
|
|
Loading…
Reference in a new issue