First commit

This commit is contained in:
Kristian Knarvik 2018-01-18 23:18:45 +01:00
commit c44a76563c
4 changed files with 92 additions and 0 deletions

21
Main.java Normal file
View File

@ -0,0 +1,21 @@
import java.lang.Runtime;
import java.util.ArrayList;
public class Main {
public ArrayList<Server> servers;
public static void main(String[] args) {
}
public static void startServers() {
for (Server server : servers) {
if (server.isEnabled()) {
String path = server.getPath();
ServerType = this.type;
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec("java -Xmx" + $MemoryValue + " -Xms512M -jar " + '"' + $loc + "\\" + $Type + '" nogui');
}
}
}
}

1
README.md Normal file
View File

@ -0,0 +1 @@
# Minecraft-Server-Launcher

49
Server.java Normal file
View File

@ -0,0 +1,49 @@
import java.util.ArrayList;
public class Server {
private String name;
private String path;
private boolean enabled;
private ArrayList<String> playerList;
private ServerType type;
private String serverVersion;
public Server(String name) {
this.name = name;
this.path = "";
this.isEnabled = false;
this.playerList = new ArrayList<String>();
this.type = null;
this.serverVersion = null;
}
public void addPlayer(String name) {
this.playerList.add(name);
}
public void removePlayer(String name) {
for (int i = 0; i < playerList.size(); i++) {
if (name.equals(playerList.get(i))) {
playerList.remove(i);
return;
}
}
}
public String getPath() {
return this.path;
}
public ServerType getType() {
return this.type;
}
public String getVersion() {
return this.version;
}
public boolean isEnabled() {
return this.enabled;
}
}

21
ServerType.java Normal file
View File

@ -0,0 +1,21 @@
public class ServerType {
private String name;
private ArrayList<String> versions;
public ServerType(String name, ArrayList<String> versions) {
this.name = name;
this.versions = versions;
}
public String getName() {
return this.name;
}
public ArrayList<String> getVersions() {
return this.versions;
}
public boolean validVersion() {
}
}