mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 06:28:49 +00:00
Fixed blocking calls to #getPosition causing crashes in rare cases
This commit is contained in:
1 parent
25d90530d3
commit
46c36f3b34
4 files changed
+114
-104
No files matched your search
@@ -6,6 +6,8 @@ import net.william278.huskhomes.position.PositionMeta;
|
||||
import net.william278.huskhomes.util.Permission;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class SetWarpCommand extends CommandBase {
|
||||
|
||||
protected SetWarpCommand(@NotNull HuskHomes implementor) {
|
||||
@@ -15,7 +17,7 @@ public class SetWarpCommand extends CommandBase {
|
||||
@Override
|
||||
public void onExecute(@NotNull OnlineUser onlineUser, @NotNull String[] args) {
|
||||
if (args.length == 1) {
|
||||
setWarp(onlineUser, args[0]);
|
||||
CompletableFuture.runAsync(() -> setWarp(onlineUser, args[0]));
|
||||
} else {
|
||||
plugin.getLocales().getLocale("error_invalid_syntax", "/setwarp <name>")
|
||||
.ifPresent(onlineUser::sendMessage);
|
||||
|
||||
Reference in new issue
Block a user