Config lässt sich mit Packen und herunterladen + Code gereinigt

This commit is contained in:
simonr 2016-10-26 21:47:19 +02:00
parent a73961ea28
commit 7d0cdef440
5 changed files with 14 additions and 98 deletions

View file

@ -1,46 +0,0 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package DateiKopieren;
/**
*
* @author simonr
*/
import forgemodpackbuilder.GUI;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileChannel;
public class DateiKopierenClass1 {
public static void main(String[] args) throws IOException {
File inF = new File(GUI.datei);
File outF = new File("./modpack/modpack/" + GUI.datei.substring( GUI.datei.lastIndexOf( "/" ) + 1 ));
copyFile(inF, outF);
}
public static void copyFile(File in, File out) throws IOException {
FileChannel inChannel = null;
FileChannel outChannel = null;
try {
inChannel = new FileInputStream(in).getChannel();
outChannel = new FileOutputStream(out).getChannel();
inChannel.transferTo(0, inChannel.size(), outChannel);
} catch (IOException e) {
throw e;
} finally {
try {
if (inChannel != null)
inChannel.close();
if (outChannel != null)
outChannel.close();
} catch (IOException e) {}
}
}
}

View file

@ -1,46 +0,0 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package DateiKopieren;
/**
*
* @author simonr
*/
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileChannel;
public class DateiKopierenClass2 {
public static void main(String[] args) throws IOException {
File inF = new File("./modpack/Minecraft.jar");
File outF = new File("./modpack/modpack/Minecraft.jar");
copyFile(inF, outF);
}
public static void copyFile(File in, File out) throws IOException {
FileChannel inChannel = null;
FileChannel outChannel = null;
try {
inChannel = new FileInputStream(in).getChannel();
outChannel = new FileOutputStream(out).getChannel();
inChannel.transferTo(0, inChannel.size(), outChannel);
} catch (IOException e) {
throw e;
} finally {
try {
if (inChannel != null)
inChannel.close();
if (outChannel != null)
outChannel.close();
} catch (IOException e) {}
}
}
}

View file

@ -5,6 +5,7 @@
*/
package ModpackDownloader;
import Zipper.UnZip;
import forgemodpackbuilder.GUI;
import java.io.BufferedReader;
import java.io.FileReader;
@ -23,6 +24,14 @@ public class ModpackDownloader {
public static void main(String[] args) throws MalformedURLException, IOException {
//Modpack-Config Download
ModpackDownloader2.URL = GUI.URL + zeile + ".zip";
ModpackDownloader2.output = "./modpack/modpack.zip";
ModpackDownloader2.main(null);
UnZip.modpack = "./modpack/modpack.zip";
UnZip.modpack1 = GUI.datei + "/";
//Modpack URL Suchen
ModpackDownloader2.URL = GUI.URL + zeile;
ModpackDownloader2.output = "./modpack/modpack.txt";
@ -53,10 +62,9 @@ public class ModpackDownloader {
//Progressbar
GUI.zahl = mods;
GUI.datei2 = zeile;
GUI.datei1 = zeile;
GUI c = new GUI();
c.progressnext();
}
}
}

View file

@ -24,7 +24,7 @@ public class downloader1 {
public static void main(String[] args) throws Throwable {
String forge10 = "https://files.minecraftforge.net/maven/net/minecraftforge/forge/1.10.2-12.18.2.2107/forge-1.10.2-12.18.2.2107-installer.jar";
String forge10 = "https://files.minecraftforge.net/maven/net/minecraftforge/forge/1.10.2-12.18.2.2114/forge-1.10.2-12.18.2.2114-installer.jar";
String forge9 = "https://files.minecraftforge.net/maven/net/minecraftforge/forge/1.9.4-12.17.0.2051/forge-1.9.4-12.17.0.2051-installer.jar";
String forge8 = "https://files.minecraftforge.net/maven/net/minecraftforge/forge/1.8.9-11.15.1.1902-1.8.9/forge-1.8.9-11.15.1.1902-1.8.9-installer.jar";
String forge7 = "https://files.minecraftforge.net/maven/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/forge-1.7.10-10.13.4.1614-1.7.10-installer.jar";

View file

@ -35,7 +35,7 @@ public class GUI extends javax.swing.JFrame {
public static ArrayList<String> mods0 = new ArrayList<String>();
public static ArrayList<String> mods1 = new ArrayList<String>();
public static String version = "1.10.2";
public static String datei2 = null;
public static String datei1 = null;
public static int funktion = 0;
public static String URL = "http://mgwywbvcwmot7vir.myfritz.net/";