# akurakuu/create-electric-drive architecture

> Architecture diagram of the GitHub repository akurakuu/create-electric-drive, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/akurakuu/create-electric-drive
- Repository: https://github.com/akurakuu/create-electric-drive

## Overview

##### Project Type and Purpose
- This is a Minecraft mod (“Create: Electric Drive”) built on Forge (Neoforge) that extends the Create mod by adding electric motors and related components.
- The README confirms it integrates with Create’s “karakuri” system, powering it via energy from other industrial mods.

##### File Structure Analysis
- Top-level build files: gradlew, build.gradle, settings.gradle, gradle/ wrapper → standard Gradle/Forge mod build.
- src/main/java/com/akurakuu/create_electric_drive → Java code packaging:
- CreateElectricDrive.java (mod entry point)
- Registration helpers: AllBlocks, AllItems, AllEntities, AllCreateModeTabs
- Core logic: block/motor subpackages, abstractmotor, capability, payload
- Utility classes: ShapeUtil, TierUtil, Config
- src/main/resources/assets & data → resource definitions for block states, models, textures, recipes, loot tables, localization.
- src/main/templates → mod metadata (neoforge.mods.toml).

##### Insights from README
- Confirms purpose: add multiple motor types, energy integration with Create karakuri.
- Points to upstream dependencies: Create and Create Crafts & Additions (both MIT-licensed).

a. Main Components
- Minecraft Engine (client & server runtime)
- Forge Mod Loader (Neoforge framework)
- Create Core Mod (provides karakuri, mechanical network)
- Create: Electric Drive Mod
- Mod Initialization (CreateElectricDrive.java + Config)
- Registration Layer (AllBlocks, AllItems, AllEntities, AllCreateModeTabs)
- Block/BlockEntity Layer (BasicMotor, AdvancedMotor, InnovativeMotor, UltimateMotor + AbstractMotor base classes)
- Capability System (Capability.java, BlockCapability, server/client PayloadHandlers)
- Resource Pack (assets + models + textures + blockstates)
- Data Pack (recipes + loot tables + tags)
- External Tools (Aseprite, Blockbench—source assets)

b. Relationships and Data Flows
- Forge loads the mod: calls mod initializer → registers blocks/items/entities/capabilities via EventBus
- Minecraft engine uses registered blocks & entities in game world
- PayloadHandlers sync capability state between server and client
- Resource pack and data pack drive in-game visuals, crafting, and loot

c. Architectural Patterns and Principles
- Modular feature packages (block­/motor, abstractmotor, capability, payload)
- Registration via central “AllX” classes (separation of concerns)
- Use of inheritance & abstract base classes (AbstractMotorBlock & AbstractMotorBlockEntity)
- Event-driven initialization (Forge EventBus)
- Client/server separation for payload handling

