Fix / clarify behaviour of matchPlayer.

This commit is contained in:
md_5
2015-09-05 13:42:33 +10:00
parent 59208aad86
commit 7ec1a1aa4e
2 changed files with 8 additions and 4 deletions

View File

@@ -660,13 +660,13 @@ public class BungeeCord extends ProxyServer
return Collections.singleton( exactMatch );
}
return Sets.newHashSet( Iterables.find( getPlayers(), new Predicate<ProxiedPlayer>()
return Sets.newHashSet( Iterables.filter( getPlayers(), new Predicate<ProxiedPlayer>()
{
@Override
public boolean apply(ProxiedPlayer input)
{
return ( input == null ) ? false : input.getName().toLowerCase().contains( partialName.toLowerCase() );
return ( input == null ) ? false : input.getName().toLowerCase().startsWith( partialName.toLowerCase() );
}
} ) );
}