mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-03 06:28:49 +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
@@ -186,7 +186,8 @@ public class TeleportManager {
|
||||
public CompletableFuture<Optional<TeleportResult>> teleportPlayerToPlayerByName(@NotNull String playerName,
|
||||
@NotNull String targetPlayer,
|
||||
@NotNull OnlineUser requester) {
|
||||
final Optional<Position> localPositionTarget = plugin.findPlayer(targetPlayer).map(OnlineUser::getPosition);
|
||||
final Optional<OnlineUser> localPlayer = plugin.findPlayer(playerName);
|
||||
final Optional<Position> localPositionTarget = localPlayer.map(OnlineUser::getPosition);
|
||||
if (localPositionTarget.isPresent()) {
|
||||
return teleportPlayerByName(playerName, localPositionTarget.get(), requester);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user