HPSlib
HPSlib is the unified shared library mod for all of my Minecraft mods, providing reusable UI components, layout utilities, cross-version compatibility layers, and common infrastructure.
Why HPSlib?
Many mods share core utilities, UI widgets, and cross-version compatibility code. In particular, JEI updates very frequently and changes between releases can easily break dependent addons. HPSlib centralizes shared code across all of my mods—allowing JEI / EMI display addons to quickly stay compatible with the latest JEI releases while also supporting older popular JEI versions cleanly in one place, and serving as the shared foundation for future mods without duplicating boilerplate.
Current Modules & Features
- Adaptive Viewport Layout: Automatically computes recipe panel height, viewport bounds, and grid rows across different GUI scale settings to prevent clipping and overflow.
- Scrollable Slot Panel & Framed Scroll Grid: Unified scrollable recipe panels and bordered scroll grids with native JEI scrollbar rendering, mouse wheel and drag support, scissor clipping, and out-of-viewport hit protection.
- Cross-Version JEI Compatibility Layer: Wraps JEI recipe type keys, base recipe categories, slot builders, crafting station catalysts, and recipe lookup plugin registration behind a stable API—compatible with both modern and older popular JEI releases (
1.20.1: 15.20.0.100+,1.21.1: 19.19.3.226+,26.1.2: 29.5.0.24+,26.2: 30.0.0.1+,26.3: 31.0.0.3+). - Runtime Recipe Sync & Indexed Lookup: Safe deduplicated recipe hot-reloading and inverted-index lookup base classes for large dynamic recipe datasets.
- Shared EMI Scroll Support: Provides reusable EMI scrollable widgets and shared scroll forwarding when EMI is installed alongside JEI (optional; JEI and EMI are not required for non-JEI mods).
Notes for Players
This is a shared library mod and does not add gameplay items or blocks on its own. Install it when required by another mod.
Source Code: https://github.com/hp3081925122/HPSlib
HPSlib
HPSlib 是面向我旗下全部 Minecraft 模组的统一独立前置库,提供可复用的通用基础设施、界面控件、自适应布局工具与跨版本兼容适配层。
为什么制作 HPSlib?
不同模组之间存在大量共用的基础能力与跨版本兼容代码——尤其是 JEI 更新非常频繁,每次版本迭代都可能引发附属模组不兼容。制作 HPSlib 是为了把我旗下所有模组的共用底层统一沉淀到一个前置库中:既能让多个 JEI / EMI 附属快速适配最新版 JEI 并集中兼容更多热门旧版 JEI,也能作为后续所有模组的公共依赖,避免重复维护。
当前包含模块与功能
- 自适应视口布局:根据当前 GUI 缩放自动计算配方高度、可视视口与槽位网格行数,避免高缩放下界面被截断或溢出。
- 可滚动槽位面板与带框滚动网格:统一的配方滚动面板与原生滚动条绘制,支持滚轮与拖拽滚动、裁剪防溢出以及视口外槽位防误触。
- 跨版本 JEI 兼容层:封装配方类型键、配方类别基类、槽位填充、催化剂与查询插件注册,同时兼容最新与热门旧版 JEI(
1.20.1: 15.20.0.100+、1.21.1: 19.19.3.226+、26.1.2: 29.5.0.24+、26.2: 30.0.0.1+、26.3: 31.0.0.3+)。 - 运行时热同步与倒排查询基类:提供安全的运行时去重刷新与倒排索引查询基类,适用于体量较大的动态配方数据。
- 可选 EMI 滚动支持:在安装 EMI 时提供共享滚动面板与滚动事件转发;对不依赖 JEI / EMI 的普通模组无额外强依赖。
玩家说明
本模组为纯前置依赖库,单独安装不会新增游戏内物品或方块,仅在被其他模组声明为前置时安装即可。