Add server version check

This commit is contained in:
Kristian Knarvik 2018-01-25 11:49:01 +01:00
parent 0c2c26e153
commit 3c3a6a3efa
2 changed files with 8 additions and 3 deletions

View File

@ -79,7 +79,12 @@ public class Server {
}
public void setServerVersion(String serverVersion) {
this.serverVersion = serverVersion;
String[] versions = this.type.getVersions();
for (String version : versions) {
if (version.equals(serverVersion)) {
this.serverVersion = serverVersion;
}
}
}
public void setMaxRam(String ram) {

View File

@ -43,13 +43,13 @@ public class ServerTest {
if (server.isEnabled()) {
String path = server.getPath();
String type = server.getType();
/* try {
try {
server.downloadJar();
System.out.println("File downloaded.");
} catch (FileNotFoundException e) {
System.out.println("File was not found.");
return;
}*/
}
String ram = server.maxRam();
Runtime rt = Runtime.getRuntime();
try {