Add method to get a connected player via their UUID

This commit is contained in:
Keir Nellyer
2014-04-09 20:25:15 +01:00
committed by md_5
parent 18316eb5f8
commit a642346a2c
2 changed files with 29 additions and 0 deletions

View File

@@ -442,6 +442,26 @@ public class BungeeCord extends ProxyServer
}
}
public ProxiedPlayer getPlayer(UUID uuid)
{
connectionLock.readLock().lock();
try
{
for ( ProxiedPlayer proxiedPlayer : connections.values() )
{
if ( proxiedPlayer.getUniqueId().equals( uuid ) )
{
return proxiedPlayer;
}
}
return null;
} finally
{
connectionLock.readLock().unlock();
}
}
@Override
public Map<String, ServerInfo> getServers()
{