$ show toxicity188/BetterModel
BetterModel is a high-performance, server-side Minecraft plugin and mod (Bukkit/Paper/Fabric) that renders custom 3D models from BlockBench (.bbmodel) files using Minecraft's display entities. It automatically generates resource packs, supports keyframe and Molang-driven animations, per-player model visibility, hitboxes, mounting, player skin integration, and third-party compatibility (MythicMobs, Citizens, SkinsRestorer). The architecture is modular with a clean API/implementation split, platform abstraction, and version-specific NMS modules for multiple Minecraft versions (1.21.4 through 26.3). The codebase demonstrates strong engineering practices in packet bundling, animation interpolation, concurrency utilities, and event-driven design. However, it suffers from significant code duplication across NMS versions, minimal test coverage, and heavy reliance on Minecraft internals via reflection, which introduces maintenance fragility. It is actively maintained with frequent updates and a responsive issue tracker.
The LLM identified 4 files worth highlighting for reuse:
Defines the PacketBundler interface and its implementations (SimpleBundler, ParallelBundler) for efficiently grouping and sending multiple Minecraft packets to players. This pattern is cleanly abstracted in the API layer and implemented per NMS version, making it reusable for any plugin that needs to batch packet sends, especially for entity spawning or data updates. It demonstrates non-obvious skill in network optimization and version-agnostic design.
Provides static methods for linear, bezier, and catmull-rom interpolation, as well as frame rounding utilities. This is a standalone math utility with no internal dependencies, making it highly reusable for any project requiring smooth value transitions or animation keyframe blending. The implementation is clean and well-optimized.
A custom ordered map that maintains insertion order while supporting priority-based ordering with tie-breaking. It is used internally for managing animation animators by priority. The class is self-contained and can be extracted for any scenario needing a sorted map with deterministic iteration order. It demonstrates careful design around edge cases like equal priorities and null keys.
A read-write lock implementation that allows multiple concurrent readers or exclusive writers, with a 'duplex' mode for simultaneous read and write access via a callback. It is used for thread-safe modifications to bone transformations. This utility is fully self-contained and can be reused in any Java/Kotlin project requiring fine-grained concurrency control beyond standard ReentrantReadWriteLock.