# dlindustries/system architecture

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

- Interactive diagram: https://gitdiagram.com/dlindustries/system
- Repository: https://github.com/dlindustries/system

## Overview

##### Project type and purpose
- This is a Minecraft client‐side mod built with Fabric (a fork of the Argon client) that injects into the Minecraft client to provide optimized PvP features, event hooks, GUI modules, and mixin‐based bytecode patches. Its primary goal is to bypass specific anticheats (Vulcan, Grim) while providing a modular, event‐driven framework for gameplay enhancements.

##### File structure
- Top‐level build files (build.gradle, settings.gradle, gradlew) indicate a Gradle‐based Java project.
- src/main/java/dlindustries/vigillant/system contains the core:
- Main.java – entry point to initialize the event bus, module manager, and mixins.
- system/event – Event, CancellableEvent, EventManager, Listener interfaces (Observer pattern).
- module – Module, ModuleManager, categories & module implementations (extensibility points).
- mixin & imixin – Fabric Mixin definitions and interfaces for bytecode injection into Minecraft classes.
- gui & font – ClickGui, windowing, font rendering components for the in‐game UI.
- utils – helper classes for game interactions (block, mouse, network simulation).
- src/main/resources/client.mixins.json & fabric.mod.json define Fabric loader metadata and mixin configuration.
- assets/system includes fonts and images for the GUI skin.

##### README for additional insights
- The README confirms it extends Argon’s core, adds anti‐cheat bypass optimizations (module adjustments, packet ordering fixes).
- Usage instructions show it’s packaged as a Fabric mod JAR, placed in the mods folder.

a. Main components to include
- Minecraft Client (external system)
- Fabric Loader & Fabric API (mod‐loading framework)
- Core Init (Main.java)
- Event System (EventManager + Listener/Event hierarchy)
- Mixin Layer (client.mixins.json → mixin classes → injection points into MinecraftClient, NetworkHandler, Renderer, etc.)
- Module Framework (ModuleManager + individual Module classes grouped by Category)
- GUI Subsystem (ClickGui, Window, Components, FontRenderer)
- Utility Library (Utils, MouseSimulation, BlockUtils, etc.)
- Resources (assets/system/fonts, images)
- Build Pipeline (Gradle wrapper, build scripts)

b. Relationships & interactions
- Fabric Loader initializes the mod via fabric.mod.json, invokes Main.java.
- Main registers mixins (via Fabric API) and initializes the EventManager and ModuleManager.
- Mixin classes inject hooks into Minecraft’s game loop, input handlers, network handlers, and rendering.
- Injected code dispatches events to the EventManager.
- Modules subscribe (Listener) to specific events (e.g., AttackListener, TickListener) to modify behavior or send custom packets.
- Utility classes are invoked by Modules and Listeners to perform computations and simulate user inputs.
- Gradle orchestrates compilation, resource processing, and packaging into a Fabric‐compatible JAR.

c. Architectural patterns & principles
- Observer pattern: EventManager dispatching to Listener implementations.
- Plugin architecture: ModuleManager dynamically loads and manages feature modules.
- Dependency injection & bytecode weaving: Fabric Mixin framework to alter game internals without direct modification.
- Separation of concerns: clear division between core mod init, event dispatch, modules, GUI, and utils.

