mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 06:28:49 +00:00
edit home, warp commands, manager methods that accept warps/homes
This commit is contained in:
11 files changed
+299
-443
No files matched your search
@@ -4,6 +4,7 @@ import net.william278.huskhomes.HuskHomes;
|
||||
import net.william278.huskhomes.position.Warp;
|
||||
import net.william278.huskhomes.user.CommandUser;
|
||||
import net.william278.huskhomes.user.OnlineUser;
|
||||
import net.william278.huskhomes.util.ValidationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
@@ -29,7 +30,12 @@ public class DelWarpCommand extends SavedPositionCommand<Warp> {
|
||||
.ifPresent(user::sendMessage);
|
||||
return;
|
||||
}
|
||||
plugin.getManager().warps().deleteWarp(warp.getName());
|
||||
try {
|
||||
plugin.getManager().warps().deleteWarp(warp);
|
||||
} catch (ValidationException e) {
|
||||
e.dispatchWarpError(executor, plugin, warp.getName());
|
||||
return;
|
||||
}
|
||||
plugin.getLocales().getLocale("warp_deleted", warp.getName())
|
||||
.ifPresent(executor::sendMessage);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user