Supported 16w05a version json
This commit is contained in:
@@ -87,22 +87,22 @@ public class ForgeInstaller {
|
||||
|
||||
File minecraftserver = new File(gameDir, "minecraft_server." + profile.install.minecraft + ".jar");
|
||||
if (minecraftserver.exists() && JOptionPane.showConfirmDialog(null, "已发现官方服务端文件,是否要重新下载?") == JOptionPane.YES_OPTION)
|
||||
if (!TaskWindow.getInstance().addTask(new FileDownloadTask("https://s3.amazonaws.com/Minecraft.Download/versions/{MCVER}/minecraft_server.{MCVER}.jar".replace("{MCVER}", profile.install.minecraft),
|
||||
minecraftserver).setTag("minecraft_server")).start())
|
||||
if (!TaskWindow.factory().append(new FileDownloadTask("https://s3.amazonaws.com/Minecraft.Download/versions/{MCVER}/minecraft_server.{MCVER}.jar".replace("{MCVER}", profile.install.minecraft),
|
||||
minecraftserver).setTag("minecraft_server")).create())
|
||||
MessageBox.Show("Minecraft官方服务端下载失败!");
|
||||
TaskWindow.TaskWindowFactory tw = TaskWindow.getInstance();
|
||||
TaskWindow.TaskWindowFactory tw = TaskWindow.factory();
|
||||
for (MinecraftLibrary library : profile.versionInfo.libraries) {
|
||||
library.init();
|
||||
File lib = new File(gameDir, "libraries" + File.separator + library.formatted + ".pack.xz");
|
||||
String libURL = "https://libraries.minecraft.net/";
|
||||
if (StrUtils.isNotBlank(library.url))
|
||||
libURL = library.url;
|
||||
tw.addTask(new FileDownloadTask(libURL + library.formatted.replace("\\", "/"), lib).setTag(library.name));
|
||||
tw.append(new FileDownloadTask(libURL + library.formatted.replace("\\", "/"), lib).setTag(library.name));
|
||||
}
|
||||
if (!tw.start())
|
||||
if (!tw.create())
|
||||
MessageBox.Show("压缩库下载失败!");
|
||||
|
||||
tw = TaskWindow.getInstance();
|
||||
tw = TaskWindow.factory();
|
||||
for (MinecraftLibrary library : profile.versionInfo.libraries) {
|
||||
File packxz = new File(gameDir, "libraries" + File.separator + library.formatted + ".pack.xz");
|
||||
if (packxz.exists())
|
||||
@@ -112,9 +112,9 @@ public class ForgeInstaller {
|
||||
String libURL = "https://libraries.minecraft.net/";
|
||||
if (StrUtils.isNotBlank(library.url))
|
||||
libURL = library.url;
|
||||
tw.addTask(new FileDownloadTask(libURL + library.formatted.replace("\\", "/"), lib).setTag(library.name));
|
||||
tw.append(new FileDownloadTask(libURL + library.formatted.replace("\\", "/"), lib).setTag(library.name));
|
||||
}
|
||||
if (!tw.start())
|
||||
if (!tw.create())
|
||||
MessageBox.Show("库下载失败!");
|
||||
|
||||
ArrayList<String> badLibs = new ArrayList<>();
|
||||
|
||||
@@ -2994,7 +2994,7 @@ public final class MainWindow extends javax.swing.JFrame
|
||||
|
||||
void refreshDownloads() {
|
||||
clearListDownloads();
|
||||
TaskWindow.getInstance().addTask(new RefreshDownloadsDone()).start();
|
||||
TaskWindow.factory().append(new RefreshDownloadsDone()).create();
|
||||
}
|
||||
|
||||
void refreshInfos() {
|
||||
@@ -3716,7 +3716,7 @@ public final class MainWindow extends javax.swing.JFrame
|
||||
serverjar.delete();
|
||||
|
||||
String downloadURL = url + "minecraft_server." + id + ".jar";
|
||||
TaskWindow.getInstance().addTask(new FileDownloadTask(downloadURL, serverjar).setTag(id)).start();
|
||||
TaskWindow.factory().append(new FileDownloadTask(downloadURL, serverjar).setTag(id)).create();
|
||||
}//GEN-LAST:event_btnMinecraftServerDownloadActionPerformed
|
||||
|
||||
private void btnRefreshInfosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRefreshInfosActionPerformed
|
||||
@@ -3850,8 +3850,8 @@ public final class MainWindow extends javax.swing.JFrame
|
||||
}
|
||||
BukkitVersion v = cb.get(idx);
|
||||
File file = new File(IOUtils.currentDir(), "craftbukkit-" + ext + "-" + v.version + ".jar");
|
||||
TaskWindow.getInstance().addTask(new FileDownloadTask(v.downloadLink, IOUtils.tryGetCanonicalFile(file)).setTag("bukkit-" + ext + "-" + v.version))
|
||||
.start();
|
||||
TaskWindow.factory().append(new FileDownloadTask(v.downloadLink, IOUtils.tryGetCanonicalFile(file)).setTag("bukkit-" + ext + "-" + v.version))
|
||||
.create();
|
||||
}//GEN-LAST:event_btnDownloadCraftbukkitActionPerformed
|
||||
|
||||
private void btnDownloadMCPCActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDownloadMCPCActionPerformed
|
||||
@@ -3862,7 +3862,7 @@ public final class MainWindow extends javax.swing.JFrame
|
||||
String url;
|
||||
File filepath = new File(IOUtils.currentDir(), "forge-installer.jar");
|
||||
url = v.installer[1];
|
||||
if (!TaskWindow.getInstance().addTask(new FileDownloadTask(url, filepath).setTag("cauldron-" + v.ver)).start())
|
||||
if (!TaskWindow.factory().append(new FileDownloadTask(url, filepath).setTag("cauldron-" + v.ver)).create())
|
||||
MessageBox.Show(C.i18n("install.failed_download_forge"));
|
||||
else
|
||||
installMCPC(filepath);
|
||||
|
||||
@@ -231,10 +231,10 @@ public class PluginInfoDialog extends javax.swing.JDialog {
|
||||
if (index == -1)
|
||||
return;
|
||||
String url = pi.versions.get(index).download;
|
||||
TaskWindow.getInstance()
|
||||
.addTask(new FileDownloadTask(url, new File(Utilities.getGameDir() + "plugins"
|
||||
TaskWindow.factory()
|
||||
.append(new FileDownloadTask(url, new File(Utilities.getGameDir() + "plugins"
|
||||
+ File.separator + pi.versions.get(index).filename)))
|
||||
.start();
|
||||
.create();
|
||||
}//GEN-LAST:event_jButton1ActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
|
||||
Reference in New Issue
Block a user