How fpsmasterteam/fpsmaster works
Project Type & Purpose
• FPSMaster is a modular Minecraft PvP client (a desktop client mod), written in Java and built with Gradle.
• It provides an SDK (in “shared/…”), platform‑specific adapters (“v1.8.9/…” and “v1.12.2/…”), a plugin/module system (features, commands, Lua scripts), a UI overlay engine, event bus, external‑service integrations (WebSocket, music APIs, OpenAI, Microsoft login), and resource assets.
Top‑Level Architectural Components
A. Core SDK
– shared/java/top/fpsmaster: EventBus (EventDispatcher, Handler), feature/command APIs, module & settings managers, font & render helpers, utility methods.
– shared/resources: Minecraft assets, GUI scripts, shaders, language packs.
B. Platform Adapters
– v1.8.9 and v1.12.2 folders: Forge mixins, wrapper providers, launch configuration, version‑specific Minecraft hooks.
C. Module & Plugin Engine
– Feature modules (“features/…”): Interface modules, render/utility/optimize modules.
– Command modules (“features/command/…”).
– Lua scripting engine (“modules/lua/…”).
– Category/ModuleManager orchestrates load/unload.
D. UI Layer
– shared/java/top/fpsmaster/ui: Click GUI, custom HUD components, minimap, notification system, dev‑space.
– FontManager + EnhancedFontRenderer.
E. Event System
– ASMHandler, ReflectHandler, DynamicHandler hook into Minecraft events.
– EventDispatcher broadcasts Event* classes to subscribed module callbacks.
F. Configuration & Persistence
– ConfigManager loads/saves module settings (Setting classes under features/settings).
G. External Integrations
– WebSocket client (“websocket/client/WsClient”) for server messages.
– Third‑party HTTP & auth (MicrosoftLogin, OpenAIClient, NeteaseApi).
– UpdateChecker, GitInfo.
H. Build & Deployment
– Gradle scripts in each version folder, GitHub Actions workflow (.github/workflows/gradle.yml).
Relationships & Data Flows
• At launch, the platform adapter loads the Core SDK via mixins/hooks.
• The EventBus registers module callbacks; Minecraft internal events are intercepted by ASMHandler → EventDispatcher → module handlers.
• Modules query ConfigManager & Setting classes for runtime preferences.
• LuaManager parses & executes scripts in response to events.
• MusicPlayer and WebSocket client run in background threads, push data via EventBus or callback interfaces.
• External APIs are invoked asynchronously; results are wrapped into events or passed to UI modules.
Architectural Patterns & Principles
• Observer Pattern (EventBus) for loose coupling between Minecraft engine and modules.
• Plugin/Module architecture: ModuleManager dynamically loads/unloads modules; settings injection.
• Adapter/Provider pattern: wrapper providers abstract Minecraft internals for core SDK.
• Model‑View separation: modules maintain state & settings (model), UI classes render overlays (view).
Final Checklist
– At least one zoomed‑in inset showing EventBus subscription flow.
– Persistent storage (config files) and CI pipeline as contextual sidebars.