# skiddermc/fdpclient architecture

> Architecture diagram of the GitHub repository skiddermc/fdpclient, 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/skiddermc/fdpclient
- Repository: https://github.com/skiddermc/fdpclient

## Overview

##### Main Components
- Core Client Engine – The entry point of the client (e.g., FDPClient.kt) that initializes all other parts.
- Module Manager – Located under features/module, this component is responsible for loading, enabling, and managing various game modifications (modules) like combat, movement, visual, player, and other miscellaneous modules.
- Event System – Appropriately found in the event package (and its async subpackages) that implements an observer/subscribe pattern for events triggering module actions.
- Command Manager – Under features/command, this manages different client commands (commands to toggle modules, bind keys, etc.).
- Injection Layer – Consisting of numerous mixin-related packages (injection/forge, mixins, transformers, etc.) that inject custom code into Minecraft’s original classes.
- Handlers – Various handler packages (e.g., handler/api, handler/cape, handler/irc, handler/macro, handler/discord) manage external APIs, messaging, cape handling, and other integrations.
- Configuration & File Management – Under file and its subpackages (configs and config/section) that deal with saving/loading client settings, module configurations, and profiles.
- Scripting & Remapping – Found within the script package, these components provide a script system for extending or altering client behavior.
- User Interface (UI) – Two main UI layers:
– Click GUI & Alt Manager (under ui/client/clickgui and ui/client/altmanager) for interacting with modules and settings.
– HUD and in-game overlays (under ui/client/hud) to present information on screen.
- Utility Libraries – A collection of diverse utility packages (utils, utils/client, utils/render, etc.) that support tasks like rendering, rotation, inventory management, timing, etc.

##### Relationships and Interactions
- The Core Engine starts up and instantiates the Module Manager which in turn registers all available modules.
- A centralized Event System (observer pattern) sends events from the game loop to registered modules, UI components, and other systems.
- The Command Manager listens to user input (via the UI) and issues commands that are processed by the Module Manager.
- Handlers (e.g., Discord, IRC, cape) act as integration endpoints. They may consume events from the core or command modules and in some cases, provide callbacks and additional data.
- The Configuration & File Manager system ensures settings are persisted. It supports the Module Manager and UI by supplying configuration data during runtime.
- The Scripting system builds upon these components, allowing runtime modifications via scripts that may trigger module behavior or extend event handling.
- The Utility Libraries are utilized by nearly all of the above components and thus can be represented as shared services supporting the system’s overall functionality.

