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
@@ -22,10 +22,17 @@ public class TpaCommand extends CommandBase implements TabCompletable {
|
||||
if (args.length == 1) {
|
||||
plugin.getRequestManager().sendTeleportRequest(onlineUser, args[0], TeleportRequest.RequestType.TPA).thenAccept(sent -> {
|
||||
if (!sent) {
|
||||
plugin.getLocales().getLocale("error_player_not_found", args[0]).ifPresent(onlineUser::sendMessage);
|
||||
if (plugin.findPlayer(args[0]).isPresent()) {
|
||||
plugin.getLocales().getLocale("error_teleport_request_self")
|
||||
.ifPresent(onlineUser::sendMessage);
|
||||
return;
|
||||
}
|
||||
plugin.getLocales().getLocale("error_player_not_found", args[0])
|
||||
.ifPresent(onlineUser::sendMessage);
|
||||
return;
|
||||
}
|
||||
plugin.getLocales().getLocale("tpa_request_sent", args[0]).ifPresent(onlineUser::sendMessage);
|
||||
plugin.getLocales().getLocale("tpa_request_sent", args[0])
|
||||
.ifPresent(onlineUser::sendMessage);
|
||||
});
|
||||
} else {
|
||||
plugin.getLocales().getLocale("error_invalid_syntax", "/tpa <player>")
|
||||
|
||||
Reference in new issue
Block a user