mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 22:16:08 +00:00
Make getting warp lists async due to blocking event
This commit is contained in:
1 parent
4db869abf1
commit
2c5486dd35
2 files changed
+2
-2
No files matched your search
@@ -21,7 +21,7 @@ public class WarpCommand extends CommandBase implements TabCompletable, ConsoleE
|
||||
@Override
|
||||
public void onExecute(@NotNull OnlineUser onlineUser, @NotNull String[] args) {
|
||||
switch (args.length) {
|
||||
case 0 -> plugin.getDatabase().getWarps().thenAccept(warps -> {
|
||||
case 0 -> plugin.getDatabase().getWarps().thenAcceptAsync(warps -> {
|
||||
if (warps.isEmpty()) {
|
||||
plugin.getLocales().getLocale("error_no_warps_set").ifPresent(onlineUser::sendMessage);
|
||||
return;
|
||||
|
||||
@@ -48,7 +48,7 @@ public class WarpListCommand extends CommandBase implements ConsoleExecutable {
|
||||
}
|
||||
|
||||
// Dispatch the warp list event
|
||||
plugin.getDatabase().getWarps().thenAccept(warps -> {
|
||||
plugin.getDatabase().getWarps().thenAcceptAsync(warps -> {
|
||||
if (warps.isEmpty()) {
|
||||
plugin.getLocales().getLocale("error_no_warps_set").ifPresent(onlineUser::sendMessage);
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user