# andrew0030/pandoracore architecture

> Architecture diagram of the GitHub repository andrew0030/pandoracore, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/andrew0030/pandoracore
- Repository: https://github.com/andrew0030/pandoracore

## Overview

1. **Repository shape**
   PandoraCore is a multi-loader Minecraft mod/library split into three Gradle modules: `common` for shared logic and content, `fabric` for Fabric-specific entrypoints and integrations, and `forge` for Forge-specific integrations. The architecture is intentionally layered so most features live in `common` and only loader differences are isolated per platform module.

2. **Bootstrap and loader boundary**
   The main entry points are `PandoraCore`, `PandoraCoreClient`, plus loader-specific wrappers like `PandoraCoreFabric`, `PandoraCoreClientFabric`, `PandoraCoreForge`, and `PandoraCoreClientForge`. These bootstraps wire shared systems into the active mod loader, while platform-specific helpers are discovered through Java service loading (`META-INF/services`) via `IPlatformHelper`, `IRegistryHelper`, `INetworkHelper`, and `IResourceLoaderHelper`.

3. **Core registry/data model**
   A large part of the shared code is a generic registry abstraction in `common/registry`, with builders and registry objects used to register blocks, items, block entities, recipes, attributes, flammables, criteria triggers, structure pool types, and other game content. The `common/src/main/resources/data` tree contains the actual content definitions that feed these registries, including advancements, worldgen modifiers, biome modifiers, and test assets.

4. **Game content and test fixtures**
   The repo includes a small set of example/test content in `common/test` packages: test blocks, block entities, entities, particles, rendering types, brewing recipes, and networking packets. These are not just unit tests; they act as architectural demonstrations of how the library’s registries, renderers, and packets are meant to be used.

5. **Client-side subsystem split**
   Client logic is concentrated under `common/client`, with its own managers and registries for key mappings, model layers, render types, particle providers, shaders, GUI, screen shake, and render backends. `PaCoClientManager` and `PaCoClientTicker` are the broad client lifecycle coordinators, while the `client/registry` package registers client-only integrations.

6. **Rendering architecture**
   Rendering is one of the largest subsystems. The codebase supports standard rendering helpers, block entity renderers, instanced rendering, VBO abstractions, buffer utilities, and backend attachment points for both vanilla and Sodium-style render pipelines. The instancing stack centers around `InstanceManager`, `BatchData`, `BatchKey`, `InstancedVBO`, `InstanceRenderer`, and `InstancedBlockEntityRenderer`, with mixins used to hook into Minecraft’s render loop and chunk compilation.

7. **Shader and post-processing pipeline**
   Shader support is modeled as a templating and wrapping system rather than a single hardcoded shader path. The `client/shader` tree includes template loading, transformation, variable mapping, program wrappers, and support for both vanilla and Iris shader environments. The resource packs under `assets/pandora_core/shaders` provide core shaders, templated shaders, compute shaders, and post-processing chains, with `PaCoPostShaderRegistry` and related holders bridging these assets into runtime shader objects.

8. **Connected textures and model adaptation**
   CTM is its own subsystem under `client/ctm`, with model/data resolvers and multiple CTM types: full, horizontal, vertical, repeat, and random. The `common` resources contain example CTM blockstates and models, while loader-specific model implementations exist in Fabric and Forge modules. This subsystem sits at the boundary between resource-driven model definitions and runtime block adjacency evaluation.

9. **GUI, config, and menu UX**
   The client GUI architecture is modular: reusable widgets live under `client/gui`, with screens, sliders, edit boxes, buttons, and content-panel elements composing the larger `PaCoScreen`. Config UI generation is handled by a separate config manager in `common/config`, while Fabric adds concrete config screen factories and Mod Menu integration, and Forge supplies its own runtime helpers. Menu/tab insertion utilities in `common/tab` are part of the same “UI integration” layer for adding content to existing game screens.

