# techtastic/cc-sable architecture

> Architecture diagram of the GitHub repository techtastic/cc-sable, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/techtastic/cc-sable
- Repository: https://github.com/techtastic/cc-sable

## Overview

CC: Sable exposes Sable physics data to in-game CC: Tweaked computers through Lua APIs and enriched block details. The main workflow is computer API registration, Lua calls into Sable physics, and conversion of results into Lua-friendly values. The README also documents bundled advanced math utilities; its implementation is a submodule and was not sampled, so its internal behavior and wiring are not shown.

Main entry points: [`common/src/main/java/io/github/techtastic/cc_sable/CCSable.java`](https://github.com/techtastic/cc-sable/blob/master/common/src/main/java/io/github/techtastic/cc_sable/CCSable.java) (Common initialization), [`common/src/main/java/io/github/techtastic/cc_sable/apis/SubLevelAPI.java`](https://github.com/techtastic/cc-sable/blob/master/common/src/main/java/io/github/techtastic/cc_sable/apis/SubLevelAPI.java) (Sub-Level API), [`common/src/main/java/io/github/techtastic/cc_sable/apis/AerodynamicsAPI.java`](https://github.com/techtastic/cc-sable/blob/master/common/src/main/java/io/github/techtastic/cc_sable/apis/AerodynamicsAPI.java) (Aerodynamics API), [`common/src/main/java/io/github/techtastic/cc_sable/util/CCSableUtils.java`](https://github.com/techtastic/cc-sable/blob/master/common/src/main/java/io/github/techtastic/cc_sable/util/CCSableUtils.java) (Lua conversion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_integration["Mod integration"]
  node_fabric["Fabric entrypoint<br/>[CCSableFabric.java]"]
  node_neoforge["NeoForge entrypoint"]
  node_common["Common initialization<br/>[CCSable.java]"]
  node_detail["Block detail enrichment<br/>[CCSable.java]"]
end

subgraph group_lua["Computer APIs"]
  node_subapi["Sub-Level API<br/>[SubLevelAPI.java]"]
  node_aeroapi["Aerodynamics API"]
  node_sublevel_lua["Sub-Level Lua module<br/>[sublevel.lua]"]
  node_aero_lua["Aerodynamics Lua module<br/>[aero.lua]"]
  node_utils["Lua conversion<br/>[CCSableUtils.java]"]
  node_bezier["Bezier Lua wrapper"]
  node_advanced_math["Advanced Math bundle"]
end

subgraph group_physics["Sable physics"]
  node_sable["Sable backend"]
  node_sublevel_physics["Sub-Level state"]
  node_dimension_physics["Dimension physics"]
  node_block_physics["Block physics properties"]
end

node_computer(("In-game computer"))
node_cc["CC: Tweaked"]
node_detail_registry["CC block details"]

node_computer -->|"calls Lua API"| node_cc
node_fabric -->|"initializes"| node_common
node_neoforge -->|"initializes"| node_common
node_common -->|"registers APIs"| node_cc
node_cc -->|"creates API"| node_subapi
node_cc -->|"creates API"| node_aeroapi
node_computer -->|"uses module"| node_sublevel_lua
node_computer -->|"uses module"| node_aero_lua
node_subapi -->|"reads and updates"| node_sublevel_physics
node_subapi -->|"converts results"| node_utils
node_aeroapi -->|"reads physics"| node_dimension_physics
node_aeroapi -->|"converts results"| node_utils
node_utils -->|"wraps pressure functions"| node_bezier
node_sublevel_physics -->|"provided by"| node_sable
node_dimension_physics -->|"provided by"| node_sable
node_common -->|"registers provider"| node_detail_registry
node_detail_registry -->|"requests block details"| node_detail
node_detail -->|"reads properties"| node_block_physics
node_block_physics -->|"provided by"| node_sable
node_advanced_math -.->|"bundled utilities"| node_computer

click node_fabric "https://github.com/techtastic/cc-sable/blob/master/fabric/src/main/java/io/github/techtastic/cc_sable/fabric/CCSableFabric.java"
click node_neoforge "https://github.com/techtastic/cc-sable/blob/master/neoforge/src/main/java/io/github/techtastic/cc_sable/neoforge/CCSableNeoForge.java"
click node_common "https://github.com/techtastic/cc-sable/blob/master/common/src/main/java/io/github/techtastic/cc_sable/CCSable.java"
click node_subapi "https://github.com/techtastic/cc-sable/blob/master/common/src/main/java/io/github/techtastic/cc_sable/apis/SubLevelAPI.java"
click node_aeroapi "https://github.com/techtastic/cc-sable/blob/master/common/src/main/java/io/github/techtastic/cc_sable/apis/AerodynamicsAPI.java"
click node_sublevel_lua "https://github.com/techtastic/cc-sable/blob/master/common/src/main/resources/data/computercraft/lua/rom/apis/sublevel.lua"
click node_aero_lua "https://github.com/techtastic/cc-sable/blob/master/common/src/main/resources/data/computercraft/lua/rom/apis/aero.lua"
click node_utils "https://github.com/techtastic/cc-sable/blob/master/common/src/main/java/io/github/techtastic/cc_sable/util/CCSableUtils.java"
click node_bezier "https://github.com/techtastic/cc-sable/blob/master/common/src/main/java/io/github/techtastic/cc_sable/util/LuaBezierResourceFunction.java"
click node_detail "https://github.com/techtastic/cc-sable/blob/master/common/src/main/java/io/github/techtastic/cc_sable/CCSable.java"
click node_advanced_math "https://github.com/techtastic/cc-sable/tree/master/libs/advanced-math"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_fabric,node_neoforge,node_common,node_detail toneBlue
class node_subapi,node_aeroapi,node_sublevel_lua,node_aero_lua,node_utils,node_bezier,node_advanced_math toneAmber
class node_sable,node_sublevel_physics,node_dimension_physics,node_block_physics toneMint
class node_computer,node_cc,node_detail_registry toneIndigo
```

## Components

### Mod integration

- [Fabric entrypoint](https://github.com/techtastic/cc-sable/blob/master/fabric/src/main/java/io/github/techtastic/cc_sable/fabric/CCSableFabric.java): `fabric/src/main/java/io/github/techtastic/cc_sable/fabric/CCSableFabric.java`
- [NeoForge entrypoint](https://github.com/techtastic/cc-sable/blob/master/neoforge/src/main/java/io/github/techtastic/cc_sable/neoforge/CCSableNeoForge.java): `neoforge/src/main/java/io/github/techtastic/cc_sable/neoforge/CCSableNeoForge.java`
- [Common initialization](https://github.com/techtastic/cc-sable/blob/master/common/src/main/java/io/github/techtastic/cc_sable/CCSable.java): `common/src/main/java/io/github/techtastic/cc_sable/CCSable.java`
- [Block detail enrichment](https://github.com/techtastic/cc-sable/blob/master/common/src/main/java/io/github/techtastic/cc_sable/CCSable.java): `common/src/main/java/io/github/techtastic/cc_sable/CCSable.java`

### Computer APIs

- [Sub-Level API](https://github.com/techtastic/cc-sable/blob/master/common/src/main/java/io/github/techtastic/cc_sable/apis/SubLevelAPI.java): `common/src/main/java/io/github/techtastic/cc_sable/apis/SubLevelAPI.java`
- [Aerodynamics API](https://github.com/techtastic/cc-sable/blob/master/common/src/main/java/io/github/techtastic/cc_sable/apis/AerodynamicsAPI.java): `common/src/main/java/io/github/techtastic/cc_sable/apis/AerodynamicsAPI.java`
- [Sub-Level Lua module](https://github.com/techtastic/cc-sable/blob/master/common/src/main/resources/data/computercraft/lua/rom/apis/sublevel.lua): `common/src/main/resources/data/computercraft/lua/rom/apis/sublevel.lua`
- [Aerodynamics Lua module](https://github.com/techtastic/cc-sable/blob/master/common/src/main/resources/data/computercraft/lua/rom/apis/aero.lua): `common/src/main/resources/data/computercraft/lua/rom/apis/aero.lua`
- [Lua conversion](https://github.com/techtastic/cc-sable/blob/master/common/src/main/java/io/github/techtastic/cc_sable/util/CCSableUtils.java): `common/src/main/java/io/github/techtastic/cc_sable/util/CCSableUtils.java`
- [Bezier Lua wrapper](https://github.com/techtastic/cc-sable/blob/master/common/src/main/java/io/github/techtastic/cc_sable/util/LuaBezierResourceFunction.java): `common/src/main/java/io/github/techtastic/cc_sable/util/LuaBezierResourceFunction.java`
- [Advanced Math bundle](https://github.com/techtastic/cc-sable/tree/master/libs/advanced-math): `libs/advanced-math`

### Sable physics

- **Sable backend**
- **Sub-Level state**
- **Dimension physics**
- **Block physics properties**

### Other components

- **In-game computer**
- **CC: Tweaked**
- **CC block details**

## Connections

- In-game computer → CC: Tweaked: calls Lua API
- Fabric entrypoint → Common initialization: initializes
- NeoForge entrypoint → Common initialization: initializes
- Common initialization → CC: Tweaked: registers APIs
- CC: Tweaked → Sub-Level API: creates API
- CC: Tweaked → Aerodynamics API: creates API
- In-game computer → Sub-Level Lua module: uses module
- In-game computer → Aerodynamics Lua module: uses module
- Sub-Level API → Sub-Level state: reads and updates
- Sub-Level API → Lua conversion: converts results
- Aerodynamics API → Dimension physics: reads physics
- Aerodynamics API → Lua conversion: converts results
- Lua conversion → Bezier Lua wrapper: wraps pressure functions
- Sub-Level state → Sable backend: provided by
- Dimension physics → Sable backend: provided by
- Common initialization → CC block details: registers provider
- CC block details → Block detail enrichment: requests block details
- Block detail enrichment → Block physics properties: reads properties
- Block physics properties → Sable backend: provided by
- Advanced Math bundle → In-game computer: bundled utilities
