diff options
author | KHobbits <rob@khobbits.co.uk> | 2012-01-29 04:59:30 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2012-01-29 04:59:30 +0000 |
commit | 6a5fefb102bde081b3eb2f04f72a256c6f8ed293 (patch) | |
tree | 1a16cb10a100b5659f01f9e6558d3921c3958ed7 | |
parent | c47c00887185f0701cc0926f2644ca3a7578dcf5 (diff) | |
download | Essentials-6a5fefb102bde081b3eb2f04f72a256c6f8ed293.tar Essentials-6a5fefb102bde081b3eb2f04f72a256c6f8ed293.tar.gz Essentials-6a5fefb102bde081b3eb2f04f72a256c6f8ed293.tar.lz Essentials-6a5fefb102bde081b3eb2f04f72a256c6f8ed293.tar.xz Essentials-6a5fefb102bde081b3eb2f04f72a256c6f8ed293.zip |
Optional second argument to /tpaccept, it will only accept the request if the sender matched that string.
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java | 5 | ||||
-rw-r--r-- | Essentials/src/plugin.yml | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java index 0cece3310..2e3e024a3 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java @@ -26,6 +26,11 @@ public class Commandtpaccept extends EssentialsCommand { throw new Exception(_("noPendingRequest")); } + + if (args.length > 0 && !target.getName().contains(args[0])) + { + throw new Exception(_("noPendingRequest")); + } long timeout = ess.getSettings().getTpaAcceptCancellation(); if (timeout != 0 && (System.currentTimeMillis() - user.getTeleportRequestTime()) / 1000 > timeout) diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index 7d8db28bb..0ec1ee6d9 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -348,7 +348,7 @@ commands: aliases: [etpaall] tpaccept: description: Accepts a teleport request. - usage: /<command> + usage: /<command> [otherplayer] aliases: [tpyes,etpaccept,etpyes] tpahere: description: Request that the specified player teleport to you. |