mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-03-02 11:11:58 +01:00
[Fix] Fix vanished player matching in: /seen /give /burn /nuke /tpall /tpaall
This commit is contained in:
parent
35783ee429
commit
3bcd3390fe
@ -47,9 +47,14 @@ public abstract class EssentialsCommand implements IEssentialsCommand
|
|||||||
{
|
{
|
||||||
return getPlayer(server, user, args, pos, user.isAuthorized("essentials.vanish.interact"), false);
|
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
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,7 +62,7 @@ public abstract class EssentialsCommand implements IEssentialsCommand
|
|||||||
{
|
{
|
||||||
return getPlayer(server, null, args, pos, getHidden, getOffline);
|
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
|
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)
|
if (args.length <= pos)
|
||||||
@ -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();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user