Verbesserungen und Säuberungen und neues System

This commit is contained in:
simonr 2016-10-26 15:03:33 +02:00
parent cae7bb411d
commit 8ef4dd7852
30 changed files with 411 additions and 267 deletions

0
forge.jar.log Normal file
View file

View file

@ -46,8 +46,8 @@ is divided into following sections:
<property file="${user.properties.file}"/>
<!-- The two properties below are usually overridden -->
<!-- by the active platform. Just a fallback. -->
<property name="default.javac.source" value="1.4"/>
<property name="default.javac.target" value="1.4"/>
<property name="default.javac.source" value="1.6"/>
<property name="default.javac.target" value="1.6"/>
</target>
<target depends="-pre-init,-init-private,-init-user" name="-init-project">
<property file="nbproject/configs/${config}.properties"/>
@ -76,7 +76,7 @@ is divided into following sections:
<and>
<isset property="javac.profile"/>
<length length="0" string="${javac.profile}" when="greater"/>
<matches pattern="1\.[89](\..*)?" string="${javac.source}"/>
<matches pattern="((1\.[89])|9)(\..*)?" string="${javac.source}"/>
</and>
</condition>
<condition property="do.archive">
@ -156,6 +156,7 @@ is divided into following sections:
<property name="application.args" value=""/>
<property name="source.encoding" value="${file.encoding}"/>
<property name="runtime.encoding" value="${source.encoding}"/>
<property name="manifest.encoding" value="${source.encoding}"/>
<condition property="javadoc.encoding.used" value="${javadoc.encoding}">
<and>
<isset property="javadoc.encoding"/>
@ -840,7 +841,7 @@ is divided into following sections:
</chainedmapper>
</pathconvert>
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
<copylibs compress="${jar.compress}" excludeFromCopy="${copylibs.excludes}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
<copylibs compress="${jar.compress}" excludeFromCopy="${copylibs.excludes}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" manifestencoding="UTF-8" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
<fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
<manifest>
<attribute name="Class-Path" value="${jar.classpath}"/>
@ -852,7 +853,7 @@ is divided into following sections:
</target>
<target name="-init-presetdef-jar">
<presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
<jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
<jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifestencoding="UTF-8">
<j2seproject1:fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
</jar>
</presetdef>
@ -975,15 +976,15 @@ is divided into following sections:
</target>
<target depends="init" if="do.archive+manifest.available" name="-do-jar-copy-manifest">
<tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
<copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
<copy encoding="${manifest.encoding}" file="${manifest.file}" outputencoding="UTF-8" tofile="${tmp.manifest.file}"/>
</target>
<target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+main.class.available" name="-do-jar-set-mainclass">
<manifest file="${tmp.manifest.file}" mode="update">
<manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
<attribute name="Main-Class" value="${main.class}"/>
</manifest>
</target>
<target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+profile.available" name="-do-jar-set-profile">
<manifest file="${tmp.manifest.file}" mode="update">
<manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
<attribute name="Profile" value="${javac.profile}"/>
</manifest>
</target>
@ -991,7 +992,7 @@ is divided into following sections:
<basename file="${application.splash}" property="splashscreen.basename"/>
<mkdir dir="${build.classes.dir}/META-INF"/>
<copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
<manifest file="${tmp.manifest.file}" mode="update">
<manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
<attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
</manifest>
</target>
@ -1186,7 +1187,7 @@ is divided into following sections:
<target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main">
<fail unless="run.class">Must select one file in the IDE or set run.class</fail>
<startprofiler/>
<antcal target="run-test-with-main"/>
<antcall target="run-test-with-main"/>
</target>
<target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent">
<fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>

View file

@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=8064a381@1.79.1.48
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=e9df12b1
nbproject/build-impl.xml.script.CRC32=869e51d9
nbproject/build-impl.xml.stylesheet.CRC32=05530350@1.79.1.48
nbproject/build-impl.xml.script.CRC32=4048cd96
nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48

View file

@ -58,7 +58,7 @@ javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
main.class=forgemodpackbuilder.GUI
main.class=main
manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
mkdist.disabled=false

