Annotated DI 是 Guice 的封装,并添加了一些额外工具,以便更方便地与 Minecraft 模组配合使用。这使得在制作模组及其 API 时可以使用 依赖注入 设计模式。
为模组开发者提供的额外工具:
@Implementation注解,可用于方便地连接所有依赖项,无需创建单独的文件来配置所有绑定关系,也不会强制 API 对实现类产生编译时依赖。- 一个中央 Injector(注入器),允许模组从其他模组中注入类/接口。
- 一个入口点/事件,为模组开发者提供了一种在创建 Injector 时向其添加自定义 Module 的方式——除非涉及某些高级绑定操作,否则大多数模组不需要此功能。
开发者的文档可在 Wiki 页面 上找到。
常见问题解答
这对用户有什么帮助?
设计为使用此库的模组可能比不使用它的模组更容易维护,从而可能导致更快的更新速度。它并非适用于所有模组的解决方案,但对于某些场景非常有用,尤其是在制作供其他模组使用的 API 时。
它本身有什么作用?
它会显示在模组列表中,但仅此而已。
它会自动为你下载模组依赖项吗?
不会
Annotated DI is a wrapper around Guice with a few extra utilities added for more convenient use with Minecraft mods. This allows the Dependency Injection design pattern to be used when making mods and APIs for them.
Extra utilities for modders:
- The @Implementation annotation, which can be used to wire up all the dependencies conveniently without needing to make a separate file to configure all the bindings, and without forcing the API to have a compile time dependency on the implementation.
- A central Injector, which allows mods to inject classes/interfaces from other mods.
- An entrypoint/event that provides a way for modders to add a custom Module to the Injector when it's created - most mods won't need this unless they're doing some advanced bindings of some kind.
Documentation for developers can be found on the wiki.
Q&A
How does this help users?
Mods that are designed to use this can be easier to maintain than mods that don't use it, which can result in faster updates. It's not the right solution for every mod, but it can be useful for some, especially when making an API that other mods can use.
Does this do anything on its own?
It shows up in the mod list, but that's about it.
Does this download mod dependencies for you?
No
下载 Annotated DI
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Annotated DI
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Annotated DI
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Annotated DI
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Annotated DI
下载 Annotated DI
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Annotated DI
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Annotated DI
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Annotated DI
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Annotated DI
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
添加德语翻译
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
适用于 MC 1.18+ 的 Effekseer 加载器
模组
添加区块认领和玩家组队功能,并与 Xaero's Minimap 和 World Map 集成
评论 0
登录后参与评分
还没有评论,来抢沙发吧