How andrew0030/pandoracore works
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: PandoraCoreClient.java Client Core · PandoraCore.java PandoraCore · resources Assets · mixin Mixins
Components 21
Common
Shared runtime, registries, client systems, and content definitions.
- PandoraCore · Shared bootstrap and main mod logic.
common/src/main/java/com/github/andrew0030/pandora_core/PandoraCore.java - Client Core · Common client bootstrap and lifecycle coordination.
common/src/main/java/com/github/andrew0030/pandora_core/PandoraCoreClient.java - Platform API · Loader-agnostic service contracts for platform, registry, networking, and resources.
common/src/main/java/com/github/andrew0030/pandora_core/platform/services - Service Loader · Resolves platform helpers through Java service loading.
common/src/main/java/com/github/andrew0030/pandora_core/platform/Services.java - Registry Core · Shared registry abstraction and content registration helpers.
common/src/main/java/com/github/andrew0030/pandora_core/registry - World Mods · Shared modifiers for features, spawns, carvers, and structure pools.
common/src/main/java/com/github/andrew0030/pandora_core/world/modifier - Networking · Loader-agnostic packet channel, sender/target, and direction handling.
common/src/main/java/com/github/andrew0030/pandora_core/network - Client Manager · Coordinates client tick and shared client state.
common/src/main/java/com/github/andrew0030/pandora_core/client/PaCoClientManager.java - Rendering · Core rendering utilities, VBOs, instancing, and renderer backends.
common/src/main/java/com/github/andrew0030/pandora_core/client/render - Shaders · Shader templating, wrapping, post-chain handling, and compute support.
common/src/main/java/com/github/andrew0030/pandora_core/client/shader - CTM · Connected-texture model resolution and adjacency evaluation.
common/src/main/java/com/github/andrew0030/pandora_core/client/ctm - GUI & Config · Screens, widgets, config data, and tab/menu insertion.
common/src/main/java/com/github/andrew0030/pandora_core/client/gui - Mixins · Cross-cutting injections and accessors used to attach systems into Minecraft.
common/src/main/java/com/github/andrew0030/pandora_core/mixin - Test Content · 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 · Fabric-specific bootstrap and client entrypoints.
fabric/src/main/java/com/github/andrew0030/pandora_core/PandoraCoreFabric.java - Fabric Helpers · Fabric implementations of platform, registry, network, and reload helpers.
fabric/src/main/java/com/github/andrew0030/pandora_core/platform - Fabric UI · 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 · Forge-specific bootstrap and client entrypoints.
forge/src/main/java/com/github/andrew0030/pandora_core/PandoraCoreForge.java - Forge Helpers · Forge implementations of platform, registry, network, and reload helpers.
forge/src/main/java/com/github/andrew0030/pandora_core/platform - Forge Hooks · 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 · Shipped models, shaders, textures, data JSON, and mixin metadata.
common/src/main/resources
Connections 29
- 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.