Repository navigation
API Reference
laurel Lin edited this page Aug 22, 2026
·
3 revisions
Source API reference (types / constants / functions), organized by module, in Chinese & English.
A Blockbench plugin that generates Create Mod track model sets from three part models (left rail / right rail / tie) plus track gauge, height, and whole-model Y offset — producing the 11 track shapes and exporting them in 4 modes.
This document covers only the exported API (types, constants, functions). For usage instructions
(each Tools menu entry) see the Tool Guides.
| Layer | Directory | Purpose |
|---|---|---|
| Pure logic | src/logic/ |
Zero-Blockbench pure functions & types, Node-testable |
| Assembly | src/build/ |
Turns logic output into real Blockbench Cube / Group / files |
| UI | src/ui/ |
Dialogs and part importing (depends on Blockbench globals) |
| Infra |
src/plugin_api.ts, src/i18n.ts, src/index.ts
|
Plugin registration, i18n, entry |
- types.ts — Pure type definitions
- gauge.ts — Gauge conversion
- parts.ts — Part parsing & normalization
- transform.ts — Geometric transforms
- generator.ts — Track shape assembly
- export.ts — Export conventions & serialization
- assembly.ts — CubeSpec → Cube/Group
- workspace.ts — Workspace creation & texture import
- export.ts — Track model export
- import.ts — Part acquisition
- dialog.ts — Generate configuration dialog
- gauge.ts — Gauge converter dialog
Parts (.bbmodel / selected tab elements)
│ ui/import.ts
▼
PartModel ──(normalized)──► src/logic/parts.ts
│
│ src/logic/transform.ts (translate/rotate/mirror/bake)
│ src/logic/generator.ts (11 shape assembly)
▼
ShapeSpec[] / TrackConfig
│ src/logic/export.ts (name mapping + blockstates + serialization)
│ src/build/export.ts (write to disk)
▼
Minecraft model JSON / OBJ / Bedrock geometry + blockstates + texture PNGs