Перейти к содержанию

API Reference

Version: 1.8.2
Endpoints total count: 145

Строительство

Контроллер Builder Controller предоставляет инструменты для программного построения и деконструкции. Он позволяет копировать, вставлять и создавать чертежи областей карты.


POST
/api/v1/builder/copy

Скопировать указанную область карты, включая здания, объекты и местность. Скопированные данные можно использовать для вставки через /api/v1/builder/paste.

Example:

curl --request POST \
--url http://localhost:8765/api/v1/builder/copy \
--header 'content-type: application/json' \
--data '{
    "from": { "x": 100, "z": 100 },
    "to": { "x": 110, "z": 110 }
}'

Response:

{
    "map_id": 0,
    "point_a": {"x": 10, "y": 0, "z": 10},
    "point_b": {"x": 16, "y": 0, "z": 16}
}

Response:

{
    "success":true,
    "data": {
        "width":7,
        "height":7,
        "floors": [
            {"def_name":"Concrete","rel_x":1,"rel_z":1},
            {"def_name":"Concrete","rel_x":3,"rel_z":2}],
        "buildings": [
            {"def_name":"Wall","stuff_def_name":"WoodLog","rel_x":0,"rel_z":0,"rotation":0},
            {"def_name":"Wall","stuff_def_name":"WoodLog","rel_x":3,"rel_z":0,"rotation":0},
            {"def_name":"Wall","stuff_def_name":"WoodLog","rel_x":0,"rel_z":1,"rotation":0},
        ]
    },
    "errors": [],
    "warnings": [],
    "timestamp": "2025-12-11T19:15:20.9851409Z"
}


POST
/api/v1/builder/paste

Вставить ранее скопированную область в новое место на карте.

Example:

curl --request POST \
--url http://localhost:8765/api/v1/builder/paste \
--header 'content-type: application/json' \
--data '{
    "at": { "x": 150, "z": 150 }
}'

Request:

{
    "map_id": 0,
    "position": {"x": 80, "y": 0, "z": 80},
    "blueprint": {
        "width":7,
        "height":7,
        "floors": [
            {"def_name":"Concrete","rel_x":1,"rel_z":1},
            {"def_name":"Concrete","rel_x":3,"rel_z":2}],
        "buildings": [
            {"def_name":"Wall","stuff_def_name":"WoodLog","rel_x":0,"rel_z":0,"rotation":0},
            {"def_name":"Wall","stuff_def_name":"WoodLog","rel_x":3,"rel_z":0,"rotation":0},
            {"def_name":"Wall","stuff_def_name":"WoodLog","rel_x":0,"rel_z":1,"rotation":0},
        ]
    },
    "clear_obstacles": true,
}

Response:

{
    "success":true,
    "errors":[],
    "warnings":[],
    "timestamp":"2025-12-31T12:18:40.2019606Z"
}


POST
/api/v1/builder/blueprint

Вставляет постройку в виде чертежа, создавая задание для поселенцев.

Example:

curl --request POST \
--url http://localhost:8765/api/v1/builder/blueprint \
--header 'content-type: application/json' \
--data '{
    "at": { "x": 150, "z": 150 }
}'

Request:

{
    "map_id": 0,
    "position": {"x": 80, "y": 0, "z": 80},
    "blueprint": {
        "width":7,
        "height":7,
        "floors": [
            {"def_name":"Concrete","rel_x":1,"rel_z":1},
            {"def_name":"Concrete","rel_x":3,"rel_z":2}],
        "buildings": [
            {"def_name":"Wall","stuff_def_name":"WoodLog","rel_x":0,"rel_z":0,"rotation":0},
            {"def_name":"Wall","stuff_def_name":"WoodLog","rel_x":3,"rel_z":0,"rotation":0},
            {"def_name":"Wall","stuff_def_name":"WoodLog","rel_x":0,"rel_z":1,"rotation":0},
        ]
    },
}

Response:

{
    "success":true,
    "errors":[],
    "warnings":[],
    "timestamp":"2025-12-31T12:18:40.2019606Z"
}