# alrex-u/parcool architecture

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

- Interactive diagram: https://gitdiagram.com/alrex-u/parcool
- Repository: https://github.com/alrex-u/parcool

## Overview

##### Project type and purpose
- ParCool is a Minecraft “mod” (plugin) built on the Forge API.
- Its goal is to extend player movement and animations—parkour-style actions—while exposing an API for other modders and packaging a guide via Patchouli.

##### High-level architecture & main components
- Common Core
- Client Module
- Server Module
- API & External Integration
Additionally, include a “Resources & Data Packs” component to capture JSON assets, models, sounds, and the Patchouli guide.

##### Break down each subsystem
A. Common Core (shared code)
– Action processor: classes under common/action → defines Action, BehaviorEnforcer, StaminaConsumeTiming
– Capability providers & storage: common/capability → Animation, Stamina, Parkourability, plus storage backends
– Block & item registry: common/block, common/item → Registers zipline hooks, ropes
– Network messaging: common/network → SimpleChannel messages (SyncStamina, SyncActionState, etc.)
– Utilities: common/utilities → math, easing, model helpers

B. Client Module
– Proxy entry: ClientProxy
– GUI / HUD: api/client/gui + client/gui + client/hud → ParCoolSettingScreen, HUDRegistry, StaminaHUD
– Animation engine: client/animation → Animator, AnimatorList, per-action Animator implementations
– Input & keybinding: client/input → KeyBindings, KeyRecorder → drives ParCoolActionEvent
– Rendering: client/renderer → custom RenderTypes, entity renderer for ziplines
– Event enforcer: RenderBehaviorEnforcer

C. Server Module
– Proxy entry: ServerProxy
– Command registration: server/command → CommandRegistry, ControlLimitationCommand
– Limitation logic: server/limitation → ActionLimitation, Limitations
– Login/logout & clone handlers: handlers for sync and state initialization

D. API & External Integration
– Stable API: api package → Attributes, Effects, SoundEvents, Stamina interfaces
– Unstable hooks: api/unstable → ParCoolActionEvent, ParCoolAnimationInfoEvent, Limitation extensions
– Extern adapters: extern → ModManager, AdditionalMods, integration with BetterThirdPerson, ShoulderSurfing

E. Resources & Data Packs
– Assets: models, textures, sounds under resources/assets/parcool
– Data: loot_tables, recipes, advancements, Patchouli books in resources/data/parcool
– Metadata: META-INF/mods.toml, mixin configs

##### Relationships & data flow
- User Input → Client Input Handler → Action Processor (common)
- Action Processor → Capability updates → Network SyncMessage → Server & back to Client
- EventBus: Forge’s event bus triggers ParCoolActionEvent and ParCoolAnimationInfoEvent subscribers
- Server Commands/API → Limitation providers → sync back to clients
- Client draws based on capability state → Renderer / Animator → HUD

##### Architectural patterns & principles
- Proxy Pattern: CommonProxy / ClientProxy / ServerProxy to separate environment-specific code
- Event-Driven: Forge EventBus, custom events for actions & animations
- Capability System: Forge capabilities for attaching per-entity data (stamina, animation)
- Modular Animation: strategy pattern via Animator implementations per action
- Resource-Driven: JSON-driven assets and data packs (recipes, Patchouli guide)

