Might fix some problems
This commit is contained in:
@@ -32,6 +32,7 @@ import org.jackhuang.hellominecraft.util.system.IOUtils;
|
|||||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
import org.jackhuang.hellominecraft.util.StrUtils;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.download.IDownloadProvider;
|
import org.jackhuang.hellominecraft.launcher.core.download.IDownloadProvider;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
|
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
|
||||||
|
import org.jackhuang.hellominecraft.util.Utils;
|
||||||
import org.jackhuang.hellominecraft.util.VersionNumber;
|
import org.jackhuang.hellominecraft.util.VersionNumber;
|
||||||
import org.jackhuang.hellominecraft.util.tasks.TaskInfo;
|
import org.jackhuang.hellominecraft.util.tasks.TaskInfo;
|
||||||
|
|
||||||
@@ -47,8 +48,7 @@ public class AssetsMojangLoader extends IAssetsHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Task getList(final MinecraftVersion mv, final IMinecraftAssetService mp) {
|
public Task getList(final MinecraftVersion mv, final IMinecraftAssetService mp) {
|
||||||
if (mv == null)
|
Utils.requireNonNull(mv);
|
||||||
throw new IllegalArgumentException("AssetsMojangLoader: null argument: MinecraftVersion");
|
|
||||||
String assetsId = mv.getAssetsIndex().getId();
|
String assetsId = mv.getAssetsIndex().getId();
|
||||||
File assets = mp.getAssets();
|
File assets = mp.getAssets();
|
||||||
HMCLog.log("Gathering asset index: " + assetsId);
|
HMCLog.log("Gathering asset index: " + assetsId);
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftService;
|
|||||||
import org.jackhuang.hellominecraft.launcher.core.version.AssetIndexDownloadInfo;
|
import org.jackhuang.hellominecraft.launcher.core.version.AssetIndexDownloadInfo;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
|
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
|
||||||
import org.jackhuang.hellominecraft.util.MessageBox;
|
import org.jackhuang.hellominecraft.util.MessageBox;
|
||||||
|
import org.jackhuang.hellominecraft.util.Utils;
|
||||||
import org.jackhuang.hellominecraft.util.func.Function;
|
import org.jackhuang.hellominecraft.util.func.Function;
|
||||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||||
import org.jackhuang.hellominecraft.util.tasks.Task;
|
import org.jackhuang.hellominecraft.util.tasks.Task;
|
||||||
@@ -55,6 +56,7 @@ public class MinecraftAssetService extends IMinecraftAssetService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Task downloadAssets(final MinecraftVersion mv) {
|
public Task downloadAssets(final MinecraftVersion mv) {
|
||||||
|
Utils.requireNonNull(mv);
|
||||||
return new TaskInfo("Download Assets") {
|
return new TaskInfo("Download Assets") {
|
||||||
Collection<Task> afters = new HashSet<>();
|
Collection<Task> afters = new HashSet<>();
|
||||||
|
|
||||||
|
|||||||
@@ -54,16 +54,15 @@ public class MinecraftDownloadService extends IMinecraftDownloadService {
|
|||||||
if (mv == null)
|
if (mv == null)
|
||||||
return downloadLibraries;
|
return downloadLibraries;
|
||||||
MinecraftVersion v = mv.resolve(service.version());
|
MinecraftVersion v = mv.resolve(service.version());
|
||||||
if (v.libraries != null)
|
for (IMinecraftLibrary l : v.getLibraries())
|
||||||
for (IMinecraftLibrary l : v.libraries)
|
if (l != null && l.allow()) {
|
||||||
if (l.allow()) {
|
File ff = l.getFilePath(service.baseDirectory());
|
||||||
File ff = l.getFilePath(service.baseDirectory());
|
if (!ff.exists()) {
|
||||||
if (!ff.exists()) {
|
String libURL = l.getDownloadInfo().getUrl(service.getDownloadType());
|
||||||
String libURL = l.getDownloadInfo().getUrl(service.getDownloadType());
|
if (libURL != null)
|
||||||
if (libURL != null)
|
downloadLibraries.add(new DownloadLibraryJob(l, libURL, ff));
|
||||||
downloadLibraries.add(new DownloadLibraryJob(l, libURL, ff));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return downloadLibraries;
|
return downloadLibraries;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -168,4 +168,8 @@ public class MinecraftVersion implements Cloneable, Comparable<MinecraftVersion>
|
|||||||
i.id = id;
|
i.id = id;
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Set<IMinecraftLibrary> getLibraries() {
|
||||||
|
return libraries == null ? new HashSet() : new HashSet(libraries);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user