# ronaldcabrera/queen-cats-dogs-fabric architecture

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

- Interactive diagram: https://gitdiagram.com/ronaldcabrera/queen-cats-dogs-fabric
- Repository: https://github.com/ronaldcabrera/queen-cats-dogs-fabric

## Overview

##### Main Components
- Mod Core & Bootstrapping: Represent the main mod classes (QueenCats.java and QueenCatsClient.java) which initialize and launch the mod. Include the Fabric mod descriptor (fabric.mod.json) as these provide the necessary metadata and entry points.
- Configuration & Integration: Include components like QueenCatsConfig.java and QueenCatsModMenuIntegration.java. These handle settings and integration with mod menus for user configuration.
- Custom Entities & Variants: Create a section for the custom entity implementations. Break these down into:
– Base Entities and their variants (located under src/main/java/net/pevori/queencats/entity, /custom, and /variant).
– Client-side rendering components (models and renderers inside the entity/client folder).
– Corresponding mixins (in the mixin folder) that modify or extend vanilla behaviors.
- Items & Registration: Denote the item management with ModItems.java, along with related classes like GlintedItem.java, ModFoodComponents.java, and ModItemGroup.java. Also include ModRegistries.java for registering components.
- Sound & Screen Components: Highlight sound definitions (ModSounds.java and the assets sounds directory) and screen elements (under the screen folder) which handle UI aspects like container screens and their handlers.
- Assets and Resources: Represent the assets (textures, models, animations, languages, and sounds) and data (such as recipes) directories that the mod uses to provide its media and configuration files for Minecraft.
- Build and Deployment: Include the Gradle build files (build.gradle, gradle-wrapper files, settings.gradle) that manage project dependencies, including Fabric API and Geckolib.

##### Component Relationships & Data Flow
– From the Core Component to the Configuration Component (loading config, integrating into a mod menu).
– From the Core Component to Entities (where mod initialization leads to entity registration and rendering configuration).
– Connect the Items and Recipes, showing how item registration in code correlates with JSON recipes in the data directory.
– Link the rendering components (mixins, models, renderers) to the assets (geo, animations, and textures) as they interact for proper in-game visuals.
– Display a connection between the Fabric mod JSON describing the mod and the core components that get registered by Fabric.

##### Architectural Patterns and Design Principles
- Modularity: Each feature (custom entities, items, config, UI, sound) is separated into its own package/subsystem.
- Separation of Concerns: There’s a clear distinction between client-side elements (rendering, mixins, screens) and game logic/configuration which can be managed separately.
- Registration Pattern: Centralized registries (see ModRegistries.java and ModEntities.java) are key for managing the custom elements.

