Skip to content

Commit

Permalink
Arg catchers
Browse files Browse the repository at this point in the history
  • Loading branch information
NinjaMandalorian committed Apr 18, 2023
1 parent 6168428 commit 35da505
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public SiegeCommands(final Main plugin) {
public boolean onCommand(final CommandSender sender, final Command cmd, final String label, final String[] args) {
if (args.length == 0) {
sender.sendMessage(String.valueOf(Helper.Chatlabel()) + "Invalid Arguments. /siege help");
return true;
}

// Start
Expand Down Expand Up @@ -61,6 +62,11 @@ private static void siegeStart(CommandSender sender, String[] args) {
if (!(sender instanceof Player)) return;
final Player player = (Player) sender;

if (args.length < 3) {
sender.sendMessage(Helper.Chatlabel() + "/war siege [war] [town]");
return;
}

// War check
War war = WarData.getWar(args[1]);
if (war == null) {
Expand Down Expand Up @@ -129,6 +135,11 @@ private static void siegeAbandon(CommandSender sender, String[] args) {
if (!(sender instanceof Player)) return;
final Player p = (Player) sender;

if (args.length < 2) {
sender.sendMessage(Helper.Chatlabel() + "/war abandon [town]");
return;
}

Siege siege = SiegeData.getSiege(args[1]);
if (siege == null) {
p.sendMessage(Helper.Chatlabel() + "Invalid siege");
Expand Down

0 comments on commit 35da505

Please sign in to comment.