##### Diagramming recommendations
– Grey for Common Core
– Blue for Client Module
– Green for Server Module
– Yellow for API/External
– Orange for Resources & Data
– From “Minecraft + Forge” into each Proxy entry point
– Between modules for data flow (Input → Processor → Network → Renderer, etc.)
- Interactions: “EventBus subscription,” “SimpleChannel message,” “Capability attach,” “JSON data load”

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Host Environment
    MF["Minecraft + Forge Mod Loader"]:::host

    %% Subsystems
    subgraph "Common Core"
        AP["Action Processor"]:::common
        CP["Capability Providers & Storage"]:::common
        BR["Block & Item Registry"]:::common
        NM["Network Messaging"]:::common
        UT["Utilities"]:::common
    end

    subgraph "Client Module"
        CPX["ClientProxy"]:::client
        GUIHUD["GUI / HUD"]:::client
        AE["Animation Engine"]:::client
        IH["Input & Keybinding"]:::client
        RD["Rendering"]:::client
        EE["RenderBehaviorEnforcer"]:::client
    end

    subgraph "Server Module"
        SPX["ServerProxy"]:::server
        CR["Command Registry"]:::server
        LL["Limitation Logic"]:::server
    end

    subgraph "API & External Integration"
        APII["API & External Integration"]:::api
        SAPI["Stable API"]:::api
        ACGUI["API Client GUI"]:::api
        UHOOK["Unstable Hooks"]:::api
        EXAD["External Adapters"]:::api
    end

    subgraph "Resources & Data Packs"
        RES["Assets (models, textures, sounds)"]:::data
        DAT["Data Packs & Patchouli"]:::data
        META["Mod Metadata"]:::data
    end

    %% Connections
    MF --> CPX
    MF --> SPX

    CPX --> GUIHUD
    CPX --> AE
    CPX --> IH
    CPX --> RD
    CPX --> EE

    SPX --> CR
    SPX --> LL

    IH -->|"drives"| AP
    AP --> CP
    CP -->|"attach data"| NM
    NM -->|"sync to server"| SPX
    SPX -->|"sync to client"| NM
    NM --> GUIHUD
    NM --> RD

    MF --> UHOOK
    UHOOK --> AP
    UHOOK --> AE

    RES --> GUIHUD
    DAT --> ACGUI
    META --> MF

    MF --> SAPI
    SAPI --> APII
    ACGUI --> GUIHUD
    EXAD --> APII

    %% Click Events
    click AP "https://github.com/alrex-u/parcool/blob/main/src/main/java/com/alrex/parcool/common/action/ActionProcessor.java"
    click CP "https://github.com/alrex-u/parcool/tree/main/src/main/java/com/alrex/parcool/common/capability"
    click BR "https://github.com/alrex-u/parcool/tree/main/src/main/java/com/alrex/parcool/common/block"
    click NM "https://github.com/alrex-u/parcool/tree/main/src/main/java/com/alrex/parcool/common/network"
    click UT "https://github.com/alrex-u/parcool/tree/main/src/main/java/com/alrex/parcool/utilities"
    click CPX "https://github.com/alrex-u/parcool/blob/main/src/main/java/com/alrex/parcool/proxy/ClientProxy.java"
    click GUIHUD "https://github.com/alrex-u/parcool/tree/main/src/main/java/com/alrex/parcool/client/gui"
    click AE "https://github.com/alrex-u/parcool/tree/main/src/main/java/com/alrex/parcool/client/animation"
    click IH "https://github.com/alrex-u/parcool/tree/main/src/main/java/com/alrex/parcool/client/input"
    click RD "https://github.com/alrex-u/parcool/tree/main/src/main/java/com/alrex/parcool/client/renderer"
    click EE "https://github.com/alrex-u/parcool/blob/main/src/main/java/com/alrex/parcool/client/RenderBehaviorEnforcer.java"
    click SPX "https://github.com/alrex-u/parcool/blob/main/src/main/java/com/alrex/parcool/proxy/ServerProxy.java"
    click CR "https://github.com/alrex-u/parcool/tree/main/src/main/java/com/alrex/parcool/server/command"
    click LL "https://github.com/alrex-u/parcool/tree/main/src/main/java/com/alrex/parcool/server/limitation"
    click APII "https://github.com/alrex-u/parcool/tree/main/src/main/java/com/alrex/parcool/api"
    click SAPI "https://github.com/alrex-u/parcool/tree/main/src/main/java/com/alrex/parcool/api"
    click ACGUI "https://github.com/alrex-u/parcool/tree/main/src/main/java/com/alrex/parcool/api/client/gui"
    click UHOOK "https://github.com/alrex-u/parcool/tree/main/src/main/java/com/alrex/parcool/api/unstable"
    click EXAD "https://github.com/alrex-u/parcool/tree/main/src/main/java/com/alrex/parcool/extern"
    click RES "https://github.com/alrex-u/parcool/tree/main/src/main/resources/assets/parcool"
    click DAT "https://github.com/alrex-u/parcool/tree/main/src/main/resources/data/parcool"
    click META "https://github.com/alrex-u/parcool/blob/main/src/main/resources/META-INF/mods.toml"

    %% Styles
    classDef host fill:#BBBBBB,stroke:#333,stroke-width:1px
    classDef common fill:#DDDDDD,stroke:#999,stroke-width:1px
    classDef client fill:#ADD8E6,stroke:#339,stroke-width:1px
    classDef server fill:#90EE90,stroke:#393,stroke-width:1px
    classDef api fill:#FFFF99,stroke:#993,stroke-width:1px
    classDef data fill:#FFD580,stroke:#c73,stroke-width:1px
```
