Reduce future join call usage

This commit is contained in:
William committed 2022-09-24 22:00:48 +01:00
1 parent 8a4ed7c565
commit 649d4c0600
18 files changed
+316 -291

No files matched your search

@@ -6,8 +6,6 @@ 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) {
@@ -17,7 +15,7 @@ public class SetWarpCommand extends CommandBase {
@Override
public void onExecute(@NotNull OnlineUser onlineUser, @NotNull String[] args) {
if (args.length == 1) {
CompletableFuture.runAsync(() -> setWarp(onlineUser, args[0]));
setWarp(onlineUser, args[0]);
} else {
plugin.getLocales().getLocale("error_invalid_syntax", "/setwarp <name>")
.ifPresent(onlineUser::sendMessage);