summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-03-24 21:07:49 +0000
committerKHobbits <rob@khobbits.co.uk>2012-03-24 21:08:45 +0000
commit7ca2b65c4f85957ca8c054fca1890a5dfd1fbe4e (patch)
tree0e5bd2d518593852d1e9af0ba523c565d5beb9c0
parenta8cbb5c8f53bed7cdd71bdcb39b93b2d8aa84a32 (diff)
downloadEssentials-7ca2b65c4f85957ca8c054fca1890a5dfd1fbe4e.tar
Essentials-7ca2b65c4f85957ca8c054fca1890a5dfd1fbe4e.tar.gz
Essentials-7ca2b65c4f85957ca8c054fca1890a5dfd1fbe4e.tar.lz
Essentials-7ca2b65c4f85957ca8c054fca1890a5dfd1fbe4e.tar.xz
Essentials-7ca2b65c4f85957ca8c054fca1890a5dfd1fbe4e.zip
New permission check: essentials.list.hidden is now required to /getpos hidden players.
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java18
1 files changed, 10 insertions, 8 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java b/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java
index c61702e59..c985ef725 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java
@@ -12,21 +12,23 @@ public class Commandgetpos extends EssentialsCommand
{
super("getpos");
}
-
+
@Override
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"))
{
final User otherUser = getPlayer(server, args, 0);
- outputPosition(user, otherUser.getLocation(), user.getLocation());
- }
- else
- {
- outputPosition(user, user.getLocation(), null);
+ if (!otherUser.isHidden() || user.isAuthorized("essentials.list.hidden"))
+ {
+ outputPosition(user, otherUser.getLocation(), user.getLocation());
+ return;
+ }
+
}
+ outputPosition(user, user.getLocation(), null);
}
-
+
@Override
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);
outputPosition(sender, user.getLocation(), null);
}
-
+
//TODO: Translate
private void outputPosition(final CommandSender sender, final Location coords, final Location distance)
{