package org.mcphoton.impl.command;

import org.mcphoton.command.Command;
import org.mcphoton.impl.server.Main;
import org.mcphoton.messaging.Messageable;

public class ListCommand implements Command {
	

	@Override
	public void execute(Messageable source, String[] args) {
		
		switch(Main.serverInstance.getOnlinePlayers().size()) {
		case 0:
			source.sendMessage("No player is connected.");
			break;
		case 1:
			source.sendMessage("There is 1 of " + Main.serverInstance.getMaxPlayers() + " player connected.");
			break;
		default:
			source.sendMessage("There are " + Main.serverInstance.getOnlinePlayers().size() + " of " + Main.serverInstance.getMaxPlayers() + " players connected.");
			break;
		}
	}

	@Override
	public String getName() {
		return "list";
	}

}

@@ -1,8 +1,899 @@
+/*%0A * Copyright (c) 2016 MCPhoton %3Chttp://mcphoton.org%3E and contributors.%0A *%0A * This file is part of the Photon Server Implementation %3Chttps://github.com/mcphoton/Photon-Server%3E.%0A *%0A * The Photon Server Implementation is free software: you can redistribute it and/or modify%0A * it under the terms of the GNU Affero General Public License as published by%0A * the Free Software Foundation, either version 3 of the License, or%0A * (at your option) any later version.%0A *%0A * The Photon Server Implementation is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the%0A * GNU Affero General Public License for more details.%0A *%0A * You should have received a copy of the GNU Affero General Public License%0A * along with this program. If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A */%0A
 package 

Fix problem with a build error.