# wagers-of-industrial-warfare/ritchiesprojectilelib architecture

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

- Interactive diagram: https://gitdiagram.com/wagers-of-industrial-warfare/ritchiesprojectilelib
- Repository: https://github.com/wagers-of-industrial-warfare/ritchiesprojectilelib

## Overview

##### Main Components
- Common Module: This module (found in the “common” directory) contains the core functionality and shared abstractions. It includes key areas such as configuration (RPLConfigs), core library classes (RitchiesProjectileLib), networking (RPLNetwork and various packet classes), effects (screen shake and camera modifiers), and projectile burst functionalities.
- Platform-Specific Modules:
- Fabric Module: Located in the “fabric” directory, it houses Fabric-specific implementations such as FabricCameraModifier, RPLFabricClient, and platform-adjusted network classes. It also contains its own mod resource definitions (e.g., fabric.mod.json).
- Forge Module: Found in the “forge” directory, this module provides Forge-specific code like ForgeCameraModifier, RPLForgeClient, and the appropriate implementations for networking and mixins along with forge-specific resource files (mods.toml, pack.mcmeta).
- Build and Deployment Infrastructure: This includes Gradle build scripts (build.gradle at the root, and specific build.gradle files in each module), GitHub actions workflows (indicating building, pull request verifications, and releases), and the integration instructions via the README that relate to dependency management.

##### Relationships and Interactions
- The Common Module acts as the central hub containing core abstractions and logic. Both the Fabric and Forge modules depend on and extend functionalities from this module by providing platform-specific implementations.
- The networking components in “common/network” tie into the platform-specific network packages (for example, fabric/src/main/java/…/network/fabric and forge/src/main/java/…/network/forge) to ensure consistent behavior across different environments.
- Components such as chunk loading, screen shake, and projectile burst have their core logic in the common module, with mixin configurations (specified in mixins.json files) that allow platform-specific runtime enhancements.
- The build system ties all modules together using Gradle, ensuring that the library is built as a multi-platform artifact (with proper Maven repository integration as noted in the README).

