# devotedmc/factorymod architecture

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

- Interactive diagram: https://gitdiagram.com/devotedmc/factorymod
- Repository: https://github.com/devotedmc/factorymod

## Overview

##### Main Components

a. Core System Components:
- FactoryMod (Main Plugin Class)
- FactoryModManager (Central Management)
- ConfigParser (Configuration Handler)

b. Factory Types Layer:
- Factory Interface/Abstract Classes
- Concrete Factory Implementations (FurnCraftChest, Pipe, Sorter)

c. Supporting Systems:
- Interaction Management
- Power Management
- Repair Management
- Recipe System
- Structure Management

**┌─ Plugin Interface Layer ─────────────────────┐**
- Commands                                   │
- Listeners                                  │
- Events                                     │
- Core Management Layer ────────────────────┐ │
- FactoryModManager                       │ │
- Configuration                           │ │
- Permission Management                   │ │
- Factory Implementation Layer ────────────┐│ │
- Factory Types                         ││ │
- Structures                            ││ │
- Interaction Handlers                  ││ │
- Supporting Systems Layer ──────────────┐││ │
- Power Management                     │││ │
- Repair Management                    │││ │
- Recipe System                        │││ │
- ┘

##### Key Relationships to Highlight

a. Factory Creation Flow:
- How Factory Eggs create Factory instances
- Structure definitions to Factory types
- Interaction between Factories and Recipes

b. Operational Flow:
- Power Management → Factory Operation
- Recipe Execution → Events
- User Interaction → Factory State Changes

##### Specific Implementation Details

Specialized components unique to this plugin:
- Factory Types (FurnCraftChest, Pipe, Sorter)
- Recipe Types (Production, Repair, Upgrade, etc.)
- Event System (FactoryActivateEvent, ItemTransferEvent, etc.)

##### External Integration Points

Connections to:
- Minecraft Server API
- Citadel Plugin (via CitadelListener)
- Configuration Files
- Storage System

##### Important Notes

a. Use clear symbols:
- Diamonds for interfaces
- Rectangles for concrete classes

b. Related components:
- Recipe system components together
- Factory types together
- Management systems together

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Style Definitions
    classDef core fill:#b3d1ff,stroke:#333,stroke-width:2px
    classDef factory fill:#90EE90,stroke:#333,stroke-width:2px
    classDef support fill:#FFE5B4,stroke:#333,stroke-width:2px
    classDef interface fill:#E6E6FA,stroke:#333,stroke-width:2px
    classDef utility fill:#D3D3D3,stroke:#333,stroke-width:2px

    %% Plugin Interface Layer
    subgraph Interface
        Commands["Commands"]
        Listeners["Listeners"]
        Events["Events"]
    end

    %% Core Management Layer
    subgraph Core
        FactoryMod["FactoryMod"]
        FactoryManager["FactoryModManager"]
        ConfigParser["ConfigParser"]
        PermManager["Permission Manager"]
    end

    %% Factory Implementation Layer
    subgraph Factories
        FactoryBase["Factory Base"]
        FactoryEggs["Factory Eggs"]
        FactoryImpl["Factory Implementations"]
    end

    %% Supporting Systems Layer
    subgraph Support
        InteractionMgr["Interaction Management"]
        PowerMgr["Power Management"]
        RepairMgr["Repair Management"]
        RecipeSystem["Recipe System"]
        StructureMgr["Structure Management"]
        GUI["GUI System"]
        FileHandler["File Handler"]
    end

    %% Relationships
    FactoryMod --> FactoryManager
    FactoryManager --> ConfigParser
    FactoryManager --> FactoryBase
    FactoryBase --> FactoryImpl
    FactoryEggs --> FactoryImpl
    FactoryManager --> Support
    Interface --> FactoryManager
    FactoryImpl --> Support

    %% Click Events
    click FactoryMod "https://github.com/devotedmc/factorymod/blob/master/src/main/java/com/github/igotyou/FactoryMod/FactoryMod.java"
    click FactoryManager "https://github.com/devotedmc/factorymod/blob/master/src/main/java/com/github/igotyou/FactoryMod/FactoryModManager.java"
    click ConfigParser "https://github.com/devotedmc/factorymod/blob/master/src/main/java/com/github/igotyou/FactoryMod/ConfigParser.java"
    click FactoryBase "https://github.com/devotedmc/factorymod/blob/master/src/main/java/com/github/igotyou/FactoryMod/factories/Factory.java"
    click FactoryImpl "https://github.com/devotedmc/factorymod/tree/master/src/main/java/com/github/igotyou/FactoryMod/factories/"
    click FactoryEggs "https://github.com/devotedmc/factorymod/blob/master/src/main/java/com/github/igotyou/FactoryMod/eggs/IFactoryEgg.java"
    click InteractionMgr "https://github.com/devotedmc/factorymod/tree/master/src/main/java/com/github/igotyou/FactoryMod/interactionManager/"
    click PowerMgr "https://github.com/devotedmc/factorymod/tree/master/src/main/java/com/github/igotyou/FactoryMod/powerManager/"
    click RepairMgr "https://github.com/devotedmc/factorymod/tree/master/src/main/java/com/github/igotyou/FactoryMod/repairManager/"
    click RecipeSystem "https://github.com/devotedmc/factorymod/tree/master/src/main/java/com/github/igotyou/FactoryMod/recipes/"
    click StructureMgr "https://github.com/devotedmc/factorymod/tree/master/src/main/java/com/github/igotyou/FactoryMod/structures/"
    click Commands "https://github.com/devotedmc/factorymod/tree/master/src/main/java/com/github/igotyou/FactoryMod/commands/"
    click Listeners "https://github.com/devotedmc/factorymod/tree/master/src/main/java/com/github/igotyou/FactoryMod/listeners/"
    click Events "https://github.com/devotedmc/factorymod/tree/master/src/main/java/com/github/igotyou/FactoryMod/events/"
    click PermManager "https://github.com/devotedmc/factorymod/blob/master/src/main/java/com/github/igotyou/FactoryMod/utility/FactoryModPermissionManager.java"
    click GUI "https://github.com/devotedmc/factorymod/blob/master/src/main/java/com/github/igotyou/FactoryMod/utility/FactoryModGUI.java"
    click FileHandler "https://github.com/devotedmc/factorymod/blob/master/src/main/java/com/github/igotyou/FactoryMod/utility/FileHandler.java"

    %% Style Applications
    class FactoryMod,FactoryManager,ConfigParser core
    class FactoryBase,FactoryEggs,FactoryImpl factory
    class InteractionMgr,PowerMgr,RepairMgr,RecipeSystem,StructureMgr support
    class Commands,Listeners,Events interface
    class PermManager,GUI,FileHandler utility
```
