mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-12 01:25:26 +02:00
Optional second argument to /tpaccept, it will only accept the request if the sender matched that string.
This commit is contained in:
@@ -26,6 +26,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.
|
||||||
|
Reference in New Issue
Block a user