Supported new version json
This commit is contained in:
@@ -4,6 +4,6 @@ jdk:
|
|||||||
deploy:
|
deploy:
|
||||||
provider: releases
|
provider: releases
|
||||||
api_key:
|
api_key:
|
||||||
secure: 3409b87fc0bb8bb1ee9b5c7636dedd076aa75260
|
secure: 1ab883a4d25412928662c5e7afe722585730eade
|
||||||
file: build/libs/*
|
file: build/libs/*
|
||||||
skip_cleanup: true
|
skip_cleanup: true
|
||||||
|
|||||||
BIN
HMCL/2016-02-25.png
Normal file
BIN
HMCL/2016-02-25.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 383 KiB |
BIN
HMCL/old.jpg
Executable file
BIN
HMCL/old.jpg
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 46 KiB |
@@ -34,6 +34,7 @@ import org.jackhuang.hellominecraft.util.code.DigestUtils;
|
|||||||
import org.jackhuang.hellominecraft.util.system.IOUtils;
|
import org.jackhuang.hellominecraft.util.system.IOUtils;
|
||||||
import org.jackhuang.hellominecraft.util.NetUtils;
|
import org.jackhuang.hellominecraft.util.NetUtils;
|
||||||
import org.jackhuang.hellominecraft.util.OverridableSwingWorker;
|
import org.jackhuang.hellominecraft.util.OverridableSwingWorker;
|
||||||
|
import org.jackhuang.hellominecraft.util.tasks.TaskInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assets
|
* Assets
|
||||||
@@ -86,12 +87,13 @@ public abstract class IAssetsHandler {
|
|||||||
|
|
||||||
public abstract boolean isVersionAllowed(String formattedVersion);
|
public abstract boolean isVersionAllowed(String formattedVersion);
|
||||||
|
|
||||||
protected class AssetsTask extends Task {
|
protected class AssetsTask extends TaskInfo {
|
||||||
|
|
||||||
ArrayList<Task> al;
|
ArrayList<Task> al;
|
||||||
String u;
|
String u;
|
||||||
|
|
||||||
public AssetsTask(String url) {
|
public AssetsTask(String url) {
|
||||||
|
super(C.i18n("assets.download"));
|
||||||
this.u = url;
|
this.u = url;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,8 +119,8 @@ public abstract class IAssetsHandler {
|
|||||||
String sha = DigestUtils.sha1Hex(NetUtils.getBytesFromStream(fis));
|
String sha = DigestUtils.sha1Hex(NetUtils.getBytesFromStream(fis));
|
||||||
IOUtils.closeQuietly(fis);
|
IOUtils.closeQuietly(fis);
|
||||||
if (contents.get(i).geteTag().equals(sha)) {
|
if (contents.get(i).geteTag().equals(sha)) {
|
||||||
hasDownloaded++;
|
++hasDownloaded;
|
||||||
HMCLog.log("File " + assetsLocalNames.get(i) + " has been downloaded successfully, skipped download.");
|
HMCLog.log("File " + assetsLocalNames.get(i) + " has been downloaded successfully, skipped downloading.");
|
||||||
if (ppl != null)
|
if (ppl != null)
|
||||||
ppl.setProgress(this, hasDownloaded, max);
|
ppl.setProgress(this, hasDownloaded, max);
|
||||||
continue;
|
continue;
|
||||||
@@ -137,10 +139,5 @@ public abstract class IAssetsHandler {
|
|||||||
public Collection<Task> getAfterTasks() {
|
public Collection<Task> getAfterTasks() {
|
||||||
return al;
|
return al;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getInfo() {
|
|
||||||
return C.i18n("assets.download");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,15 +20,15 @@ package org.jackhuang.hellominecraft.launcher.core.asset;
|
|||||||
import com.google.gson.JsonSyntaxException;
|
import com.google.gson.JsonSyntaxException;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hellominecraft.util.C;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftAssetService;
|
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftAssetService;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftProvider;
|
|
||||||
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftService;
|
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.code.DigestUtils;
|
|
||||||
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;
|
||||||
@@ -36,6 +36,7 @@ import org.jackhuang.hellominecraft.util.tasks.TaskWindow;
|
|||||||
import org.jackhuang.hellominecraft.util.tasks.download.FileDownloadTask;
|
import org.jackhuang.hellominecraft.util.tasks.download.FileDownloadTask;
|
||||||
import org.jackhuang.hellominecraft.util.system.FileUtils;
|
import org.jackhuang.hellominecraft.util.system.FileUtils;
|
||||||
import org.jackhuang.hellominecraft.util.system.IOUtils;
|
import org.jackhuang.hellominecraft.util.system.IOUtils;
|
||||||
|
import org.jackhuang.hellominecraft.util.tasks.TaskInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -49,18 +50,23 @@ public class MinecraftAssetService extends IMinecraftAssetService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Task downloadAssets(final String mcVersion) {
|
public Task downloadAssets(final String mcVersion) {
|
||||||
return new Task() {
|
return downloadAssets(service.version().getVersionById(mcVersion));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task downloadAssets(final MinecraftVersion mv) {
|
||||||
|
return new TaskInfo("Download Assets") {
|
||||||
|
Collection<Task> afters = new HashSet<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void executeTask() throws Throwable {
|
public void executeTask() throws Throwable {
|
||||||
IAssetsHandler type = IAssetsHandler.ASSETS_HANDLER;
|
IAssetsHandler type = IAssetsHandler.ASSETS_HANDLER;
|
||||||
type.getList(service.version().getVersionById(mcVersion), service.asset())
|
type.getList(mv, service.asset()).justDo();
|
||||||
.reg((t) -> TaskWindow.factory().append(type.getDownloadTask(service.getDownloadType().getProvider())).create()).execute();
|
afters.add(type.getDownloadTask(service.getDownloadType().getProvider()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getInfo() {
|
public Collection<Task> getAfterTasks() {
|
||||||
return "Download Assets";
|
return afters;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -75,10 +81,6 @@ public class MinecraftAssetService extends IMinecraftAssetService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean downloadMinecraftAssetsIndex(AssetIndexDownloadInfo assets) {
|
public boolean downloadMinecraftAssetsIndex(AssetIndexDownloadInfo assets) {
|
||||||
String aurl = service.getDownloadType().getProvider().getIndexesDownloadURL() + assets.getId() + ".json";
|
|
||||||
if (assets.url != null && service.getDownloadType().getProvider().isAllowedToUseSelfURL())
|
|
||||||
aurl = assets.url;
|
|
||||||
|
|
||||||
File assetsLocation = getAssets();
|
File assetsLocation = getAssets();
|
||||||
if (!assetsLocation.exists() && !assetsLocation.mkdirs())
|
if (!assetsLocation.exists() && !assetsLocation.mkdirs())
|
||||||
HMCLog.warn("Failed to make directories: " + assetsLocation);
|
HMCLog.warn("Failed to make directories: " + assetsLocation);
|
||||||
@@ -90,7 +92,7 @@ public class MinecraftAssetService extends IMinecraftAssetService {
|
|||||||
HMCLog.warn("Failed to rename " + assetsIndex + " to " + renamed);
|
HMCLog.warn("Failed to rename " + assetsIndex + " to " + renamed);
|
||||||
}
|
}
|
||||||
if (TaskWindow.factory()
|
if (TaskWindow.factory()
|
||||||
.append(new FileDownloadTask(aurl, IOUtils.tryGetCanonicalFile(assetsIndex), assets.sha1).setTag(assets.getId() + ".json"))
|
.append(new FileDownloadTask(assets.getUrl(service.getDownloadType()), IOUtils.tryGetCanonicalFile(assetsIndex), assets.sha1).setTag(assets.getId() + ".json"))
|
||||||
.create()) {
|
.create()) {
|
||||||
if (renamed != null && !renamed.delete())
|
if (renamed != null && !renamed.delete())
|
||||||
HMCLog.warn("Failed to delete " + renamed + ", maybe you should do it.");
|
HMCLog.warn("Failed to delete " + renamed + ", maybe you should do it.");
|
||||||
@@ -191,10 +193,8 @@ public class MinecraftAssetService extends IMinecraftAssetService {
|
|||||||
|
|
||||||
public final Function<MinecraftVersion, String> ASSET_PROVIDER_IMPL = t -> {
|
public final Function<MinecraftVersion, String> ASSET_PROVIDER_IMPL = t -> {
|
||||||
if (!checkAssetsExistance(t.getAssetsIndex()))
|
if (!checkAssetsExistance(t.getAssetsIndex()))
|
||||||
if (MessageBox.Show(C.i18n("assets.no_assets"), MessageBox.YES_NO_OPTION) == MessageBox.YES_OPTION) {
|
if (MessageBox.Show(C.i18n("assets.no_assets"), MessageBox.YES_NO_OPTION) == MessageBox.YES_OPTION)
|
||||||
IAssetsHandler.ASSETS_HANDLER.getList(t, MinecraftAssetService.this).run();
|
TaskWindow.execute(downloadAssets(t));
|
||||||
TaskWindow.factory().append(IAssetsHandler.ASSETS_HANDLER.getDownloadTask(service.getDownloadType().getProvider())).create();
|
|
||||||
}
|
|
||||||
return reconstructAssets(t.getAssetsIndex()).getAbsolutePath();
|
return reconstructAssets(t.getAssetsIndex()).getAbsolutePath();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
package org.jackhuang.hellominecraft.launcher.core.download;
|
package org.jackhuang.hellominecraft.launcher.core.download;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hellominecraft.util.C;
|
||||||
|
import org.jackhuang.hellominecraft.util.tasks.TaskWindow;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -55,6 +56,7 @@ public enum DownloadType {
|
|||||||
public static void setSuggestedDownloadType(DownloadType suggestedDownloadType) {
|
public static void setSuggestedDownloadType(DownloadType suggestedDownloadType) {
|
||||||
if (suggestedDownloadType == null)
|
if (suggestedDownloadType == null)
|
||||||
throw new IllegalArgumentException("download type should not be null.");
|
throw new IllegalArgumentException("download type should not be null.");
|
||||||
|
TaskWindow.downloadSource = suggestedDownloadType.getName();
|
||||||
DownloadType.suggestedDownloadType = suggestedDownloadType;
|
DownloadType.suggestedDownloadType = suggestedDownloadType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.google.gson.JsonSyntaxException;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hellominecraft.util.C;
|
||||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||||
@@ -32,14 +33,11 @@ import org.jackhuang.hellominecraft.launcher.core.version.IMinecraftLibrary;
|
|||||||
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
|
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
|
||||||
import org.jackhuang.hellominecraft.util.tasks.TaskWindow;
|
import org.jackhuang.hellominecraft.util.tasks.TaskWindow;
|
||||||
import org.jackhuang.hellominecraft.util.tasks.download.FileDownloadTask;
|
import org.jackhuang.hellominecraft.util.tasks.download.FileDownloadTask;
|
||||||
import org.jackhuang.hellominecraft.util.NetUtils;
|
|
||||||
import org.jackhuang.hellominecraft.util.OverridableSwingWorker;
|
|
||||||
import org.jackhuang.hellominecraft.util.func.Function;
|
import org.jackhuang.hellominecraft.util.func.Function;
|
||||||
import org.jackhuang.hellominecraft.util.system.FileUtils;
|
import org.jackhuang.hellominecraft.util.system.FileUtils;
|
||||||
import org.jackhuang.hellominecraft.util.tasks.DoingDoneListener;
|
import org.jackhuang.hellominecraft.util.tasks.DoingDoneListener;
|
||||||
import org.jackhuang.hellominecraft.util.tasks.Task;
|
import org.jackhuang.hellominecraft.util.tasks.Task;
|
||||||
import org.jackhuang.hellominecraft.util.version.MinecraftRemoteVersion;
|
import org.jackhuang.hellominecraft.util.tasks.TaskInfo;
|
||||||
import org.jackhuang.hellominecraft.util.version.MinecraftRemoteVersions;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -58,80 +56,82 @@ public class MinecraftDownloadService extends IMinecraftDownloadService {
|
|||||||
return downloadLibraries;
|
return downloadLibraries;
|
||||||
MinecraftVersion v = mv.resolve(service.version());
|
MinecraftVersion v = mv.resolve(service.version());
|
||||||
if (v.libraries != null)
|
if (v.libraries != null)
|
||||||
for (IMinecraftLibrary l : v.libraries) {
|
for (IMinecraftLibrary l : v.libraries)
|
||||||
l.init();
|
|
||||||
if (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 = service.getDownloadType().getProvider().getLibraryDownloadURL() + "/";
|
String libURL = service.getDownloadType().getProvider().getParsedLibraryDownloadURL(l.getDownloadInfo().getUrl(service.getDownloadType()));
|
||||||
libURL = service.getDownloadType().getProvider().getParsedLibraryDownloadURL(l.getDownloadURL(libURL, 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MinecraftVersion downloadMinecraft(String id) {
|
public Task downloadMinecraft(String id) {
|
||||||
String vurl = service.getDownloadType().getProvider().getVersionsDownloadURL() + id + "/";
|
return new TaskInfo("Download Minecraft") {
|
||||||
File vpath = new File(service.baseDirectory(), "versions/" + id);
|
|
||||||
File mvt = new File(vpath, id + ".json");
|
|
||||||
File mvj = new File(vpath, id + ".jar");
|
|
||||||
if (!vpath.exists() && !vpath.mkdirs())
|
|
||||||
HMCLog.warn("Failed to make directories: " + vpath);
|
|
||||||
if (mvt.exists() && !mvt.delete())
|
|
||||||
HMCLog.warn("Failed to delete " + mvt);
|
|
||||||
if (mvj.exists() && !mvj.delete())
|
|
||||||
HMCLog.warn("Failed to delete " + mvj);
|
|
||||||
|
|
||||||
Task t = new FileDownloadTask(vurl + id + ".json", mvt).setTag(id + ".json");
|
|
||||||
t.addTaskListener(new DoingDoneListener<Task>() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onDone(Task k, Collection<Task> taskCollection) {
|
public void executeTask() throws Throwable {
|
||||||
MinecraftVersion mv;
|
List<MinecraftRemoteVersion> versions = MinecraftRemoteVersions.getRemoteVersions(service.getDownloadType()).justDo();
|
||||||
try {
|
MinecraftRemoteVersion currentVersion = null;
|
||||||
mv = C.GSON.fromJson(FileUtils.readFileToStringQuietly(mvt), MinecraftVersion.class);
|
for (MinecraftRemoteVersion v : versions)
|
||||||
if (mv == null)
|
if (id.equals(v.id)) {
|
||||||
throw new JsonSyntaxException("incorrect version");
|
currentVersion = v;
|
||||||
} catch (JsonSyntaxException ex) {
|
break;
|
||||||
HMCLog.err("Failed to parse minecraft version json.", ex);
|
|
||||||
onFailed(k);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String jarURL = vurl + id + ".jar", hash = null;
|
|
||||||
if (mv.downloads != null && service.getDownloadType().getProvider().isAllowedToUseSelfURL()) {
|
|
||||||
GameDownloadInfo gdi = mv.downloads.get("client");
|
|
||||||
if (gdi != null) {
|
|
||||||
if (gdi.url != null)
|
|
||||||
jarURL = gdi.url;
|
|
||||||
if (gdi.sha1 != null)
|
|
||||||
hash = gdi.sha1;
|
|
||||||
}
|
}
|
||||||
}
|
if (currentVersion == null)
|
||||||
|
throw new RuntimeException("Cannot find version: " + id + " in remote repository.");
|
||||||
|
String jsonURL = currentVersion.getUrl(service.getDownloadType());
|
||||||
|
File vpath = new File(service.baseDirectory(), "versions/" + id);
|
||||||
|
File mvt = new File(vpath, id + ".json");
|
||||||
|
File mvj = new File(vpath, id + ".jar");
|
||||||
|
if (!vpath.exists() && !vpath.mkdirs())
|
||||||
|
HMCLog.warn("Failed to make directories: " + vpath);
|
||||||
|
if (mvt.exists() && !mvt.delete())
|
||||||
|
HMCLog.warn("Failed to delete " + mvt);
|
||||||
|
if (mvj.exists() && !mvj.delete())
|
||||||
|
HMCLog.warn("Failed to delete " + mvj);
|
||||||
|
|
||||||
taskCollection.add(new FileDownloadTask(jarURL, mvj, hash).setFailedCallbackReturnsNewURL(new DownloadTypeSwitcher(id + "/" + id + ".jar")).setTag(id + ".jar"));
|
Task t = new FileDownloadTask(jsonURL, mvt).setTag(id + ".json");
|
||||||
|
t.addTaskListener(new DoingDoneListener<Task>() {
|
||||||
|
@Override
|
||||||
|
public void onDone(Task k, Collection<Task> taskCollection) {
|
||||||
|
MinecraftVersion mv;
|
||||||
|
try {
|
||||||
|
mv = C.GSON.fromJson(FileUtils.readFileToStringQuietly(mvt), MinecraftVersion.class);
|
||||||
|
if (mv == null)
|
||||||
|
throw new JsonSyntaxException("incorrect version");
|
||||||
|
} catch (JsonSyntaxException ex) {
|
||||||
|
HMCLog.err("Failed to parse minecraft version json.", ex);
|
||||||
|
onFailed(k);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
GameDownloadInfo i = mv.getClientDownloadInfo();
|
||||||
|
taskCollection.add(new FileDownloadTask(i.getUrl(service.getDownloadType()), mvj, i.sha1)
|
||||||
|
.setFailedCallbackReturnsNewURL(new DownloadTypeSwitcher(id + "/" + id + ".jar")).setTag(id + ".jar"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDoing(Task k, Collection<Task> taskCollection) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(Task k) {
|
||||||
|
FileUtils.deleteDirectoryQuietly(vpath);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
afters.add(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Collection<Task> afters = new HashSet<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDoing(Task k, Collection<Task> taskCollection) {
|
public Collection<Task> getAfterTasks() {
|
||||||
|
return afters;
|
||||||
}
|
}
|
||||||
|
};
|
||||||
@Override
|
|
||||||
public void onFailed(Task k) {
|
|
||||||
FileUtils.deleteDirectoryQuietly(vpath);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!TaskWindow.factory().append(t).create())
|
|
||||||
return null;
|
|
||||||
try {
|
|
||||||
return C.GSON.fromJson(FileUtils.readFileToStringQuietly(mvt), MinecraftVersion.class);
|
|
||||||
} catch (JsonSyntaxException ex) {
|
|
||||||
HMCLog.err("Failed to parse minecraft version json.", ex);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -180,20 +180,8 @@ public class MinecraftDownloadService extends IMinecraftDownloadService {
|
|||||||
@Override
|
@Override
|
||||||
public Task downloadMinecraftJarTo(MinecraftVersion mv, File mvt) {
|
public Task downloadMinecraftJarTo(MinecraftVersion mv, File mvt) {
|
||||||
String jar = mv.jar == null ? mv.id : mv.jar;
|
String jar = mv.jar == null ? mv.id : mv.jar;
|
||||||
String vurl = service.getDownloadType().getProvider().getVersionsDownloadURL() + jar + "/";
|
GameDownloadInfo i = mv.getClientDownloadInfo();
|
||||||
String jarURL = vurl + jar + ".jar", hash = null;
|
return new FileDownloadTask(i.getUrl(service.getDownloadType(), true), mvt, i.sha1).setTag(jar + ".jar");
|
||||||
if (mv.downloads != null) {
|
|
||||||
// Dont consider adding isAllowedToUseSelfURL, because some modpacks want to use their own download source.
|
|
||||||
GameDownloadInfo gdi = mv.downloads.get("client");
|
|
||||||
if (gdi != null) {
|
|
||||||
if (gdi.url != null)
|
|
||||||
jarURL = gdi.url;
|
|
||||||
if (gdi.sha1 != null)
|
|
||||||
hash = gdi.sha1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return new FileDownloadTask(jarURL, mvt, hash).setTag(jar + ".jar");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -223,16 +211,4 @@ public class MinecraftDownloadService extends IMinecraftDownloadService {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public OverridableSwingWorker<MinecraftRemoteVersion> getRemoteVersions() {
|
|
||||||
return new OverridableSwingWorker<MinecraftRemoteVersion>() {
|
|
||||||
@Override
|
|
||||||
protected void work() throws Exception {
|
|
||||||
MinecraftRemoteVersions r = C.GSON.fromJson(NetUtils.get(service.getDownloadType().getProvider().getVersionsListDownloadURL()), MinecraftRemoteVersions.class);
|
|
||||||
if (r != null && r.versions != null)
|
|
||||||
publish(r.versions.toArray(new MinecraftRemoteVersion[r.versions.size()]));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
* Hello Minecraft!.
|
||||||
|
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
|
*/
|
||||||
|
package org.jackhuang.hellominecraft.launcher.core.download;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author huangyuhui
|
||||||
|
*/
|
||||||
|
public class MinecraftRemoteLatestVersion {
|
||||||
|
|
||||||
|
public String snapshot, release;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* Hello Minecraft!.
|
||||||
|
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
|
*/
|
||||||
|
package org.jackhuang.hellominecraft.launcher.core.download;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author huangyuhui
|
||||||
|
*/
|
||||||
|
public class MinecraftRemoteVersion {
|
||||||
|
|
||||||
|
public String id, time, releaseTime, type;
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
public String getUrl(DownloadType type) {
|
||||||
|
if (url == null)
|
||||||
|
return type.getProvider().getVersionsDownloadURL() + id + "/" + id + ".json";
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
/*
|
||||||
|
* Hello Minecraft!.
|
||||||
|
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
|
*/
|
||||||
|
package org.jackhuang.hellominecraft.launcher.core.download;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import org.jackhuang.hellominecraft.util.C;
|
||||||
|
import org.jackhuang.hellominecraft.util.NetUtils;
|
||||||
|
import org.jackhuang.hellominecraft.util.OverridableSwingWorker;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author huangyuhui
|
||||||
|
*/
|
||||||
|
public class MinecraftRemoteVersions {
|
||||||
|
|
||||||
|
public ArrayList<MinecraftRemoteVersion> versions;
|
||||||
|
public MinecraftRemoteLatestVersion latest;
|
||||||
|
|
||||||
|
private static volatile MinecraftRemoteVersions INSTANCE = null;
|
||||||
|
private static final Object INSTANCE_LOCK = new Object();
|
||||||
|
|
||||||
|
public static RemoteVersionsTask getRemoteVersions(DownloadType type) {
|
||||||
|
return new RemoteVersionsTask(type) {
|
||||||
|
@Override
|
||||||
|
public void work() throws Exception {
|
||||||
|
synchronized (INSTANCE_LOCK) {
|
||||||
|
if (INSTANCE != null)
|
||||||
|
send(INSTANCE.versions.toArray(new MinecraftRemoteVersion[INSTANCE.versions.size()]));
|
||||||
|
else
|
||||||
|
super.work();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RemoteVersionsTask refreshRomoteVersions(DownloadType type) {
|
||||||
|
return new RemoteVersionsTask(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class RemoteVersionsTask extends OverridableSwingWorker<MinecraftRemoteVersion> {
|
||||||
|
|
||||||
|
DownloadType type;
|
||||||
|
|
||||||
|
public RemoteVersionsTask(DownloadType type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void work() throws Exception {
|
||||||
|
MinecraftRemoteVersions r = C.GSON.fromJson(NetUtils.get(type.getProvider().getVersionsListDownloadURL()), MinecraftRemoteVersions.class);
|
||||||
|
if (r != null && r.versions != null) {
|
||||||
|
INSTANCE = r;
|
||||||
|
send(r.versions.toArray(new MinecraftRemoteVersion[r.versions.size()]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -59,7 +59,7 @@ public class MojangDownloadProvider extends IDownloadProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getVersionsListDownloadURL() {
|
public String getVersionsListDownloadURL() {
|
||||||
return "http://s3.amazonaws.com/Minecraft.Download/versions/versions.json";
|
return "https://launchermeta.mojang.com/mc/game/version_manifest.json";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -76,8 +76,7 @@ public class ForgeInstaller extends Task {
|
|||||||
entry = zipFile.getEntry(profile.install.getFilePath());
|
entry = zipFile.getEntry(profile.install.getFilePath());
|
||||||
InputStream is = zipFile.getInputStream(entry);
|
InputStream is = zipFile.getInputStream(entry);
|
||||||
MinecraftLibrary forge = new MinecraftLibrary(profile.install.getPath());
|
MinecraftLibrary forge = new MinecraftLibrary(profile.install.getPath());
|
||||||
forge.init();
|
File file = new File(gameDir, "libraries/" + forge.getDownloadInfo().path);
|
||||||
File file = new File(gameDir, "libraries/" + forge.formatted);
|
|
||||||
if (file.getParentFile().mkdirs())
|
if (file.getParentFile().mkdirs())
|
||||||
HMCLog.warn("Failed to make library directory " + file.getParent());
|
HMCLog.warn("Failed to make library directory " + file.getParent());
|
||||||
try (FileOutputStream fos = new FileOutputStream(file); BufferedOutputStream bos = new BufferedOutputStream(fos)) {
|
try (FileOutputStream fos = new FileOutputStream(file); BufferedOutputStream bos = new BufferedOutputStream(fos)) {
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class OptiFineVersionList extends InstallerVersionList {
|
|||||||
versionMap = new HashMap<>();
|
versionMap = new HashMap<>();
|
||||||
versions = new ArrayList<>();
|
versions = new ArrayList<>();
|
||||||
|
|
||||||
content = content.replace(" ", " ").replace(">", ">").replace("<", "<");
|
content = content.replace(" ", " ").replace(">", ">").replace("<", "<").replace("<br>", "<br />");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||||
|
|||||||
@@ -44,11 +44,9 @@ public class MinecraftLoader extends AbstractMinecraftLoader {
|
|||||||
@Override
|
@Override
|
||||||
protected void makeSelf(List<String> res) throws GameException {
|
protected void makeSelf(List<String> res) throws GameException {
|
||||||
StringBuilder library = new StringBuilder(options.isCanceledWrapper() ? "" : "-cp=");
|
StringBuilder library = new StringBuilder(options.isCanceledWrapper() ? "" : "-cp=");
|
||||||
for (MinecraftLibrary l : version.libraries) {
|
for (MinecraftLibrary l : version.libraries)
|
||||||
l.init();
|
|
||||||
if (l.allow() && !l.isRequiredToUnzip())
|
if (l.allow() && !l.isRequiredToUnzip())
|
||||||
library.append(l.getFilePath(gameDir).getAbsolutePath()).append(File.pathSeparator);
|
library.append(l.getFilePath(gameDir).getAbsolutePath()).append(File.pathSeparator);
|
||||||
}
|
|
||||||
File f = version.getJar(service.baseDirectory());
|
File f = version.getJar(service.baseDirectory());
|
||||||
if (!f.exists())
|
if (!f.exists())
|
||||||
throw new GameException("Minecraft jar does not exists");
|
throw new GameException("Minecraft jar does not exists");
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ import org.jackhuang.hellominecraft.util.system.FileUtils;
|
|||||||
import org.jackhuang.hellominecraft.util.system.ZipEngine;
|
import org.jackhuang.hellominecraft.util.system.ZipEngine;
|
||||||
import org.jackhuang.hellominecraft.util.tasks.Task;
|
import org.jackhuang.hellominecraft.util.tasks.Task;
|
||||||
import org.jackhuang.hellominecraft.util.ui.WebPage;
|
import org.jackhuang.hellominecraft.util.ui.WebPage;
|
||||||
import org.jackhuang.hellominecraft.util.version.MinecraftVersionRequest;
|
import org.jackhuang.hellominecraft.util.MinecraftVersionRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A mod pack(*.zip) includes these things:
|
* A mod pack(*.zip) includes these things:
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import org.jackhuang.hellominecraft.launcher.core.download.DownloadLibraryJob;
|
|||||||
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
|
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
|
||||||
import org.jackhuang.hellominecraft.util.OverridableSwingWorker;
|
import org.jackhuang.hellominecraft.util.OverridableSwingWorker;
|
||||||
import org.jackhuang.hellominecraft.util.tasks.Task;
|
import org.jackhuang.hellominecraft.util.tasks.Task;
|
||||||
import org.jackhuang.hellominecraft.util.version.MinecraftRemoteVersion;
|
import org.jackhuang.hellominecraft.launcher.core.download.MinecraftRemoteVersion;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -36,7 +36,7 @@ public abstract class IMinecraftDownloadService extends IMinecraftBasicService {
|
|||||||
super(service);
|
super(service);
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract MinecraftVersion downloadMinecraft(String id);
|
public abstract Task downloadMinecraft(String id);
|
||||||
|
|
||||||
public abstract boolean downloadMinecraftJar(String id);
|
public abstract boolean downloadMinecraftJar(String id);
|
||||||
|
|
||||||
@@ -51,6 +51,4 @@ public abstract class IMinecraftDownloadService extends IMinecraftBasicService {
|
|||||||
*/
|
*/
|
||||||
public abstract List<DownloadLibraryJob> getDownloadLibraries(MinecraftVersion mv) throws GameException;
|
public abstract List<DownloadLibraryJob> getDownloadLibraries(MinecraftVersion mv) throws GameException;
|
||||||
|
|
||||||
public abstract OverridableSwingWorker<MinecraftRemoteVersion> getRemoteVersions();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,13 +17,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.core.version;
|
package org.jackhuang.hellominecraft.launcher.core.version;
|
||||||
|
|
||||||
|
import org.jackhuang.hellominecraft.launcher.core.download.DownloadType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author huangyuhui
|
* @author huangyuhui
|
||||||
*/
|
*/
|
||||||
public class AssetIndexDownloadInfo extends GameDownloadInfo {
|
public class AssetIndexDownloadInfo extends GameDownloadInfo {
|
||||||
|
|
||||||
String id;
|
|
||||||
int totalSize;
|
int totalSize;
|
||||||
|
|
||||||
public AssetIndexDownloadInfo() {
|
public AssetIndexDownloadInfo() {
|
||||||
@@ -34,6 +35,14 @@ public class AssetIndexDownloadInfo extends GameDownloadInfo {
|
|||||||
url = null;
|
url = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUrl(DownloadType dt, boolean allowSelf) {
|
||||||
|
if (url != null && dt.getProvider().isAllowedToUseSelfURL())
|
||||||
|
return url;
|
||||||
|
else
|
||||||
|
return dt.getProvider().getIndexesDownloadURL() + id + ".json";
|
||||||
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,14 +17,48 @@
|
|||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.core.version;
|
package org.jackhuang.hellominecraft.launcher.core.version;
|
||||||
|
|
||||||
|
import org.jackhuang.hellominecraft.launcher.core.download.DownloadType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author huangyuhui
|
* @author huangyuhui
|
||||||
*/
|
*/
|
||||||
public class GameDownloadInfo implements Cloneable {
|
public class GameDownloadInfo implements Cloneable {
|
||||||
|
|
||||||
public String sha1, url;
|
public String sha1;
|
||||||
public int size;
|
public int size;
|
||||||
|
protected String url;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ready for AssetIndexDownloadInfo, and GameDownloadInfo also need this.
|
||||||
|
*/
|
||||||
|
public String id = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the game download url.
|
||||||
|
*
|
||||||
|
* @param dt where to download?
|
||||||
|
*
|
||||||
|
* @return the download url
|
||||||
|
*/
|
||||||
|
public String getUrl(DownloadType dt) {
|
||||||
|
return getUrl(dt, dt.getProvider().isAllowedToUseSelfURL());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the game download url.
|
||||||
|
*
|
||||||
|
* @param dt where to download?
|
||||||
|
* @param allowSelf allow this game to be downloaded from its modified url?
|
||||||
|
*
|
||||||
|
* @return the download url
|
||||||
|
*/
|
||||||
|
public String getUrl(DownloadType dt, boolean allowSelf) {
|
||||||
|
if (url != null && allowSelf)
|
||||||
|
return url;
|
||||||
|
else
|
||||||
|
return dt.getProvider().getVersionsDownloadURL() + id + "/" + id + ".jar";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
package org.jackhuang.hellominecraft.launcher.core.version;
|
package org.jackhuang.hellominecraft.launcher.core.version;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.download.DownloadType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -36,14 +35,12 @@ public abstract class IMinecraftLibrary implements Cloneable {
|
|||||||
|
|
||||||
public abstract Extract getDecompressExtractRules();
|
public abstract Extract getDecompressExtractRules();
|
||||||
|
|
||||||
public abstract void init();
|
public abstract LibraryDownloadInfo getDownloadInfo();
|
||||||
|
|
||||||
public abstract boolean allow();
|
public abstract boolean allow();
|
||||||
|
|
||||||
public abstract File getFilePath(File gameDir);
|
public abstract File getFilePath(File gameDir);
|
||||||
|
|
||||||
public abstract String getDownloadURL(String urlBase, DownloadType downloadType);
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (obj instanceof MinecraftLibrary)
|
if (obj instanceof MinecraftLibrary)
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* Hello Minecraft! Launcher.
|
||||||
|
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
|
*/
|
||||||
|
package org.jackhuang.hellominecraft.launcher.core.version;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author huangyuhui
|
||||||
|
*/
|
||||||
|
public class LibrariesDownloadInfo {
|
||||||
|
|
||||||
|
Map<String, LibraryDownloadInfo> classifiers;
|
||||||
|
LibraryDownloadInfo artifact;
|
||||||
|
}
|
||||||
@@ -17,6 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.core.version;
|
package org.jackhuang.hellominecraft.launcher.core.version;
|
||||||
|
|
||||||
|
import org.jackhuang.hellominecraft.launcher.core.download.DownloadType;
|
||||||
|
import org.jackhuang.hellominecraft.util.StrUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author huangyuhui
|
* @author huangyuhui
|
||||||
@@ -24,4 +27,15 @@ package org.jackhuang.hellominecraft.launcher.core.version;
|
|||||||
public class LibraryDownloadInfo extends GameDownloadInfo {
|
public class LibraryDownloadInfo extends GameDownloadInfo {
|
||||||
|
|
||||||
public String path;
|
public String path;
|
||||||
|
public String forgeURL;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUrl(DownloadType dt, boolean allowSelf) {
|
||||||
|
String myURL = (forgeURL == null ? dt.getProvider().getLibraryDownloadURL() : forgeURL) + "/";
|
||||||
|
if (StrUtils.isNotBlank(url) && allowSelf)
|
||||||
|
myURL = url;
|
||||||
|
if (!myURL.endsWith(".jar"))
|
||||||
|
myURL += path.replace('\\', '/');
|
||||||
|
return myURL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ package org.jackhuang.hellominecraft.launcher.core.version;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.download.DownloadType;
|
import java.util.HashMap;
|
||||||
import org.jackhuang.hellominecraft.util.system.OS;
|
import org.jackhuang.hellominecraft.util.system.OS;
|
||||||
import org.jackhuang.hellominecraft.util.system.Platform;
|
import org.jackhuang.hellominecraft.util.system.Platform;
|
||||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
import org.jackhuang.hellominecraft.util.StrUtils;
|
||||||
@@ -32,9 +32,9 @@ public class MinecraftLibrary extends IMinecraftLibrary {
|
|||||||
|
|
||||||
public ArrayList<Rules> rules;
|
public ArrayList<Rules> rules;
|
||||||
public String url;
|
public String url;
|
||||||
public transient String formatted = null;
|
|
||||||
public Natives natives;
|
public Natives natives;
|
||||||
public Extract extract;
|
public Extract extract;
|
||||||
|
public LibrariesDownloadInfo downloads;
|
||||||
|
|
||||||
public MinecraftLibrary(String name) {
|
public MinecraftLibrary(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
@@ -87,31 +87,42 @@ public class MinecraftLibrary extends IMinecraftLibrary {
|
|||||||
return natives != null && allow();
|
return natives != null && allow();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public String formatName() {
|
||||||
public void init() {
|
|
||||||
String[] s = name.split(":");
|
String[] s = name.split(":");
|
||||||
StringBuilder sb = new StringBuilder(s[0].replace('.', '/')).append('/').append(s[1]).append('/').append(s[2]).append('/').append(s[1]).append('-').append(s[2]);
|
StringBuilder sb = new StringBuilder(s[0].replace('.', '/')).append('/').append(s[1]).append('/').append(s[2]).append('/').append(s[1]).append('-').append(s[2]);
|
||||||
if (natives != null)
|
if (natives != null)
|
||||||
sb.append('-').append(getNative());
|
sb.append('-').append(getNative());
|
||||||
formatted = sb.append(".jar").toString();
|
return sb.append(".jar").toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public File getFilePath(File gameDir) {
|
public File getFilePath(File gameDir) {
|
||||||
return new File(gameDir, "libraries/" + formatted);
|
return new File(gameDir, "libraries/" + getDownloadInfo().path);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getDownloadURL(String urlBase, DownloadType downloadType) {
|
|
||||||
if (StrUtils.isNotBlank(url) && downloadType.getProvider().isAllowedToUseSelfURL())
|
|
||||||
urlBase = this.url;
|
|
||||||
if (urlBase.endsWith(".jar"))
|
|
||||||
return urlBase;
|
|
||||||
return urlBase + formatted.replace('\\', '/');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Extract getDecompressExtractRules() {
|
public Extract getDecompressExtractRules() {
|
||||||
return extract == null ? new Extract() : extract;
|
return extract == null ? new Extract() : extract;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LibraryDownloadInfo getDownloadInfo() {
|
||||||
|
if (downloads == null)
|
||||||
|
downloads = new LibrariesDownloadInfo();
|
||||||
|
LibraryDownloadInfo info;
|
||||||
|
if (natives != null) {
|
||||||
|
if (downloads.classifiers == null)
|
||||||
|
downloads.classifiers = new HashMap<>();
|
||||||
|
if (!downloads.classifiers.containsKey(getNative()))
|
||||||
|
downloads.classifiers.put(getNative(), info = new LibraryDownloadInfo());
|
||||||
|
else
|
||||||
|
info = downloads.classifiers.get(getNative());
|
||||||
|
} else if (downloads.artifact == null)
|
||||||
|
downloads.artifact = info = new LibraryDownloadInfo();
|
||||||
|
else
|
||||||
|
info = downloads.artifact;
|
||||||
|
if (StrUtils.isBlank(info.path))
|
||||||
|
info.path = formatName();
|
||||||
|
info.forgeURL = this.url;
|
||||||
|
return info;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,10 +35,6 @@ public class MinecraftOldLibrary extends MinecraftLibrary {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void init() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean allow() {
|
public boolean allow() {
|
||||||
return true;
|
return true;
|
||||||
@@ -55,7 +51,7 @@ public class MinecraftOldLibrary extends MinecraftLibrary {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDownloadURL(String urlBase, DownloadType downloadType) {
|
public LibraryDownloadInfo getDownloadInfo() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public class MinecraftVersion implements Cloneable, Comparable<MinecraftVersion>
|
|||||||
public int minimumLauncherVersion;
|
public int minimumLauncherVersion;
|
||||||
public boolean hidden;
|
public boolean hidden;
|
||||||
public AssetIndexDownloadInfo assetIndex;
|
public AssetIndexDownloadInfo assetIndex;
|
||||||
public Map<String, GameDownloadInfo> downloads;
|
private Map<String, GameDownloadInfo> downloads;
|
||||||
|
|
||||||
public ArrayList<MinecraftLibrary> libraries;
|
public ArrayList<MinecraftLibrary> libraries;
|
||||||
|
|
||||||
@@ -156,4 +156,15 @@ public class MinecraftVersion implements Cloneable, Comparable<MinecraftVersion>
|
|||||||
assetIndex = new AssetIndexDownloadInfo((String) Utils.firstNonNull(assets, AssetsIndex.DEFAULT_ASSET_NAME));
|
assetIndex = new AssetIndexDownloadInfo((String) Utils.firstNonNull(assets, AssetsIndex.DEFAULT_ASSET_NAME));
|
||||||
return assetIndex;
|
return assetIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GameDownloadInfo getClientDownloadInfo() {
|
||||||
|
if (downloads == null)
|
||||||
|
downloads = new HashMap<>();
|
||||||
|
if (!downloads.containsKey("client"))
|
||||||
|
downloads.put("client", new GameDownloadInfo());
|
||||||
|
GameDownloadInfo i = downloads.get("client");
|
||||||
|
if (i.id == null)
|
||||||
|
i.id = id;
|
||||||
|
return i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public class MinecraftVersionManager extends IMinecraftProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void refreshVersions() {
|
public synchronized void refreshVersions() {
|
||||||
onRefreshingVersions.execute(service);
|
onRefreshingVersions.execute(service);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -138,9 +138,6 @@ public class MinecraftVersionManager extends IMinecraftProvider {
|
|||||||
FileUtils.writeQuietly(jsonFile, C.GSON.toJson(mcVersion));
|
FileUtils.writeQuietly(jsonFile, C.GSON.toJson(mcVersion));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mcVersion.libraries != null)
|
|
||||||
for (MinecraftLibrary ml : mcVersion.libraries)
|
|
||||||
ml.init();
|
|
||||||
versions.put(id, mcVersion);
|
versions.put(id, mcVersion);
|
||||||
onLoadedVersion.execute(id);
|
onLoadedVersion.execute(id);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -199,12 +196,14 @@ public class MinecraftVersionManager extends IMinecraftProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean install(String id, Consumer<MinecraftVersion> callback) {
|
public boolean install(String id, Consumer<MinecraftVersion> callback) {
|
||||||
MinecraftVersion v = service.download().downloadMinecraft(id);
|
if (!TaskWindow.factory().append(service.download().downloadMinecraft(id)).create())
|
||||||
if (v == null)
|
|
||||||
return false;
|
return false;
|
||||||
if (callback != null) {
|
if (callback != null) {
|
||||||
callback.accept(v);
|
|
||||||
File mvt = new File(versionRoot(id), id + ".json");
|
File mvt = new File(versionRoot(id), id + ".json");
|
||||||
|
MinecraftVersion v = C.GSON.fromJson(FileUtils.readFileToStringQuietly(mvt), MinecraftVersion.class);
|
||||||
|
if (v == null)
|
||||||
|
return false;
|
||||||
|
callback.accept(v);
|
||||||
FileUtils.writeQuietly(mvt, C.GSON.toJson(v));
|
FileUtils.writeQuietly(mvt, C.GSON.toJson(v));
|
||||||
}
|
}
|
||||||
refreshVersions();
|
refreshVersions();
|
||||||
@@ -222,13 +221,11 @@ public class MinecraftVersionManager extends IMinecraftProvider {
|
|||||||
throw new GameException("Wrong format: minecraft.json");
|
throw new GameException("Wrong format: minecraft.json");
|
||||||
ArrayList<File> unzippings = new ArrayList<>();
|
ArrayList<File> unzippings = new ArrayList<>();
|
||||||
ArrayList<Extract> extractRules = new ArrayList<>();
|
ArrayList<Extract> extractRules = new ArrayList<>();
|
||||||
for (IMinecraftLibrary l : v.libraries) {
|
for (IMinecraftLibrary l : v.libraries)
|
||||||
l.init();
|
|
||||||
if (l.isRequiredToUnzip() && v.isAllowedToUnpackNatives()) {
|
if (l.isRequiredToUnzip() && v.isAllowedToUnpackNatives()) {
|
||||||
unzippings.add(IOUtils.tryGetCanonicalFile(l.getFilePath(service.baseDirectory())));
|
unzippings.add(IOUtils.tryGetCanonicalFile(l.getFilePath(service.baseDirectory())));
|
||||||
extractRules.add(l.getDecompressExtractRules());
|
extractRules.add(l.getDecompressExtractRules());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return new DecompressLibraryJob(unzippings.toArray(new File[unzippings.size()]), extractRules.toArray(new Extract[extractRules.size()]), getDecompressNativesToLocation(v));
|
return new DecompressLibraryJob(unzippings.toArray(new File[unzippings.size()]), extractRules.toArray(new Extract[extractRules.size()]), getDecompressNativesToLocation(v));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -290,9 +287,4 @@ public class MinecraftVersionManager extends IMinecraftProvider {
|
|||||||
public void initializeMiencraft() {
|
public void initializeMiencraft() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void downloadModpack(String url) throws IOException {
|
|
||||||
File tmp = File.createTempFile("hmcl", ".zip");
|
|
||||||
TaskWindow.factory().append(new FileDownloadTask(IOUtils.parseURL(url), tmp)).append(new DecompressTask(tmp, service.baseDirectory())).create();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,10 +18,13 @@
|
|||||||
package org.jackhuang.hellominecraft.launcher.ui;
|
package org.jackhuang.hellominecraft.launcher.ui;
|
||||||
|
|
||||||
import javax.swing.table.DefaultTableModel;
|
import javax.swing.table.DefaultTableModel;
|
||||||
|
import org.jackhuang.hellominecraft.launcher.core.download.DownloadType;
|
||||||
|
import org.jackhuang.hellominecraft.launcher.core.download.MinecraftRemoteVersions;
|
||||||
import org.jackhuang.hellominecraft.launcher.setting.Settings;
|
import org.jackhuang.hellominecraft.launcher.setting.Settings;
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hellominecraft.util.C;
|
||||||
import org.jackhuang.hellominecraft.util.MessageBox;
|
import org.jackhuang.hellominecraft.util.MessageBox;
|
||||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
import org.jackhuang.hellominecraft.util.StrUtils;
|
||||||
|
import org.jackhuang.hellominecraft.util.tasks.TaskWindow;
|
||||||
import org.jackhuang.hellominecraft.util.ui.SwingUtils;
|
import org.jackhuang.hellominecraft.util.ui.SwingUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -105,7 +108,7 @@ public class GameDownloadPanel extends AnimatedPanel {
|
|||||||
|
|
||||||
public void refreshDownloads() {
|
public void refreshDownloads() {
|
||||||
DefaultTableModel model = SwingUtils.clearDefaultTable(lstDownloads);
|
DefaultTableModel model = SwingUtils.clearDefaultTable(lstDownloads);
|
||||||
Settings.getLastProfile().service().download().getRemoteVersions()
|
MinecraftRemoteVersions.refreshRomoteVersions(Settings.getLastProfile().service().getDownloadType())
|
||||||
.reg((ver) -> model.addRow(new Object[] { ver.id, ver.time,
|
.reg((ver) -> model.addRow(new Object[] { ver.id, ver.time,
|
||||||
StrUtils.equalsOne(ver.type, "old_beta", "old_alpha", "release", "snapshot") ? C.i18n("versions." + ver.type) : ver.type }))
|
StrUtils.equalsOne(ver.type, "old_beta", "old_alpha", "release", "snapshot") ? C.i18n("versions." + ver.type) : ver.type }))
|
||||||
.regDone(lstDownloads::requestFocus).execute();
|
.regDone(lstDownloads::requestFocus).execute();
|
||||||
@@ -117,7 +120,7 @@ public class GameDownloadPanel extends AnimatedPanel {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String id = (String) lstDownloads.getModel().getValueAt(lstDownloads.getSelectedRow(), 0);
|
String id = (String) lstDownloads.getModel().getValueAt(lstDownloads.getSelectedRow(), 0);
|
||||||
Settings.getLastProfile().service().download().downloadMinecraft(id);
|
TaskWindow.execute(Settings.getLastProfile().service().download().downloadMinecraft(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
|
|||||||
import org.jackhuang.hellominecraft.launcher.setting.VersionSetting;
|
import org.jackhuang.hellominecraft.launcher.setting.VersionSetting;
|
||||||
import org.jackhuang.hellominecraft.util.MessageBox;
|
import org.jackhuang.hellominecraft.util.MessageBox;
|
||||||
import org.jackhuang.hellominecraft.util.OverridableSwingWorker;
|
import org.jackhuang.hellominecraft.util.OverridableSwingWorker;
|
||||||
import org.jackhuang.hellominecraft.util.version.MinecraftVersionRequest;
|
import org.jackhuang.hellominecraft.util.MinecraftVersionRequest;
|
||||||
import org.jackhuang.hellominecraft.util.system.OS;
|
import org.jackhuang.hellominecraft.util.system.OS;
|
||||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
import org.jackhuang.hellominecraft.util.StrUtils;
|
||||||
import org.jackhuang.hellominecraft.util.func.Consumer;
|
import org.jackhuang.hellominecraft.util.func.Consumer;
|
||||||
|
|||||||
BIN
HMCL/src/main/resources/org/jackhuang/hellominecraft/launcher/background.jpg
Executable file → Normal file
BIN
HMCL/src/main/resources/org/jackhuang/hellominecraft/launcher/background.jpg
Executable file → Normal file
Binary file not shown.
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 82 KiB |
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.util.version;
|
package org.jackhuang.hellominecraft.util;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -142,7 +142,7 @@ public class MinecraftVersionRequest implements Serializable {
|
|||||||
int k = i;
|
int k = i;
|
||||||
if (tmp[i + 1] >= (int) 'a' && tmp[i + 1] <= (int) 'z')
|
if (tmp[i + 1] >= (int) 'a' && tmp[i + 1] <= (int) 'z')
|
||||||
i++;
|
i++;
|
||||||
while (tmp[k] >= 48 && tmp[k] <= 57 || tmp[k] == (int) '.' || tmp[k] == (int) 'w')
|
while (tmp[k] >= 48 && tmp[k] <= 57 || tmp[k] == (int) '-' || tmp[k] == (int) '.' || tmp[k] >= 97 && tmp[k] <= (int) 'z')
|
||||||
k--;
|
k--;
|
||||||
k++;
|
k++;
|
||||||
r.version = new String(tmp, k, i - k + 1);
|
r.version = new String(tmp, k, i - k + 1);
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
package org.jackhuang.hellominecraft.util;
|
package org.jackhuang.hellominecraft.util;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.swing.SwingWorker;
|
import javax.swing.SwingWorker;
|
||||||
import org.jackhuang.hellominecraft.util.func.Consumer;
|
import org.jackhuang.hellominecraft.util.func.Consumer;
|
||||||
@@ -64,4 +65,16 @@ public abstract class OverridableSwingWorker<T> extends SwingWorker<Void, T> {
|
|||||||
c.accept(t);
|
c.accept(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final List<T> lastChunks = new ArrayList<>();
|
||||||
|
|
||||||
|
protected void send(T... t) {
|
||||||
|
lastChunks.addAll(Arrays.asList(t));
|
||||||
|
publish(t);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<T> justDo() throws Exception {
|
||||||
|
work();
|
||||||
|
return lastChunks;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,12 +20,14 @@ package org.jackhuang.hellominecraft.util.tasks;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
|
import java.util.concurrent.Future;
|
||||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -84,7 +86,9 @@ public class TaskList extends Thread {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static final ExecutorService EXECUTOR_SERVICE = Executors.newFixedThreadPool(64);
|
ExecutorService EXECUTOR_SERVICE = Executors.newFixedThreadPool(64);
|
||||||
|
HashMap<Invoker, Future<?>> futures = new HashMap<>();
|
||||||
|
HashSet<Invoker> invokers = new HashSet<>();
|
||||||
|
|
||||||
private void processTasks(Collection<? extends Task> c) {
|
private void processTasks(Collection<? extends Task> c) {
|
||||||
if (c == null || c.isEmpty())
|
if (c == null || c.isEmpty())
|
||||||
@@ -95,8 +99,9 @@ public class TaskList extends Thread {
|
|||||||
t2.setParallelExecuting(true);
|
t2.setParallelExecuting(true);
|
||||||
Invoker thread = new Invoker(t2, runningThread);
|
Invoker thread = new Invoker(t2, runningThread);
|
||||||
runningThread.add(thread);
|
runningThread.add(thread);
|
||||||
|
invokers.add(thread);
|
||||||
if (!EXECUTOR_SERVICE.isTerminated())
|
if (!EXECUTOR_SERVICE.isTerminated())
|
||||||
EXECUTOR_SERVICE.execute(thread);
|
futures.put(thread, EXECUTOR_SERVICE.submit(thread));
|
||||||
}
|
}
|
||||||
while (!runningThread.isEmpty())
|
while (!runningThread.isEmpty())
|
||||||
try {
|
try {
|
||||||
@@ -116,10 +121,10 @@ public class TaskList extends Thread {
|
|||||||
if (c == null)
|
if (c == null)
|
||||||
c = new HashSet<>();
|
c = new HashSet<>();
|
||||||
HMCLog.log("Executing task: " + t.getInfo());
|
HMCLog.log("Executing task: " + t.getInfo());
|
||||||
for (DoingDoneListener<Task> d : taskListener)
|
|
||||||
d.onDoing(t, c);
|
|
||||||
for (DoingDoneListener<Task> d : t.getTaskListeners())
|
for (DoingDoneListener<Task> d : t.getTaskListeners())
|
||||||
d.onDoing(t, c);
|
d.onDoing(t, c);
|
||||||
|
for (DoingDoneListener<Task> d : taskListener)
|
||||||
|
d.onDoing(t, c);
|
||||||
processTasks(c);
|
processTasks(c);
|
||||||
|
|
||||||
boolean flag = true;
|
boolean flag = true;
|
||||||
@@ -134,10 +139,10 @@ public class TaskList extends Thread {
|
|||||||
Collection<Task> at = t.getAfterTasks();
|
Collection<Task> at = t.getAfterTasks();
|
||||||
if (at == null)
|
if (at == null)
|
||||||
at = new HashSet<>();
|
at = new HashSet<>();
|
||||||
for (DoingDoneListener<Task> d : taskListener)
|
|
||||||
d.onDone(t, at);
|
|
||||||
for (DoingDoneListener<Task> d : t.getTaskListeners())
|
for (DoingDoneListener<Task> d : t.getTaskListeners())
|
||||||
d.onDone(t, at);
|
d.onDone(t, at);
|
||||||
|
for (DoingDoneListener<Task> d : taskListener)
|
||||||
|
d.onDone(t, at);
|
||||||
processTasks(at);
|
processTasks(at);
|
||||||
} else {
|
} else {
|
||||||
HMCLog.err("Task failed: " + t.getInfo(), t.getFailReason());
|
HMCLog.err("Task failed: " + t.getInfo(), t.getFailReason());
|
||||||
@@ -166,7 +171,15 @@ public class TaskList extends Thread {
|
|||||||
|
|
||||||
public void abort() {
|
public void abort() {
|
||||||
shouldContinue = false;
|
shouldContinue = false;
|
||||||
EXECUTOR_SERVICE.shutdownNow();
|
final HashSet<Invoker> in = this.invokers;
|
||||||
|
EXECUTOR_SERVICE.shutdown();
|
||||||
|
while (!in.isEmpty())
|
||||||
|
synchronized (in) {
|
||||||
|
Invoker it = in.iterator().next();
|
||||||
|
if (!it.task.abort())
|
||||||
|
futures.get(it).cancel(true);
|
||||||
|
in.remove(it);
|
||||||
|
}
|
||||||
this.interrupt();
|
this.interrupt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,9 +34,11 @@ import org.jackhuang.hellominecraft.util.ui.SwingUtils;
|
|||||||
public class TaskWindow extends javax.swing.JDialog
|
public class TaskWindow extends javax.swing.JDialog
|
||||||
implements ProgressProviderListener, Runnable, DoingDoneListener<Task> {
|
implements ProgressProviderListener, Runnable, DoingDoneListener<Task> {
|
||||||
|
|
||||||
private static final TaskWindow INSTANCE = new TaskWindow();
|
private static volatile TaskWindow INSTANCE = null;
|
||||||
|
|
||||||
private static TaskWindow instance() {
|
private static synchronized TaskWindow instance() {
|
||||||
|
if (INSTANCE == null)
|
||||||
|
INSTANCE = new TaskWindow();
|
||||||
INSTANCE.clean();
|
INSTANCE.clean();
|
||||||
return INSTANCE;
|
return INSTANCE;
|
||||||
}
|
}
|
||||||
@@ -82,6 +84,8 @@ public class TaskWindow extends javax.swing.JDialog
|
|||||||
taskList.addAllDoneListener(this);
|
taskList.addAllDoneListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String downloadSource = "";
|
||||||
|
|
||||||
public boolean start() {
|
public boolean start() {
|
||||||
if (isVisible() || taskList == null || taskList.isAlive())
|
if (isVisible() || taskList == null || taskList.isAlive())
|
||||||
return false;
|
return false;
|
||||||
@@ -101,7 +105,7 @@ public class TaskWindow extends javax.swing.JDialog
|
|||||||
MessageBox.Show(C.i18n("taskwindow.no_more_instance"));
|
MessageBox.Show(C.i18n("taskwindow.no_more_instance"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
setTitle(C.i18n("taskwindow.title") + ": " + C.i18n("download.source"));
|
setTitle(C.i18n("taskwindow.title") + " - " + C.i18n("download.source") + ": " + downloadSource);
|
||||||
this.setVisible(true);
|
this.setVisible(true);
|
||||||
return this.areTasksFinished();
|
return this.areTasksFinished();
|
||||||
}
|
}
|
||||||
@@ -296,6 +300,13 @@ public class TaskWindow extends javax.swing.JDialog
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean execute(Task... ts) {
|
||||||
|
TaskWindowFactory f = factory();
|
||||||
|
for (Task t : ts)
|
||||||
|
f.append(t);
|
||||||
|
return f.create();
|
||||||
|
}
|
||||||
|
|
||||||
public static class TaskWindowFactory {
|
public static class TaskWindowFactory {
|
||||||
|
|
||||||
LinkedList<Task> ll = new LinkedList<>();
|
LinkedList<Task> ll = new LinkedList<>();
|
||||||
@@ -309,10 +320,10 @@ public class TaskWindow extends javax.swing.JDialog
|
|||||||
public boolean create() {
|
public boolean create() {
|
||||||
String stacktrace = StrUtils.getStackTrace(new Throwable());
|
String stacktrace = StrUtils.getStackTrace(new Throwable());
|
||||||
return SwingUtils.invokeAndWait(() -> {
|
return SwingUtils.invokeAndWait(() -> {
|
||||||
synchronized (INSTANCE) {
|
final TaskWindow tw = instance();
|
||||||
if (INSTANCE.isVisible())
|
synchronized (tw) {
|
||||||
|
if (tw.isVisible())
|
||||||
return false;
|
return false;
|
||||||
TaskWindow tw = instance();
|
|
||||||
for (Task t : ll)
|
for (Task t : ll)
|
||||||
tw.addTask(t);
|
tw.addTask(t);
|
||||||
tw.lastStackTrace = tw.stackTrace;
|
tw.lastStackTrace = tw.stackTrace;
|
||||||
|
|||||||
@@ -128,6 +128,8 @@ public class FileDownloadTask extends Task implements PreviousResult<File>, Prev
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!shouldContinue)
|
||||||
|
break;
|
||||||
try {
|
try {
|
||||||
|
|
||||||
// Open connection to URL.
|
// Open connection to URL.
|
||||||
@@ -195,8 +197,6 @@ public class FileDownloadTask extends Task implements PreviousResult<File>, Prev
|
|||||||
lastTime = now;
|
lastTime = now;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (downloaded != contentLength)
|
|
||||||
throw new IllegalStateException("Unexptected file size: " + downloaded + ", expected: " + contentLength);
|
|
||||||
closeFiles();
|
closeFiles();
|
||||||
if (aborted)
|
if (aborted)
|
||||||
tempFile.delete();
|
tempFile.delete();
|
||||||
@@ -205,6 +205,10 @@ public class FileDownloadTask extends Task implements PreviousResult<File>, Prev
|
|||||||
filePath.delete();
|
filePath.delete();
|
||||||
tempFile.renameTo(filePath);
|
tempFile.renameTo(filePath);
|
||||||
}
|
}
|
||||||
|
if (!shouldContinue)
|
||||||
|
break;
|
||||||
|
if (downloaded != contentLength)
|
||||||
|
throw new IllegalStateException("Unexptected file size: " + downloaded + ", expected: " + contentLength);
|
||||||
String hashCode = String.format("%1$040x", new Object[] { new BigInteger(1, digest.digest()) });
|
String hashCode = String.format("%1$040x", new Object[] { new BigInteger(1, digest.digest()) });
|
||||||
if (expectedHash != null && !expectedHash.equals(hashCode))
|
if (expectedHash != null && !expectedHash.equals(hashCode))
|
||||||
throw new IllegalStateException("Unexpected hash code: " + hashCode + ", expected: " + expectedHash);
|
throw new IllegalStateException("Unexpected hash code: " + hashCode + ", expected: " + expectedHash);
|
||||||
|
|||||||
@@ -290,7 +290,7 @@ mainwindow.enter_script_name=输入要生成脚本的文件名
|
|||||||
mainwindow.make_launch_succeed=启动脚本已生成完毕:
|
mainwindow.make_launch_succeed=启动脚本已生成完毕:
|
||||||
mainwindow.no_version=未找到任何版本,是否进入游戏下载?
|
mainwindow.no_version=未找到任何版本,是否进入游戏下载?
|
||||||
|
|
||||||
launcher.about=<html>默认背景图来自Liberty Dome服务器。<br/>关于作者:<br/>百度ID:huanghongxun20<br/>mcbbs:huanghongxun<br/>邮箱:huanghongxun2008@126.com<br/>Minecraft Forum ID: klkl6523<br/>欢迎提交Bug哦<br/>Copyright (c) 2013-2016 huangyuhui.<br/>免责声明:Minecraft软件版权归Mojang AB所有,使用本软件产生的版权问题本软件制作方概不负责。<br/>本启动器在GPLv3协议下开源:https://github.com/huanghongxun/HMCL/ ,感谢issues和pull requests贡献者<br/>本软件使用了基于Apache License 2.0的Gson项目,感谢贡献者。</html>
|
launcher.about=<html>默认背景图感谢gamerteam提供。<br/>关于作者:<br/>百度ID:huanghongxun20<br/>mcbbs:huanghongxun<br/>邮箱:huanghongxun2008@126.com<br/>Minecraft Forum ID: klkl6523<br/>欢迎提交Bug哦<br/>Copyright (c) 2013-2016 huangyuhui.<br/>免责声明:Minecraft软件版权归Mojang AB所有,使用本软件产生的版权问题本软件制作方概不负责。<br/>本启动器在GPLv3协议下开源:https://github.com/huanghongxun/HMCL/ ,感谢issues和pull requests贡献者<br/>本软件使用了基于Apache License 2.0的Gson项目,感谢贡献者。</html>
|
||||||
launcher.download_source=下载源
|
launcher.download_source=下载源
|
||||||
launcher.background_location=背景地址
|
launcher.background_location=背景地址
|
||||||
launcher.exit_failed=强制退出失败,可能是Forge 1.7.10及更高版本导致的,无法解决。
|
launcher.exit_failed=强制退出失败,可能是Forge 1.7.10及更高版本导致的,无法解决。
|
||||||
|
|||||||
@@ -290,7 +290,7 @@ mainwindow.enter_script_name=\u8f93\u5165\u8981\u751f\u6210\u811a\u672c\u7684\u6
|
|||||||
mainwindow.make_launch_succeed=\u542f\u52a8\u811a\u672c\u5df2\u751f\u6210\u5b8c\u6bd5:
|
mainwindow.make_launch_succeed=\u542f\u52a8\u811a\u672c\u5df2\u751f\u6210\u5b8c\u6bd5:
|
||||||
mainwindow.no_version=\u672a\u627e\u5230\u4efb\u4f55\u7248\u672c\uff0c\u662f\u5426\u8fdb\u5165\u6e38\u620f\u4e0b\u8f7d\uff1f
|
mainwindow.no_version=\u672a\u627e\u5230\u4efb\u4f55\u7248\u672c\uff0c\u662f\u5426\u8fdb\u5165\u6e38\u620f\u4e0b\u8f7d\uff1f
|
||||||
|
|
||||||
launcher.about=<html>\u9ed8\u8ba4\u80cc\u666f\u56fe\u6765\u81eaLiberty Dome\u670d\u52a1\u5668\u3002<br/>\u5173\u4e8e\u4f5c\u8005\uff1a<br/>\u767e\u5ea6ID\uff1ahuanghongxun20<br/>mcbbs\uff1ahuanghongxun<br/>\u90ae\u7bb1\uff1ahuanghongxun2008@126.com<br/>Minecraft Forum ID: klkl6523<br/>\u6b22\u8fce\u63d0\u4ea4Bug\u54e6<br/>Copyright (c) 2013-2016 huangyuhui.<br/>\u514d\u8d23\u58f0\u660e\uff1aMinecraft\u8f6f\u4ef6\u7248\u6743\u5f52Mojang AB\u6240\u6709\uff0c\u4f7f\u7528\u672c\u8f6f\u4ef6\u4ea7\u751f\u7684\u7248\u6743\u95ee\u9898\u672c\u8f6f\u4ef6\u5236\u4f5c\u65b9\u6982\u4e0d\u8d1f\u8d23\u3002<br/>\u672c\u542f\u52a8\u5668\u5728GPLv3\u534f\u8bae\u4e0b\u5f00\u6e90:https://github.com/huanghongxun/HMCL/ ,\u611f\u8c22issues\u548cpull requests\u8d21\u732e\u8005<br/>\u672c\u8f6f\u4ef6\u4f7f\u7528\u4e86\u57fa\u4e8eApache License 2.0\u7684Gson\u9879\u76ee\uff0c\u611f\u8c22\u8d21\u732e\u8005\u3002</html>
|
launcher.about=<html>\u9ed8\u8ba4\u80cc\u666f\u56fe\u611f\u8c22gamerteam\u63d0\u4f9b\u3002<br/>\u5173\u4e8e\u4f5c\u8005\uff1a<br/>\u767e\u5ea6ID\uff1ahuanghongxun20<br/>mcbbs\uff1ahuanghongxun<br/>\u90ae\u7bb1\uff1ahuanghongxun2008@126.com<br/>Minecraft Forum ID: klkl6523<br/>\u6b22\u8fce\u63d0\u4ea4Bug\u54e6<br/>Copyright (c) 2013-2016 huangyuhui.<br/>\u514d\u8d23\u58f0\u660e\uff1aMinecraft\u8f6f\u4ef6\u7248\u6743\u5f52Mojang AB\u6240\u6709\uff0c\u4f7f\u7528\u672c\u8f6f\u4ef6\u4ea7\u751f\u7684\u7248\u6743\u95ee\u9898\u672c\u8f6f\u4ef6\u5236\u4f5c\u65b9\u6982\u4e0d\u8d1f\u8d23\u3002<br/>\u672c\u542f\u52a8\u5668\u5728GPLv3\u534f\u8bae\u4e0b\u5f00\u6e90:https://github.com/huanghongxun/HMCL/ ,\u611f\u8c22issues\u548cpull requests\u8d21\u732e\u8005<br/>\u672c\u8f6f\u4ef6\u4f7f\u7528\u4e86\u57fa\u4e8eApache License 2.0\u7684Gson\u9879\u76ee\uff0c\u611f\u8c22\u8d21\u732e\u8005\u3002</html>
|
||||||
launcher.download_source=\u4e0b\u8f7d\u6e90
|
launcher.download_source=\u4e0b\u8f7d\u6e90
|
||||||
launcher.background_location=\u80cc\u666f\u5730\u5740
|
launcher.background_location=\u80cc\u666f\u5730\u5740
|
||||||
launcher.exit_failed=\u5f3a\u5236\u9000\u51fa\u5931\u8d25\uff0c\u53ef\u80fd\u662fForge 1.7.10\u53ca\u66f4\u9ad8\u7248\u672c\u5bfc\u81f4\u7684\uff0c\u65e0\u6cd5\u89e3\u51b3\u3002
|
launcher.exit_failed=\u5f3a\u5236\u9000\u51fa\u5931\u8d25\uff0c\u53ef\u80fd\u662fForge 1.7.10\u53ca\u66f4\u9ad8\u7248\u672c\u5bfc\u81f4\u7684\uff0c\u65e0\u6cd5\u89e3\u51b3\u3002
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
launch.failed=啟動失敗
|
launch.failed=啟動失敗
|
||||||
launch.failed_creating_process=啟動失敗,在創建新進程時發生錯誤,可能是Java路徑錯誤。
|
launch.failed_creating_process=啟動失敗,在創建新進程時發生錯誤,可能是Java路徑錯誤。
|
||||||
launch.failed_sh_permission=為啟動資料添加權限時發生錯誤
|
launch.failed_sh_permission=為啟動資料添加權限時發生錯誤
|
||||||
launch.failed_packing_jar=在打包jar時發生錯誤
|
launch.failed_packing_jar=在打包jar時發生錯誤
|
||||||
launch.unsupported_launcher_version=對不起,本啟動器現在可能不能啟動這個版本的Minecraft,但啟動器還是會嘗試啟動,請盡快將此問題報告給作者。
|
launch.unsupported_launcher_version=對不起,本啟動器現在可能不能啟動這個版本的Minecraft,但啟動器還是會嘗試啟動,請盡快將此問題報告給作者。
|
||||||
launch.too_big_memory_alloc_64bit=您设置的内存大小过大,由于可能超过了32位Java的内存分配限制,所以可能无法启动游戏,请将内存调至1024MB或更小,启动器仍会尝试启动。
|
launch.too_big_memory_alloc_64bit=您设置的内存大小过大,由于可能超过了32位Java的内存分配限制,所以可能无法启动游戏,请将内存调至1024MB或更小,启动器仍会尝试启动。
|
||||||
launch.too_big_memory_alloc_free_space_too_low=您设置的内存大小过大,由于超过了系统内存大小%dMB,所以可能影响游戏体验或无法启动游戏,启动器仍会尝试启动。
|
launch.too_big_memory_alloc_free_space_too_low=您设置的内存大小过大,由于超过了系统内存大小%dMB,所以可能影响游戏体验或无法启动游戏,启动器仍会尝试启动。
|
||||||
@@ -290,7 +290,7 @@ mainwindow.enter_script_name=輸入要生成腳本的資料名
|
|||||||
mainwindow.make_launch_succeed=啟動腳本已生成完畢:
|
mainwindow.make_launch_succeed=啟動腳本已生成完畢:
|
||||||
mainwindow.no_version=未找到任何版本,是否進入遊戲下載?
|
mainwindow.no_version=未找到任何版本,是否進入遊戲下載?
|
||||||
|
|
||||||
launcher.about=<html>默認背景圖來自Liberty Dome伺服器。 <br/>關於作者:<br/>百度ID:huanghongxun20<br/>mcbbs:huanghongxun<br/>郵箱:huanghongxun2008@126.com<br/>Minecraft Forum ID: klkl6523<br />歡迎提交Bug哦<br/>Copyright (c) 2013-2016 huangyuhui.<br/>免責聲明:Minecraft軟體版權歸Mojang AB所有,遊戲由於誤操作本啟動器而丟失數據的概不負責。 <br/>本啟動器在GPLv3協議下開源:http://github.com/huanghongxun/HMCL/ ,感谢issues和pull requests贡献者<br/>本軟體使用了基於Apache License 2.0的Gson項目,感謝貢獻者。</html>
|
launcher.about=<html>默認背景圖感謝gamerteam提供。 <br/>關於作者:<br/>百度ID:huanghongxun20<br/>mcbbs:huanghongxun<br/>郵箱:huanghongxun2008@126.com<br/>Minecraft Forum ID: klkl6523<br />歡迎提交Bug哦<br/>Copyright (c) 2013-2016 huangyuhui.<br/>免責聲明:Minecraft軟體版權歸Mojang AB所有,遊戲由於誤操作本啟動器而丟失數據的概不負責。 <br/>本啟動器在GPLv3協議下開源:http://github.com/huanghongxun/HMCL/ ,感谢issues和pull requests贡献者<br/>本軟體使用了基於Apache License 2.0的Gson項目,感謝貢獻者。</html>
|
||||||
launcher.download_source=下載源
|
launcher.download_source=下載源
|
||||||
launcher.background_location=背景地址
|
launcher.background_location=背景地址
|
||||||
launcher.exit_failed=強制退出失敗,可能是Forge 1.7.10及更高版本導致的,無法解決。
|
launcher.exit_failed=強制退出失敗,可能是Forge 1.7.10及更高版本導致的,無法解決。
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
launch.failed=\u555f\u52d5\u5931\u6557
|
launch.failed=\u555f\u52d5\u5931\u6557
|
||||||
launch.failed_creating_process=\u555f\u52d5\u5931\u6557\uff0c\u5728\u5275\u5efa\u65b0\u9032\u7a0b\u6642\u767c\u751f\u932f\u8aa4\uff0c\u53ef\u80fd\u662fJava\u8def\u5f91\u932f\u8aa4\u3002
|
launch.failed_creating_process=\u555f\u52d5\u5931\u6557\uff0c\u5728\u5275\u5efa\u65b0\u9032\u7a0b\u6642\u767c\u751f\u932f\u8aa4\uff0c\u53ef\u80fd\u662fJava\u8def\u5f91\u932f\u8aa4\u3002
|
||||||
launch.failed_sh_permission=\u70ba\u555f\u52d5\u8cc7\u6599\u6dfb\u52a0\u6b0a\u9650\u6642\u767c\u751f\u932f\u8aa4
|
launch.failed_sh_permission=\u70ba\u555f\u52d5\u8cc7\u6599\u6dfb\u52a0\u6b0a\u9650\u6642\u767c\u751f\u932f\u8aa4
|
||||||
launch.failed_pa\u200b\u200bcking_jar=\u5728\u6253\u5305jar\u6642\u767c\u751f\u932f\u8aa4
|
launch.failed_packing_jar=\u5728\u6253\u5305jar\u6642\u767c\u751f\u932f\u8aa4
|
||||||
launch.unsupported_launcher_version=\u5c0d\u4e0d\u8d77\uff0c\u672c\u555f\u52d5\u5668\u73fe\u5728\u53ef\u80fd\u4e0d\u80fd\u555f\u52d5\u9019\u500b\u7248\u672c\u7684Minecraft\uff0c\u4f46\u555f\u52d5\u5668\u9084\u662f\u6703\u5617\u8a66\u555f\u52d5\uff0c\u8acb\u76e1\u5feb\u5c07\u6b64\u554f\u984c\u5831\u544a\u7d66\u4f5c\u8005\u3002
|
launch.unsupported_launcher_version=\u5c0d\u4e0d\u8d77\uff0c\u672c\u555f\u52d5\u5668\u73fe\u5728\u53ef\u80fd\u4e0d\u80fd\u555f\u52d5\u9019\u500b\u7248\u672c\u7684Minecraft\uff0c\u4f46\u555f\u52d5\u5668\u9084\u662f\u6703\u5617\u8a66\u555f\u52d5\uff0c\u8acb\u76e1\u5feb\u5c07\u6b64\u554f\u984c\u5831\u544a\u7d66\u4f5c\u8005\u3002
|
||||||
launch.too_big_memory_alloc_64bit=\u60a8\u8bbe\u7f6e\u7684\u5185\u5b58\u5927\u5c0f\u8fc7\u5927\uff0c\u7531\u4e8e\u53ef\u80fd\u8d85\u8fc7\u4e8632\u4f4dJava\u7684\u5185\u5b58\u5206\u914d\u9650\u5236\uff0c\u6240\u4ee5\u53ef\u80fd\u65e0\u6cd5\u542f\u52a8\u6e38\u620f\uff0c\u8bf7\u5c06\u5185\u5b58\u8c03\u81f31024MB\u6216\u66f4\u5c0f\uff0c\u542f\u52a8\u5668\u4ecd\u4f1a\u5c1d\u8bd5\u542f\u52a8\u3002
|
launch.too_big_memory_alloc_64bit=\u60a8\u8bbe\u7f6e\u7684\u5185\u5b58\u5927\u5c0f\u8fc7\u5927\uff0c\u7531\u4e8e\u53ef\u80fd\u8d85\u8fc7\u4e8632\u4f4dJava\u7684\u5185\u5b58\u5206\u914d\u9650\u5236\uff0c\u6240\u4ee5\u53ef\u80fd\u65e0\u6cd5\u542f\u52a8\u6e38\u620f\uff0c\u8bf7\u5c06\u5185\u5b58\u8c03\u81f31024MB\u6216\u66f4\u5c0f\uff0c\u542f\u52a8\u5668\u4ecd\u4f1a\u5c1d\u8bd5\u542f\u52a8\u3002
|
||||||
launch.too_big_memory_alloc_free_space_too_low=\u60a8\u8bbe\u7f6e\u7684\u5185\u5b58\u5927\u5c0f\u8fc7\u5927\uff0c\u7531\u4e8e\u8d85\u8fc7\u4e86\u7cfb\u7edf\u5185\u5b58\u5927\u5c0f%dMB\uff0c\u6240\u4ee5\u53ef\u80fd\u5f71\u54cd\u6e38\u620f\u4f53\u9a8c\u6216\u65e0\u6cd5\u542f\u52a8\u6e38\u620f\uff0c\u542f\u52a8\u5668\u4ecd\u4f1a\u5c1d\u8bd5\u542f\u52a8\u3002
|
launch.too_big_memory_alloc_free_space_too_low=\u60a8\u8bbe\u7f6e\u7684\u5185\u5b58\u5927\u5c0f\u8fc7\u5927\uff0c\u7531\u4e8e\u8d85\u8fc7\u4e86\u7cfb\u7edf\u5185\u5b58\u5927\u5c0f%dMB\uff0c\u6240\u4ee5\u53ef\u80fd\u5f71\u54cd\u6e38\u620f\u4f53\u9a8c\u6216\u65e0\u6cd5\u542f\u52a8\u6e38\u620f\uff0c\u542f\u52a8\u5668\u4ecd\u4f1a\u5c1d\u8bd5\u542f\u52a8\u3002
|
||||||
@@ -290,7 +290,7 @@ mainwindow.enter_script_name=\u8f38\u5165\u8981\u751f\u6210\u8173\u672c\u7684\u8
|
|||||||
mainwindow.make_launch_succeed=\u555f\u52d5\u8173\u672c\u5df2\u751f\u6210\u5b8c\u7562:
|
mainwindow.make_launch_succeed=\u555f\u52d5\u8173\u672c\u5df2\u751f\u6210\u5b8c\u7562:
|
||||||
mainwindow.no_version=\u672a\u627e\u5230\u4efb\u4f55\u7248\u672c\uff0c\u662f\u5426\u9032\u5165\u904a\u6232\u4e0b\u8f09\uff1f
|
mainwindow.no_version=\u672a\u627e\u5230\u4efb\u4f55\u7248\u672c\uff0c\u662f\u5426\u9032\u5165\u904a\u6232\u4e0b\u8f09\uff1f
|
||||||
|
|
||||||
launcher.about=<html>\u9ed8\u8a8d\u80cc\u666f\u5716\u4f86\u81eaLiberty Dome\u4f3a\u670d\u5668\u3002 <br/>\u95dc\u65bc\u4f5c\u8005\uff1a<br/>\u767e\u5ea6ID\uff1ahuanghongxun20<br/>mcbbs\uff1ahuanghongxun<br/>\u90f5\u7bb1\uff1ahuanghongxun2008@126.com<br/>Minecraft Forum ID: klkl6523<br />\u6b61\u8fce\u63d0\u4ea4Bug\u54e6<br/>Copyright (c) 2013-2016 huangyuhui.<br/>\u514d\u8cac\u8072\u660e\uff1aMinecraft\u8edf\u9ad4\u7248\u6b0a\u6b78Mojang AB\u6240\u6709\uff0c\u904a\u6232\u7531\u65bc\u8aa4\u64cd\u4f5c\u672c\u555f\u52d5\u5668\u800c\u4e1f\u5931\u6578\u64da\u7684\u6982\u4e0d\u8ca0\u8cac\u3002 <br/>\u672c\u555f\u52d5\u5668\u5728GPLv3\u5354\u8b70\u4e0b\u958b\u6e90:http://github.com/huanghongxun/HMCL/ ,\u611f\u8c22issues\u548cpull requests\u8d21\u732e\u8005<br/>\u672c\u8edf\u9ad4\u4f7f\u7528\u4e86\u57fa\u65bcApache License 2.0\u7684Gson\u9805\u76ee\uff0c\u611f\u8b1d\u8ca2\u737b\u8005\u3002</html>
|
launcher.about=<html>\u9ed8\u8a8d\u80cc\u666f\u5716\u611f\u8b1dgamerteam\u63d0\u4f9b\u3002 <br/>\u95dc\u65bc\u4f5c\u8005\uff1a<br/>\u767e\u5ea6ID\uff1ahuanghongxun20<br/>mcbbs\uff1ahuanghongxun<br/>\u90f5\u7bb1\uff1ahuanghongxun2008@126.com<br/>Minecraft Forum ID: klkl6523<br />\u6b61\u8fce\u63d0\u4ea4Bug\u54e6<br/>Copyright (c) 2013-2016 huangyuhui.<br/>\u514d\u8cac\u8072\u660e\uff1aMinecraft\u8edf\u9ad4\u7248\u6b0a\u6b78Mojang AB\u6240\u6709\uff0c\u904a\u6232\u7531\u65bc\u8aa4\u64cd\u4f5c\u672c\u555f\u52d5\u5668\u800c\u4e1f\u5931\u6578\u64da\u7684\u6982\u4e0d\u8ca0\u8cac\u3002 <br/>\u672c\u555f\u52d5\u5668\u5728GPLv3\u5354\u8b70\u4e0b\u958b\u6e90:http://github.com/huanghongxun/HMCL/ ,\u611f\u8c22issues\u548cpull requests\u8d21\u732e\u8005<br/>\u672c\u8edf\u9ad4\u4f7f\u7528\u4e86\u57fa\u65bcApache License 2.0\u7684Gson\u9805\u76ee\uff0c\u611f\u8b1d\u8ca2\u737b\u8005\u3002</html>
|
||||||
launcher.download_source=\u4e0b\u8f09\u6e90
|
launcher.download_source=\u4e0b\u8f09\u6e90
|
||||||
launcher.background_location=\u80cc\u666f\u5730\u5740
|
launcher.background_location=\u80cc\u666f\u5730\u5740
|
||||||
launcher.exit_failed=\u5f37\u5236\u9000\u51fa\u5931\u6557\uff0c\u53ef\u80fd\u662fForge 1.7.10\u53ca\u66f4\u9ad8\u7248\u672c\u5c0e\u81f4\u7684\uff0c\u7121\u6cd5\u89e3\u6c7a\u3002
|
launcher.exit_failed=\u5f37\u5236\u9000\u51fa\u5931\u6557\uff0c\u53ef\u80fd\u662fForge 1.7.10\u53ca\u66f4\u9ad8\u7248\u672c\u5c0e\u81f4\u7684\uff0c\u7121\u6cd5\u89e3\u6c7a\u3002
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ import org.jackhuang.hellominecraft.util.MessageBox;
|
|||||||
import org.jackhuang.hellominecraft.svrmgr.util.ModType;
|
import org.jackhuang.hellominecraft.svrmgr.util.ModType;
|
||||||
import org.jackhuang.hellominecraft.svrmgr.util.MonitorInfoBean;
|
import org.jackhuang.hellominecraft.svrmgr.util.MonitorInfoBean;
|
||||||
import org.jackhuang.hellominecraft.svrmgr.util.MonitorServiceImpl;
|
import org.jackhuang.hellominecraft.svrmgr.util.MonitorServiceImpl;
|
||||||
import org.jackhuang.hellominecraft.util.version.MinecraftRemoteVersions;
|
import org.jackhuang.hellominecraft.svrmgr.util.version.MinecraftRemoteVersions;
|
||||||
import org.jackhuang.hellominecraft.svrmgr.Main;
|
import org.jackhuang.hellominecraft.svrmgr.Main;
|
||||||
import org.jackhuang.hellominecraft.svrmgr.plugin.BukkitPlugin;
|
import org.jackhuang.hellominecraft.svrmgr.plugin.BukkitPlugin;
|
||||||
import org.jackhuang.hellominecraft.svrmgr.plugin.Category;
|
import org.jackhuang.hellominecraft.svrmgr.plugin.Category;
|
||||||
@@ -85,7 +85,7 @@ import org.jackhuang.hellominecraft.svrmgr.util.FolderOpener;
|
|||||||
import org.jackhuang.hellominecraft.svrmgr.util.IPGet;
|
import org.jackhuang.hellominecraft.svrmgr.util.IPGet;
|
||||||
import org.jackhuang.hellominecraft.svrmgr.util.Utilities;
|
import org.jackhuang.hellominecraft.svrmgr.util.Utilities;
|
||||||
import org.jackhuang.hellominecraft.util.ui.SwingUtils;
|
import org.jackhuang.hellominecraft.util.ui.SwingUtils;
|
||||||
import org.jackhuang.hellominecraft.util.version.MinecraftRemoteVersion;
|
import org.jackhuang.hellominecraft.svrmgr.util.version.MinecraftRemoteVersion;
|
||||||
import org.jackhuang.hellominecraft.lookandfeel.comp.ConstomButton;
|
import org.jackhuang.hellominecraft.lookandfeel.comp.ConstomButton;
|
||||||
import org.jackhuang.hellominecraft.util.Event;
|
import org.jackhuang.hellominecraft.util.Event;
|
||||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
import org.jackhuang.hellominecraft.util.StrUtils;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.util.version;
|
package org.jackhuang.hellominecraft.svrmgr.util.version;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.util.version;
|
package org.jackhuang.hellominecraft.svrmgr.util.version;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -24,4 +24,5 @@ package org.jackhuang.hellominecraft.util.version;
|
|||||||
public class MinecraftRemoteVersion {
|
public class MinecraftRemoteVersion {
|
||||||
|
|
||||||
public String id, time, releaseTime, type;
|
public String id, time, releaseTime, type;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.util.version;
|
package org.jackhuang.hellominecraft.svrmgr.util.version;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
Reference in New Issue
Block a user