From 6a5fefb102bde081b3eb2f04f72a256c6f8ed293 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 29 Jan 2012 04:59:30 +0000 Subject: Optional second argument to /tpaccept, it will only accept the request if the sender matched that string. --- Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java | 5 +++++ Essentials/src/plugin.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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: / + usage: / [otherplayer] aliases: [tpyes,etpaccept,etpyes] tpahere: description: Request that the specified player teleport to you. -- cgit v1.2.3