10. **Networking**
   Networking is abstracted through `common/network` with `PaCoPacket`, `PaCoPacketChannel`, `PacketSender`, `PacketTarget`, and direction/context wrappers. Fabric and Forge each provide their own packet registration and network context implementations. The test package includes a simple C2S/S2C flow (`KeyPressedPacket`, `OpenTestGUIPacket`), showing the intended data path from client input to server action and back to client UI.

11. **Worldgen, structures, and advancement hooks**
   World modification is represented by a family of modifiers under `common/world/modifier`, covering add/remove operations for features, carvers, spawns, spawn costs, structure set members, and template pool elements. The data directory mirrors this with JSON modifier definitions. Advancements and container/container-menu hooks are also a first-class feature: criteria triggers, mixins into inventory/menu classes, and resource-based advancement JSONs together implement “item placed in container” style events.

12. **Mixin-heavy integration strategy**
   Much of PandoraCore’s functionality depends on mixins and accessors rather than direct subclassing. The common module contains mixins for rendering, shaders, GUI, camera, player/level behavior, containers, and CTM/model bakery integration; Fabric and Forge add their own compatibility mixins for loader-specific screens, lifecycle hooks, and mod compatibility. This means the runtime architecture is heavily “injected” into Minecraft and neighboring mods rather than isolated behind pure interfaces.

13. **Platform compatibility and external mod integration**
   The loader modules are not just thin shims; they handle platform-specific APIs and compatibility with external mods like Mod Menu, Iris, Sodium, and other shader/menu ecosystems. Shared interfaces and helper services keep the common code agnostic while loader code translates those abstractions into the correct environment-specific behavior.

14. **Utilities and support layer**
   The `common/utils` package provides a broad support layer: logging, resource loading, shader parsing/checking, update checking, color and easing utilities, collection helpers, and side-checking. These are used across subsystems to normalize behavior and reduce direct dependency on Minecraft or loader APIs.

15. **Resources as architecture contract**
   The resource tree is not incidental: it defines the shipped shaders, CTM models/blockstates, GUI textures, particles, advancements, worldgen JSON, and metadata like `mixins.json`, `accesswidener`, and `pack.mcmeta`. In practice, the runtime architecture is “code plus declarative assets,” with many systems driven by these resource definitions rather than hardcoded registrations alone.

