Remove getServer from the api - long depreceated
This commit is contained in:
parent
f93b647df3
commit
3e28decef2
@ -79,20 +79,6 @@ public abstract class ProxyServer
|
||||
*/
|
||||
public abstract ProxiedPlayer getPlayer(String name);
|
||||
|
||||
/**
|
||||
* Get a server by its name. The instance returned will be taken from a
|
||||
* player currently on that server to facilitate abstract proxy -> server
|
||||
* actions.
|
||||
*
|
||||
* @param name the name to lookup
|
||||
* @return the associated server
|
||||
* @deprecated in most cases the {@link #getServerInfo(java.lang.String)}
|
||||
* method should be used, as it will return a server even when no players
|
||||
* are online.
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract Server getServer(String name);
|
||||
|
||||
/**
|
||||
* Return all servers registered to this proxy, keyed by name. Unlike the
|
||||
* methods in {@link ConfigurationAdapter#getServers()}, this will not
|
||||
|
@ -391,13 +391,6 @@ public class BungeeCord extends ProxyServer
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Server getServer(String name)
|
||||
{
|
||||
Collection<ProxiedPlayer> users = getServers().get( name ).getPlayers();
|
||||
return ( users != null && !users.isEmpty() ) ? users.iterator().next().getServer() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, ServerInfo> getServers()
|
||||
{
|
||||
|
@ -79,10 +79,11 @@ public class BungeeServerInfo implements ServerInfo
|
||||
return address.hashCode();
|
||||
}
|
||||
|
||||
// TODO: Don't like this method
|
||||
@Override
|
||||
public void sendData(String channel, byte[] data)
|
||||
{
|
||||
Server server = ProxyServer.getInstance().getServer( getName() );
|
||||
Server server = ( players.isEmpty() ) ? null : players.iterator().next().getServer();
|
||||
if ( server != null )
|
||||
{
|
||||
server.sendData( channel, data );
|
||||
|
Loading…
Reference in New Issue
Block a user