mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 22:16:08 +00:00
Prevent sending teleport requests to self, send message on /tpall
This commit is contained in:
1 parent
312bff2efc
commit
98931c1900
7 files changed
+41
-18
No files matched your search
@@ -83,6 +83,9 @@ public class RequestManager {
|
||||
Instant.now().getEpochSecond() + plugin.getSettings().teleportRequestExpiryTime);
|
||||
final Optional<OnlineUser> localTarget = plugin.findPlayer(targetUser);
|
||||
if (localTarget.isPresent()) {
|
||||
if (localTarget.get().uuid.equals(requester.uuid)) {
|
||||
return CompletableFuture.completedFuture(false);
|
||||
}
|
||||
request.recipientName = localTarget.get().username;
|
||||
return CompletableFuture.supplyAsync(() -> sendLocalTeleportRequest(request, localTarget.get()));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user