Download von Modpacks und erstellen von Modpacks Online

This commit is contained in:
Simon Rieger 2016-10-19 01:34:00 +02:00
parent 90bae0c04a
commit cae7bb411d
12 changed files with 342 additions and 60 deletions

View file

@ -24,9 +24,10 @@
<Layout> <Layout>
<DimensionLayout dim="0"> <DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Component id="jProgressBar1" max="32767" attributes="0"/>
<Group type="102" attributes="0"> <Group type="102" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="0"/> <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/> <EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
@ -39,8 +40,8 @@
<Component id="jButton3" min="-2" pref="157" max="-2" attributes="0"/> <Component id="jButton3" min="-2" pref="157" max="-2" attributes="0"/>
</Group> </Group>
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" max="-2" attributes="0"> <Group type="103" groupAlignment="1" max="-2" attributes="0">
<Group type="102" attributes="0"> <Group type="102" alignment="0" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="0"/> <Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="jButton2" min="-2" max="-2" attributes="0"/> <Component id="jButton2" min="-2" max="-2" attributes="0"/>
@ -51,7 +52,7 @@
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/> <Component id="jButton1" min="-2" max="-2" attributes="0"/>
</Group> </Group>
<Component id="jScrollPane1" min="-2" pref="537" max="-2" attributes="0"/> <Component id="jScrollPane1" alignment="0" pref="537" max="32767" attributes="0"/>
</Group> </Group>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
@ -96,7 +97,8 @@
<Component id="jScrollPane1" pref="478" max="32767" attributes="0"/> <Component id="jScrollPane1" pref="478" max="32767" attributes="0"/>
<Component id="jScrollPane3" max="32767" attributes="0"/> <Component id="jScrollPane3" max="32767" attributes="0"/>
</Group> </Group>
<EmptySpace min="-2" pref="26" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="jProgressBar1" min="-2" max="-2" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -199,11 +201,12 @@
<Component class="javax.swing.JComboBox" name="jComboBox1"> <Component class="javax.swing.JComboBox" name="jComboBox1">
<Properties> <Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="4"> <StringArray count="5">
<StringItem index="0" value="1.10.2"/> <StringItem index="0" value="Modpacks"/>
<StringItem index="1" value="1.9.4"/> <StringItem index="1" value="1.10.2"/>
<StringItem index="2" value="1.8.9"/> <StringItem index="2" value="1.9.4"/>
<StringItem index="3" value="1.7.10"/> <StringItem index="3" value="1.8.9"/>
<StringItem index="4" value="1.7.10"/>
</StringArray> </StringArray>
</Property> </Property>
</Properties> </Properties>
@ -246,5 +249,7 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton7ActionPerformed"/> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton7ActionPerformed"/>
</Events> </Events>
</Component> </Component>
<Component class="javax.swing.JProgressBar" name="jProgressBar1">
</Component>
</SubComponents> </SubComponents>
</Form> </Form>

View file

