mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-03 02:55:46 +00:00
New permission check: essentials.list.hidden is now required to /getpos hidden players.
This commit is contained in:
parent
a8cbb5c8f5
commit
7ca2b65c4f
1 changed files with 10 additions and 8 deletions
|
@ -12,21 +12,23 @@ public class Commandgetpos extends EssentialsCommand
|
||||||
{
|
{
|
||||||
super("getpos");
|
super("getpos");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
||||||
{
|
{
|
||||||
if (args.length > 0 && user.isAuthorized("essentials.getpos.others"))
|
if (args.length > 0 && user.isAuthorized("essentials.getpos.others"))
|
||||||
{
|
{
|
||||||
final User otherUser = getPlayer(server, args, 0);
|
final User otherUser = getPlayer(server, args, 0);
|
||||||
outputPosition(user, otherUser.getLocation(), user.getLocation());
|
if (!otherUser.isHidden() || user.isAuthorized("essentials.list.hidden"))
|
||||||
}
|
{
|
||||||
else
|
outputPosition(user, otherUser.getLocation(), user.getLocation());
|
||||||
{
|
return;
|
||||||
outputPosition(user, user.getLocation(), null);
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
outputPosition(user, user.getLocation(), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||||
{
|
{
|
||||||
|
@ -37,7 +39,7 @@ public class Commandgetpos extends EssentialsCommand
|
||||||
final User user = getPlayer(server, args, 0);
|
final User user = getPlayer(server, args, 0);
|
||||||
outputPosition(sender, user.getLocation(), null);
|
outputPosition(sender, user.getLocation(), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Translate
|
//TODO: Translate
|
||||||
private void outputPosition(final CommandSender sender, final Location coords, final Location distance)
|
private void outputPosition(final CommandSender sender, final Location coords, final Location distance)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue