This commit is contained in:
huangyuhui 2017-02-09 13:10:30 +08:00
parent f6bdb986dd
commit 2553ce82ec
2 changed files with 9 additions and 2 deletions

View File

@ -80,7 +80,7 @@ public class MojangDownloadProvider extends IDownloadProvider {
return str.replace("http://files.minecraftforge.net/maven", "http://ftb.cursecdn.com/FTB2/maven/"); return str.replace("http://files.minecraftforge.net/maven", "http://ftb.cursecdn.com/FTB2/maven/");
else if (str.contains("typesafe") || str.contains("scala")) else if (str.contains("typesafe") || str.contains("scala"))
if (SupportedLocales.NOW_LOCALE.self == Locale.CHINA) if (SupportedLocales.NOW_LOCALE.self == Locale.CHINA)
return str.replace("http://files.minecraftforge.net/maven", "http://maven.oschina.net/content/groups/public"); return str.replace("http://files.minecraftforge.net/maven", "http://ftb.cursecdn.com/FTB2/maven/");
else else
return str.replace("http://files.minecraftforge.net/maven", "http://repo1.maven.org/maven2"); return str.replace("http://files.minecraftforge.net/maven", "http://repo1.maven.org/maven2");
else else

View File

@ -70,6 +70,8 @@ public class MinecraftLibrary extends IMinecraftLibrary {
} }
private String getNative() { private String getNative() {
if (natives == null)
return "";
switch (OS.os()) { switch (OS.os()) {
case WINDOWS: case WINDOWS:
return formatArch(natives.windows); return formatArch(natives.windows);
@ -86,6 +88,8 @@ public class MinecraftLibrary extends IMinecraftLibrary {
} }
public String formatName() { public String formatName() {
if (name == null)
return null;
String[] s = name.split(":"); String[] s = name.split(":");
if (s.length < 3) if (s.length < 3)
return null; return null;
@ -110,6 +114,8 @@ public class MinecraftLibrary extends IMinecraftLibrary {
@Override @Override
public LibraryDownloadInfo getDownloadInfo() { public LibraryDownloadInfo getDownloadInfo() {
if (name == null)
return null;
if (downloads == null) if (downloads == null)
downloads = new LibrariesDownloadInfo(); downloads = new LibrariesDownloadInfo();
LibraryDownloadInfo info; LibraryDownloadInfo info;
@ -120,7 +126,8 @@ public class MinecraftLibrary extends IMinecraftLibrary {
downloads.classifiers.put(getNative(), info = new LibraryDownloadInfo()); downloads.classifiers.put(getNative(), info = new LibraryDownloadInfo());
else { else {
info = downloads.classifiers.get(getNative()); info = downloads.classifiers.get(getNative());
if (info == null) info = new LibraryDownloadInfo(); if (info == null)
info = new LibraryDownloadInfo();
} }
} else { } else {
if (downloads.artifact == null) if (downloads.artifact == null)