@ -8,6 +8,7 @@ package forgemodpackbuilder;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.swing.DefaultListModel; import javax.swing.DefaultListModel;
@ -20,8 +21,8 @@ import javax.swing.JOptionPane;
public class GUI extends javax.swing.JFrame { public class GUI extends javax.swing.JFrame {
static String datei = null; static String datei = null;
static String[] mods1 = new String[300]; static ArrayList<String> mods0 = new ArrayList<String>();
static String[] mods2 = new String[300]; static ArrayList<String> mods1 = new ArrayList<String>();
static String version = "1.10.2"; static String version = "1.10.2";
/** /**
@ -56,6 +57,7 @@ public class GUI extends javax.swing.JFrame {
jButton8 = new javax.swing.JButton(); jButton8 = new javax.swing.JButton();
jTextField1 = new javax.swing.JTextField(); jTextField1 = new javax.swing.JTextField();
jButton7 = new javax.swing.JButton(); jButton7 = new javax.swing.JButton();
jProgressBar1 = new javax.swing.JProgressBar();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("ForgeModpackBuilder"); setTitle("ForgeModpackBuilder");
@ -109,7 +111,7 @@ public class GUI extends javax.swing.JFrame {
} }
}); });
jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "1.10.2", "1.9.4", "1.8.9", "1.7.10" })); jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Modpacks", "1.10.2", "1.9.4", "1.8.9", "1.7.10" }));
jComboBox1.addActionListener(new java.awt.event.ActionListener() { jComboBox1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) { public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBox1ActionPerformed(evt); jComboBox1ActionPerformed(evt);
@ -151,6 +153,7 @@ public class GUI extends javax.swing.JFrame {
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jProgressBar1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addComponent(jLabel1) .addComponent(jLabel1)
.addGap(4, 4, 4) .addGap(4, 4, 4)
@ -162,8 +165,8 @@ public class GUI extends javax.swing.JFrame {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addGroup(layout.createSequentialGroup() .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(jLabel2) .addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton2) .addComponent(jButton2)
@ -173,7 +176,7 @@ public class GUI extends javax.swing.JFrame {
.addComponent(jButton8) .addComponent(jButton8)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton1)) .addComponent(jButton1))
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 537, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 537, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .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, 421, Short.MAX_VALUE)
@ -207,7 +210,8 @@ public class GUI extends javax.swing.JFrame {
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 478, Short.MAX_VALUE) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 478, Short.MAX_VALUE)
.addComponent(jScrollPane3)) .addComponent(jScrollPane3))
.addGap(26, 26, 26)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
); );
pack(); pack();
@ -228,24 +232,46 @@ public class GUI extends javax.swing.JFrame {
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
// TODO add your handling code here: // TODO add your handling code here:
//jProgressBar1.setValue(10);
String s = (String) jComboBox1.getSelectedItem();
System.out.println(s);
version = s;
try {
if (!version.equals("Modpacks")) {
File dir = new File("./modpack/" + version);
dir.mkdir();
dir = new File("./modpack/" + version + "/mods");
dir.mkdir();
}
File dir = new File("./modpack/modpack"); File dir = new File("./modpack/modpack");
dir.mkdir(); dir.mkdir();
dir = new File("./modpack/modpack/mods"); dir = new File("./modpack/modpack/mods");
dir.mkdir(); dir.mkdir();
for (int i = 0; i < 200; i++) { mods0.clear();
mods1[i] = null; mods1.clear();
mods2[i] = null; if (version.equals("Modpacks")) {
ModpackSuche.main(null);
} else {
Suche.main(null);
} }
Suche.main(mods1); Suche1.main(null);
Suche1.main(mods2); System.out.println("Tabelle 1 Mods = " + mods0.size());
DefaultListModel dim = new DefaultListModel(); DefaultListModel dim = new DefaultListModel();
DefaultListModel dim1 = new DefaultListModel(); DefaultListModel dim1 = new DefaultListModel();
for (int i = 0; i < 200; i++) { for (int i = 0; i < mods0.size(); i++) {
dim.addElement(mods1[i]); dim.addElement(mods0.get(i));
dim1.addElement(mods2[i]); }
System.out.println("Tabelle 2 Mods = " + mods1.size());
for (int i = 0; i < mods1.size(); i++) {
dim1.addElement(mods1.get(i));
} }
jList1.setModel(dim); jList1.setModel(dim);
jList2.setModel(dim1); jList2.setModel(dim1);
} catch (java.lang.NullPointerException ex) {
System.out.println("VerbindungsFehler 404!!!");
} catch (IOException ex) {
System.out.println("Fehler!!!");
}
}//GEN-LAST:event_jButton2ActionPerformed }//GEN-LAST:event_jButton2ActionPerformed
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
@ -278,13 +304,6 @@ public class GUI extends javax.swing.JFrame {
private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed
// TODO add your handling code here: // TODO add your handling code here:
String s = (String) jComboBox1.getSelectedItem();
System.out.println(s);
version = s;
File dir = new File("./modpack/" + version);
dir.mkdir();
dir = new File("./modpack/" + version + "/mods");
dir.mkdir();
jButton2ActionPerformed(evt); jButton2ActionPerformed(evt);
}//GEN-LAST:event_jComboBox1ActionPerformed }//GEN-LAST:event_jComboBox1ActionPerformed
@ -292,6 +311,7 @@ public class GUI extends javax.swing.JFrame {
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
// TODO add your handling code here: // TODO add your handling code here:
try { try {
if (!version.equals("Modpacks")) {
JOptionPane.showMessageDialog(null, "Bitte geben sie den Pfad zu dem Modpack ein!"); JOptionPane.showMessageDialog(null, "Bitte geben sie den Pfad zu dem Modpack ein!");
OeffnenDialogClass.main(null); OeffnenDialogClass.main(null);
OeffnenDialogClass a = new OeffnenDialogClass(); OeffnenDialogClass a = new OeffnenDialogClass();
@ -302,9 +322,21 @@ public class GUI extends javax.swing.JFrame {
System.out.println("GUI = " + datei); System.out.println("GUI = " + datei);
UnZip.modpack1 = datei; UnZip.modpack1 = datei;
UnZip.main(); 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;
ModpackDownloader.main(null);
}
jButton4ActionPerformed(evt); jButton4ActionPerformed(evt);
} catch (java.lang.NullPointerException ex) { } catch (java.lang.NullPointerException ex) {
System.out.println("Keine Eingabe"); System.out.println("Keine Eingabe!!!");
}catch (IOException ex) {
System.out.println("Fehler!!!");
} }
//jButton3ActionPerformed(evt); //jButton3ActionPerformed(evt);
}//GEN-LAST:event_jButton6ActionPerformed }//GEN-LAST:event_jButton6ActionPerformed
@ -336,7 +368,7 @@ public class GUI extends javax.swing.JFrame {
// TODO add your handling code here: // TODO add your handling code here:
downloader.main(null); downloader.main(null);
downloader1.main(null); downloader1.main(null);
VerzeichnisDurchsuchen3.main(null); Suche3.main(null);
DateiKopierenClass1.main(null); DateiKopierenClass1.main(null);
DateiKopierenClass2.main(null); DateiKopierenClass2.main(null);
String file = "./modpack/modpack/" + GUI.datei.substring(GUI.datei.lastIndexOf("/") + 1); String file = "./modpack/modpack/" + GUI.datei.substring(GUI.datei.lastIndexOf("/") + 1);
@ -415,6 +447,7 @@ public class GUI extends javax.swing.JFrame {
private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel2;
private javax.swing.JList<String> jList1; private javax.swing.JList<String> jList1;
private javax.swing.JList<String> jList2; private javax.swing.JList<String> jList2;
private javax.swing.JProgressBar jProgressBar1;
private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane3; private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField1;

View file

@ -0,0 +1,102 @@
/*
* 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

@ -0,0 +1,44 @@
/*
* 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.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
/**
*
* @author simonr
*/
public class ModpackDownloader2 {
static String URL;
static String output;
public static void main(String[] args) throws MalformedURLException, IOException {
final URL url = new URL(URL);
final URLConnection conn = url.openConnection();
try (InputStream is = new BufferedInputStream(conn.getInputStream())) {
final OutputStream os;
os = new BufferedOutputStream(new FileOutputStream(output));
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();
}
}
}

View file

@ -0,0 +1,58 @@
/*
* 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.URL;
import java.net.URLConnection;
/**
*
* @author simonr
*/
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 URLConnection conn = url.openConnection();
try (InputStream is = new BufferedInputStream(conn.getInputStream())) {
final OutputStream os;
os = new BufferedOutputStream(new FileOutputStream("./modpack/Modpacks/Modpacks.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();
// Datei durchsuchen
FileReader fr = new FileReader("./modpack/Modpacks/Modpacks.txt");
BufferedReader br = new BufferedReader(fr);
String zeile;
while ((zeile = br.readLine()) != null) {
GUI.mods0.add(zeile);
}
System.out.println("Zeilen = " + GUI.mods0.size());
for (int i = 0; i < GUI.mods0.size(); i++) {
System.out.println(GUI.mods0.get(i));
}
br.close();
}
}
}

View file

@ -0,0 +1,32 @@
/*
* 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.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
/**
*
* @author simonr
*/
public class Modpacktxt {
static String name;
public static void main(String[] args) throws IOException {
FileWriter fw = new FileWriter(name + ".txt");
BufferedWriter bw = new BufferedWriter(fw);
for (int i = 0; i < GUI.mods1.size(); i++) {
bw.write(GUI.mods1.get(i).substring( GUI.mods1.get(i).lastIndexOf( "/" ) + 1 ));
bw.newLine();
}
bw.close();
}
}

View file

@ -28,8 +28,7 @@ public class Suche {
if (fileThatYouWantToFilter.startsWith(name) if (fileThatYouWantToFilter.startsWith(name)
&& fileThatYouWantToFilter.endsWith(".jar")) { && fileThatYouWantToFilter.endsWith(".jar")) {
System.out.println("found" + " " + fileThatYouWantToFilter); System.out.println("found" + " " + fileThatYouWantToFilter);
GUI.mods1[i] = "./modpack/" + GUI.version + "/mods/" + fileThatYouWantToFilter; GUI.mods0.add("./modpack/" + GUI.version + "/mods/" + fileThatYouWantToFilter);
i++;
} }
} }
} }

