Skip to content

API Reference

laurel Lin edited this page Aug 22, 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 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.

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

Clone this wiki locally