import net.knarcraft.serverlauncher.profile.Profile; import net.knarcraft.serverlauncher.server.ServerType; import net.knarcraft.serverlauncher.userinterface.GUI; import net.knarcraft.serverlauncher.userinterface.ServerConsoles; import javax.naming.ConfigurationException; import java.awt.*; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; //Java 8 required. /** * A software for managing Minecraft servers. * * @author Kristian Knarvik * @version 0.0.0.1 * @since 0.0.0.1 */ class Main { public static void main(String[] args) { EventQueue.invokeLater(() -> { try { setup(); new GUI(); //new ServerConsoles(); Profile.addProfile("Default"); //TODO: replace with profiles loading generating a default profile if empty. ScheduledExecutorService exec = Executors.newSingleThreadScheduledExecutor(); exec.scheduleAtFixedRate(() -> { //TODO: Read from consoles and insert into ServerConsoles. }, 0, 5, TimeUnit.SECONDS); } catch (Exception e) { e.printStackTrace(); } }); } private static void setup() { try { ServerType.loadServerTypes(); } catch (ConfigurationException e) { e.printStackTrace(); System.exit(1); } } }