mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-14 05:01:28 +00:00
[Fix] Fix vanished player matching in: /seen /give /burn /nuke /tpall /tpaall
This commit is contained in:
parent
35783ee429
commit
3bcd3390fe
1 changed files with 8 additions and 3 deletions
|
@ -47,9 +47,14 @@ public abstract class EssentialsCommand implements IEssentialsCommand
|
|||
{
|
||||
return getPlayer(server, user, args, pos, user.isAuthorized("essentials.vanish.interact"), false);
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -57,7 +62,7 @@ public abstract class EssentialsCommand implements IEssentialsCommand
|
|||
{
|
||||
return getPlayer(server, null, args, pos, getHidden, getOffline);
|
||||
}
|
||||
|
||||
|
||||
private User getPlayer(final Server server, final User sourceUser, final String[] args, final int pos, boolean getHidden, final boolean getOffline) throws NoSuchFieldException, NotEnoughArgumentsException
|
||||
{
|
||||
if (args.length <= pos)
|
||||
|
@ -75,7 +80,7 @@ public abstract class EssentialsCommand implements IEssentialsCommand
|
|||
{
|
||||
throw new PlayerNotFoundException();
|
||||
}
|
||||
if (!getHidden && user.isHidden() || user.equals(sourceUser))
|
||||
if (!getHidden && user.isHidden() && !user.equals(sourceUser))
|
||||
{
|
||||
throw new PlayerNotFoundException();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue