From 10b7f1629ffd253839852978ac2c5e9d7201a51b Mon Sep 17 00:00:00 2001 From: William278 Date: Mon, 5 Sep 2022 01:04:39 +0300 Subject: [PATCH] Fetch home lists asynchronously due to new event --- .../main/java/net/william278/huskhomes/command/HomeCommand.java | 2 +- .../java/net/william278/huskhomes/command/HomeListCommand.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/net/william278/huskhomes/command/HomeCommand.java b/common/src/main/java/net/william278/huskhomes/command/HomeCommand.java index 057ad820..716180f0 100644 --- a/common/src/main/java/net/william278/huskhomes/command/HomeCommand.java +++ b/common/src/main/java/net/william278/huskhomes/command/HomeCommand.java @@ -25,7 +25,7 @@ public class HomeCommand extends CommandBase implements TabCompletable, ConsoleE @Override public void onExecute(@NotNull OnlineUser onlineUser, @NotNull String[] args) { switch (args.length) { - case 0 -> plugin.getDatabase().getHomes(onlineUser).thenAccept(homes -> { + case 0 -> plugin.getDatabase().getHomes(onlineUser).thenAcceptAsync(homes -> { // Send the home list if they have homes set. If they have just one home set, teleport the player switch (homes.size()) { case 0 -> plugin.getLocales().getLocale("error_no_homes_set").ifPresent(onlineUser::sendMessage); diff --git a/common/src/main/java/net/william278/huskhomes/command/HomeListCommand.java b/common/src/main/java/net/william278/huskhomes/command/HomeListCommand.java index 565a68ec..5c1589cb 100644 --- a/common/src/main/java/net/william278/huskhomes/command/HomeListCommand.java +++ b/common/src/main/java/net/william278/huskhomes/command/HomeListCommand.java @@ -64,7 +64,7 @@ public class HomeListCommand extends CommandBase implements ConsoleExecutable { return; } } - plugin.getDatabase().getHomes(userData.user()).thenAccept(homes -> { + plugin.getDatabase().getHomes(userData.user()).thenAcceptAsync(homes -> { if (homes.isEmpty()) { if (!onlineUser.uuid.equals(userData.user().uuid)) { plugin.getLocales().getLocale("error_no_homes_set_other",