How talia-12/hexal works
Main Components
• Common Module – This is the heart of the project and contains the shared APIs, core casting actions, pattern definitions, network messages, data generation, and utility classes. It includes packages for API endpoints (e.g., spell, everbook, gates, linkable, nbt), events, casting actions (both standard and “great spells”), data providers (datagen), and interop with documentation (patchouli books).
• Platform-Specific Implementations – Two major subprojects:
– Fabric Module: Contains Fabric-specific initializers, client renderers, networking, and interop code. It adapts the core mod for Fabric’s mod loader and Minecraft’s client/server architecture.
– Forge Module: Contains corresponding Forge adapters, initializers, event handlers, mixins, client renderers, and network handlers for Forge compatibility.
• Resources and Data – Resources such as block models, textures, animations, language files, data (recipes, advancements, loot tables), and Patchouli book definitions. These assets form part of the mod’s visual and gameplay configuration.
• Tests – A unit testing suite placed under Common/src/test, ensuring integrity for casting actions and other components.
• Build and Configuration – Gradle build scripts, CI configurations (GitHub workflows), and mod configuration files that allow proper compilation and packaging for release.
• External Dependencies – Although not detailed in the file tree, the README mentions dependencies on Hex Casting. Visualizing where Hexal “plugs into” an already-running Hex Casting framework (as well as Minecraft’s mod ecosystem) is essential.
Relationships and Interactions
• The Common module serves as the central hub. Both the Fabric and Forge modules depend on “Common” as they implement platform-specific behavior while reusing common business logic.
• There’s a clear boundary between client and server logic:
– The client parts (e.g., client rendering, network packets, client-side configurations in Fabric/Forge) interact with the common APIs via networking and event handlers.
– The server-side or shared logic (casting actions, configuration, level generation) on Common feeds into both platform-specific parts.
• External interactions include:
– Minecraft’s underlying game engine.
– Possibly external tools (Patchouli book integration for in-game documentation).
Architectural Patterns and Design Principles
• Cross-Platform Abstraction: Notice the xplat packages (e.g., IClientXplatAbstractions, IXplatAbstractions) that define contracts to be implemented differently on Fabric and Forge.
• Modular Design: Separation into Common, Fabric, and Forge illustrates a classic modular approach, where shared logic is decoupled from platform-specific code.
• Event-Driven and Network Messaging: There are packages annotated for network messages (e.g., MsgAddRenderLinkAck, MsgWispCastSoundAck) and event handlers (e.g., EverbookEventHandler), suggesting reactive programming patterns.
• API Exposure and Extensibility: The numerous API packages (spell, linkable, extended casting actions) indicate a design built to be extensible for additional casting or mod functionality.
Detailed and Precise Representation
• Service boundaries showing how the mod utilizes interop packages (xplat) to abstract differences.