Add methods to get players / servers.
This commit is contained in:
parent
a946e988bf
commit
fe6b40a6a8
@ -1,6 +1,5 @@
|
|||||||
package net.md_5.bungee.api;
|
package net.md_5.bungee.api;
|
||||||
|
|
||||||
import net.md_5.bungee.api.connection.Connection;
|
|
||||||
import net.md_5.bungee.api.plugin.PluginManager;
|
import net.md_5.bungee.api.plugin.PluginManager;
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@ -8,6 +7,7 @@ import java.util.logging.Logger;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.md_5.bungee.api.config.ConfigurationAdapter;
|
import net.md_5.bungee.api.config.ConfigurationAdapter;
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
import net.md_5.bungee.api.connection.Server;
|
||||||
import net.md_5.bungee.api.plugin.Plugin;
|
import net.md_5.bungee.api.plugin.Plugin;
|
||||||
|
|
||||||
public abstract class ProxyServer
|
public abstract class ProxyServer
|
||||||
@ -58,6 +58,29 @@ public abstract class ProxyServer
|
|||||||
*/
|
*/
|
||||||
public abstract Collection<ProxiedPlayer> getPlayers();
|
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
|
* Get the {@link PluginManager} associated with loading plugins and
|
||||||
* dispatching events. It is recommended that implementations use the
|
* dispatching events. It is recommended that implementations use the
|
||||||
|
Loading…
Reference in New Issue
Block a user