if (TownySettings.isUsingEconomy() && (!resident.canPayFromHoldings(cost)))
throw new TownyException(String.format(TownySettings.getLangString("msg_no_funds_claim"), selection.size(), TownyEconomyObject.getFormattedBalance(cost)));
// Start the claim task
new PlotClaim(plugin, player, resident, selection, PlotClaim.Action.CLAIM).start();
} else {
player.sendMessage(TownySettings.getLangString("msg_err_empty_area_selection"));
}
} else if (split[0].equalsIgnoreCase("unclaim")) {
if (plugin.getTownyUniverse().isWarTime())
throw new TownyException(TownySettings.getLangString("msg_war_cannot_do"));
if (split.length == 2 && split[1].equalsIgnoreCase("all")) {
// Start the unclaim task
new PlotClaim(plugin, player, resident, null, PlotClaim.Action.UNCLAIM).start();
} else {
List<WorldCoord> selection = TownyUtil.selectWorldCoordArea(resident, new WorldCoord(world, Coord.parseCoord(player)), StringMgmt.remFirstArg(split));
selection = TownyUtil.filterOwnedBlocks(resident, selection);
if (selection.size() > 0) {
// Start the unclaim task
new PlotClaim(plugin, player, resident, selection, PlotClaim.Action.UNCLAIM).start();
} else {
player.sendMessage(TownySettings.getLangString("msg_err_empty_area_selection"));
}
}