$ show Polyfrost/OneConfig
OneConfig is a modular, Compose-based configuration library for Minecraft mods, providing a unified API for config definitions, UI rendering, HUD management, keybind handling, event system, and notifications. It supports multiple Minecraft versions and mod loaders (Fabric, NeoForge) via a stonecutter-based build system and extensive mixin compatibility layers for third-party mod configs (e.g., YACL, ClothConfig, MoulConfig). The library features a custom Compose runtime (poly-compose) for Skia-accelerated UI, a tree-based config model with annotation-driven properties, and a service-loader-based platform abstraction. It is actively maintained with a large test suite covering config persistence, event validation, keybind codecs, and HUD migration.
The LLM identified 2 files worth highlighting for reuse:
Central event bus with typed event classes, priority ordering, automatic removal of failing handlers, and support for both annotation-driven (@Subscribe) and lambda-based registration. Self-contained and could be extracted as a standalone event library.
Generic object serializer that handles primitives, arrays, enums, maps, colors, and custom objects via registered adapters. Supports cycle detection and immutable types. Could be reused in any Java project needing flexible serialization without a heavy framework.