How wagers-of-industrial-warfare/ritchiesprojectilelib works
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.