Add methods to get players / servers.

This commit is contained in:
md_5 2013-01-12 14:43:21 +11:00
parent a946e988bf
commit fe6b40a6a8

View File

@ -1,6 +1,5 @@
package net.md_5.bungee.api;
import net.md_5.bungee.api.connection.Connection;
import net.md_5.bungee.api.plugin.PluginManager;
import com.google.common.base.Preconditions;
import java.util.Collection;
@ -8,6 +7,7 @@ import java.util.logging.Logger;
import lombok.Getter;
import net.md_5.bungee.api.config.ConfigurationAdapter;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.connection.Server;
import net.md_5.bungee.api.plugin.Plugin;
public abstract class ProxyServer
@ -58,6 +58,29 @@ public abstract class ProxyServer
*/
public abstract Collection<ProxiedPlayer> getPlayers();
/**
* Gets a connected player via their unique username.
*
* @param name of the player
* @return their player instance
*/
public abstract ProxiedPlayer getPlayer(String name);
/**
* Get a server by its name.
*
* @param name the name to lookup
* @return the associated server
*/
public abstract Server getServer(String name);
/**
* Return all servers configured as proxy targets.
*
* @return all known target servers
*/
public abstract Collection<Server> getServers();
/**
* Get the {@link PluginManager} associated with loading plugins and
* dispatching events. It is recommended that implementations use the