##### Relevant Technologies/Frameworks
- Fabric API: Note its role in modding, event handling, and integration with Minecraft.
- Geckolib: Highlight its use for handling animations and advanced rendering.
- Gradle: Indicate the build and dependency management system.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Mod Loader & Configuration
    subgraph "Mod Loader & Configuration"
        FAB["Fabric API"]:::build
        FMD["Fabric Mod Descriptor"]:::core
    end

    %% Core Bootstrapping
    subgraph "Core Bootstrapping"
        QC["QueenCats (Core)"]:::core
        QCC["QueenCatsClient (Client)"]:::core
    end

    %% Game Components
    subgraph "Game Components"
        %% Configuration & Integration
        subgraph "Configuration & Integration"
            QCFG["QueenCatsConfig"]:::config
            QMM["QueenCatsModMenuIntegration"]:::config
        end

        %% Entity System
        subgraph "Entities"
            ME["Entity Registration"]:::entity
            CE["Custom Entities (Base)"]:::entity
            CV["Custom Entities (Variants)"]:::entity
            CR["Client Rendering"]:::entity
            MX["Mixins"]:::entity
        end

        %% Items & Registration
        subgraph "Items"
            MI["ModItems"]:::item
            GI["Glinted Item"]:::item
            FC["Food Components"]:::item
            IG["Item Group"]:::item
            MR["Registries"]:::item
        end

        %% Sound & Screen Components
        subgraph "Sound & Screen"
            SD["Sound Definitions"]:::sound
            SG["Screen GUI"]:::screen
            SH["Screen Handler"]:::screen
        end
    end

    %% Assets & Resources
    subgraph "Assets & Resources"
        AN["Animation Files"]:::asset
        GEO["Geometry Files"]:::asset
        LANG["Language Files"]:::asset
        IM["Item Models"]:::asset
        TEX["Texture Assets"]:::asset
        REC["Recipe Data"]:::asset
        SA["Sound Assets"]:::asset
    end

    %% Build & Deployment
    subgraph "Build & Deployment"
        GB["Gradle Build Files"]:::build
        MC["Mixin Config"]:::build
    end

    %% Connections from Mod Loader to Core Bootstrapping
    FMD -->|"loads"| QC
    FAB -.-> FMD

    %% Core Bootstrapping to Configuration & Integration
    QC -->|"init config"| QCFG
    QC -->|"init mod menu"| QMM

    %% Core Bootstrapping to Game Components
    QC -->|"register entities"| ME
    QC -->|"register items"| MI
    QC -->|"setup sound"| SD
    QC -->|"init screens"| SG
    QC -->|"handle screens"| SH

    %% Entity Relationships
    ME -->|"base entities"| CE
    ME -->|"variants"| CV
    ME -->|"setup rendering"| CR
    ME --> MX

    %% Items Relationships
    MI --> GI
    MI --> FC
    MI --> IG
    MI --> MR
    MI -->|"link recipes"| REC
    MI -->|"link models"| IM

    %% Rendering Assets Link
    CR -->|"uses"| AN
    CR -->|"uses"| GEO
    CR -->|"uses"| TEX

    %% Sound Assets Link
    SD -->|"uses"| SA

    %% Screen Assets Link
    SG -->|"uses"| TEX

    %% Core Bootstrapping to Build & Deployment
    QC -->|"config mixins"| MC
    GB -.-> QC

    %% Click Events
    click QC "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/blob/fabric-1.18/src/main/java/net/pevori/queencats/QueenCats.java"
    click QCC "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/blob/fabric-1.18/src/main/java/net/pevori/queencats/QueenCatsClient.java"
    click FMD "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/blob/fabric-1.18/src/main/resources/fabric.mod.json"
    click QCFG "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/blob/fabric-1.18/src/main/java/net/pevori/queencats/config/QueenCatsConfig.java"
    click QMM "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/blob/fabric-1.18/src/main/java/net/pevori/queencats/config/QueenCatsModMenuIntegration.java"
    click ME "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/blob/fabric-1.18/src/main/java/net/pevori/queencats/entity/ModEntities.java"
    click CE "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/tree/fabric-1.18/src/main/java/net/pevori/queencats/entity/custom"
    click CV "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/tree/fabric-1.18/src/main/java/net/pevori/queencats/entity/variant"
    click CR "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/tree/fabric-1.18/src/main/java/net/pevori/queencats/entity/client"
    click MX "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/tree/fabric-1.18/src/main/java/net/pevori/queencats/mixin"
    click MI "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/blob/fabric-1.18/src/main/java/net/pevori/queencats/item/ModItems.java"
    click GI "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/blob/fabric-1.18/src/main/java/net/pevori/queencats/item/GlintedItem.java"
    click FC "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/blob/fabric-1.18/src/main/java/net/pevori/queencats/item/ModFoodComponents.java"
    click IG "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/blob/fabric-1.18/src/main/java/net/pevori/queencats/item/ModItemGroup.java"
    click MR "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/blob/fabric-1.18/src/main/java/net/pevori/queencats/util/ModRegistries.java"
    click SD "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/blob/fabric-1.18/src/main/java/net/pevori/queencats/sound/ModSounds.java"
    click SG "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/blob/fabric-1.18/src/main/java/net/pevori/queencats/screen/HumanoidAnimalScreen.java"
    click SH "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/blob/fabric-1.18/src/main/java/net/pevori/queencats/screen/HumanoidAnimalScreenHandler.java"
    click AN "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/tree/fabric-1.18/src/main/resources/assets/queencats/animations/"
    click GEO "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/tree/fabric-1.18/src/main/resources/assets/queencats/geo/"
    click LANG "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/tree/fabric-1.18/src/main/resources/assets/queencats/lang/"
    click IM "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/tree/fabric-1.18/src/main/resources/assets/queencats/models/item/"
    click TEX "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/tree/fabric-1.18/src/main/resources/assets/queencats/textures/"
    click REC "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/tree/fabric-1.18/src/main/resources/data/queencats/recipes/"
    click SA "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/tree/fabric-1.18/src/main/resources/assets/queencats/sounds/"
    click GB "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/blob/fabric-1.18/build.gradle"
    click MC "https://github.com/ronaldcabrera/queen-cats-dogs-fabric/blob/fabric-1.18/src/main/resources/queencats.mixins.json"

    %% Styles
    classDef core fill:#FFEE88,stroke:#333,stroke-width:2px;
    classDef config fill:#88CCFF,stroke:#333,stroke-width:2px;
    classDef entity fill:#CCFFCC,stroke:#333,stroke-width:2px;
    classDef item fill:#FFCCCC,stroke:#333,stroke-width:2px;
    classDef sound fill:#D8BFD8,stroke:#333,stroke-width:2px;
    classDef screen fill:#B0DFFB,stroke:#333,stroke-width:2px;
    classDef asset fill:#FFFFCC,stroke:#333,stroke-width:2px;
    classDef build fill:#D3D3D3,stroke:#333,stroke-width:2px;
```
