Example #1
0
def get_block(block, meta=None, init=True):
    ret = None
    if isinstance(block, int):  # by id
        ret = find_by(block, blocks)
    else:  # by name
        ret = find_by(block, blocks_name)
    if init and ret is not None:
        return ret(meta)
    return ret
Example #2
0
def get_item(item, meta=None, init=True):
    ret = None
    if isinstance(item, int):  # by id
        ret = find_by(item, items)
    else:  # by name
        ret = find_by(item, items_name)
    if init and ret is not None:
        return ret(meta)
    return ret
Example #3
0
def get_block(block, meta=None, init=True):
    ret = None
    if isinstance(block, int):  # by id
        ret = find_by(block, blocks)
    else:  # by name
        ret = find_by(block, blocks_name)
    if init and ret is not None:
        return ret(meta)
    return ret
Example #4
0
def get_item_or_block(find, meta=0, init=True):
    ret = None
    if isinstance(find, int):  # by id
        ret = find_by(find, items.items, blocks.blocks)
    else:  # by name
        ret = find_by(find, items.items_name, blocks.blocks_name)
    if init and ret is not None:
        return ret(meta)
    return ret
Example #5
0
def get_item(item, meta=None, init=True):
    ret = None
    if isinstance(item, int):  # by id
        ret = find_by(item, items)
    else:  # by name
        ret = find_by(item, items_name)
    if init and ret is not None:
        return ret(meta)
    return ret
Example #6
0
def get_item_or_block(find, meta=None, init=True):
    ret = None
    if isinstance(find, int):  # by id
        ret = find_by(find, items.items, blocks.blocks)
    else:  # by name
        ret = find_by(find, items.items_name, blocks.blocks_name)
    if init and ret is not None:
        return ret(meta)
    return ret
Example #7
0
def get_material(name):
    return find_by(name, materials)
Example #8
0
def get_material(name):
    return find_by(name, materials)
Example #9
0
def get_biome(biome):
    if isinstance(biome, int):  # by id
        return find_by(biome, biomes)
    else:  # by name
        return find_by(biome, biomes_name)
Example #10
0
def get_biome(biome):
    if isinstance(biome, int):  # by id
        return find_by(biome, biomes)
    else:  # by name
        return find_by(biome, biomes_name)