-
Notifications
You must be signed in to change notification settings - Fork 0
API en
| Method | Path | Description |
|---|---|---|
| GET | /api/catalog |
Block catalog (frontend palette) |
| POST | /api/build |
Build mod DLL |
| POST | /api/compile/project |
Preview generated files |
| POST | /api/compile/register |
Compile register code only |
| GET | /api/projects |
List all projects |
| POST | /api/projects |
Create new project |
| GET | /api/projects/{name} |
Load project |
| PUT | /api/projects/{name} |
Save project |
| DELETE | /api/projects/{name} |
Delete project |
| GET | /api/projects/{name}/assets |
List project assets |
| POST | /api/projects/{name}/assets/upload |
Upload sprite |
| DELETE | /api/projects/{name}/assets/{file} |
Delete asset |
| GET | /api/projects/{name}/assets/raw/{file} |
Get raw asset file |
Returns the catalog of all available blocks.
Response:
{
"nodes": [
{ "type": "cu_register_item", "category": "Register" },
...
]
}Build mod DLL from blueprint.
Request body: Blueprint JSON
Response:
{
"success": true,
"message": "Build succeeded!",
"dllPath": "D:\\...\\builds\\MyMod\\bin\\Release\\MyMod.dll",
"buildDir": "D:\\...\\builds\\MyMod"
}Build process:
- Generate C# source files (Plugin.cs, RegisterContent.cs, EventHandlers.cs)
- Write to
builds/{ModName}/directory - Copy project assets to
Sprites/subdirectory - Run
dotnet build -c Release - Return build result
Preview files to be generated (without writing to disk).
Request body: Blueprint JSON
Response:
{
"files": {
"MyMod.csproj": "...",
"Plugin.cs": "...",
"RegisterContent.cs": "..."
}
}Compile register code only.
Request body: Blueprint JSON
Response:
{
"registerContent": "..."
}List all projects in the server's projects/ directory.
Response:
[
{ "name": "MyMod", "cbpFile": "D:\\...\\projects\\MyMod\\MyMod.cbp" }
]Create a new project.
Request body:
{
"mod": {
"name": "MyMod",
"id": "com.example.mymod",
"version": "1.0.0",
"description": "My first mod"
}
}Response:
{ "name": "MyMod" }Save project blueprint.
Request body: Blueprint JSON
Delete project and all its files.
List project asset files.
Response:
[
{ "name": "sprite.png", "size": 12345, "uploaded": "2026-09-06T00:00:00Z" }
]Upload a sprite file.
Request: multipart/form-data, field name file
Supported formats: .png, .jpg, .jpeg, .bmp
Response:
{ "assetId": "sprite.png", "name": "sprite.png", "originalName": "my sprite.png" }Delete specified asset file.
Get raw asset file (for frontend preview).
interface Blueprint {
mod: {
name: string;
id: string;
version: string;
description: string;
};
items: ItemEntry[];
recipes: RecipeEntry[];
eventHandlers: string; // Event handler code
eventHandlersXml: string; // Blockly workspace XML
assets: AssetEntry[];
}
interface ItemEntry {
id: string;
fullName: string;
description: string;
category: string;
spriteRef?: string;
isAdvanced?: boolean;
useAction?: string;
limbUseAction?: string;
container?: ContainerProps;
tool?: ToolProps;
wearable?: WearableProps;
liquidContainer?: LiquidContainerProps;
battery?: BatteryProps;
light?: LightProps;
bandage?: BandageProps;
syringe?: SyringeProps;
}After building, files are generated in builds/{ModName}/:
MyMod/
├── MyMod.csproj # .NET 4.7.2 project file
├── Plugin.cs # BepInEx plugin entry point
├── RegisterContent.cs # Item/recipe/building/tile/liquid registration
├── EventHandlers.cs # Harmony patches (if events used)
├── Sprites/ # Sprite resources
└── README.md # Auto-generated documentation