##### Architectural Patterns and Design Principles
- Modular Design – Each client feature is implemented as an independent module (evident from the numerous “modules” packages) allowing for extensibility and dynamic loading/unloading.
- Observer/Publisher-Subscriber Pattern – Implemented by the event system to decouple event producers (game events) from consumers (modules, handlers).
- Dependency Injection via Mixins – The use of mixin-based injection into Minecraft’s classes creates a separation between the vanilla code and the injected functionality.
- Layered Architecture – Differentiating between low-level injection/utility components and high-level features (module managers, UI, handlers).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Core Systems
    subgraph "Core Systems"
        CCE["Core Client Engine"]:::core
        MM["Module Manager"]:::core
        ES["Event System"]:::core
        CM["Command Manager"]:::core
    end

    %% Injection and Scripting Layer
    subgraph "Injection & Scripting"
        IL["Injection Layer"]:::inj
        SE["Scripting Engine"]:::script
        RM["Remapping"]:::script
    end

    %% UI and External Integrations
    subgraph "UI & Integrations"
        CG["Click GUI & Alt Manager"]:::ui
        HUD["HUD & Overlays"]:::ui
        API["API Handler"]:::inj
        CPH["Cape Handler"]:::inj
        DH["Discord Handler"]:::inj
        IRCH["IRC Handler"]:::inj
        MH["Macro Handler"]:::inj
    end

    %% Configuration and Utilities
    subgraph "Configuration & Utilities"
        CF["Configuration & File Management"]:::config
        UL["Utility Libraries"]:::util
    end

    %% Core Systems Interactions
    CCE -->|"init-modules"| MM
    CCE -->|"init-events"| ES
    ES -->|"publish-events"| MM
    CM -->|"issue-command"| MM
    CG -->|"user-command"| CM
    MM -->|"UI-sync"| CG

    %% Injection Interactions
    IL -->|"injects-core"| CCE
    IL -->|"injects-UI"| CG

    %% Handlers receiving events
    ES -->|"notify"| API
    ES -->|"notify"| CPH
    ES -->|"notify"| DH
    ES -->|"notify"| IRCH
    ES -->|"notify"| MH

    %% Configuration feeding systems
    CF -->|"config-data"| MM
    CF -->|"config-data"| CG

    %% Scripting interactions
    SE -->|"runtime-mods"| MM
    SE -->|"assist-remap"| RM

    %% Utility libraries support
    UL -->|"support"| CCE
    UL -->|"support"| MM
    UL -->|"support"| CG

    %% Click Events
    click CCE "https://github.com/skiddermc/fdpclient/blob/main/src/main/java/net/ccbluex/liquidbounce/FDPClient.kt"
    click MM "https://github.com/skiddermc/fdpclient/blob/main/src/main/java/net/ccbluex/liquidbounce/features/module/ModuleManager.kt"
    click ES "https://github.com/skiddermc/fdpclient/tree/main/src/main/java/net/ccbluex/liquidbounce/event"
    click CM "https://github.com/skiddermc/fdpclient/blob/main/src/main/java/net/ccbluex/liquidbounce/features/command/CommandManager.kt"
    click IL "https://github.com/skiddermc/fdpclient/tree/main/src/main/java/net/ccbluex/liquidbounce/injection"
    click API "https://github.com/skiddermc/fdpclient/tree/main/src/main/java/net/ccbluex/liquidbounce/handler/api"
    click CPH "https://github.com/skiddermc/fdpclient/tree/main/src/main/java/net/ccbluex/liquidbounce/handler/cape"
    click DH "https://github.com/skiddermc/fdpclient/tree/main/src/main/java/net/ccbluex/liquidbounce/handler/discord"
    click IRCH "https://github.com/skiddermc/fdpclient/tree/main/src/main/java/net/ccbluex/liquidbounce/handler/irc"
    click MH "https://github.com/skiddermc/fdpclient/tree/main/src/main/java/net/ccbluex/liquidbounce/handler/macro"
    click CF "https://github.com/skiddermc/fdpclient/tree/main/src/main/java/net/ccbluex/liquidbounce/file"
    click SE "https://github.com/skiddermc/fdpclient/tree/main/src/main/java/net/ccbluex/liquidbounce/script"
    click RM "https://github.com/skiddermc/fdpclient/tree/main/src/main/java/net/ccbluex/liquidbounce/script/remapper"
    click CG "https://github.com/skiddermc/fdpclient/tree/main/src/main/java/net/ccbluex/liquidbounce/ui/client/clickgui"
    click HUD "https://github.com/skiddermc/fdpclient/tree/main/src/main/java/net/ccbluex/liquidbounce/ui/client/hud"
    click UL "https://github.com/skiddermc/fdpclient/tree/main/src/main/java/net/ccbluex/liquidbounce/utils"

    %% Styles
    classDef core fill:#a4c8f0,stroke:#1e5f8b,stroke-width:2px;
    classDef inj fill:#f0a4a4,stroke:#8b1e1e,stroke-width:2px;
    classDef ui fill:#f0e68c,stroke:#8b8b1e,stroke-width:2px;
    classDef config fill:#d3d3d3,stroke:#696969,stroke-width:2px;
    classDef script fill:#dda0dd,stroke:#8b1e8b,stroke-width:2px;
    classDef util fill:#ffdead,stroke:#cd853f,stroke-width:2px;
```
