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
|
* @version 0.0.0.1
|
||||||
* @since 0.0.0.1
|
* @since 0.0.0.1
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("SpellCheckingInspection")
|
|
||||||
class Main {
|
class Main {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
setup();
|
setup();
|
||||||
|
@ -49,9 +49,15 @@ public class ServerType {
|
|||||||
*/
|
*/
|
||||||
public static void loadServerTypes() throws ConfigurationException {
|
public static void loadServerTypes() throws ConfigurationException {
|
||||||
if (serverTypes.isEmpty()) {
|
if (serverTypes.isEmpty()) {
|
||||||
try (Scanner in = new Scanner(new File("config/servertypes.csv"))) {
|
Scanner file;
|
||||||
while (in.hasNextLine()) {
|
try {
|
||||||
String[] str = in.nextLine().split(";", -1);
|
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;
|
int len = str.length;
|
||||||
String[] ver;
|
String[] ver;
|
||||||
if (str[1].contains(",")) {
|
if (str[1].contains(",")) {
|
||||||
@ -70,11 +76,6 @@ public class ServerType {
|
|||||||
throw new ConfigurationException("Error: Configuration file invalid.");
|
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 {
|
} else {
|
||||||
throw new ConfigurationException("Error: Configuration already loaded.");
|
throw new ConfigurationException("Error: Configuration already loaded.");
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
package net.knarcraft.serverlauncher.userinterface;
|
package net.knarcraft.serverlauncher.userinterface;
|
||||||
|
|
||||||
|
import javax.imageio.ImageIO;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.border.EmptyBorder;
|
import javax.swing.border.EmptyBorder;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A class for creating the gui.
|
* A class for creating the gui.
|
||||||
@ -15,18 +17,17 @@ public class GUI {
|
|||||||
public GUI() {
|
public GUI() {
|
||||||
try {
|
try {
|
||||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException | UnsupportedLookAndFeelException | InstantiationException | IllegalAccessException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (InstantiationException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (UnsupportedLookAndFeelException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
JFrame frame = new JFrame("Minecraft server launcher");
|
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.setIconImage(img.getImage());
|
||||||
frame.setLocation(0,0);
|
frame.setLocation(0,0);
|
||||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
|
Loading…
Reference in New Issue
Block a user