mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-22 21:43:41 +00:00
Allow timeout of /tpa /tpahere requests
Adds new config setting tpa-accept-cancellation Test #781
This commit is contained in:
parent
52b1017bda
commit
95d5217f58
15 changed files with 52 additions and 0 deletions
|
@ -27,6 +27,13 @@ public class Commandtpaccept extends EssentialsCommand
|
|||
throw new Exception(_("noPendingRequest"));
|
||||
}
|
||||
|
||||
long timeout = ess.getSettings().getTpaAcceptCancellation();
|
||||
if (timeout != 0 && (System.currentTimeMillis() - user.getTeleportRequestTime()) / 1000 > timeout)
|
||||
{
|
||||
user.requestTeleport(null, false);
|
||||
throw new Exception(_("requestTimedOut"));
|
||||
}
|
||||
|
||||
final Trade charge = new Trade(this.getName(), ess);
|
||||
if (user.isTeleportRequestHere())
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue