summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIaccidentally <coryhuckaby@gmail.com>2012-11-11 14:34:56 -0500
committerIaccidentally <coryhuckaby@gmail.com>2012-11-11 14:34:56 -0500
commitfbb3d7344f46ae813c6e8f3ec9d36329d785af86 (patch)
treefd91302dc467c7fc2d676b66fbf31b14589ee911
parent8b660d32ac0885b7b29885ea1c3ed96cce07ec18 (diff)
downloadEssentials-fbb3d7344f46ae813c6e8f3ec9d36329d785af86.tar
Essentials-fbb3d7344f46ae813c6e8f3ec9d36329d785af86.tar.gz
Essentials-fbb3d7344f46ae813c6e8f3ec9d36329d785af86.tar.lz
Essentials-fbb3d7344f46ae813c6e8f3ec9d36329d785af86.tar.xz
Essentials-fbb3d7344f46ae813c6e8f3ec9d36329d785af86.zip
update tptoggle to allow toggling other players :: new permission: essentials.tptoggle.others
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java b/Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java
index 1fc4c2aa4..6a17de81a 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java
@@ -15,8 +15,26 @@ public class Commandtptoggle extends EssentialsCommand
@Override
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
+ User otherUser = null;
+ if (args.length > 0 && user.isAuthorized("essentials.tptoggle.others"))
+ {
+ otherUser = ess.getUser(server.getPlayer(args[0]));
+ if (otherUser == null)
+ {
+ throw new Exception(_("playerNotFound"));
+ }
+ else
+ {
+ ess.getUser(server.getPlayer(args[0])).sendMessage(user.toggleTeleportEnabled()
+ ? _("teleportationEnabled")
+ : _("teleportationDisabled"));
+ }
+ }
+ else
+ {
user.sendMessage(user.toggleTeleportEnabled()
? _("teleportationEnabled")
: _("teleportationDisabled"));
+ }
}
}