# age-series/electricalage architecture

> Architecture diagram of the GitHub repository age-series/electricalage, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/age-series/electricalage
- Repository: https://github.com/age-series/electricalage

## Overview

Electrical Age is a Minecraft Forge mod for in-world electrical simulation, machines, and automation. The player places and configures face-wired nodes; node management tracks their world state, while simulation components model electrical and thermal behavior and drive device processes. The mod also provides climate and room-thermal features, fluids, ghost construction helpers, and an optional MQTT bridge for signal controllers. The graph emphasizes documented wiring and sampled calls; several capabilities are represented by their source directories because their implementation files were not excerpted.

Main entry points: [`src/main/java/mods/eln/Eln.java`](https://github.com/age-series/electricalage/blob/main/src/main/java/mods/eln/Eln.java) (Mod registration), [`src/main/java/mods/eln/sixnode`](https://github.com/age-series/electricalage/tree/main/src/main/java/mods/eln/sixnode) (Face-wired devices), [`src/main/kotlin/mods/eln/node/NodeManager.kt`](https://github.com/age-series/electricalage/blob/main/src/main/kotlin/mods/eln/node/NodeManager.kt) (Node registry), [`src/main/java/mods/eln/sim/Simulator.java`](https://github.com/age-series/electricalage/blob/main/src/main/java/mods/eln/sim/Simulator.java) (Circuit simulator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Mod Runtime"]
  node_eln["Mod registration<br/>[Eln.java]"]
  node_packets["Packet handling<br/>[PacketHandler.kt]"]
  node_gui["GUI routing<br/>[GuiHandler.java]"]
end

subgraph group_world["World Nodes"]
  node_nodebase["Node lifecycle<br/>[NodeBase.kt]"]
  node_nodemanager[("Node registry<br/>[NodeManager.kt]")]
  node_sixnodes["Face-wired devices"]
  node_devices["Machines and items"]
end

subgraph group_simulation["Simulation"]
  node_electrical["Electrical loads"]
  node_thermal["Thermal loads<br/>[ThermalLoad.java]"]
  node_simulator["Circuit simulator<br/>[Simulator.java]"]
  node_mna["MNA solver<br/>[SubSystem.java]"]
end

subgraph group_features["World Features"]
  node_environment["Climate service"]
  node_roomthermal["Room thermal manager"]
  node_fluids["Fluid handling"]
  node_ghost[("Ghost construction<br/>[GhostManager.kt]")]
end

subgraph group_integration["Integrations"]
  node_mqttcontroller["MQTT signal device"]
  node_mqttmanager["MQTT manager<br/>[MqttManager.kt]"]
  node_mqttsignals["MQTT signal routing"]
end

node_player(("Minecraft player"))
node_forge(("Forge runtime"))
node_mqttbroker(("MQTT broker"))

node_forge -->|"loads mod"| node_eln
node_eln -->|"creates handler"| node_packets
node_player -.->|"sends actions"| node_packets
node_eln -->|"configures GUI"| node_gui
node_sixnodes -.->|"opens containers"| node_gui
node_nodebase -->|"registers node"| node_nodemanager
node_nodemanager -->|"restores nodes"| node_nodebase
node_sixnodes -.->|"extends lifecycle"| node_nodebase
node_devices -.->|"uses loads"| node_electrical
node_sixnodes -->|"exposes ports"| node_electrical
node_sixnodes -.->|"models heat"| node_thermal
node_simulator -.->|"simulates loads"| node_electrical
node_simulator -.->|"simulates heat"| node_thermal
node_simulator -.->|"solves circuits"| node_mna
node_eln -->|"initializes service"| node_environment
node_eln -->|"initializes manager"| node_roomthermal
node_roomthermal -->|"queries nodes"| node_nodemanager
node_eln -.->|"registers fluids"| node_fluids
node_eln -->|"owns manager"| node_ghost
node_nodemanager -->|"resolves ghost nodes"| node_ghost
node_mqttcontroller -->|"gets client"| node_mqttmanager
node_mqttcontroller -->|"publishes snapshots"| node_mqttsignals
node_mqttsignals -->|"gets client"| node_mqttmanager
node_mqttsignals -.->|"publishes and subscribes"| node_mqttbroker

click node_eln "https://github.com/age-series/electricalage/blob/main/src/main/java/mods/eln/Eln.java"
click node_packets "https://github.com/age-series/electricalage/blob/main/src/main/kotlin/mods/eln/PacketHandler.kt"
click node_gui "https://github.com/age-series/electricalage/blob/main/src/main/java/mods/eln/GuiHandler.java"
click node_nodebase "https://github.com/age-series/electricalage/blob/main/src/main/kotlin/mods/eln/node/NodeBase.kt"
click node_nodemanager "https://github.com/age-series/electricalage/blob/main/src/main/kotlin/mods/eln/node/NodeManager.kt"
click node_sixnodes "https://github.com/age-series/electricalage/tree/main/src/main/java/mods/eln/sixnode"
click node_devices "https://github.com/age-series/electricalage/tree/main/src/main/java/mods/eln/item"
click node_electrical "https://github.com/age-series/electricalage/blob/main/src/main/java/mods/eln/sim/ElectricalLoad.java"
click node_thermal "https://github.com/age-series/electricalage/blob/main/src/main/java/mods/eln/sim/ThermalLoad.java"
click node_simulator "https://github.com/age-series/electricalage/blob/main/src/main/java/mods/eln/sim/Simulator.java"
click node_mna "https://github.com/age-series/electricalage/blob/main/src/main/java/mods/eln/sim/mna/SubSystem.java"
click node_environment "https://github.com/age-series/electricalage/blob/main/src/main/kotlin/mods/eln/environment/BiomeClimateService.kt"
click node_roomthermal "https://github.com/age-series/electricalage/blob/main/src/main/kotlin/mods/eln/environment/RoomThermalManager.kt"
click node_fluids "https://github.com/age-series/electricalage/tree/main/src/main/kotlin/mods/eln/fluid"
click node_ghost "https://github.com/age-series/electricalage/blob/main/src/main/kotlin/mods/eln/ghost/GhostManager.kt"
click node_mqttcontroller "https://github.com/age-series/electricalage/blob/main/src/main/kotlin/mods/eln/sixnode/mqttsignal/MqttSignalControllerElement.kt"
click node_mqttmanager "https://github.com/age-series/electricalage/blob/main/src/main/kotlin/mods/eln/mqtt/MqttManager.kt"
click node_mqttsignals "https://github.com/age-series/electricalage/blob/main/src/main/kotlin/mods/eln/mqtt/MqttSignalControllerManager.kt"

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_eln,node_packets,node_gui toneBlue
class node_nodebase,node_nodemanager,node_sixnodes,node_devices toneAmber
class node_electrical,node_thermal,node_simulator,node_mna toneMint
class node_environment,node_roomthermal,node_fluids,node_ghost toneRose
class node_mqttcontroller,node_mqttmanager,node_mqttsignals,node_player,node_forge,node_mqttbroker toneIndigo
```

## Components

### Mod Runtime

- [Mod registration](https://github.com/age-series/electricalage/blob/main/src/main/java/mods/eln/Eln.java): `src/main/java/mods/eln/Eln.java`
- [Packet handling](https://github.com/age-series/electricalage/blob/main/src/main/kotlin/mods/eln/PacketHandler.kt): `src/main/kotlin/mods/eln/PacketHandler.kt`
- [GUI routing](https://github.com/age-series/electricalage/blob/main/src/main/java/mods/eln/GuiHandler.java): `src/main/java/mods/eln/GuiHandler.java`

### World Nodes

- [Node lifecycle](https://github.com/age-series/electricalage/blob/main/src/main/kotlin/mods/eln/node/NodeBase.kt): `src/main/kotlin/mods/eln/node/NodeBase.kt`
- [Node registry](https://github.com/age-series/electricalage/blob/main/src/main/kotlin/mods/eln/node/NodeManager.kt): `src/main/kotlin/mods/eln/node/NodeManager.kt`
- [Face-wired devices](https://github.com/age-series/electricalage/tree/main/src/main/java/mods/eln/sixnode): `src/main/java/mods/eln/sixnode`
- [Machines and items](https://github.com/age-series/electricalage/tree/main/src/main/java/mods/eln/item): `src/main/java/mods/eln/item`

### Simulation

- [Electrical loads](https://github.com/age-series/electricalage/blob/main/src/main/java/mods/eln/sim/ElectricalLoad.java): `src/main/java/mods/eln/sim/ElectricalLoad.java`
- [Thermal loads](https://github.com/age-series/electricalage/blob/main/src/main/java/mods/eln/sim/ThermalLoad.java): `src/main/java/mods/eln/sim/ThermalLoad.java`
- [Circuit simulator](https://github.com/age-series/electricalage/blob/main/src/main/java/mods/eln/sim/Simulator.java): `src/main/java/mods/eln/sim/Simulator.java`
- [MNA solver](https://github.com/age-series/electricalage/blob/main/src/main/java/mods/eln/sim/mna/SubSystem.java): `src/main/java/mods/eln/sim/mna/SubSystem.java`

### World Features

- [Climate service](https://github.com/age-series/electricalage/blob/main/src/main/kotlin/mods/eln/environment/BiomeClimateService.kt): `src/main/kotlin/mods/eln/environment/BiomeClimateService.kt`
- [Room thermal manager](https://github.com/age-series/electricalage/blob/main/src/main/kotlin/mods/eln/environment/RoomThermalManager.kt): `src/main/kotlin/mods/eln/environment/RoomThermalManager.kt`
- [Fluid handling](https://github.com/age-series/electricalage/tree/main/src/main/kotlin/mods/eln/fluid): `src/main/kotlin/mods/eln/fluid`
- [Ghost construction](https://github.com/age-series/electricalage/blob/main/src/main/kotlin/mods/eln/ghost/GhostManager.kt): `src/main/kotlin/mods/eln/ghost/GhostManager.kt`

### Integrations

- [MQTT signal device](https://github.com/age-series/electricalage/blob/main/src/main/kotlin/mods/eln/sixnode/mqttsignal/MqttSignalControllerElement.kt): `src/main/kotlin/mods/eln/sixnode/mqttsignal/MqttSignalControllerElement.kt`
- [MQTT manager](https://github.com/age-series/electricalage/blob/main/src/main/kotlin/mods/eln/mqtt/MqttManager.kt): `src/main/kotlin/mods/eln/mqtt/MqttManager.kt`
- [MQTT signal routing](https://github.com/age-series/electricalage/blob/main/src/main/kotlin/mods/eln/mqtt/MqttSignalControllerManager.kt): `src/main/kotlin/mods/eln/mqtt/MqttSignalControllerManager.kt`

### Other components

- **Minecraft player**
- **Forge runtime**
- **MQTT broker**

## Connections

- Forge runtime → Mod registration: loads mod (evidence: `src/main/java/mods/eln/Eln.java`)
- Mod registration → Packet handling: creates handler (evidence: `src/main/java/mods/eln/Eln.java`)
- Minecraft player → Packet handling: sends actions
- Mod registration → GUI routing: configures GUI (evidence: `src/main/java/mods/eln/GuiHandler.java`)
- Face-wired devices → GUI routing: opens containers
- Node lifecycle → Node registry: registers node (evidence: `src/main/kotlin/mods/eln/node/NodeBase.kt`)
- Node registry → Node lifecycle: restores nodes (evidence: `src/main/kotlin/mods/eln/node/NodeManager.kt`)
- Face-wired devices → Node lifecycle: extends lifecycle
- Machines and items → Electrical loads: uses loads
- Face-wired devices → Electrical loads: exposes ports
- Face-wired devices → Thermal loads: models heat
- Circuit simulator → Electrical loads: simulates loads
- Circuit simulator → Thermal loads: simulates heat
- Circuit simulator → MNA solver: solves circuits
- Mod registration → Climate service: initializes service (evidence: `src/main/kotlin/mods/eln/environment/BiomeClimateService.kt`)
- Mod registration → Room thermal manager: initializes manager (evidence: `src/main/kotlin/mods/eln/environment/RoomThermalManager.kt`)
- Room thermal manager → Node registry: queries nodes (evidence: `src/main/kotlin/mods/eln/environment/RoomThermalManager.kt`)
- Mod registration → Fluid handling: registers fluids (evidence: `src/main/java/mods/eln/Eln.java`)
- Mod registration → Ghost construction: owns manager (evidence: `src/main/kotlin/mods/eln/ghost/GhostManager.kt`)
- Node registry → Ghost construction: resolves ghost nodes (evidence: `src/main/kotlin/mods/eln/ghost/GhostManager.kt`)
- MQTT signal device → MQTT manager: gets client (evidence: `src/main/kotlin/mods/eln/sixnode/mqttsignal/MqttSignalControllerElement.kt`)
- MQTT signal device → MQTT signal routing: publishes snapshots (evidence: `src/main/kotlin/mods/eln/sixnode/mqttsignal/MqttSignalControllerElement.kt`)
- MQTT signal routing → MQTT manager: gets client (evidence: `src/main/kotlin/mods/eln/mqtt/MqttSignalControllerManager.kt`)
- MQTT signal routing → MQTT broker: publishes and subscribes
