Add yet another way to get a user from our users list, Don't teleport an offline player when jailed

Added playerjoin to jaillistener to teleport a player on login
This commit is contained in:
ementalo 2011-07-18 22:16:58 +01:00
parent 7aea8a3fce
commit 81cc5b1f28
6 changed files with 38 additions and 4 deletions

View file

@ -41,6 +41,15 @@ public abstract class EssentialsCommand implements IEssentialsCommand
protected User getPlayer(Server server, String[] args, int pos, boolean getOffline) throws NoSuchFieldException, NotEnoughArgumentsException
{
if (args.length <= pos) throw new NotEnoughArgumentsException();
User user = ess.getAllUsers().get(args[pos]);
if (user != null)
{
if(user.isHidden())
{
throw new NoSuchFieldException(Util.i18n("playerNotFound"));
}
return user;
}
List<Player> matches = server.matchPlayer(args[pos]);
if (matches.size() < 1)