Merge remote-tracking branch 'FabricMC/dev/0.6' into dev/0.6

dev/0.11
modmuss50 2021-01-28 21:17:12 +00:00
commit 48d4243be6
3 changed files with 8 additions and 12 deletions

View File

@ -31,8 +31,6 @@ import java.net.URL;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.Optional; import java.util.Optional;
import java.util.function.Consumer; import java.util.function.Consumer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.zip.ZipError; import java.util.zip.ZipError;
import com.google.common.io.Files; import com.google.common.io.Files;
@ -170,13 +168,11 @@ public class MinecraftProvider extends DependencyProvider {
} else { } else {
getProject().getLogger().debug("Downloading Minecraft {} manifest", minecraftVersion); getProject().getLogger().debug("Downloading Minecraft {} manifest", minecraftVersion);
String url = optionalVersion.get().url; ManifestVersion.Versions version = optionalVersion.get();
// Find the sha1 of the json from the url, return true if it matches the local json String url = version.url;
Pattern sha1Pattern = Pattern.compile("\\b[0-9a-f]{5,40}\\b");
Matcher matcher = sha1Pattern.matcher(url);
if (matcher.find()) { if (version.sha1 != null) {
HashedDownloadUtil.downloadIfInvalid(new URL(url), minecraftJson, matcher.group(), getProject().getLogger(), true); HashedDownloadUtil.downloadIfInvalid(new URL(url), minecraftJson, version.sha1, getProject().getLogger(), true);
} else { } else {
// Use the etag if no hash found from url // Use the etag if no hash found from url
DownloadUtil.downloadIfChanged(new URL(url), minecraftJson, getProject().getLogger()); DownloadUtil.downloadIfChanged(new URL(url), minecraftJson, getProject().getLogger());

View File

@ -31,6 +31,6 @@ public class ManifestVersion {
public List<Versions> versions = new ArrayList<>(); public List<Versions> versions = new ArrayList<>();
public static class Versions { public static class Versions {
public String id, url; public String id, url, sha1;
} }
} }

View File

@ -45,6 +45,9 @@ public abstract class AbstractRunTask extends JavaExec {
super(); super();
setGroup("fabric"); setGroup("fabric");
this.configProvider = config; this.configProvider = config;
classpath(getProject().getConfigurations().getByName("runtimeClasspath"));
classpath(this.getProject().getExtensions().getByType(LoomGradleExtension.class).getUnmappedModCollection());
} }
@Override @Override
@ -53,9 +56,6 @@ public abstract class AbstractRunTask extends JavaExec {
config = configProvider.apply(getProject()); config = configProvider.apply(getProject());
} }
classpath(getProject().getConfigurations().getByName("runtimeClasspath"));
classpath(this.getProject().getExtensions().getByType(LoomGradleExtension.class).getUnmappedModCollection());
List<String> argsSplit = new ArrayList<>(); List<String> argsSplit = new ArrayList<>();
String[] args = config.programArgs.split(" "); String[] args = config.programArgs.split(" ");
int partPos = -1; int partPos = -1;