show hidden for /whois

This commit is contained in:
snowleo 2011-07-19 00:09:30 +02:00
parent 6dbb5bc605
commit 548666b79b

View File

@ -22,13 +22,25 @@ public class Commandwhois extends EssentialsCommand
{ {
throw new NotEnoughArgumentsException(); throw new NotEnoughArgumentsException();
} }
boolean showhidden = false;
if (sender instanceof Player)
{
if (ess.getUser(sender).isAuthorized("essentials.list.hidden"))
{
showhidden = true;
}
}
else
{
showhidden = true;
}
String whois = args[0].toLowerCase(); String whois = args[0].toLowerCase();
charge(sender); charge(sender);
int prefixLength = ChatColor.stripColor(ess.getSettings().getNicknamePrefix()).length(); int prefixLength = ChatColor.stripColor(ess.getSettings().getNicknamePrefix()).length();
for (Player p : server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
User u = ess.getUser(p); User u = ess.getUser(p);
if (u.isHidden()) if (u.isHidden() && !showhidden)
{ {
continue; continue;
} }