
Recipe Book Access 是一个简单的 API,旨在为任何合成屏幕直观地添加外部容器访问支持。
它将配方书功能重定向,以从可自定义的容器列表中检查和填充物品,而不仅仅是玩家自己的背包。
这意味着什么?
亲自体验一下!
这是一个示例,展示了某个模组化的合成台通过此 API 使用自定义的容器列表,在本例中,它使用了附近所有箱子的容器。
仅靠本模组 无法 实现上述效果 —— 如果你正在寻找一个为合成台实现此功能的模组,你可能需要 Nearby Crafting 模组。
快速入门指南
如需更详细的使用指南,包括如何在你的项目环境中设置此 API,请参阅本项目在 Github 上的 readme 文件 这里。
此 API 提供了一个名为 RecipeBookInventoryProvider 的简单接口,位于 com.jomlom.recipebookaccess.api 包中。
你必须在屏幕处理器类中实现此接口,只需重写一个方法 (getInventoriesForAutofill()) 即可启用 API 的功能。另外两个方法也可用于获得更多控制权。
你必须实现 getInventoriesForAutofill() 以返回一个容器列表,这些容器将允许配方书访问并进行自动合成,默认情况下这不会包含玩家的背包。
代码示例:
import com.jomlom.recipebookaccess.api.RecipeBookInventoryProvider
public class YourCraftingMenu extends AbstractCraftingMenu implements RecipeBookInventoryProvider {
// your existing code...
@Override
public List<Container> getInventoriesForAutofill() {
return yourContainersList;
}
}
此 API 做出的假设:
- 你的屏幕处理器类继承自 'AbstractCraftingMenu' 或其任何子类
- 对应的屏幕继承自配方书屏幕,以便利用 Minecraft 的配方书系统
(我未在这些假设之外的环境下进行测试)
常见问题解答 (FAQs)
-
问:我觉得我发现了一个问题……
答:欢迎在 Github 上创建 Issue,或通过电子邮件contact@jontyali.com直接联系我。 -
问:你会支持 x 吗?
答:只要我有时间和兴致,我都会确保本模组兼容最新版本,但有时我也会很忙!同样,欢迎提出支持特定版本或其他模组的需求。 -
问:我的
getInventoriesForAutofill()实现需要在客户端运行吗?
答:不需要!getInventoriesForAutofill()仅在服务器端的屏幕处理器中使用,API 会自动为你保持客户端与结果同步!

Recipe Book Access is a simple API designed to intuitively add support for external inventory access in any crafting screen.
It redirects the recipe book functionality to check and fill from a customisable list of inventories, instead of just the player's.
What does this mean?
See for yourself!
This is an EXAMPLE of a modded crafting table uses a custom list of inventories via this API, in this specific case it uses all inventories from nearby chests.
This mod alone will not achieve what is shown above - If you are looking for a mod that implements this for the crafting table, you probably want the Nearby Crafting mod.
Quickstart Guide
For a more detailed how-to-use guide, including how to setup this API in your project's environment, please see the readme on Github for this project here.
This API provides a simple interface called RecipeBookInventoryProvider, located in com.jomlom.recipebookaccess.api.
This interface must be implemented to your screen handler class, only one method needs overriding (getInventoriesForAutofill()) for the API's functionality. Two other methods are also available for more control.
You must implement getInventoriesForAutofill() to return a list of containers which you want the recipe book to access and craft from, this won't include the player's inventory by default.
Code Example:
import com.jomlom.recipebookaccess.api.RecipeBookInventoryProvider
public class YourCraftingMenu extends AbstractCraftingMenu implements RecipeBookInventoryProvider {
// your existing code...
@Override
public List<Container> getInventoriesForAutofill() {
return yourContainersList;
}
}
Assumptions made by this API:
- Your screen handler class extends 'AbstractCraftingMenu', or any of its subclasses
- Your corresponding screen extends a recipe book screen, in order to utilize the minecraft recipe book
(I have not tested outside these assumptions)
FAQs
-
Q: I think I found an issue...
A: Feel free to create an issue on Github or reach out directly by emailcontact@jontyali.com. -
Q: Will you release support for x ?
A: Whenever I have time and feel like it, I make sure this mod comes to support the latest versions, but sometimes I get busy! Again, feel free to reach out with reqeusts to support certain versions or other mods. -
Q: Does my
getInventoriesForAutofill()implementation need to work from the client?
A: Nope!getInventoriesForAutofill()is only used from the server side screen handler, and the API will keep the client up to date on the results for you automatically!
下载 Recipe Book Access API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Recipe Book Access API
下载 Recipe Book Access API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Recipe Book Access API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Recipe Book Access API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Recipe Book Access API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Recipe Book Access API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Recipe Book Access API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Recipe Book Access API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Recipe Book Access API
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
暂无更新日志
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
AE2:一款流行的自动化与存储模组
评论 0
登录后参与评分
还没有评论,来抢沙发吧