Added option to hide player from /list /who ... login message.

This is for other plugins, that want to hide a player.
Use IEssentials.getUser(Player p).setHidden(boolean)
This commit is contained in:
snowleo 2011-07-18 03:42:21 +02:00
parent e3a470e264
commit be83383fd5
10 changed files with 107 additions and 9 deletions

View file

@ -53,12 +53,18 @@ public abstract class EssentialsCommand implements IEssentialsCommand
for (Player p : matches)
{
if (p.getDisplayName().startsWith(args[pos]))
final User u = ess.getUser(p);
if (u.getDisplayName().startsWith(args[pos]) && (getOffline || !u.isHidden()))
{
return ess.getUser(p);
return u;
}
}
return ess.getUser(matches.get(0));
final User u = ess.getUser(matches.get(0));
if (!getOffline && u.isHidden())
{
throw new NoSuchFieldException(Util.i18n("playerNotFound"));
}
return u;
}
@Override