# winsrewu/noglerr architecture

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

- Interactive diagram: https://gitdiagram.com/winsrewu/noglerr
- Repository: https://github.com/winsrewu/noglerr

## Overview

##### Main Components
- Minecraft Client Integration: Since the mod is meant for the client only (as noted in the README), start by placing the “Minecraft Client” component showing where the mod hooks into the Minecraft runtime.
- Core Mod Loader/Entry Point: Represent the main mod entry (e.g., classes like NoglerrClient.java) which initializes the mod’s systems.
- Command System: Include the command package that implements several custom commands (e.g., NoglerrCommand, ShowVarCommand, VoskCommand). This component interacts with the Minecraft chat/command interface.
- Configuration Management: Show a dedicated “Config” or “Settings” component that loads and manages mod configurations (see files in the config package such as ConfigHandler.java, Configs.java, Hotkeys.java).
- Event Handling System: Indicate an “Events” component that deals with various game events (tick events, input, entity updates) based on classes like ClientTickHandler, EntityHandler, Callbacks, and OnTick.
- Mixin and Extension Layer: Outline the “Mixin” component that alters vanilla behaviors (e.g., EntityMixin, MouseMixin) to integrate mod logic into Minecraft’s internal systems.
- “Variable Tweaks” (organized under org.jawbts.noglerr.tweak.var and its subpackages for var, script, and javascript proxy classes) which allow dynamic entity data manipulation and script integration.
- “Voice-to-Text Module” (in the tweak.voice package with Vosk and VoskThread classes) that integrates with the external vosk API for speech recognition.
- Other experimental functionalities (such as entity tracer and assistants for handling projectiles or specific game entity attributes).
- Utility/Helper Components: Highlight support utilities (for example, UpdateChecker, PlayerMessageSender, and general Utils classes) that assist in mod operations and user notifications.

##### Relationships and Interactions
- Core Mod Loader propagating initialization calls to the Event Handling System, Command System, and Configuration Management.
- The Command System should be shown interacting with both the Event Handling (e.g., user-triggered events) and the Configuration Management (to read/update settings).
- The Mixin Layer needs to be drawn as intercepting calls from the Minecraft runtime and redirecting them to the mod’s internal handlers (like Event Handling or Tweaks).
- The “Variable Tweaks” and “Voice-to-Text Module” should be depicted as specialized submodules of “Tweaks,” with lines indicating that they rely on external libraries (Vosk API for voice and Nashorn/Javascript for scripting).
- That the mod also supports scripting with JavaScript (via Nashorn) by linking these packages to a “Scripting & Proxy” component.

##### Architectural Patterns / Design Principles
- Event-Driven Design: Indicate that a significant aspect of the mod architecture is event handling with callbacks and tick handlers integrating with Minecraft’s game loop.
- Integration via Mixins: Note the use of mixin injections to alter vanilla functionality without directly modifying game code.
- Extensibility via Scripting: Emphasize the plugin-like mechanism available by externalizing certain logic (scripts), which acts as hooks for mod developers/users to extend behavior dynamically.

##### Relevant Technologies and External Dependencies
- External Libraries: Clearly mark dependencies such as:
- “vosk-api” for voice-to-text functionality.
- “nashorn” for JavaScript integration.
- “malilib” as a required dependency on the client.
- Resource Files: Represent that assets (language files, mod JSON descriptors like fabric.mod.json and mixins.json) are part of the configuration for mod metadata and localization.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Core Components
    A["Minecraft Client"] 
    B["Core Mod Loader / NoglerrClient"]
    C["Commands & Inputs"]
    D["Config Manager"]
    E["Event & Callback System"]
    F["Mixin & Extension Layer"]
    J["Utilities & Helpers"]

    %% Feature Modules Subgraph
    subgraph "Feature Modules: Tweaks & Assistants"
        G1["Variable Tweaks"]
        G2["Scripting"]
        G3["Proxy"]
        G4["Voice-to-Text Module"]
        G5["Assistants"]
    end

    %% External Dependencies Subgraph
    subgraph "External Dependencies"
        K1["vosk-api"]
        K2["nashorn"]
        K3["malilib"]
        K4["Gradle Build"]
    end

    %% Relationships between Core Components
    A --> B
    B --> C
    B --> D
    B --> E
    B --> F
    B --> J

    %% Interactions between Core Modules
    C -->|"interacts"| E
    C -->|"reads-updates"| D
    C -->|"triggers"| G1
    C -->|"triggers"| G2
    C -->|"triggers"| G3
    E -->|"fires"| G1
    E -->|"fires"| G4
    E -->|"fires"| G5
    D -->|"supports"| G1
    E -->|"logs-to"| J

    %% External Dependencies linking to Modules
    K1 --> G4
    K2 --> G2
    K3 --> A
    K4 --> B

    %% Styles
    class A,K3 external
    class K1,K2,K4 external
    class B,D,E,F,J core
    class C command
    class G1,G2,G3,G4,G5 feature

    %% Class Definitions with Colors
    classDef external fill:#F9E79F,stroke:#000,stroke-width:1px;
    classDef core fill:#AED6F1,stroke:#000,stroke-width:1px;
    classDef command fill:#D7BDE2,stroke:#000,stroke-width:1px;
    classDef feature fill:#A9DFBF,stroke:#000,stroke-width:1px;
    classDef util fill:#F5CBA7,stroke:#000,stroke-width:1px;

    %% Click Events for Component Mapping
    click A "https://github.com/winsrewu/noglerr/blob/fabric-1.17.x/src/main/java/org/jawbts/noglerr/client/NoglerrClient.java"
    click B "https://github.com/winsrewu/noglerr/blob/fabric-1.17.x/src/main/java/org/jawbts/noglerr/client/NoglerrClient.java"
    click C "https://github.com/winsrewu/noglerr/tree/fabric-1.17.x/src/main/java/org/jawbts/noglerr/commands"
    click D "https://github.com/winsrewu/noglerr/tree/fabric-1.17.x/src/main/java/org/jawbts/noglerr/config"
    click E "https://github.com/winsrewu/noglerr/tree/fabric-1.17.x/src/main/java/org/jawbts/noglerr/event"
    click F "https://github.com/winsrewu/noglerr/tree/fabric-1.17.x/src/main/java/org/jawbts/noglerr/mixin"
    click G1 "https://github.com/winsrewu/noglerr/tree/fabric-1.17.x/src/main/java/org/jawbts/noglerr/tweak/var"
    click G2 "https://github.com/winsrewu/noglerr/tree/fabric-1.17.x/src/main/java/org/jawbts/noglerr/tweak/var/javascript"
    click G3 "https://github.com/winsrewu/noglerr/tree/fabric-1.17.x/src/main/java/org/jawbts/noglerr/tweak/var/javascript/proxy"
    click G4 "https://github.com/winsrewu/noglerr/tree/fabric-1.17.x/src/main/java/org/jawbts/noglerr/tweak/voice"
    click G5 "https://github.com/winsrewu/noglerr/tree/fabric-1.17.x/src/main/java/org/jawbts/noglerr/tweak/assistant"
    click J "https://github.com/winsrewu/noglerr/tree/fabric-1.17.x/src/main/java/org/jawbts/noglerr/util"
```