View file

@ -3,12 +3,13 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package forgemodpackbuilder;
package DateiKopieren;
/**
*
* @author simonr
*/
import forgemodpackbuilder.GUI;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;

View file

@ -3,12 +3,13 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package forgemodpackbuilder;
package DateiKopieren;
/**
*
* @author simonr
*/
import forgemodpackbuilder.GUI;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;

View file

@ -3,7 +3,7 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package forgemodpackbuilder;
package DateiKopieren;
/**
*

View file

@ -3,12 +3,13 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package forgemodpackbuilder;
package DateiKopieren;
/**
*
* @author simonr
*/
import forgemodpackbuilder.GUI;
import java.io.File;
public class FileDeleteExample {

View file

@ -0,0 +1,60 @@
/*
* 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 ModpackDownloader;
import ModpackDownloader.ModpackDownloader2;
import forgemodpackbuilder.GUI;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.net.MalformedURLException;
/**
*
* @author simonr
*/
public class ModpackDownloader {
static int mods = 0;
public static String zeile = "";
private static String version;
public static void main(String[] args) throws MalformedURLException, IOException {
//Modpack URL Suchen
ModpackDownloader2.URL = "http://localhost/" + zeile;
ModpackDownloader2.output = "./modpack/modpack.txt";
ModpackDownloader2.main(null);
//Progressbar Modpack durchsuchen
FileReader fr = new FileReader("./modpack/modpack.txt");
BufferedReader br = new BufferedReader(fr);
while ((zeile = br.readLine()) != null) {
mods++;
}
System.out.println("Mods = " + mods);
//Modpack Installieren
FileReader fr1 = new FileReader("./modpack/modpack.txt");
BufferedReader br1 = new BufferedReader(fr1);
version = br1.readLine();
while ((zeile = br1.readLine()) != null) {
ModpackDownloader2.URL = "http://localhost/mods/" + version + "/" + zeile;
ModpackDownloader2.output = GUI.datei + "/mods/" + zeile;
ModpackDownloader2.main(null);
//Progressbar
GUI.zahl = mods;
GUI.datei2 = zeile;
GUI c = new GUI();
c.progressnext();
}
}
}

View file

@ -3,7 +3,7 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package forgemodpackbuilder;
package ModpackDownloader;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;

View file

@ -3,8 +3,9 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package forgemodpackbuilder;
package ModpackDownloader;
import forgemodpackbuilder.GUI;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
@ -24,11 +25,11 @@ public class ModpackSuche {
public static void main(String[] args) throws IOException {
final URL url = new URL("https://www.dropbox.com/s/fjy9lnv5ga00hq4/Modpacks.txt?dl=1");
final URL url = new URL("http://localhost/modpacks.txt");
final URLConnection conn = url.openConnection();
try (InputStream is = new BufferedInputStream(conn.getInputStream())) {
final OutputStream os;
os = new BufferedOutputStream(new FileOutputStream("./modpack/Modpacks/Modpacks.txt"));
os = new BufferedOutputStream(new FileOutputStream("./modpack/modpacks.txt"));
byte[] chunk = new byte[1024];
int chunkSize;
while ((chunkSize = is.read(chunk)) != -1) {
@ -38,7 +39,7 @@ public class ModpackSuche {
os.close();
// Datei durchsuchen
FileReader fr = new FileReader("./modpack/Modpacks/Modpacks.txt");
FileReader fr = new FileReader("./modpack/modpacks.txt");
BufferedReader br = new BufferedReader(fr);
String zeile;

View file

@ -3,7 +3,7 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package forgemodpackbuilder;
package ModpackDownloader;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;;

View file

@ -3,12 +3,15 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package forgemodpackbuilder;
package ModpackDownloader;
import forgemodpackbuilder.GUI;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
@ -30,25 +33,45 @@ public class downloader1 {
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";
String total = "";
String version = "";
if (GUI.version.equals("1.10.2")) {
total = forge10;
version = forge10;
}
if (GUI.version.equals("1.9.4")) {
total = forge9;
version = forge9;
}
if (GUI.version.equals("1.8.9")) {
total = forge8;
version = forge8;
}
if (GUI.version.equals("1.7.10")) {
total = forge7;
version = forge7;
}
if (GUI.version.equals("Modpacks")) {
FileReader fr = new FileReader("./modpack/modpack.txt");
BufferedReader br = new BufferedReader(fr);
total = br.readLine();
System.out.println(total);
if (total.equals("1.10.2")) {
version = forge10;
}
if (total.equals("1.9.4")) {
version = forge9;
}
if (total.equals("1.8.9")) {
version = forge8;
}
if (total.equals("1.7.10")) {
version = forge7;
}
}
final URL url = new URL(total);
final URL url = new URL(version);
final URLConnection conn = url.openConnection();
try (InputStream is = new BufferedInputStream(conn.getInputStream())) {
final OutputStream os;
os = new BufferedOutputStream(new FileOutputStream("./modpack/" + GUI.version + "/" + total.substring(total.lastIndexOf("/") + 1)));
os = new BufferedOutputStream(new FileOutputStream("./modpack/forge.jar"));
byte[] chunk = new byte[1024];
int chunkSize;
while ((chunkSize = is.read(chunk)) != -1) {

View file

@ -3,8 +3,9 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package forgemodpackbuilder;
package Suche;
import forgemodpackbuilder.GUI;
import java.io.File;
/**
@ -13,7 +14,7 @@ import java.io.File;
*/
public class Suche {
static String name = "";
public static String name = "";
public static void main(String[] args) {

View file

@ -3,8 +3,9 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package forgemodpackbuilder;
package Suche;
import forgemodpackbuilder.GUI;
import java.io.File;
/**
@ -13,7 +14,7 @@ import java.io.File;
*/
public class Suche1 {
static String name = "";
public static String name = "";
public static void main(String[] args) {

View file

@ -3,7 +3,7 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package forgemodpackbuilder;
package Suche;
/**
*
@ -13,7 +13,7 @@ import java.io.File;
public class Suche2 {
static String filename;
public static String filename;
public static void main(String[] args) {

View file

@ -3,12 +3,13 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package forgemodpackbuilder;
package Suche;
/**
*
* @author simonr
*/
import forgemodpackbuilder.GUI;
import java.io.File;
public class Suche3 {

View file

@ -3,12 +3,13 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package forgemodpackbuilder;
package Zipper;
/**
*
* @author simonr
*/
import Zipper.Zip;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

View file

@ -3,8 +3,9 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package forgemodpackbuilder;
package Zipper;
import forgemodpackbuilder.GUI;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
@ -22,6 +23,7 @@ public class Modpacktxt {
FileWriter fw = new FileWriter(name + ".txt");
BufferedWriter bw = new BufferedWriter(fw);
bw.write(GUI.version);
for (int i = 0; i < GUI.mods1.size(); i++) {
bw.write(GUI.mods1.get(i).substring( GUI.mods1.get(i).lastIndexOf( "/" ) + 1 ));
bw.newLine();

View file

@ -3,7 +3,7 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package forgemodpackbuilder;
package Zipper;
import net.lingala.zip4j.core.ZipFile;
import net.lingala.zip4j.exception.ZipException;
@ -14,8 +14,8 @@ import net.lingala.zip4j.exception.ZipException;
*/
public class UnZip {
static String modpack = "";
static String modpack1 = "";
public static String modpack = "";
public static String modpack1 = "";
public static void main() {
String source = modpack;
String destination = modpack1;

View file

@ -3,7 +3,7 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package forgemodpackbuilder;
package Zipper;
/**
*

View file

@ -3,8 +3,10 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package forgemodpackbuilder;
package Zipper;
import Zipper.AktuellesDatumJava8;
import Zipper.Zip;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

View file

@ -34,10 +34,8 @@
<Component id="jComboBox1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="58" max="-2" attributes="0"/>
<Component id="jButton6" max="32767" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jButton4" min="-2" pref="154" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jButton3" min="-2" pref="157" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="158" max="-2" attributes="0"/>
<Component id="jButton5" min="-2" pref="177" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="1" max="-2" attributes="0">
@ -56,11 +54,11 @@
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane3" pref="421" max="32767" attributes="0"/>
<Component id="jScrollPane3" pref="569" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<Component id="jButton7" max="32767" attributes="0"/>
<Component id="jButton4" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jButton5" min="-2" pref="177" max="-2" attributes="0"/>
<Component id="jButton3" min="-2" pref="271" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
@ -75,10 +73,9 @@
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButton3" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButton4" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jComboBox1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButton6" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButton5" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
@ -86,10 +83,10 @@
<Group type="103" alignment="1" groupAlignment="3" attributes="0">
<Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButton5" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButton8" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jTextField1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButton7" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButton4" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButton3" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
@ -241,14 +238,6 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jTextField1ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="jButton7">
<Properties>
<Property name="text" type="java.lang.String" value="Bibliotheken download"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton7ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JProgressBar" name="jProgressBar1">
</Component>
</SubComponents>

View file

@ -5,6 +5,16 @@
*/
package forgemodpackbuilder;
import ModpackDownloader.ModpackSuche;
import DateiKopieren.DateiKopierenClass;
import DateiKopieren.FileDeleteExample;
import Zipper.frage;
import Zipper.UnZip;
import ModpackDownloader.ModpackDownloader;
import ModpackDownloader.downloader1;
import ModpackDownloader.downloader;
import Suche.Suche1;
import Suche.Suche;
import java.awt.event.KeyEvent;
import java.io.File;
import java.io.IOException;
@ -20,10 +30,13 @@ import javax.swing.JOptionPane;
*/
public class GUI extends javax.swing.JFrame {
static String datei = null;
static ArrayList<String> mods0 = new ArrayList<String>();
static ArrayList<String> mods1 = new ArrayList<String>();
static String version = "1.10.2";
public static String datei = null;
public static int zahl = 0;
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 int funktion = 0;
/**
* Creates new form GUI
@ -56,7 +69,6 @@ public class GUI extends javax.swing.JFrame {
jButton6 = new javax.swing.JButton();
jButton8 = new javax.swing.JButton();
jTextField1 = new javax.swing.JTextField();
jButton7 = new javax.swing.JButton();
jProgressBar1 = new javax.swing.JProgressBar();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
@ -139,13 +151,6 @@ public class GUI extends javax.swing.JFrame {
}
});
jButton7.setText("Bibliotheken download");
jButton7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton7ActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
@ -160,10 +165,8 @@ public class GUI extends javax.swing.JFrame {
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(58, 58, 58)
.addComponent(jButton6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(18, 18, 18)
.addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(158, 158, 158)
.addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
@ -179,11 +182,11 @@ public class GUI extends javax.swing.JFrame {
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 537, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 421, Short.MAX_VALUE)
.addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 569, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addComponent(jButton7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE)))))
.addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 271, javax.swing.GroupLayout.PREFERRED_SIZE)))))
.addContainerGap())
);
layout.setVerticalGroup(
@ -192,20 +195,19 @@ public class GUI extends javax.swing.JFrame {
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jButton3)
.addComponent(jButton4)
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton6))
.addComponent(jButton6)
.addComponent(jButton5))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton1)
.addComponent(jButton2)
.addComponent(jButton5)
.addComponent(jButton8)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton7)))
.addComponent(jButton4)
.addComponent(jButton3)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 478, Short.MAX_VALUE)
@ -232,7 +234,6 @@ public class GUI extends javax.swing.JFrame {
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
// TODO add your handling code here:
//jProgressBar1.setValue(10);
String s = (String) jComboBox1.getSelectedItem();
System.out.println(s);
version = s;
@ -275,23 +276,30 @@ public class GUI extends javax.swing.JFrame {
}//GEN-LAST:event_jButton2ActionPerformed
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
// TODO add your handling code here:
ProcExecExamples.funktion = 1;
try {
ProcExecExamples.main(null);
} catch (Exception ex) {
downloader.main(null);
funktion = 1;
ProcExec.main(null);
} catch (Throwable ex) {
Logger.getLogger(GUI.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jButton3ActionPerformed
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
// TODO add your handling code here:
ProcExecExamples.funktion = 2;
try {
ProcExecExamples.main(null);
} catch (Exception ex) {
// TODO add your handling code here:
File dir = new File(System.getProperty("user.home") + "/.minecraft");
dir.mkdir();
downloader1.main(null);
funktion = 2;
ProcExec.main(null);
} catch (Throwable ex) {
Logger.getLogger(GUI.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jButton4ActionPerformed
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
@ -323,22 +331,22 @@ public class GUI extends javax.swing.JFrame {
UnZip.modpack1 = datei;
UnZip.main();
} else {
ModpackDownloader.modpack = jList1.getSelectedValue();
JOptionPane.showMessageDialog(null, "Bitte geben sie einen Installationsort für das Modpack!");
OeffnenDialogClass.main(null);
System.out.println("GUI = " + datei);
File dir = new File(datei + "/mods");
dir.mkdir();
ModpackDownloader.install = datei;
System.out.println("Ausgewählt = " + jList1.getSelectedValue());
ModpackDownloader.zeile = jList1.getSelectedValue();
ModpackDownloader.main(null);
}
jButton3ActionPerformed(evt);
jButton4ActionPerformed(evt);
} catch (java.lang.NullPointerException ex) {
System.out.println("Keine Eingabe!!!");
} catch (IOException ex) {
System.out.println("Fehler!!!");
}
//jButton3ActionPerformed(evt);
}//GEN-LAST:event_jButton6ActionPerformed
private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
@ -363,21 +371,6 @@ public class GUI extends javax.swing.JFrame {
}//GEN-LAST:event_jTextField1ActionPerformed
private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
try {
// TODO add your handling code here:
downloader.main(null);
downloader1.main(null);
Suche3.main(null);
DateiKopierenClass1.main(null);
DateiKopierenClass2.main(null);
String file = "./modpack/modpack/" + GUI.datei.substring(GUI.datei.lastIndexOf("/") + 1);
new File(file).renameTo(new File("./modpack/modpack/forge.jar"));
} catch (Throwable ex) {
Logger.getLogger(GUI.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jButton7ActionPerformed
private void jList1KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jList1KeyPressed
// TODO add your handling code here:
if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
@ -386,52 +379,14 @@ public class GUI extends javax.swing.JFrame {
}
}//GEN-LAST:event_jList1KeyPressed
DefaultListModel dim2 = new DefaultListModel();
public void progressnext() {
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
jProgressBar1.setMaximum(zahl);
jProgressBar1.setValue(jProgressBar1.getValue() + 1);
jProgressBar1.setStringPainted(true);
jProgressBar1.setString(datei);
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(GUI.class
.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(GUI.class
.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(GUI.class
.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(GUI.class
.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(() -> {
System.out.println("Hallo Welt");
new GUI().setVisible(true);
File dir = new File("./modpack");
dir.mkdir();
System.out.println(System.getProperty("user.home"));
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
@ -440,7 +395,6 @@ public class GUI extends javax.swing.JFrame {
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton5;
private javax.swing.JButton jButton6;
private javax.swing.JButton jButton7;
private javax.swing.JButton jButton8;
private javax.swing.JComboBox<String> jComboBox1;
private javax.swing.JLabel jLabel1;

View file

@ -1,102 +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 forgemodpackbuilder;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
/**
*
* @author simonr
*/
public class ModpackDownloader {
static String install;
static String modpack = "Xerxes";
static ArrayList<String> text = new ArrayList<String>();
public static void main(String[] args) throws MalformedURLException, IOException {
final URL url = new URL("https://www.dropbox.com/s/n91j0wjb88s8341/URL.txt?dl=1");
final URLConnection conn = url.openConnection();
try (InputStream is = new BufferedInputStream(conn.getInputStream())) {
final OutputStream os;
os = new BufferedOutputStream(new FileOutputStream("./modpack/Modpacks/URL.txt"));
byte[] chunk = new byte[1024];
int chunkSize;
while ((chunkSize = is.read(chunk)) != -1) {
os.write(chunk, 0, chunkSize);
}
os.flush(); // Necessary for Java < 6
os.close();
//Modpack URL Suchen
FileReader fr = new FileReader("./modpack/Modpacks/URL.txt");
BufferedReader br = new BufferedReader(fr);
String zeile = "";
int b = 0;
while (!(zeile.equals(modpack))) {
zeile = br.readLine();
System.out.println(zeile);
text.add(zeile);
b++;
}
System.out.println(text.get(b - 2));
br.close();
//Modpack Installieren
ModpackDownloader2.URL = text.get(b - 2);
ModpackDownloader2.output = "./modpack/Modpacks/Modpack.txt";
ModpackDownloader2.main(null);
text.clear();
FileReader fr1 = new FileReader("./modpack/Modpacks/Modpack.txt");
BufferedReader br1 = new BufferedReader(fr1);
String zeile1 = "";
while ((zeile1 = br1.readLine()) != null) {
System.out.println(zeile1);
FileReader fr2 = new FileReader("./modpack/Modpacks/URL.txt");
BufferedReader br2 = new BufferedReader(fr2);
b = 0;
zeile = "";
while (!(zeile.equals(modpack))) {
zeile = br2.readLine();
System.out.println(zeile);
text.add(zeile);
b++;
}
br2.close();
ModpackDownloader2.URL = text.get(b - 2);
ModpackDownloader2.output = install + "/mods/" + zeile1;
ModpackDownloader2.main(null);
text.clear();
}
br1.close();
}
}
}

View file

@ -10,17 +10,15 @@ package forgemodpackbuilder;
* @author simonr
*/
public class ProcExecExamples {
public static int funktion = 1;
public class ProcExec {
public static void main(String[] args) throws Exception {
if (funktion == 1) {
if (GUI.funktion == 1) {
Runtime.getRuntime().exec("java -jar ./modpack/Minecraft.jar");
}
if (funktion == 2) {
Runtime.getRuntime().exec("java -jar ./modpack/modpack/forge.jar");
if (GUI.funktion == 2) {
Runtime.getRuntime().exec("java -jar ./modpack/forge.jar");
}
}
}

23
src/main.java Normal file
View file

@ -0,0 +1,23 @@
/*
* 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.
*/
import forgemodpackbuilder.GUI;
import java.io.File;
/**
*
* @author simonr
*/
public class main {
public static void main(String[] args) {
System.out.println("Hallo Welt");
new GUI().setVisible(true);
File dir = new File("./modpack");
dir.mkdir();
System.out.println(System.getProperty("user.home"));
}
}

65
test/NewJFrame.form Normal file
View file

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="3"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace pref="156" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="jProgressBar1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="134" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="180" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace pref="161" max="32767" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="43" max="-2" attributes="0"/>
<Component id="jProgressBar1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="47" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JProgressBar" name="jProgressBar1">
</Component>
<Component class="javax.swing.JButton" name="jButton1">
<Properties>
<Property name="text" type="java.lang.String" value="jButton1"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>

121
test/NewJFrame.java Normal file
View file

@ -0,0 +1,121 @@
/*
* 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.
*/
/**
*
* @author simonr
*/
public class NewJFrame extends javax.swing.JFrame {
/**
* Creates new form NewJFrame
*/
public NewJFrame() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jProgressBar1 = new javax.swing.JProgressBar();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jButton1.setText("jButton1");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap(156, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(134, 134, 134))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(jButton1)
.addGap(180, 180, 180))))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(161, Short.MAX_VALUE)
.addComponent(jButton1)
.addGap(43, 43, 43)
.addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(47, 47, 47))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
jProgressBar1.setMaximum(10);
jProgressBar1.setValue(jProgressBar1.getValue() + 1);
jProgressBar1.setStringPainted(true);
jProgressBar1.setString("hi");
}//GEN-LAST:event_jButton1ActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new NewJFrame().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JProgressBar jProgressBar1;
// End of variables declaration//GEN-END:variables
}