本项目适用于该模组的 Forge 版本。点击此处查看该模组的 Fabric 版本。
Annotated DI 是对 Guice 的封装,并添加了一些额外工具,以便更方便地与 Minecraft 模组配合使用。这使得在制作模组及其 API 时可以使用依赖注入(Dependency Injection)设计模式。
为模组开发者提供的额外工具:
- @Implementation 注解:可用于方便地连接所有依赖项,无需创建单独的文件来配置所有绑定,且不会强制 API 对实现类产生编译期依赖。
- 每个模组一个中心 Injector:允许模组从自身及其依赖项中注入类/接口。
- 注册表:提供了一种方式,让模组开发者在 Injector 创建之前向其添加自定义 Module——除非进行某种高级绑定,否则大多数模组不需要此功能。
开发者文档可在 Wiki 页面 找到。
Q&A
这如何帮助用户?
设计为使用该模式的模组比不使用它的模组更容易维护,从而可能带来更快的更新速度。它并非适用于所有模组的解决方案,但对某些模组(尤其是为其他模组提供 API 时)非常有用。
它本身有什么实际功能吗?
它只会显示在模组列表中,仅此而已。
它会为你自动下载模组依赖项吗?
不会
This project is for the Forge version of the mod. Click here for the Fabric version of the mod.
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 for each mod, which allows mods to inject classes/interfaces from themselves and their dependencies.
- A registry that provides a way for modders to add a custom Module to the Injector before 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 (Forge)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Annotated DI (Forge)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Annotated DI (Forge)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Annotated DI (Forge)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Annotated DI (Forge)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Annotated DI (Forge)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Annotated DI (Forge)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Annotated DI (Forge)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Annotated DI (Forge)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Annotated DI (Forge)
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
添加德语翻译
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
模组
适用于 MC 1.18+ 的 Effekseer 加载器
模组
添加区块认领和玩家组队功能,并与 Xaero's Minimap 和 World Map 集成
评论 0
登录后参与评分
还没有评论,来抢沙发吧