View file

@ -28,8 +28,7 @@ public class Suche1 {
if (fileThatYouWantToFilter.startsWith(name) if (fileThatYouWantToFilter.startsWith(name)
&& fileThatYouWantToFilter.endsWith(".jar")) { && fileThatYouWantToFilter.endsWith(".jar")) {
System.out.println("found" + " " + fileThatYouWantToFilter); System.out.println("found" + " " + fileThatYouWantToFilter);
GUI.mods2[i] = "./modpack/modpack/mods/" + fileThatYouWantToFilter; GUI.mods1.add("./modpack/modpack/mods/" + fileThatYouWantToFilter);
i++;
} }
} }
} }

View file

@ -11,7 +11,7 @@ package forgemodpackbuilder;
*/ */
import java.io.File; import java.io.File;
public class VerzeichnisDurchsuchen2 { public class Suche2 {
static String filename; static String filename;

View file

@ -11,7 +11,7 @@ package forgemodpackbuilder;
*/ */
import java.io.File; import java.io.File;
public class VerzeichnisDurchsuchen3 { public class Suche3 {
public static void main(String[] args) { public static void main(String[] args) {

View file

@ -5,6 +5,10 @@
*/ */
package forgemodpackbuilder; package forgemodpackbuilder;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
/** /**
* *
* @author simonr * @author simonr
@ -80,6 +84,12 @@ public class frage extends javax.swing.JFrame {
Zip a = new Zip(); Zip a = new Zip();
a.modpack = name; a.modpack = name;
a.archiveDir(null); a.archiveDir(null);
Modpacktxt.name = name;
try {
Modpacktxt.main(null);
} catch (IOException ex) {
Logger.getLogger(frage.class.getName()).log(Level.SEVERE, null, ex);
}
this.dispose(); this.dispose();
}//GEN-LAST:event_jButton1ActionPerformed }//GEN-LAST:event_jButton1ActionPerformed