How cigaretteclient/cigarette works
Project type and purpose
• This is a Java-based Minecraft client “mod” (using Fabric), named Cigarette Client.
• Its purpose is to inject custom behaviors—game-play enhancements, HUD overlays, automated agents—into the vanilla Minecraft client at runtime.
File structure
• Top‐level build files (build.gradle, gradlew, settings.gradle) → Gradle build and release pipeline, GitHub Actions workflows.
• src/main/java/dev/cigarette: main code, organized into sub-packages:
• agent (auto-detectors for game modes)
• config (persistent settings, file system abstraction)
• events (central event bus)
• gui (widgets, HUD modules, screens, render utilities)
• lib (utility wrappers around Minecraft internals)
• mixin (Fabric Mixin definitions for injecting into Minecraft classes)
• module (hacks/plugins sorted by category: bedwars, combat, UI, etc.)
• precomputed (preprocessed data for fast lookup)
• src/main/resources:
• fabric.mod.json + cigarette.mixins.json → Fabric loader metadata
• assets/cigarette/lang/… → internationalization resources
• assets/cigarette/font → custom fonts
README for additional insights
• Minimal README—logo, title, tagline “Next-gen Hypixel Fuckery.”
• Confirms it’s a client mod for the Hypixel server, no further architecture details.
a. Main components
1. Fabric Loader & Mixin Engine
2. Minecraft Client (vanilla game code)
3. Cigarette Mod Core
• Injector Layer (mixins)
• Event Bus (Event dispatcher, listener registration)
• Config Manager (Config, FileSystem)
• Module Registry (BaseModule, ModuleList)
• Agents (GameDetector → selects bedwars/murder/zombies agents)
• GUI / HUD System (CigaretteScreen, HUD modules, widgets)
• Utility Library (ChatLogger, Renderer, Raycast, etc.)
• Precomputed Data (BlockIn, PyramidQuadrant)
4. External Services (Hypixel server via Minecraft’s networking)
5. Build & Release Pipeline (Gradle, GitHub Actions)
b. Relationships and interactions
• Fabric Loader loads Minecraft Client + Cigarette mod jars.
• Mixin Engine applies mixins to Minecraft classes at startup (e.g., EntityMixin, Renderer, Input Mixin).
• Mixin-injected hooks fire custom events into the Cigarette Event Bus.
• Event Bus broadcasts events (render tick, client tick, network packet received) to registered modules and agents.
• Modules subscribe to events, use Utility Library + precomputed data to implement features.
• GUI system hooks into Render events, draws HUD overlays and screens using Renderer and custom fonts.
• Config Manager reads/writes JSON or similar to persist user settings.
• Agents detect game mode from the world state and register mode-specific modules/providers.
• Communication with the Hypixel server happens through unmodified Minecraft networking stack.
c. Architectural patterns and principles
• Modular plugin architecture: each feature is a Module implementing BaseModule.
• Event-driven design: core loop generates events, modules react.
• Dependency Injection via mixins: decouples mod code from Minecraft internals.
• Registry pattern: modules, bar widget providers, keybinds registered centrally.
• Separation of concerns: agents (mode detection) vs. modules (feature implementations) vs. GUI vs. config.
d. Key technologies and frameworks
• Java 17 (or 8, per Fabric version)
• Fabric Loader + Mixin framework
• Gradle build system
• GitHub Actions (build-and-release.yml, build-test.yml)
• JSON/YAML for config and resource definitions