mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 14:38:53 +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
|
@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().getWarps().thenAccept(warps -> {
|
case 0 -> plugin.getDatabase().getWarps().thenAcceptAsync(warps -> {
|
||||||
if (warps.isEmpty()) {
|
if (warps.isEmpty()) {
|
||||||
plugin.getLocales().getLocale("error_no_warps_set").ifPresent(onlineUser::sendMessage);
|
plugin.getLocales().getLocale("error_no_warps_set").ifPresent(onlineUser::sendMessage);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class WarpListCommand extends CommandBase implements ConsoleExecutable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Dispatch the warp list event
|
// Dispatch the warp list event
|
||||||
plugin.getDatabase().getWarps().thenAccept(warps -> {
|
plugin.getDatabase().getWarps().thenAcceptAsync(warps -> {
|
||||||
if (warps.isEmpty()) {
|
if (warps.isEmpty()) {
|
||||||
plugin.getLocales().getLocale("error_no_warps_set").ifPresent(onlineUser::sendMessage);
|
plugin.getLocales().getLocale("error_no_warps_set").ifPresent(onlineUser::sendMessage);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in new issue
Block a user