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,8 +79,13 @@ public class Server {
} }
public void setServerVersion(String serverVersion) { public void setServerVersion(String serverVersion) {
String[] versions = this.type.getVersions();
for (String version : versions) {
if (version.equals(serverVersion)) {
this.serverVersion = serverVersion; this.serverVersion = serverVersion;
} }
}
}
public void setMaxRam(String ram) { public void setMaxRam(String ram) {
this.maxRam = ram; this.maxRam = ram;

View File

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