mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-14 21:22:09 +00:00
Optional second argument to /tpaccept, it will only accept the request if the sender matched that string.
This commit is contained in:
parent
c47c008871
commit
6a5fefb102
2 changed files with 6 additions and 1 deletions
|
@ -27,6 +27,11 @@ public class Commandtpaccept extends EssentialsCommand
|
||||||
throw new Exception(_("noPendingRequest"));
|
throw new Exception(_("noPendingRequest"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (args.length > 0 && !target.getName().contains(args[0]))
|
||||||
|
{
|
||||||
|
throw new Exception(_("noPendingRequest"));
|
||||||
|
}
|
||||||
|
|
||||||
long timeout = ess.getSettings().getTpaAcceptCancellation();
|
long timeout = ess.getSettings().getTpaAcceptCancellation();
|
||||||
if (timeout != 0 && (System.currentTimeMillis() - user.getTeleportRequestTime()) / 1000 > timeout)
|
if (timeout != 0 && (System.currentTimeMillis() - user.getTeleportRequestTime()) / 1000 > timeout)
|
||||||
{
|
{
|
||||||
|
|
|
@ -348,7 +348,7 @@ commands:
|
||||||
aliases: [etpaall]
|
aliases: [etpaall]
|
||||||
tpaccept:
|
tpaccept:
|
||||||
description: Accepts a teleport request.
|
description: Accepts a teleport request.
|
||||||
usage: /<command>
|
usage: /<command> [otherplayer]
|
||||||
aliases: [tpyes,etpaccept,etpyes]
|
aliases: [tpyes,etpaccept,etpyes]
|
||||||
tpahere:
|
tpahere:
|
||||||
description: Request that the specified player teleport to you.
|
description: Request that the specified player teleport to you.
|
||||||
|
|
Loading…
Reference in a new issue