How inglettronald/dulkirmod works
Project Type and Purpose
• Type: A client-side Minecraft mod (Forge/Fabric style) written in Kotlin/Java.
• Purpose: Inject new behaviors, commands, HUD overlays, event listeners, and rendering changes into the Minecraft client using Mixins.
High-Level Components
a. External Host
• Minecraft Game Engine
• Mod Loader (Fabric/Forge)
b. Core Mod
• Entry Point (DulkirMod.kt)
• Configuration Manager
• Event Dispatcher
• Command Processor
c. Mixin Injection Layer
• Mixins under src/main/java/dulkirmod/mixins
• JSON config (mixins.dulkirmod.json)
d. Feature Modules
• src/main/kotlin/dulkirmod/features
• src/main/kotlin/dulkirmod/features/chat
• src/main/kotlin/dulkirmod/features/dungeons
• src/main/kotlin/dulkirmod/features/rift
e. Overlays / Renderers
• src/main/kotlin/dulkirmod/overlays
f. Utilities
• src/main/kotlin/dulkirmod/utils
• src/main/kotlin/dulkirmod/config
g. Resources
• src/main/resources (assets, sounds, mod info)
h. Build & Deployment
• build.gradle.kts, gradle wrappers, log4j2.xml
Relationships & Data Flows
• At startup, the Mod Loader reads build metadata, loads the mixin JSON, and invokes DulkirMod.kt.
• DulkirMod registers:
• Event listeners (Events.kt → features → utilities)
• Client commands (ClientCommandBase → individual commands)
• Config system reads from disk (DulkirConfig.kt → ConfigData.kt)
• Minecraft engine calls into injected mixin methods (e.g., MixinEntityRenderer) to alter rendering or game logic.
• Mixins funnel modified game state into the Event Dispatcher.
• The Event Dispatcher broadcasts to subscribed feature modules.
• Feature modules compute HUD state or control logic, emitting overlay instructions.
• Overlay classes render additional HUD elements via Minecraft’s rendering pipeline.
• Utility classes support shared operations (text formatting, scoreboard queries, waypoint math).
Architectural Patterns & Design Principles
• Modular Feature Pattern: each feature lives in its own file/package under features/ and subscribes to events it cares about.
• Mixin-based Inversion of Control: instead of direct subclassing, use mixins to inject into existing game classes.
• Centralized Event Bus: decouples game lifecycle hooks from features and overlays.
• Command Framework: base class (ClientCommandBase) with concrete commands under command/.
• Config-Driven Behavior: settings loaded/serialized via config classes, exposed to users via /dulkir.
Checklist
• [ ] Build & Deployment annotation (Gradle files, log4j2.xml)