? GBLib — Fabric 模组的指南库
GBLib 是一个轻量级、数据驱动的指南库框架,适用于 Minecraft 1.20.2 上的 Fabric 模组。
它提供了一个简洁的 API,用于创建游戏内文档、教程、手册、百科全书和模组指南——无需编写任何 GUI 代码。
无论你是正在构建小型实用工具模组还是完整的内容扩展包,GBLib 都能提供一个精致且可定制的书籍系统,无缝融入 Minecraft 的用户界面风格。
✨ 功能特性
? 数据驱动指南书
使用简单的 JSON 文件定义整本指南书:
- 标题、作者及元数据
- 支持自动换行的页面文本
- 分类与文档条目
- 完全可通过资源包重载
无需任何 Java 样板代码。
?️ 可定制 GUI
GBLib 包含一个灵活的指南书屏幕:
- 支持自定义纹理
- 9‑切片渲染以确保边角清晰
- 可调尺寸(默认 185×144)
- 前景渲染(无背景渗出)
- 整洁的文本换行与布局
放入你自己的纹理,其余工作由库自动处理。
? 易于集成
仅需一行代码即可注册指南书物品:
GuidebookItem.setBookId(stack, new Identifier("modid", "my_book"))
从任意位置打开指南书:
GuidebookClientAPI.open(book)
? 热重载支持
当资源重载时,指南书会自动重新加载,使开发过程中的迭代快速且无痛。
? JSON 结构示例
{
"title": "Example Guidebook",
"author": "GBLib",
"pages": [
{ "type": "text", "content": "Welcome to your new guidebook!" }
]
}
将指南书文件放置在:
assets/<namespace>/gamedata/guidebooks/<id>.json
?️ 面向模组开发者
GBLib 的设计旨在:
- 轻量 —— 最小化开销
- 模块化 —— 仅使用所需部分
- 可扩展 —— 添加自定义页面类型、渲染器或 UI 元素
- 稳定 —— 在重载和会话间保持一致的行为
非常适合以下场景:
- 科技类模组
- 魔法类模组
- 冒险类模组
- 教程与新手引导
- 游戏内文档
? 安装
在你的 fabric.mod.json 中将 GBLib 添加为依赖项:
"depends": {
"fabricloader": ">=0.14.0",
"minecraft": "1.20.2",
"gblib": "*"
}
然后像其他库模组一样包含它即可。
❤️ 为什么选择 GBLib?
因为自己编写指南书系统既繁琐又耗时。
GBLib 为你提供:
- 精致的用户界面
- 简洁的 API
- 数据驱动的工作流
- “开箱即用”的系统
专注于你的模组内容——让 GBLib 来处理文档部分。
? 许可证
GBLib 是开源的,可在任何 Fabric 模组中免费使用。
欢迎贡献、功能请求以及提交 PR。
? 开始构建更优秀的指南书
GBLib 使得创建美观且实用的游戏内文档变得轻松简单。
如果你的模组需要一本指南书,GBLib 是最简单、最干净的添加方式。
? GBLib — Guidebook Library for Fabric Mods
GBLib is a lightweight, data‑driven guidebook framework for Fabric mods on Minecraft 1.20.2.
It provides a clean API for creating in‑game documentation, tutorials, manuals, codices, and mod guides — all without writing a single line of GUI code.
Whether you’re building a small utility mod or a full content expansion, GBLib gives you a polished, customizable book system that fits seamlessly into Minecraft’s UI style.
✨ Features
? Data‑Driven Guidebooks
Define entire books using simple JSON files:
- Titles, authors, and metadata
- Pages with wrapped text
- Categories and documentation entries
- Fully reloadable via resource packs
No Java boilerplate required.
?️ Customizable GUI
GBLib includes a flexible guidebook screen:
- Supports custom textures
- 9‑slice rendering for crisp corners
- Adjustable size (default 185×144)
- Foreground rendering (no background bleed)
- Clean text wrapping and layout
Drop in your own texture and the library handles the rest.
? Easy Integration
Register a guidebook item with one line:
GuidebookItem.setBookId(stack, new Identifier("modid", "my_book"))`
Open a book from anywhere:
GuidebookClientAPI.open(book)`
? Hot‑Reload Support
Guidebooks reload automatically when resources reload, making iteration fast and painless during development.
? JSON Structure Example
{
"title": "Example Guidebook",
"author": "GBLib",
"pages": [
{ "type": "text", "content": "Welcome to your new guidebook!" }
]
}
Place guidebook files in:
assets/<namespace>/gamedata/guidebooks/<id>.json
?️ For Mod Developers
GBLib is designed to be:
- Lightweight — minimal overhead
- Modular — use only what you need
- Extendable — add custom page types, renderers, or UI elements
- Stable — consistent behavior across reloads and sessions
Perfect for:
- Tech mods
- Magic mods
- Adventure mods
- Tutorials and onboarding
- In‑game documentation
? Installation
Add GBLib as a dependency in your fabric.mod.json:
"depends": {
"fabricloader": ">=0.14.0",
"minecraft": "1.20.2",
"gblib": "*"
}
Then include it like any other library mod.
❤️ Why Use GBLib?
Because writing your own guidebook system is tedious.
GBLib gives you:
- A polished UI
- A clean API
- A data‑driven workflow
- A system that “just works”
Focus on your mod’s content — let GBLib handle the documentation.
? License
GBLib is open‑source and free to use in any Fabric mod.
Contributions, feature requests, and PRs are welcome.
? Start Building Better Guidebooks
GBLib makes it easy to create beautiful, functional in‑game documentation.
If your mod needs a guidebook, GBLib is the simplest and cleanest way to add one.
评论 0
登录后参与评分
还没有评论,来抢沙发吧