Fix crash when resolving libs of new snapshot.

This commit is contained in:
modmuss50 2017-03-31 12:27:55 +01:00
parent d4792dd0af
commit 29631ad1bb
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82
4 changed files with 12 additions and 4 deletions

View file

@ -15,7 +15,7 @@ apply from: 'https://github.com/FabricMC/fabric-docs/raw/master/gradle/license.g
group = 'net.fabricmc'
archivesBaseName = project.name.toLowerCase()
version = '0.0.6-SNAPSHOT'
version = '0.0.7-SNAPSHOT'
repositories {
mavenCentral()

View file

@ -233,7 +233,7 @@ public class AbstractPlugin implements Plugin<Project> {
for (Version.Library library : version.libraries) {
if (library.allowed() && library.getFile(extension) != null) {
String configName = Constants.CONFIG_MC_DEPENDENCIES;
if (library.name.contains("java3d") || library.name.contains("paulscode") || library.name.contains("lwjgl") || library.name.contains("twitch") || library.name.contains("jinput")) {
if (library.name.contains("java3d") || library.name.contains("paulscode") || library.name.contains("lwjgl") || library.name.contains("twitch") || library.name.contains("jinput") || library.name.contains("text2speech") || library.name.contains("objc")) {
configName = Constants.CONFIG_MC_DEPENDENCIES_CLIENT;
}
project1.getDependencies().add(configName, library.getArtifactName());

View file

@ -118,7 +118,7 @@ public class DownloadTask extends DefaultTask {
if (library.allowed() && library.getFile(extension) != null) {
// By default, they are all available on all sides
String configName = Constants.CONFIG_MC_DEPENDENCIES;
if (library.name.contains("java3d") || library.name.contains("paulscode") || library.name.contains("lwjgl") || library.name.contains("twitch") || library.name.contains("jinput")) {
if (library.name.contains("java3d") || library.name.contains("paulscode") || library.name.contains("lwjgl") || library.name.contains("twitch") || library.name.contains("jinput") || library.name.contains("text2speech") || library.name.contains("objc")) {
configName = Constants.CONFIG_MC_DEPENDENCIES_CLIENT;
}
dependencyHandler.add(configName, library.getArtifactName());

View file

@ -24,6 +24,7 @@
package net.fabricmc.loom.util;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import net.fabricmc.loom.LoomGradleExtension;
@ -108,7 +109,14 @@ public class Version {
if (artifact == null) {
artifact = new Artifact(name);
}
return artifact.getArtifact(natives == null ? artifact.getClassifier() : natives.get(OperatingSystem.getOS()).getAsString());
if(natives != null){
JsonElement jsonElement = natives.get(OperatingSystem.getOS());
if(jsonElement != null){
return artifact.getArtifact(jsonElement.getAsString());
}
}
return artifact.getArtifact(artifact.classifier);
}
private class Artifact {