def ids_loader(gamePlatform, gameVersionNumber, namespace=u"minecraft", json_dict=False, timestamps=False):
    """Load the whole files from mcver directory.
    :game_version: str/unicode: the game version for which the resources will be loaded.
    :namespace: unicode: the name to be put in front of some IDs. default to 'minecraft'.
    :json_dict: bool: Whether to return a ran dict from the JSon file(s) instead of the (MCEDIT_DEFS, MCEDIT_IDS) pair.
    :timestamp: bool: wheter the return also the loaded file timestamp."""
    log.info("Loading resources for MC {} {}".format(gamePlatform, gameVersionNumber))
    global MCEDIT_DEFS
    global MCEDIT_IDS
    MCEDIT_DEFS = {}
    MCEDIT_IDS = {}
    if json_dict:
        _json = {}
    if timestamps:
        _timestamps = {}
    d = os.path.join('mcver', gamePlatform, gameVersionNumber)

    # If version 1.2.4 files are not found, try to load the one for the closest
    # lower version (like 1.2.3 or 1.2).
    if not os.path.isdir(d) and gameVersionNumber != "Unknown":
        log.info("No definitions found for MC {} {}. Trying to find ones for the closest lower version.".format(gamePlatform, gameVersionNumber))
        ver_dirs = os.listdir(os.path.join('mcver', gamePlatform))
        ver_dirs.append(gameVersionNumber)
        ver_dirs.sort(key=LooseVersion)
        idx = ver_dirs.index(gameVersionNumber) - 1
        ver = ver_dirs[idx]
        d = os.path.join('mcver', gamePlatform, ver)
        log.info("Closest lower version found is MC {} {}.".format(gamePlatform, ver))

    if os.path.isdir(d):
        for file_name in os.listdir(d):
            if os.path.splitext(file_name)[-1].lower() == '.json':
                log.info("Found %s" % file_name)
                path_name = os.path.join(d, file_name)
                data = _get_data(path_name)
                if timestamps:
                    _timestamps[path_name] = os.stat(path_name).st_mtime
                if data:
                    # We use here names coming from the 'minecraft:name_of_the_stuff' ids
                    # The second part of the name is present in the first file used (for MC 1.11) in the 'idStr' value).
                    # The keys of MCEDIT_DEFS are built by concatenating the file base name and the idStr
                    # References to MCEDIT_DEFS elements are stored in MCEDIT_IDS dict.
                    # If an element "load" is defined in the JSON data, it must be a string corresponding to another game version.
                    # The corresponding file will be loaded before parsing the data.
                    log.info("Loading...")
                    prefix = os.path.splitext(file_name)[0]
                    deps = []
                    r = ''
                    _data = {}
                    first = True
                    while type(r) in (str, unicode):
                        if first:
                            r = _parse_data(data, prefix, namespace, MCEDIT_DEFS, MCEDIT_IDS)
                            if json_dict:
                                _json.update(data)
                            first = False
                        else:
                            r = _parse_data(_data, prefix, namespace, MCEDIT_DEFS, MCEDIT_IDS)
                            if json_dict:
                                _json.update(_data)
                        if isinstance(r, (str, unicode)):
                            v = gameVersionNumber
                            if len(deps):
                                v = deps[-1]
                            log.info("Found dependency for %s %s"%(v, prefix))
                            deps.append(r)
                            _data = _get_data(os.path.join('mcver', gamePlatform, r, file_name))
                        else:
                            defs, ids = r
                            MCEDIT_DEFS.update(defs)
                            MCEDIT_IDS.update(ids)
                    if deps:
                        deps.reverse()
                        log.info("Loading definitions dependencies")
                        _data = {}
                        for dep in deps:
                            _file_name = os.path.join('mcver', gamePlatform, dep, file_name)
                            if os.path.exists(_file_name):
                                log.info("Found %s"%_file_name)
                                #_data.update(_get_data(_file_name))
                                update(_data, _get_data(_file_name))
                                if timestamps:
                                    _timestamps[_file_name] = os.stat(_file_name).st_mtime
                            else:
                                log.info("Could not find %s"%_file_name)
                        update(_data, data)
                        #_data.update(data)
                        _defs, _ids = _parse_data(_data, prefix, namespace, MCEDIT_DEFS, MCEDIT_IDS, ignore_load=True)
                        update(MCEDIT_DEFS, _defs)
                        update(MCEDIT_IDS, _ids)
                        #MCEDIT_DEFS.update(_defs)
                        #MCEDIT_IDS.update(_ids)
                        if json_dict:
                            _json.update(_data)
                    log.info("Done")
    else:
        log.info("MC {} {} resources not found.".format(gamePlatform, gameVersionNumber))
    # Override the module objects to expose them outside when (re)importing.
    pymclevel.MCEDIT_DEFS = MCEDIT_DEFS
    pymclevel.MCEDIT_IDS = MCEDIT_IDS
    log.info("Loaded %s defs and %s ids"%(len(MCEDIT_DEFS), len(MCEDIT_IDS)))
    toreturn = (MCEDIT_DEFS, MCEDIT_IDS)
    if json_dict:
        toreturn = _json
    if '--dump-defs' in sys.argv:
        dump_f_name = 'defs_ids-{}-{}.json'.format(gamePlatform, gameVersionNumber)
        log.info("Dumping definitions as JSON data in '%s'." % dump_f_name)
        with open(dump_f_name, 'w') as f:
            f.write("#" * 80)
            f.write("\nDEFS\n")
            f.write(json.dumps(MCEDIT_DEFS, indent=4))
            f.write("\n\n" + "#" * 80)
            f.write("\nIDS\n")
            f.write(json.dumps(MCEDIT_IDS, indent=4))
            f.close()
    if timestamps:
        toreturn += (_timestamps,)
    return toreturn
Load the whole files from mcver directory.
    :game_version: str/unicode: the game version for which the resources will be loaded.
    :namespace: unicode: the name to be put in front of some IDs. default to 'minecraft'.
    :json_dict: bool: Whether to return a ran dict from the JSon file(s) instead of the (MCEDIT_DEFS, MCEDIT_IDS) pair.
    :timestamp: bool: wheter the return also the loaded file timestamp.
pymclevel/id_definitions.py