How toshimichi0915/sushi-client works
Main Components
• Client Core & Initialization:
• Core startup classes (e.g., SushiInitializer, SushiMod, ModConfig) that bootstrap the mod.
• Integration points with Minecraft’s mod loader and Forge/Mixin system.
• Module System:
• How modules can be added, removed, and manipulated (clonable modules, removable modules, etc.).
• Event & Handlers System:
• Detail the event bus and event classes (found in the events directory) which capture game events such as player movements, ticks, input events, packet events, etc.
• Various event handlers in the handlers directory along with specific handlers for forge event types.
• Command & Input System:
• Isolate the command system (classes under the command directory) that handles textual inputs (".help", ".restore", etc.) and parses custom commands.
• This system with the module system, showing that commands trigger module behavior (e.g., toggle modules and change settings).
• Graphical User Interface (GUI & HUD):
• GUI components (components, panels, themes, and HUD elements found in the gui and hud directories).
• How the GUI interacts with user input (via keybinds), how it’s customizable with configuration settings, and how HUD elements are rendered during gameplay.
• Configuration & Task System:
• Task framework (Task, TaskChain, and various tasks) used to execute delayed or asynchronous operations.
• Mixin & Low-Level Integration:
• Mixin-based classes (in the mixin package) that modify or intercept Minecraft client internals to enable enhanced functionality.
• That this layer connects the mod’s core with the game’s internal mechanics.
• Account & Networking Components:
• Account management parts (in the account package) that deal with Mojang authentication, account encryption, and related API requests/responses.
Relationships and Data Flow
• Initialization flows from SushiInitializer into the core system where modules are registered, events are bound to handlers, and the GUI is set up.
• Mixins interpose on the Minecraft client, funneling game events (render, input, tick, etc.) into the Event Bus; from there, events are dispatched to both module logic and GUI components.
• The Module System depends on the Event System (receiving game events, keybinds, and commands), and in turn, modules can affect game behavior (e.g., combat modules, movement modules).
• The Configuration subsystem supplies data to the GUI, modules, and even to account management; likewise, changes in settings (via the GUI) update the configuration records.
• The Task system works as a utility layer, running scheduled work that might be triggered by modules or event handlers.
• Finally, clearly display connections between the core, mixins, and external Minecraft/Forge APIs.
Incorporate Essential Architectural Patterns
• Event-driven design: use arrowed lines to illustrate the flow of events from the game (via mixins) to event handlers and modules.
• Use layering to capture separation of concerns (Core, Event/Command System, GUI/HUD, Module functionalities, and Utility/Task handlers).
• Modular design that allows modules to be dynamically added, removed, and reconfigured.
• Dependency injection or configuration injection patterns in the Configuration system if applicable.