コード例 #1
0
def copy(world: "World", dimension: Dimension, selection: SelectionGroup):
    if selection:
        structure = Structure.from_world(world, selection, dimension)
        structure_cache.add_structure(structure)
        raise OperationSilentAbort
    else:
        raise OperationError(
            "At least one selection is required for the copy operation.")
コード例 #2
0
ファイル: cut.py プロジェクト: strugee/Amulet-Map-Editor
def cut(world: "World", dimension: Dimension,
        selection: SelectionGroup) -> OperationReturnType:
    structure = Structure.from_world(world, selection, dimension)
    structure_cache.add_structure(structure)
    yield from delete(
        world,
        dimension,
        selection,
    )
コード例 #3
0
def copy(world: "BaseLevel", dimension: Dimension,
         selection: SelectionGroup) -> OperationReturnType:
    if selection:
        yield 0, "Copying"
        structure = yield from world.extract_structure_iter(
            selection, dimension)
        structure_cache.add_structure(structure, structure.dimensions[0])
        raise OperationSilentAbort
    else:
        raise OperationError(
            "At least one selection is required for the copy operation.")
コード例 #4
0
ファイル: cut.py プロジェクト: cpaika/Amulet-Map-Editor
def cut(world: "BaseLevel", dimension: Dimension,
        selection: SelectionGroup) -> OperationReturnType:
    if selection:
        structure = world.extract_structure(selection, dimension)
        structure_cache.add_structure(structure, structure.dimensions[0])
        yield from delete(
            world,
            dimension,
            selection,
        )
    else:
        raise OperationError(
            "At least one selection is required for the copy operation.")
コード例 #5
0
def cut(world: "World", dimension: Dimension,
        selection: SelectionGroup) -> OperationReturnType:
    if selection:
        structure = Structure.from_world(world, selection, dimension)
        structure_cache.add_structure(structure)
        yield from delete(
            world,
            dimension,
            selection,
        )
    else:
        raise OperationError(
            "At least one selection is required for the copy operation.")
コード例 #6
0
ファイル: copy.py プロジェクト: strugee/Amulet-Map-Editor
def copy(world: "World", dimension: Dimension, selection: SelectionGroup):
    structure = Structure.from_world(world, selection, dimension)
    structure_cache.add_structure(structure)
    raise OperationSilentAbort