More comments

This commit is contained in:
Kristian Knarvik 2018-02-27 10:58:05 +01:00
parent 2476e379e5
commit cf0d1f7fff
2 changed files with 11 additions and 1 deletions

View File

@ -50,7 +50,6 @@ public class Main {
setup();
new ServerConsoles();
Profile.load();
ScheduledExecutorService exec = Executors.newSingleThreadScheduledExecutor();
exec.scheduleAtFixedRate(Main::updateConsoles, 10, 500, TimeUnit.MILLISECONDS);
} catch (Exception e) {

View File

@ -42,6 +42,11 @@ public class ServerType {
return serverTypes;
}
/**
* Gets a list of all server types' names.
*
* @return A list of strings
*/
public static String[] getTypeNames() {
ArrayList<ServerType> types = ServerType.getServerTypes();
String[] serverTypes = new String[types.size()];
@ -51,6 +56,12 @@ public class ServerType {
return serverTypes;
}
/**
* Gets a server type by name.
*
* @param name Then name of the server type
* @return A ServerType
*/
public static ServerType getByName(String name) {
for (ServerType serverType : serverTypes) {
if (serverType.getName().equals(name)) {