Main entry points: [`common/src/main/java/com/github/andrew0030/pandora_core/PandoraCoreClient.java`](https://github.com/andrew0030/pandoracore/blob/main/common/src/main/java/com/github/andrew0030/pandora_core/PandoraCoreClient.java) (Client Core), [`common/src/main/java/com/github/andrew0030/pandora_core/PandoraCore.java`](https://github.com/andrew0030/pandoracore/blob/main/common/src/main/java/com/github/andrew0030/pandora_core/PandoraCore.java) (PandoraCore), [`common/src/main/resources`](https://github.com/andrew0030/pandoracore/tree/main/common/src/main/resources) (Assets), [`common/src/main/java/com/github/andrew0030/pandora_core/mixin`](https://github.com/andrew0030/pandoracore/tree/main/common/src/main/java/com/github/andrew0030/pandora_core/mixin) (Mixins)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_root["PandoraCore"]
end

subgraph group_common["Common"]
  node_pandora_core["PandoraCore<br/>shared mod core<br/>[PandoraCore.java]"]
  node_pandora_client["Client Core<br/>shared client bootstrap"]
  node_platform_services["Platform API<br/>service interfaces"]
  node_service_loader(("Service Loader<br/>service lookup<br/>[Services.java]"))
  node_registry_core["Registry Core<br/>generic registries"]
  node_world_modifiers["World Mods<br/>worldgen modifiers"]
  node_network_core["Networking<br/>packet layer"]
  node_client_manager["Client Manager<br/>client lifecycle"]
  node_rendering["Rendering<br/>render subsystem"]
  node_shader_pipeline["Shaders<br/>templated shader system"]
  node_ctm_system["CTM<br/>connected textures"]
  node_gui_config["GUI & Config<br/>client ui"]
  node_mixin_layer["Mixins<br/>integration hooks"]
  node_test_content["Test Content<br/>demo fixtures"]
end

subgraph group_fabric["Fabric"]
  node_fabric_boot["Fabric Boot<br/>fabric entrypoints"]
  node_fabric_helpers["Fabric Helpers<br/>fabric services"]
  node_fabric_ui["Fabric UI<br/>config/menu integration"]
end

subgraph group_forge["Forge"]
  node_forge_boot["Forge Boot<br/>forge entrypoints"]
  node_forge_helpers["Forge Helpers<br/>forge services"]
  node_forge_hooks["Forge Hooks<br/>forge integration"]
end

subgraph group_resources["Assets"]
  node_assets["Assets<br/>resources"]
end

node_service_loader -->|"uses"| node_platform_services
node_pandora_core -->|"loads helpers"| node_service_loader
node_pandora_client -->|"drives"| node_client_manager
node_pandora_core -->|"initializes"| node_registry_core
node_pandora_core -->|"publishes"| node_world_modifiers
node_pandora_core -->|"defines"| node_network_core
node_pandora_client -->|"coordinates"| node_rendering
node_pandora_client -->|"configures"| node_shader_pipeline
node_pandora_client -->|"enables"| node_ctm_system
node_pandora_client -->|"builds"| node_gui_config
node_rendering -->|"hooks"| node_mixin_layer
node_shader_pipeline -->|"hooks"| node_mixin_layer
node_ctm_system -->|"hooks"| node_mixin_layer
node_gui_config -->|"hooks"| node_mixin_layer
node_test_content -->|"demonstrates"| node_registry_core
node_test_content -->|"demonstrates"| node_network_core
node_fabric_boot -->|"starts"| node_pandora_core
node_fabric_boot -->|"starts"| node_pandora_client
node_fabric_boot -->|"binds"| node_fabric_helpers
node_fabric_ui -->|"extends"| node_gui_config
node_forge_boot -->|"starts"| node_pandora_core
node_forge_boot -->|"starts"| node_pandora_client
node_forge_boot -->|"binds"| node_forge_helpers
node_forge_hooks -->|"extends"| node_mixin_layer
node_assets -.->|"feeds"| node_registry_core
node_assets -.->|"provides"| node_shader_pipeline
node_assets -.->|"provides"| node_ctm_system
node_assets -.->|"provides"| node_gui_config
node_assets -.->|"provides"| node_world_modifiers

click node_pandora_core "https://github.com/andrew0030/pandoracore/blob/main/common/src/main/java/com/github/andrew0030/pandora_core/PandoraCore.java"
click node_pandora_client "https://github.com/andrew0030/pandoracore/blob/main/common/src/main/java/com/github/andrew0030/pandora_core/PandoraCoreClient.java"
click node_platform_services "https://github.com/andrew0030/pandoracore/tree/main/common/src/main/java/com/github/andrew0030/pandora_core/platform/services"
click node_service_loader "https://github.com/andrew0030/pandoracore/blob/main/common/src/main/java/com/github/andrew0030/pandora_core/platform/Services.java"
click node_registry_core "https://github.com/andrew0030/pandoracore/tree/main/common/src/main/java/com/github/andrew0030/pandora_core/registry"
click node_world_modifiers "https://github.com/andrew0030/pandoracore/tree/main/common/src/main/java/com/github/andrew0030/pandora_core/world/modifier"
click node_network_core "https://github.com/andrew0030/pandoracore/tree/main/common/src/main/java/com/github/andrew0030/pandora_core/network"
click node_client_manager "https://github.com/andrew0030/pandoracore/blob/main/common/src/main/java/com/github/andrew0030/pandora_core/client/PaCoClientManager.java"
click node_rendering "https://github.com/andrew0030/pandoracore/tree/main/common/src/main/java/com/github/andrew0030/pandora_core/client/render"
click node_shader_pipeline "https://github.com/andrew0030/pandoracore/tree/main/common/src/main/java/com/github/andrew0030/pandora_core/client/shader"
click node_ctm_system "https://github.com/andrew0030/pandoracore/tree/main/common/src/main/java/com/github/andrew0030/pandora_core/client/ctm"
click node_gui_config "https://github.com/andrew0030/pandoracore/tree/main/common/src/main/java/com/github/andrew0030/pandora_core/client/gui"
click node_mixin_layer "https://github.com/andrew0030/pandoracore/tree/main/common/src/main/java/com/github/andrew0030/pandora_core/mixin"
click node_test_content "https://github.com/andrew0030/pandoracore/tree/main/common/src/main/java/com/github/andrew0030/pandora_core/test"
click node_fabric_boot "https://github.com/andrew0030/pandoracore/blob/main/fabric/src/main/java/com/github/andrew0030/pandora_core/PandoraCoreFabric.java"
click node_fabric_helpers "https://github.com/andrew0030/pandoracore/tree/main/fabric/src/main/java/com/github/andrew0030/pandora_core/platform"
click node_fabric_ui "https://github.com/andrew0030/pandoracore/tree/main/fabric/src/main/java/com/github/andrew0030/pandora_core/config"
click node_forge_boot "https://github.com/andrew0030/pandoracore/blob/main/forge/src/main/java/com/github/andrew0030/pandora_core/PandoraCoreForge.java"
click node_forge_helpers "https://github.com/andrew0030/pandoracore/tree/main/forge/src/main/java/com/github/andrew0030/pandora_core/platform"
click node_forge_hooks "https://github.com/andrew0030/pandoracore/tree/main/forge/src/main/java/com/github/andrew0030/pandora_core/mixin"
click node_assets "https://github.com/andrew0030/pandoracore/tree/main/common/src/main/resources"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_pandora_core,node_pandora_client,node_platform_services,node_service_loader,node_registry_core,node_world_modifiers,node_network_core,node_client_manager,node_rendering,node_shader_pipeline,node_ctm_system,node_gui_config,node_mixin_layer,node_test_content toneAmber
class node_fabric_boot,node_fabric_helpers,node_fabric_ui toneMint
class node_forge_boot,node_forge_helpers,node_forge_hooks toneRose
class node_assets toneIndigo
```

## Components

### Common

Shared runtime, registries, client systems, and content definitions.

- [PandoraCore](https://github.com/andrew0030/pandoracore/blob/main/common/src/main/java/com/github/andrew0030/pandora_core/PandoraCore.java): shared mod core · Shared bootstrap and main mod logic. · `common/src/main/java/com/github/andrew0030/pandora_core/PandoraCore.java`
- [Client Core](https://github.com/andrew0030/pandoracore/blob/main/common/src/main/java/com/github/andrew0030/pandora_core/PandoraCoreClient.java): shared client bootstrap · Common client bootstrap and lifecycle coordination. · `common/src/main/java/com/github/andrew0030/pandora_core/PandoraCoreClient.java`
- [Platform API](https://github.com/andrew0030/pandoracore/tree/main/common/src/main/java/com/github/andrew0030/pandora_core/platform/services): service interfaces · Loader-agnostic service contracts for platform, registry, networking, and resources. · `common/src/main/java/com/github/andrew0030/pandora_core/platform/services`
- [Service Loader](https://github.com/andrew0030/pandoracore/blob/main/common/src/main/java/com/github/andrew0030/pandora_core/platform/Services.java): service lookup · Resolves platform helpers through Java service loading. · `common/src/main/java/com/github/andrew0030/pandora_core/platform/Services.java`
- [Registry Core](https://github.com/andrew0030/pandoracore/tree/main/common/src/main/java/com/github/andrew0030/pandora_core/registry): generic registries · Shared registry abstraction and content registration helpers. · `common/src/main/java/com/github/andrew0030/pandora_core/registry`
- [World Mods](https://github.com/andrew0030/pandoracore/tree/main/common/src/main/java/com/github/andrew0030/pandora_core/world/modifier): worldgen modifiers · Shared modifiers for features, spawns, carvers, and structure pools. · `common/src/main/java/com/github/andrew0030/pandora_core/world/modifier`
- [Networking](https://github.com/andrew0030/pandoracore/tree/main/common/src/main/java/com/github/andrew0030/pandora_core/network): packet layer · Loader-agnostic packet channel, sender/target, and direction handling. · `common/src/main/java/com/github/andrew0030/pandora_core/network`
- [Client Manager](https://github.com/andrew0030/pandoracore/blob/main/common/src/main/java/com/github/andrew0030/pandora_core/client/PaCoClientManager.java): client lifecycle · Coordinates client tick and shared client state. · `common/src/main/java/com/github/andrew0030/pandora_core/client/PaCoClientManager.java`
- [Rendering](https://github.com/andrew0030/pandoracore/tree/main/common/src/main/java/com/github/andrew0030/pandora_core/client/render): render subsystem · Core rendering utilities, VBOs, instancing, and renderer backends. · `common/src/main/java/com/github/andrew0030/pandora_core/client/render`
- [Shaders](https://github.com/andrew0030/pandoracore/tree/main/common/src/main/java/com/github/andrew0030/pandora_core/client/shader): templated shader system · Shader templating, wrapping, post-chain handling, and compute support. · `common/src/main/java/com/github/andrew0030/pandora_core/client/shader`
- [CTM](https://github.com/andrew0030/pandoracore/tree/main/common/src/main/java/com/github/andrew0030/pandora_core/client/ctm): connected textures · Connected-texture model resolution and adjacency evaluation. · `common/src/main/java/com/github/andrew0030/pandora_core/client/ctm`
- [GUI & Config](https://github.com/andrew0030/pandoracore/tree/main/common/src/main/java/com/github/andrew0030/pandora_core/client/gui): client ui · Screens, widgets, config data, and tab/menu insertion. · `common/src/main/java/com/github/andrew0030/pandora_core/client/gui`
- [Mixins](https://github.com/andrew0030/pandoracore/tree/main/common/src/main/java/com/github/andrew0030/pandora_core/mixin): integration hooks · Cross-cutting injections and accessors used to attach systems into Minecraft. · `common/src/main/java/com/github/andrew0030/pandora_core/mixin`
- [Test Content](https://github.com/andrew0030/pandoracore/tree/main/common/src/main/java/com/github/andrew0030/pandora_core/test): demo fixtures · Example blocks, entities, particles, renderers, and packets demonstrating usage. · `common/src/main/java/com/github/andrew0030/pandora_core/test`

### Fabric

Fabric entrypoints, helpers, and compatibility layers.

- [Fabric Boot](https://github.com/andrew0030/pandoracore/blob/main/fabric/src/main/java/com/github/andrew0030/pandora_core/PandoraCoreFabric.java): fabric entrypoints · Fabric-specific bootstrap and client entrypoints. · `fabric/src/main/java/com/github/andrew0030/pandora_core/PandoraCoreFabric.java`
- [Fabric Helpers](https://github.com/andrew0030/pandoracore/tree/main/fabric/src/main/java/com/github/andrew0030/pandora_core/platform): fabric services · Fabric implementations of platform, registry, network, and reload helpers. · `fabric/src/main/java/com/github/andrew0030/pandora_core/platform`
- [Fabric UI](https://github.com/andrew0030/pandoracore/tree/main/fabric/src/main/java/com/github/andrew0030/pandora_core/config): config/menu integration · Fabric config screen factories and Mod Menu integration. · `fabric/src/main/java/com/github/andrew0030/pandora_core/config`

### Forge

Forge entrypoints, helpers, and compatibility layers.

- [Forge Boot](https://github.com/andrew0030/pandoracore/blob/main/forge/src/main/java/com/github/andrew0030/pandora_core/PandoraCoreForge.java): forge entrypoints · Forge-specific bootstrap and client entrypoints. · `forge/src/main/java/com/github/andrew0030/pandora_core/PandoraCoreForge.java`
- [Forge Helpers](https://github.com/andrew0030/pandoracore/tree/main/forge/src/main/java/com/github/andrew0030/pandora_core/platform): forge services · Forge implementations of platform, registry, network, and reload helpers. · `forge/src/main/java/com/github/andrew0030/pandora_core/platform`
- [Forge Hooks](https://github.com/andrew0030/pandoracore/tree/main/forge/src/main/java/com/github/andrew0030/pandora_core/mixin): forge integration · Forge-specific lifecycle hooks and compatibility mixins. · `forge/src/main/java/com/github/andrew0030/pandora_core/mixin`

### Assets

Declarative resources that drive content, shaders, models, and worldgen.

- [Assets](https://github.com/andrew0030/pandoracore/tree/main/common/src/main/resources): resources · Shipped models, shaders, textures, data JSON, and mixin metadata. · `common/src/main/resources`

## Connections

- Service Loader → Platform API: uses · Resolves implementations for shared service interfaces.
- PandoraCore → Service Loader: loads helpers · Bootstraps shared systems through platform services.
- Client Core → Client Manager: drives · Starts and updates shared client lifecycle.
- PandoraCore → Registry Core: initializes · Registers shared game content and registry objects.
- PandoraCore → World Mods: publishes · Exposes worldgen and structure modification hooks.
- PandoraCore → Networking: defines · Sets up shared packet abstractions and flows.
- Client Core → Rendering: coordinates · Connects client lifecycle to rendering systems.
- Client Core → Shaders: configures · Wires shader registration and post-processing.
- Client Core → CTM: enables · Hooks connected-texture model resolution into client loading.
- Client Core → GUI & Config: builds · Hosts screens, widgets, and config/menu UI.
- Rendering → Mixins: hooks · Depends on mixins/accessors for render-loop attachment.
- Shaders → Mixins: hooks · Uses mixins to integrate shader and post-chain behavior.
- CTM → Mixins: hooks · Uses model bakery and render mixins for CTM integration.
- GUI & Config → Mixins: hooks · Extends screens and widgets through injected behavior.
- Test Content → Registry Core: demonstrates · Example content shows registry usage patterns.
- Test Content → Networking: demonstrates · Includes sample client-server packet flow.
- Fabric Boot → PandoraCore: starts · Fabric entrypoint launches shared mod logic.
- Fabric Boot → Client Core: starts · Fabric client entrypoint launches shared client logic.
- Fabric Boot → Fabric Helpers: binds · Connects Fabric runtime to service implementations.
- Fabric UI → GUI & Config: extends · Supplies Fabric config screen factories and menu integration.
- Forge Boot → PandoraCore: starts · Forge entrypoint launches shared mod logic.
- Forge Boot → Client Core: starts · Forge client entrypoint launches shared client logic.
- Forge Boot → Forge Helpers: binds · Connects Forge runtime to service implementations.
- Forge Hooks → Mixins: extends · Adds Forge-specific compatibility and lifecycle injections.
- Assets → Registry Core: feeds · Data and asset JSONs back shared registries and content systems.
- Assets → Shaders: provides · Contains core shaders, templated shaders, and post chains.
- Assets → CTM: provides · Contains CTM blockstates, models, and textures.
- Assets → GUI & Config: provides · Provides GUI textures and UI resources.
- Assets → World Mods: provides · Contains worldgen modifier and advancement JSON definitions.
