mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-06 04:23:02 +00:00
Check for timeout in /tpa
and /tpaccept
. Fixes #818.
This commit adds a method called hasOutstandingTeleportRequest() in IUser - implemented fully in User.
This commit is contained in:
parent
6ade8132af
commit
ad94cca95b
5 changed files with 28 additions and 4 deletions
|
@ -28,7 +28,7 @@ public class Commandtpa extends EssentialsCommand {
|
|||
throw new Exception(tl("noPerm", "essentials.worlds." + player.getWorld().getName()));
|
||||
}
|
||||
// Don't let sender request teleport twice to the same player.
|
||||
if (user.getConfigUUID().equals(player.getTeleportRequest())
|
||||
if (user.getConfigUUID().equals(player.getTeleportRequest()) && player.hasOutstandingTeleportRequest() // Check timeout
|
||||
&& player.isTpRequestHere() == false) { // Make sure the last teleport request was actually tpa and not tpahere
|
||||
throw new Exception(tl("requestSentAlready", player.getDisplayName()));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue