How linkachugaming/stackable works
Main Components
• Mod Entry Points: Represent the main classes that serve as the mod’s initialization points. For example, in src/main/java/com/lonkachu/ you have StackableMod.java (likely the central mod class) and Config.java plus configLoader.java which handle configuration.
• Client Side Logic: Located in src/client (e.g., ExampleModClient.java). This component deals with client-specific functionality.
• Mixin Layers: Split between client-side mixins (e.g., DrawContextFixin.java in src/client/java/com/lonkachu/mixin/client) and main mixins (e.g., BundleItemMixin.java, DataComponentTypesFixin.java, InventoryStackMixin.java, ItemEntityMixin.java in src/main/java/com/lonkachu/mixin). These mixins are critical as they intervene in Minecraft’s classes to support the new stack sizes.
• Resources & Configuration: This includes assets in src/main/resources/assets, and the fabric.mod.json file that defines mod metadata. The mixin configuration files (fabric.mod.json, stackable.mixins.json, and stackable.client.mixins.json) are key to wiring up the mixin transformations.
• Build and Deployment Infrastructure: Note the Gradle files (build.gradle, settings.gradle, etc.) and the GitHub workflows (.github/workflows/build.yml). They manage builds, dependencies, and CI pipelines.
Relationships and Interactions
• The Mod Loader (Fabric) acts as the environment in which the mod is injected into Minecraft. Represent it as an external dependency.
• The main mod class (StackableMod.java) registers mod features during initialization. It interacts with configuration classes to adjust behavior dynamically.
• Mixins are “advice” layers that intercept or modify Minecraft’s native code at runtime. They are triggered when Minecraft classes are loaded, hence link directly to Minecraft’s code (which can be depicted as an external “Minecraft Engine” component).
• The client and main modules may have overlapping roles: while the main code handles general logic, the client module updates client-specific elements.
• The resources (assets and configuration files) tie into both mod metadata (fabric.mod.json) and mixin configurations, instructing the mod loader on how to apply mixins.
Architectural Patterns and Design Principles
• Configuration and Dependency Injection: Highlight that configuration files (fabric.mod.json, mixin JSON files) determine entry points and behavior adjustments.
• CI/CD Pipeline: Include a side component that covers build automation (Gradle scripts and GitHub workflows).
Essential Detail
Architectural element is detailed—instead of a generic “Backend” block, split the system into all the components identified: mod initializer, configuration loader, mixin transformers for client and main operations, and indicate the external Minecraft environment. This level of granularity is important given the experimental nature of mod development and mixin injection.