# pan4ur/thunderhack-recode architecture

> Architecture diagram of the GitHub repository pan4ur/thunderhack-recode, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pan4ur/thunderhack-recode
- Repository: https://github.com/pan4ur/thunderhack-recode

## Overview

##### Relationships and Data Flows
- “Event System” to both the Core and Modules: events are created (or intercepted by Injection/Mixins) and then propagated to modules and GUI components.
- “GUI Layer” to the “Core” and “Event System” to show that user interactions and on-screen displays are driven by core state and events.
- That the “Settings” management ties back to both Core and Command systems for user configuration.

##### Important Architectural Patterns and Design Principles
- Event-driven Architecture: Emphasize how modules and GUI components subscribe to events (like key presses, mouse events, and world updates) that originate from both the core and Mixin injections.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Systems
    subgraph "External Systems"
        MCI["Minecraft Client Engine"]:::external
        Fabric["Fabric API & Libraries"]:::external
    end

    %% Core & Management Layer
    subgraph "Core & Management Layer"
        Core["Core System"]:::core
        Managers["Managers"]:::manager
        Core -->|"initializes"| Managers
    end

    %% Mid-Level Systems
    subgraph "Mid-Level Systems"
        Events["Event System"]:::event
        Modules["Modules/Features"]:::modules
        Injection["Mixin Injections"]:::injection
        Settings["Settings/Configuration"]:::config
        Utilities["Utility Libraries"]:::utility
        Resources["Resources/Assets"]:::resources
    end

    %% User Interface & Command/Add-on Layer
    subgraph "User Interface & Command/Add-on Layer"
        GUI["GUI Components"]:::gui
        Commands["Command Infrastructure"]:::command
        AddonMgr["Addon Manager"]:::addon
        IAddon["IAddon API"]:::addon
    end

    %% Relationships
    Managers -->|"coordinates"| Events
    Managers -->|"loads_modules"| Modules
    Managers -->|"manages_config"| Settings
    Modules -->|"subscribes_to"| Events
    GUI -->|"renders_based_on"| Events
    Injection -->|"injects_into"| MCI
    Modules -->|"triggers_commands"| Commands
    Commands -->|"updates_config"| Settings
    Utilities ---|"supports"| Core
    Utilities --- Modules
    Utilities --- GUI
    AddonMgr ---|"integrates_addons_with"| Managers
    Resources ---|"provides_assets_to"| Core

    %% External connections
    Core --- Fabric
    Modules --- Fabric

    %% Additional connection for addon API usage
    GUI ---|"utilizes"| IAddon

    %% Click Events
    click Core "https://github.com/pan4ur/thunderhack-recode/tree/main/src/main/java/thunder/hack/core"
    click Managers "https://github.com/pan4ur/thunderhack-recode/tree/main/src/main/java/thunder/hack/core/manager"
    click Modules "https://github.com/pan4ur/thunderhack-recode/tree/main/src/main/java/thunder/hack/features"
    click Events "https://github.com/pan4ur/thunderhack-recode/tree/main/src/main/java/thunder/hack/events"
    click Injection "https://github.com/pan4ur/thunderhack-recode/tree/main/src/main/java/thunder/hack/injection"
    click GUI "https://github.com/pan4ur/thunderhack-recode/tree/main/src/main/java/thunder/hack/gui"
    click Settings "https://github.com/pan4ur/thunderhack-recode/tree/main/src/main/java/thunder/hack/setting"
    click Utilities "https://github.com/pan4ur/thunderhack-recode/tree/main/src/main/java/thunder/hack/utility"
    click Resources "https://github.com/pan4ur/thunderhack-recode/tree/main/src/main/resources/assets/thunderhack"
    click Commands "https://github.com/pan4ur/thunderhack-recode/tree/main/src/main/java/thunder/hack/features/cmd"
    click AddonMgr "https://github.com/pan4ur/thunderhack-recode/tree/main/src/main/java/thunder/hack/core/manager/client/AddonManager"
    click IAddon "https://github.com/pan4ur/thunderhack-recode/tree/main/src/main/java/thunder/hack/api/IAddon"

    %% Styles
    classDef core fill:#ffcccc,stroke:#990000,stroke-width:2px;
    classDef manager fill:#ccffcc,stroke:#006600,stroke-width:2px;
    classDef event fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef modules fill:#e2ccff,stroke:#5a009d,stroke-width:2px;
    classDef injection fill:#ffe6cc,stroke:#e65c00,stroke-width:2px;
    classDef config fill:#ffffcc,stroke:#999900,stroke-width:2px;
    classDef utility fill:#d9d9d9,stroke:#333333,stroke-width:2px;
    classDef resources fill:#d1e7dd,stroke:#0f5132,stroke-width:2px;
    classDef gui fill:#ccffff,stroke:#008080,stroke-width:2px;
    classDef command fill:#ffccff,stroke:#cc0066,stroke-width:2px;
    classDef addon fill:#ffd9b3,stroke:#e65c00,stroke-width:2px;
    classDef external fill:#f8d7da,stroke:#721c24,stroke-width:2px;
```
