Skip to content

API Reference

laurel Lin edited this page Aug 16, 2026 · 3 revisions

Create Track Generator

create_track_gen API Reference

Source API reference (types / constants / functions), organized by module, in Chinese & English.

GitHub 中文 API


create_track_gen API Reference (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 9 track shapes and exporting them in 4 modes.

This document covers only the exported API of the source (types, constants, functions). For usage instructions (each Tools menu entry, its buttons & fields) see the Tool Guides or the GitHub repository.

Note on this English reference: entries whose behavior is fully inferable from the symbol name alone are omitted for brevity (e.g. unit-conversion helpers). The complete per-symbol reference is available in the Chinese version.

Layered structure

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

Table of Contents

Pure logic layer src/logic/

Assembly layer src/build/

UI layer src/ui/

Infrastructure

Data flow

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 (9 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

Clone this wiki locally