d. Key Technologies & Frameworks
- Java 17+, Forge (Neoforge), Gradle
- Create API (mechanical network integration)
- JSON-based resource & data definitions
- Aseprite & Blockbench for assets

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Systems
    Forge["Forge Mod Loader"]:::external
    CreateAPI["Create Core Mod<br/>(Karakuri)"]:::external
    Minecraft["Minecraft Engine<br/>(Client & Server)"]:::external

    %% Mod Initialization
    ModInit["Mod Initialization<br/>(CreateElectricDrive.java)"]:::codeModule
    click ModInit "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/java/com/akurakuu/create_electric_drive/CreateElectricDrive.java"

    %% Configuration
    Config["Configuration Module<br/>(Config.java)"]:::codeModule
    click Config "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/java/com/akurakuu/create_electric_drive/Config.java"

    %% Registration Layer
    subgraph "Registration Layer"
        AllBlocks["AllBlocks"]:::codeModule
        click AllBlocks "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/java/com/akurakuu/create_electric_drive/AllBlocks.java"
        AllItems["AllItems"]:::codeModule
        click AllItems "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/java/com/akurakuu/create_electric_drive/AllItems.java"
        AllEntities["AllEntities"]:::codeModule
        click AllEntities "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/java/com/akurakuu/create_electric_drive/AllEntities.java"
        AllTabs["AllCreateModeTabs"]:::codeModule
        click AllTabs "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/java/com/akurakuu/create_electric_drive/AllCreateModeTabs.java"
    end

    %% Block/Motor Implementations
    subgraph "Block/Motor Layer"
        BasicBlock["BasicMotorBlock"]:::codeModule
        click BasicBlock "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/java/com/akurakuu/create_electric_drive/block/motor/BasicMotorBlock.java"
        BasicEntity["BasicMotorBlockEntity"]:::codeModule
        click BasicEntity "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/java/com/akurakuu/create_electric_drive/block/motor/BasicMotorBlockEntity.java"

        AdvancedBlock["AdvancedMotorBlock"]:::codeModule
        click AdvancedBlock "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/java/com/akurakuu/create_electric_drive/block/motor/AdvancedMotorBlock.java"
        AdvancedEntity["AdvancedMotorBlockEntity"]:::codeModule
        click AdvancedEntity "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/java/com/akurakuu/create_electric_drive/block/motor/AdvancedMotorBlockEntity.java"

        InnovativeBlock["InnovativeMotorBlock"]:::codeModule
        click InnovativeBlock "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/java/com/akurakuu/create_electric_drive/block/motor/InnovativeMotorBlock.java"
        InnovativeEntity["InnovativeMotorBlockEntity"]:::codeModule
        click InnovativeEntity "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/java/com/akurakuu/create_electric_drive/block/motor/InnovativeMotorBlockEntity.java"

        UltimateBlock["UltimateMotorBlock"]:::codeModule
        click UltimateBlock "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/java/com/akurakuu/create_electric_drive/block/motor/UltimateMotorBlock.java"
        UltimateEntity["UltimateMotorBlockEntity"]:::codeModule
        click UltimateEntity "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/java/com/akurakuu/create_electric_drive/block/motor/UltimateMotorBlockEntity.java"
    end

    %% Abstract Motor Base Classes
    subgraph "Abstract Motor Base"
        AbstractBlock["AbstractMotorBlock"]:::codeModule
        click AbstractBlock "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/java/com/akurakuu/create_electric_drive/block/motor/abstractmotor/AbstractMotorBlock.java"
        AbstractEntity["AbstractMotorBlockEntity"]:::codeModule
        click AbstractEntity "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/java/com/akurakuu/create_electric_drive/block/motor/abstractmotor/AbstractMotorBlockEntity.java"
        AbstractRenderer["AbstractMotorRenderer"]:::codeModule
        click AbstractRenderer "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/java/com/akurakuu/create_electric_drive/block/motor/abstractmotor/AbstractMotorRenderer.java"
    end

    %% Capability System
    subgraph "Capability System"
        CapInterface["Capability Interface"]:::codeModule
        click CapInterface "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/java/com/akurakuu/create_electric_drive/capability/Capability.java"
        BlockCap["Block Capability Integration"]:::codeModule
        click BlockCap "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/java/com/akurakuu/create_electric_drive/block/BlockCapability.java"
    end

    %% Payload Synchronization
    subgraph "Payload Synchronization"
        PayloadDef["CapabilityPayload"]:::codeModule
        click PayloadDef "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/java/com/akurakuu/create_electric_drive/payload/capability/CapabilityPayload.java"
        ClientHandler["ClientPayloadHandler"]:::codeModule
        click ClientHandler "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/java/com/akurakuu/create_electric_drive/payload/capability/ClientPayloadHandler.java"
        ServerHandler["ServerPayloadHandler"]:::codeModule
        click ServerHandler "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/java/com/akurakuu/create_electric_drive/payload/capability/ServerPayloadHandler.java"
    end

    %% Utility Modules
    subgraph "Utility Modules"
        ShapeUtil["ShapeUtil"]:::codeModule
        click ShapeUtil "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/java/com/akurakuu/create_electric_drive/ShapeUtil.java"
        TierUtil["TierUtil"]:::codeModule
        click TierUtil "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/java/com/akurakuu/create_electric_drive/TierUtil.java"
    end

    %% Resources & Data
    subgraph "Resource Pack" 
        Assets["Assets Root"]:::data
        click Assets "https://github.com/akurakuu/create-electric-drive/tree/master/src/main/resources/assets/create_electric_drive"
        Aseprite["Aseprite Sources"]:::data
        click Aseprite "https://github.com/akurakuu/create-electric-drive/tree/master/src/main/resources/assets/aseprite"
        Blockbench["Blockbench Models"]:::data
        click Blockbench "https://github.com/akurakuu/create-electric-drive/tree/master/src/main/resources/assets/blockbench"
    end

    subgraph "Data Pack"
        DataRoot["Data Root"]:::data
        click DataRoot "https://github.com/akurakuu/create-electric-drive/tree/master/src/main/resources/data/create_electric_drive"
        Loot["Loot Tables"]:::data
        click Loot "https://github.com/akurakuu/create-electric-drive/tree/master/src/main/resources/data/create_electric_drive/loot_table"
        Recipes["Recipes"]:::data
        click Recipes "https://github.com/akurakuu/create-electric-drive/tree/master/src/main/resources/data/create_electric_drive/recipe"
        Tags["Tags"]:::data
        click Tags "https://github.com/akurakuu/create-electric-drive/tree/master/src/main/resources/data/create_electric_drive/tags"
    end

    %% Mod Metadata
    Meta["neoforge.mods.toml"]:::data
    click Meta "https://github.com/akurakuu/create-electric-drive/blob/master/src/main/templates/META-INF/neoforge.mods.toml"

    %% Relationships
    Forge -->|"initializes"| ModInit
    ModInit --> Config
    ModInit --> AllBlocks & AllItems & AllEntities & AllTabs
    AllBlocks & AllItems & AllEntities & AllTabs --> BlockLayer
    BlockLayer --> AbstractBlock & AbstractEntity
    BlockLayer --> CapInterface & BlockCap
    BlockLayer --> Minecraft
    BlockLayer --> CreateAPI
    CapInterface & BlockCap --> PayloadDef
    PayloadDef --> ClientHandler & ServerHandler
    ClientHandler <-->|"sync"| ServerHandler
    ServerHandler --> Minecraft
    Minecraft --> Assets & DataRoot
    DataRoot --> Loot & Recipes & Tags

    %% Styles
    classDef codeModule fill:#cfe2f3,stroke:#036; 
    classDef data fill:#d9ead3,stroke:#38761d;
    classDef external fill:#f9cb9c,stroke:#b45f06;
```
