Jar compiling is now possible
This commit is contained in:
parent
1fafab78b6
commit
55c7c8defd
2
bin/artifacts/Minecraft_Server_Launcher_jar/run.bat
Normal file
2
bin/artifacts/Minecraft_Server_Launcher_jar/run.bat
Normal file
@ -0,0 +1,2 @@
|
||||
java -jar Minecraft-Server-Launcher.jar
|
||||
pause
|
@ -0,0 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
Main-Class: Main
|
||||
|
3
src/META-INF/MANIFEST.MF
Normal file
3
src/META-INF/MANIFEST.MF
Normal file
@ -0,0 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
Main-Class: Main
|
||||
|
@ -11,7 +11,7 @@ import javax.naming.ConfigurationException;
|
||||
* @version 0.0.0.1
|
||||
* @since 0.0.0.1
|
||||
*/
|
||||
@SuppressWarnings("SpellCheckingInspection")
|
||||
|
||||
class Main {
|
||||
public static void main(String[] args) {
|
||||
setup();
|
||||
|
@ -49,9 +49,15 @@ public class ServerType {
|
||||
*/
|
||||
public static void loadServerTypes() throws ConfigurationException {
|
||||
if (serverTypes.isEmpty()) {
|
||||
try (Scanner in = new Scanner(new File("config/servertypes.csv"))) {
|
||||
while (in.hasNextLine()) {
|
||||
String[] str = in.nextLine().split(";", -1);
|
||||
Scanner file;
|
||||
try {
|
||||
file = new Scanner(new File("config/servertypes.csv"));
|
||||
} catch (FileNotFoundException e) {
|
||||
file = new Scanner(ServerType.class.getResourceAsStream("/config/servertypes.csv"));
|
||||
}
|
||||
|
||||
while (file.hasNextLine()) {
|
||||
String[] str = file.nextLine().split(";", -1);
|
||||
int len = str.length;
|
||||
String[] ver;
|
||||
if (str[1].contains(",")) {
|
||||
@ -70,11 +76,6 @@ public class ServerType {
|
||||
throw new ConfigurationException("Error: Configuration file invalid.");
|
||||
}
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
throw new ConfigurationException("Error: Configuration file not found.");
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
throw new ConfigurationException("Error: Configuration file invalid.");
|
||||
}
|
||||
} else {
|
||||
throw new ConfigurationException("Error: Configuration already loaded.");
|
||||
}
|
||||
|
@ -1,8 +1,10 @@
|
||||
package net.knarcraft.serverlauncher.userinterface;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import java.awt.*;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* A class for creating the gui.
|
||||
@ -15,18 +17,17 @@ public class GUI {
|
||||
public GUI() {
|
||||
try {
|
||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InstantiationException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
} catch (UnsupportedLookAndFeelException e) {
|
||||
} catch (ClassNotFoundException | UnsupportedLookAndFeelException | InstantiationException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
JFrame frame = new JFrame("Minecraft server launcher");
|
||||
ImageIcon img = new ImageIcon("files/GUIIcon.png");
|
||||
ImageIcon img;
|
||||
try {
|
||||
img = new ImageIcon(ImageIO.read(GUI.class.getResourceAsStream("/files/GUIIcon.png")));
|
||||
} catch (IOException | IllegalArgumentException e) {
|
||||
img = new ImageIcon("files/GUIIcon.png");
|
||||
}
|
||||
frame.setIconImage(img.getImage());
|
||||
frame.setLocation(0,0);
|
||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
Loading…
Reference in New Issue
Block a user