[Fix] Fix vanished player matching in: /seen /give /burn /nuke /tpall /tpaall

This commit is contained in:
KHobbits 2013-05-26 01:47:28 +01:00
parent 35783ee429
commit 3bcd3390fe

View file

@ -50,6 +50,11 @@ public abstract class EssentialsCommand implements IEssentialsCommand
protected User getPlayer(final Server server, final CommandSender sender, final String[] args, final int pos) throws NoSuchFieldException, NotEnoughArgumentsException protected User getPlayer(final Server server, final CommandSender sender, final String[] args, final int pos) throws NoSuchFieldException, NotEnoughArgumentsException
{ {
if (sender instanceof Player)
{
User user = ess.getUser(sender);
return getPlayer(server, user, args, pos);
}
return getPlayer(server, null, args, pos, true, false); return getPlayer(server, null, args, pos, true, false);
} }
@ -75,7 +80,7 @@ public abstract class EssentialsCommand implements IEssentialsCommand
{ {
throw new PlayerNotFoundException(); throw new PlayerNotFoundException();
} }
if (!getHidden && user.isHidden() || user.equals(sourceUser)) if (!getHidden && user.isHidden() && !user.equals(sourceUser))
{ {
throw new PlayerNotFoundException(); throw new PlayerNotFoundException();
} }