##### Specific Architectural Patterns and Technologies
- Multi-Module/Multi-Platform Architecture: A clear separation exists between the shared logic (common) and specialized implementations (fabric and forge), reflecting a plug-in or modular design pattern.
- Mixin Usage: The presence of mixin packages and JSON configuration files shows that the library uses mixins for runtime bytecode manipulation/injection—an important aspect when integrating with Minecraft.
- Network Communication Layer: Well-defined network packet classes and handlers indicate a robust, custom networking layer to handle synchronization tasks across client-server boundaries.
- Gradle Build System: The project employs Gradle (including specific sub-module build scripts) and GitHub Actions for building and releasing, emphasizing modern continuous integration practices.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Common Module
    subgraph "Common Module"
        CL["Core Library & Configurations"]:::common
        NW["Networking Infrastructure"]:::common
        EF["Effects (Screen Shake & Camera Modifier)"]:::common
        PB["Projectile Burst Logic"]:::common
        MX["Mixin Configurations"]:::common
    end

    %% Fabric Module
    subgraph "Fabric Module"
        FI["Fabric Implementations"]:::fabric
        FN["Fabric Networking"]:::fabric
        FR["Fabric Mod Resources"]:::fabric
    end

    %% Forge Module
    subgraph "Forge Module"
        FOI["Forge Implementations"]:::forge
        FON["Forge Networking"]:::forge
        FMR["Forge Mod Resources"]:::forge
    end

    %% Build and Deployment Infrastructure
    subgraph "Build & Deployment Infrastructure"
        BS["Gradle Build Scripts"]:::build
        CI["CI/CD Workflows"]:::build
        RI["Integration Instructions (README)"]:::build
    end

    %% Relationships from Common to Fabric and Forge
    CL -->|"extends"| FI
    NW -->|"provides"| FN
    NW -->|"provides"| FON
    EF -->|"usedBy"| FI
    EF -->|"usedBy"| FOI
    PB -->|"integratedIn"| FI
    PB -->|"integratedIn"| FOI
    MX -->|"configures"| FI
    MX -->|"configures"| FOI

    %% Build system dependencies
    BS -->|"builds"| CL
    BS -->|"builds"| FI
    BS -->|"builds"| FOI
    CI -->|"triggers"| BS
    RI -->|"defines"| BS

    %% Class Definitions for Colors
    classDef common fill:#f4a582,stroke:#d95f02,stroke-width:2px;
    classDef fabric fill:#a6cee3,stroke:#1f78b4,stroke-width:2px;
    classDef forge fill:#b2df8a,stroke:#33a02c,stroke-width:2px;
    classDef build fill:#ffff99,stroke:#ffcc00,stroke-width:2px;

    %% Click Events - Common Module
    click CL "https://github.com/wagers-of-industrial-warfare/ritchiesprojectilelib/blob/1.18.2/dev/common/src/main/java/rbasamoyai/ritchiesprojectilelib/RitchiesProjectileLib.java"
    click CL "https://github.com/wagers-of-industrial-warfare/ritchiesprojectilelib/blob/1.18.2/dev/common/src/main/java/rbasamoyai/ritchiesprojectilelib/config/RPLConfigs.java"
    click NW "https://github.com/wagers-of-industrial-warfare/ritchiesprojectilelib/tree/1.18.2/dev/common/src/main/java/rbasamoyai/ritchiesprojectilelib/network"
    click EF "https://github.com/wagers-of-industrial-warfare/ritchiesprojectilelib/blob/1.18.2/dev/common/src/main/java/rbasamoyai/ritchiesprojectilelib/effects/CameraModifier.java"
    click EF "https://github.com/wagers-of-industrial-warfare/ritchiesprojectilelib/tree/1.18.2/dev/common/src/main/java/rbasamoyai/ritchiesprojectilelib/effects/screen_shake"
    click PB "https://github.com/wagers-of-industrial-warfare/ritchiesprojectilelib/tree/1.18.2/dev/common/src/main/java/rbasamoyai/ritchiesprojectilelib/projectile_burst"
    click MX "https://github.com/wagers-of-industrial-warfare/ritchiesprojectilelib/tree/1.18.2/dev/common/src/main/java/rbasamoyai/ritchiesprojectilelib/mixin"
    click MX "https://github.com/wagers-of-industrial-warfare/ritchiesprojectilelib/blob/1.18.2/dev/common/src/main/resources/ritchiesprojectilelib.mixins.json"

    %% Click Events - Fabric Module
    click FI "https://github.com/wagers-of-industrial-warfare/ritchiesprojectilelib/tree/1.18.2/dev/fabric/src/main/java/rbasamoyai/ritchiesprojectilelib/fabric"
    click FN "https://github.com/wagers-of-industrial-warfare/ritchiesprojectilelib/tree/1.18.2/dev/fabric/src/main/java/rbasamoyai/ritchiesprojectilelib/network/fabric"
    click FR "https://github.com/wagers-of-industrial-warfare/ritchiesprojectilelib/blob/1.18.2/dev/fabric/src/main/resources/fabric.mod.json"
    click FR "https://github.com/wagers-of-industrial-warfare/ritchiesprojectilelib/blob/1.18.2/dev/fabric/src/main/resources/ritchiesprojectilelib-fabric.mixins.json"

    %% Click Events - Forge Module
    click FOI "https://github.com/wagers-of-industrial-warfare/ritchiesprojectilelib/tree/1.18.2/dev/forge/src/main/java/rbasamoyai/ritchiesprojectilelib/forge"
    click FON "https://github.com/wagers-of-industrial-warfare/ritchiesprojectilelib/tree/1.18.2/dev/forge/src/main/java/rbasamoyai/ritchiesprojectilelib/network/forge"
    click FMR "https://github.com/wagers-of-industrial-warfare/ritchiesprojectilelib/blob/1.18.2/dev/forge/src/main/resources/META-INF/mods.toml"
    click FMR "https://github.com/wagers-of-industrial-warfare/ritchiesprojectilelib/blob/1.18.2/dev/forge/src/main/resources/pack.mcmeta"
    click FMR "https://github.com/wagers-of-industrial-warfare/ritchiesprojectilelib/blob/1.18.2/dev/forge/src/main/resources/ritchiesprojectilelib-forge.mixins.json"

    %% Click Events - Build and Deployment Infrastructure
    click BS "https://github.com/wagers-of-industrial-warfare/ritchiesprojectilelib/blob/1.18.2/dev/build.gradle"
    click BS "https://github.com/wagers-of-industrial-warfare/ritchiesprojectilelib/blob/1.18.2/dev/common/build.gradle"
    click BS "https://github.com/wagers-of-industrial-warfare/ritchiesprojectilelib/blob/1.18.2/dev/fabric/build.gradle"
    click BS "https://github.com/wagers-of-industrial-warfare/ritchiesprojectilelib/blob/1.18.2/dev/forge/build.gradle"
    click CI "https://github.com/wagers-of-industrial-warfare/ritchiesprojectilelib/tree/1.18.2/dev/.github/workflows"
    click RI "https://github.com/wagers-of-industrial-warfare/ritchiesprojectilelib/blob/1.18.2/dev/README.md"
```