d. Key technologies & frameworks
- Java 17+
- Gradle build system
- Fabric Loader & Fabric API
- SpongePowered Mixin
- Minecraft client internals (net.minecraft.*)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External Systems
    MC["Minecraft Client"]:::external
    FL["Fabric Loader"]:::external

    %% Build Pipeline
    subgraph "Build Pipeline"
        direction TB
        Gradle["build.gradle"]:::build
        Settings["settings.gradle"]:::build
        Gradlew["gradlew"]:::build
        Wrapper["gradle/wrapper/"]:::build
    end

    %% Core Framework
    subgraph "Core Framework"
        direction TB
        Main["Main (Core Init)"]:::core
        EventMgr["EventManager"]:::core
        ModuleMgr["ModuleManager"]:::core
    end

    %% Event System
    subgraph "Event System"
        direction TB
        EventBase["Event / CancellableEvent"]:::core
        Listener["Listener"]:::core
        EventHooks["Concrete Event Hooks"]:::core
    end

    %% Mixin Layer
    subgraph "Mixin Layer"
        direction TB
        IMixins["IMixin Interfaces"]:::mixin
        Mixins["Mixin Implementations"]:::mixin
        MixinCfg["client.mixins.json"]:::mixin
    end

    %% Module Framework
    subgraph "Module Framework"
        direction TB
        ModuleCore["Module.java"]:::modules
        ModuleSettings["Module Settings"]:::modules
        FeatureModules["Feature Modules"]:::modules
        Category["Category"]:::modules
    end

    %% GUI Subsystem
    subgraph "GUI Subsystem"
        direction TB
        ClickGui["ClickGui"]:::core
        Window["Window"]:::core
        GUIComponents["GUI Components"]:::core
        FontRender["FontRenderer"]:::core
    end

    %% Utility Library
    subgraph "Utility Library"
        direction TB
        Utils["Utils Package"]:::utils
    end

    %% Managers
    subgraph "Auxiliary Managers"
        direction TB
        Managers["FriendManager / ProfileManager"]:::core
    end

    %% Resources
    subgraph "Resources"
        direction TB
        FontsRes["assets/system/font/"]:::resources
        ImagesRes["assets/system/images/"]:::resources
        FabricCfg["fabric.mod.json"]:::resources
    end

    %% Connections
    Gradle -->|orchestrates build| FL
    Settings --> FL
    Gradlew --> FL
    Wrapper --> FL

    FL -->|loads mod via fabric.mod.json| Main
    FabricCfg --> FL

    Main -->|"init EventMgr"| EventMgr
    Main -->|"init ModuleMgr"| ModuleMgr
    Main -->|"register mixins"| MixinCfg

    Mixins -->|inject hooks into| MC
    IMixins -->|define injection points| Mixins

    MC -->|"game loop events"| EventHooks
    EventHooks -->|dispatch| EventMgr
    EventMgr -->|notify| Listener

    Listener -->|triggers| FeatureModules
    ModuleMgr --> FeatureModules
    FeatureModules -->|use| Utils

    EventHooks -->|render2DEvent / input| ClickGui
    ClickGui -->|draw| GUIComponents
    GUIComponents -->|use| FontRender

    %% Legend
    subgraph Legend
        direction TB
        A[Core Framework]:::core
        B[Modules]:::modules
        C[Mixins]:::mixin
        D[Utilities]:::utils
        E[External]:::external
        F[Resources]:::resources
        G[Build Scripts]:::build
    end

    %% Click Events
    click FabricCfg "https://github.com/dlindustries/system/blob/main/src/main/resources/fabric.mod.json"
    click MixinCfg "https://github.com/dlindustries/system/blob/main/src/main/resources/client.mixins.json"
    click Main "https://github.com/dlindustries/system/blob/main/src/main/java/dlindustries/vigillant/system/Main.java"
    click EventBase "https://github.com/dlindustries/system/blob/main/src/main/java/dlindustries/vigillant/system/event/Event.java"
    click EventHooks "https://github.com/dlindustries/system/tree/main/src/main/java/dlindustries/vigillant/system/event/events/"
    click ModuleCore "https://github.com/dlindustries/system/blob/main/src/main/java/dlindustries/vigillant/system/module/Module.java"
    click ModuleSettings "https://github.com/dlindustries/system/tree/main/src/main/java/dlindustries/vigillant/system/module/setting/"
    click FeatureModules "https://github.com/dlindustries/system/tree/main/src/main/java/dlindustries/vigillant/system/module/modules/"
    click ClickGui "https://github.com/dlindustries/system/blob/main/src/main/java/dlindustries/vigillant/system/gui/ClickGui.java"
    click Window "https://github.com/dlindustries/system/blob/main/src/main/java/dlindustries/vigillant/system/gui/Window.java"
    click GUIComponents "https://github.com/dlindustries/system/tree/main/src/main/java/dlindustries/vigillant/system/gui/components/"
    click FontRender "https://github.com/dlindustries/system/tree/main/src/main/java/dlindustries/vigillant/system/font/"
    click IMixins "https://github.com/dlindustries/system/tree/main/src/main/java/dlindustries/vigillant/system/imixin/"
    click Mixins "https://github.com/dlindustries/system/tree/main/src/main/java/dlindustries/vigillant/system/mixin/"
    click Utils "https://github.com/dlindustries/system/tree/main/src/main/java/dlindustries/vigillant/system/utils/"
    click Managers "https://github.com/dlindustries/system/tree/main/src/main/java/dlindustries/vigillant/system/managers/"
    click FontsRes "https://github.com/dlindustries/system/tree/main/src/main/resources/assets/system/font/"
    click ImagesRes "https://github.com/dlindustries/system/tree/main/src/main/resources/assets/system/images/"
    click Gradle "https://github.com/dlindustries/system/blob/main/build.gradle"
    click Settings "https://github.com/dlindustries/system/blob/main/settings.gradle"
    click Gradlew "https://github.com/dlindustries/system/tree/main/gradlew"
    click Wrapper "https://github.com/dlindustries/system/tree/main/gradle/wrapper/"

    %% Styles
    classDef core fill:#BBDEFB,stroke:#2196F3,color:#0D47A1
    classDef modules fill:#C8E6C9,stroke:#388E3C,color:#1B5E20
    classDef mixin fill:#FFE0B2,stroke:#FB8C00,color:#E65100
    classDef utils fill:#EEEEEE,stroke:#9E9E9E,color:#424242
    classDef external fill:#CFD8DC,stroke:#607D8B,color:#263238
    classDef resources fill:#B0BEC5,stroke:#455A64,color:#1C313A
    classDef build fill:#D1C4E9,stroke:#7E57C2,color:#311B92
```
