mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 06:28:49 +00:00
Bump to v3.1, rewrite Teleport/TimedTeleport and add TeleportBuilder, expose new Teleport API, remove TeleportManager, minor database utility refactoring
This commit is contained in:
1 parent
e7f8298b12
commit
9630e53613
35 files changed
+1070
-881
No files matched your search
@@ -20,20 +20,22 @@ public class TpaHereCommand extends CommandBase implements TabCompletable {
|
||||
@Override
|
||||
public void onExecute(@NotNull OnlineUser onlineUser, @NotNull String[] args) {
|
||||
if (args.length == 1) {
|
||||
plugin.getRequestManager().sendTeleportRequest(onlineUser, args[0], TeleportRequest.RequestType.TPA_HERE).thenAccept(sent -> {
|
||||
if (sent.isEmpty()) {
|
||||
if (plugin.findPlayer(args[0]).isPresent()) {
|
||||
plugin.getLocales().getLocale("error_teleport_request_self")
|
||||
plugin.getRequestManager()
|
||||
.sendTeleportRequest(onlineUser, args[0], TeleportRequest.RequestType.TPA_HERE)
|
||||
.thenAccept(sent -> {
|
||||
if (sent.isEmpty()) {
|
||||
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("tpahere_request_sent", sent.get().getRecipientName())
|
||||
.ifPresent(onlineUser::sendMessage);
|
||||
return;
|
||||
}
|
||||
plugin.getLocales().getLocale("error_player_not_found", args[0])
|
||||
.ifPresent(onlineUser::sendMessage);
|
||||
return;
|
||||
}
|
||||
plugin.getLocales().getLocale("tpahere_request_sent", sent.get().getRecipientName())
|
||||
.ifPresent(onlineUser::sendMessage);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
plugin.getLocales().getLocale("error_invalid_syntax", "/tpahere <player>")
|
||||
.ifPresent(onlineUser::sendMessage);
|
||||
|
||||
Reference in new issue
Block a user