mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 22:16:08 +00:00
Reduce future join call usage
This commit is contained in:
1 parent
8a4ed7c565
commit
649d4c0600
18 files changed
+316
-291
No files matched your search
@@ -54,9 +54,8 @@ public class RtpCommand extends CommandBase implements ConsoleExecutable {
|
||||
|
||||
final OnlineUser userToTeleport = target;
|
||||
final boolean isExecutorTeleporting = userToTeleport.uuid.equals(onlineUser.uuid);
|
||||
CompletableFuture.runAsync(() -> {
|
||||
plugin.getDatabase().getUserData(onlineUser.uuid).thenAccept(userData -> {
|
||||
// Check the user is not still on /rtp cooldown
|
||||
final Optional<UserData> userData = plugin.getDatabase().getUserData(onlineUser.uuid).join();
|
||||
if (userData.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user