How skyblockermod/skyblocker works
Project Type & Purpose
• Skyblocker is a Fabric-based Minecraft client mod (Java library) that injects additional features, HUDs, GUI screens, and game‐event handlers into Hypixel Skyblock. It uses Gradle+buildSrc for build-time annotation processing and Mixin-based bytecode weaving to modify Minecraft classes at runtime.
Key Architectural Layers
a. Build & Instrumentation
• Gradle + buildSrc: custom annotation processors (InitProcessor, HudProcessor) generate injection metadata.
• Fabric Loom & Mixin: the skyblocker.mixins.json defines mixin classes that transform Minecraft bytecode on startup.
b. Initialization & Entry
• SkyblockerMod (Fabric entrypoint) registers event listeners, GUI screens, data fixers, commands, and config manager.
c. Core Subsystems
• Event System: events package listens to chat, network, world, and tick events.
• Feature Modules: grouped under skyblocker/skyblock (dungeons, slayers, rift, etc.) each exposing HUD widgets, solvers, and overlays.
• GUI & HUD: hud, screen, and tabhud packages implement MVC-style screens/widgets and a pipeline (ScreenBuilder, WidgetManager) for rendering.
• Configuration: config package loads JSON via Codec, provides config screens, and applies data fixer migrations.
• WebSocket Service: utils.ws package manages external WebSocket connections for sharing waypoints (Crystal Hollows).
• Utilities: utils contains HTTP/API clients, JSON utilities, schedulers, and shared data structures.
d. Assets & Resources
• src/main/resources/assets/skyblocker: textures, language files, skeleton maps for dungeons.
• Resourcepacks: dynamic recoloring for dungeon textures.
Relationships & Data Flows
• At build time, annotation processors scan @Init / @RegisterWidget annotations → generate metadata → packaged into JAR.
• On mod startup, Fabric loads SkyblockerMod → registers Mixins → initializes subsystems: config, event bus, WebSocket, GUI registry.
• Game events (tick, network, chat) fire into event listeners → delegated to feature modules (e.g., dungeon solver) → compute state → push to HUD manager.
• Rendering pipeline pulls widget state each frame → draws GUI overlays using Fabric’s rendering hooks via Mixins (InGameHudMixin).
• Config reads/writes JSON on disk; user triggers screens via commands or mod menu; data fixers migrate older schemas.
• WebSocket connects to external server → sends/receives waypoint messages → injects into in-game map overlay.
Architectural Patterns & Principles
• Plugin/Module pattern: each feature (dungeons, slayers, profile viewer) lives in its own package, implements common interfaces (Tickable, Widget).
• Observer: event listeners decoupled from feature logic via registration in Fabric’s event bus.
• Builder/Pipeline: GUI elements are composed at runtime via a pipeline of WidgetPositioners.
• AOP / Mixin: cross-cutting concerns (render hook, network interception) injected without modifying vanilla code.
• Data Migration: config datafixer ensures backward compatibility.