mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 22:16:22 +00:00
Fetch home lists asynchronously due to new event
This commit is contained in:
1 parent
a5d8b6ff35
commit
10b7f1629f
2 files changed
+2
-2
No files matched your search
@@ -25,7 +25,7 @@ public class HomeCommand extends CommandBase implements TabCompletable, ConsoleE
|
|||||||
@Override
|
@Override
|
||||||
public void onExecute(@NotNull OnlineUser onlineUser, @NotNull String[] args) {
|
public void onExecute(@NotNull OnlineUser onlineUser, @NotNull String[] args) {
|
||||||
switch (args.length) {
|
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
|
// Send the home list if they have homes set. If they have just one home set, teleport the player
|
||||||
switch (homes.size()) {
|
switch (homes.size()) {
|
||||||
case 0 -> plugin.getLocales().getLocale("error_no_homes_set").ifPresent(onlineUser::sendMessage);
|
case 0 -> plugin.getLocales().getLocale("error_no_homes_set").ifPresent(onlineUser::sendMessage);
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class HomeListCommand extends CommandBase implements ConsoleExecutable {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
plugin.getDatabase().getHomes(userData.user()).thenAccept(homes -> {
|
plugin.getDatabase().getHomes(userData.user()).thenAcceptAsync(homes -> {
|
||||||
if (homes.isEmpty()) {
|
if (homes.isEmpty()) {
|
||||||
if (!onlineUser.uuid.equals(userData.user().uuid)) {
|
if (!onlineUser.uuid.equals(userData.user().uuid)) {
|
||||||
plugin.getLocales().getLocale("error_no_homes_set_other",
|
plugin.getLocales().getLocale("error_no_homes_set_other",
|
||||||
|
|||||||
Reference in new issue
Block a user