How serilum/collective works
Main Components
• Common Library Core: This is encapsulated in the “Common” directory, where you see packages for configuration, events, functions, networking, schematics, services, and utilities. It contains the central code that all mod loader implementations depend on.
• Mod Loader Specific Adapters: There are distinct modules for Fabric, Forge, and NeoForge. Each of these directories contains classes and mixins that integrate the core functionalities into each mod loader’s ecosystem. For instance:
• Fabric module: Contains Fabric-specific classes (e.g., CollectiveFabric, callbacks, Fabric mixins, configuration screens, and networking handlers).
• Forge module: Contains its respective implementations and mixins (e.g., CollectiveForge, Forge-specific events and networking).
• NeoForge module: Similarly handles NeoForge implementation details.
• Integration with Minecraft’s Ecosystem: Although not directly visible in external systems, each mod loader component (via mixins and event callbacks) integrates with Minecraft game events, rendering, world interactions, and the underlying mod loader frameworks.
Out Relationships and Interactions
• The “Common” layer acts as the central “service provider.” Its classes (like UtilityFunctions, CollectiveConfigHandler, Networking, and event-related components) feed into each loader module.
• From each mod loader component (Fabric, Forge, NeoForge), arrowed connections should point back to the Common layer where shared logic is called or extended. This shows that while each platform has adapter code (mixins callbacks and configuration screens), they all rely on the code housed in the “Common” module.
• Data flow & configuration dependencies: For example, mod loader-specific configuration screens (in Fabric and Forge) read or modify values maintained by the Common configuration classes.
• Event flow: Client and server events captured in the loader-specific modules eventually call back to the shared event handling routines within Common.
• Networking interactions: Each loader’s networking handlers ultimately route their packets via the shared networking functionality from the Common module.
Architectural Patterns and Design Principles
• Modularity: The architecture cleanly separates concerns by grouping shared functionality in “Common,” while specific adaptations to mod loaders are handled in dedicated modules.
• Adapter/Bridge Pattern: The loader-specific modules act as adapters bridging the Common shared API with the specific environments (Fabric, Forge, NeoForge).
• Event-Driven Design: Numerous classes and callback packages indicate that events are a primary mechanism for runtime behavior.
• Use of Mixins: Mixin packages in each module demonstrate the use of aspect-oriented techniques to modify core game classes without direct inheritance.
Relevant Technologies and Frameworks
• Java as the main programming language.
• Gradle as the build tool (evident from multiple build.gradle files and Gradle wrapper settings).
• Specific mod loader dependencies (Fabric, Forge, NeoForge) integrated using their respective APIs and using mixins.
• Minecraft modding framework support (with config screens, network packet handling, and event callbacks).
Elements
• Clear Labels: Name each component clearly (“Common Library Core”, “Fabric Adapter”, “Forge Adapter”, “NeoForge Adapter”).
• Annotations: Briefly annotate clusters indicating “Configuration Management,” “Event Handling,” “Networking,” etc., to provide clarity about what each module handles.