Minecraft-Server-Launcher/Server.java

49 lines
892 B
Java
Raw Normal View History

2018-01-18 23:18:45 +01:00
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;
}
}