mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-06 04:23:02 +00:00
Prevent multiple tpa requests in a row. Resolves #59
This commit is contained in:
parent
5540683013
commit
3245ce10ac
26 changed files with 35 additions and 0 deletions
|
@ -27,6 +27,12 @@ public class Commandtpa extends EssentialsCommand {
|
|||
if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.worlds." + player.getWorld().getName())) {
|
||||
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())
|
||||
&& player.isTpRequestHere() == false) { // Make sure the last teleport request was actually tpa and not tpahere
|
||||
throw new Exception(tl("requestSentAlready", player.getDisplayName()));
|
||||
}
|
||||
|
||||
if (!player.isIgnoredPlayer(user)) {
|
||||
player.requestTeleport(user, false);
|
||||
player.sendMessage(tl("teleportRequest", user.getDisplayName()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue