$ show mezz/JustEnoughItems
JustEnoughItems (JEI) is a Minecraft mod that provides an in-game recipe viewer and ingredient browser. It is a client-side mod that integrates with both Fabric and NeoForge mod loaders via a common core library. The system's primary function is to display all available recipes, items, and fluids in a searchable overlay, allowing players to look up crafting, smelting, brewing, and other recipes. It also supports a plugin API (IModPlugin) that lets other mods register custom recipe categories, ingredient types, recipe transfer handlers, GUI handlers, and search prefixes. The codebase is organized into distinct modules: Common (shared logic, networking, configuration, and platform abstractions), Library (core implementations for recipe management, ingredient indexing, vanilla integrations, and runtime), Gui (client-side overlays, input handling, bookmarking, and search), and platform-specific modules for Fabric and NeoForge. The mod includes a sophisticated search engine with prefix-based tokens, an ingredient filter, a configurable overlay layout, ghost ingredient dragging, and a bookmark system. Recipe transfer to in-game crafting grids is handled via network packets with server-side permission checks. The codebase demonstrates strong architectural practices with clear API separation, extensive unit and game tests, and a flexible configuration framework. However, it exhibits significant platform duplication between Fabric and NeoForge implementations and carries deprecated API surfaces, indicating ongoing evolution.
The LLM identified 5 files worth highlighting for reuse:
Immutable rectangle class with no dependencies beyond Java standard library. Provides construction, accessors, and transformation methods (crop, move, inset, intersect). Self-contained and easily extractable for any project needing immutable 2D rectangles.
Generic lazy initialization supplier that computes a value on first access and caches it. Thread-safe and rethrow-compatible. Depends only on Java's Supplier interface. Can be reused in any Java project for deferred computation.
A runnable decorator that delays execution by a configurable interval and replaces the pending task if a new one is submitted before the delay expires. Useful for coalescing rapid state changes (e.g., config saves). Self-contained except for a DelayedExecutor dependency.
Generic configuration schema framework that supports categories, typed config values, default values, and change listeners. Serializes to/from config files. The pattern is generic enough to be reused in non-Minecraft projects for config management.
Timer that cycles through a list of items at a configurable interval, with display duration per item. Uses TickTimer for timing. Can be extracted for any UI that needs cycling through a set of elements (e.g., animated textures, rotating tooltip content).