Resident resident = TownyUniverse.getDataSource().getResident(player.getName());
Town town = resident.getTown();
Nation nation = town.getNation();
if (!resident.isKing())
throw new TownyException(TownySettings.getLangString("msg_not_king"));
if (plugin.isPermissions() && (!TownyUniverse.getPermissionSource().hasPermission(player, PermissionNodes.TOWNY_NATION_DELETE.getNode())))
throw new TownyException(TownySettings.getLangString("msg_err_command_disable"));
TownyUniverse.getDataSource().removeNation(nation);
TownyMessaging.sendGlobalMessage(TownySettings.getDelNationMsg(nation));
} catch (TownyException x) {
TownyMessaging.sendErrorMsg(player, x.getMessage());
return;
}
else
try {
if (!TownyUniverse.getPermissionSource().isTownyAdmin(player))
throw new TownyException(TownySettings.getLangString("msg_err_admin_only_delete_nation"));
Nation nation = TownyUniverse.getDataSource().getNation(split[0]);
TownyUniverse.getDataSource().removeNation(nation);
TownyMessaging.sendGlobalMessage(TownySettings.getDelNationMsg(nation));
} catch (TownyException x) {
TownyMessaging.sendErrorMsg(player, x.getMessage());