配置文件
基本信息
| 属性 | 值 |
|---|---|
| 配置文件名 | config/NEIAddons.cfg(由 NEIAddons.preInit 的 event.getSuggestedConfigurationFile() 生成,FML 按 modId 命名) |
| 配置 API | Forge net.minecraftforge.common.config.Configuration(1.7.10 旧 API,非 GTNHLib @Config 注解) |
| 读写时机 | preInit 打开文件 → init 读取全部业务选项 → 遍历完 addon 后 config.save() |
| 选项总数 | 6(Addons 分类)+ 1(AE2)+ 2(Botany)+ 12(Forestry)= 21 |
创建点:net/bdew/neiaddons/NEIAddons.java:78-79
配置文件先注册一个自定义分类注释:
config = new Configuration(event.getSuggestedConfigurationFile());
config.addCustomCategoryComment("Addons", "Controls loading of different addons, set to false to disable");
分类 Addons — addon 总开关
这一组不是硬编码的:NEIAddons.init 遍历 addons 列表,用 addon.getName() 当键、addon.isEnabledByDefault() 当默认值,因此键名完全取决于各 addon 覆写了什么。
| 键 | 类型 | 默认值 | 控制 |
|---|---|---|---|
Applied Energistics 2 |
boolean | true |
整个 AE2 addon(appeng/AddonAppeng) |
Botany |
boolean | true |
整个 Botany addon(仅客户端,见 checkSide) |
Crafting Tables |
boolean | true |
整个工作台叠加 addon(仅客户端) |
Developer Tools |
boolean | false |
整个开发者工具 addon(仅客户端) |
Ex Nihilo |
boolean | true |
整个 Ex Nihilo addon(仅客户端,只含 WAILA) |
Forestry |
boolean | true |
整个 Forestry addon |
Developer Tools 是唯一一个默认关闭的,因为 AddonDeveloper.isEnabledByDefault() 显式 return false。
关闭某个 addon 的效果:日志打 "%s Addon disabled - skipping",其 init() 完全不执行,因此该 addon 声明的所有子开关在 .cfg 里也不会被写入(get(...) 没被调用过)。
分类 Applied Energistics 2
| 键 | 类型 | 默认值 | 控制 |
|---|---|---|---|
Blacklist Gui Class Name |
String 列表 | ["com.glodblock.github.client.gui.GuiFluidPatternTerminal", "com.glodblock.github.client.gui.GuiFluidPatternTerminalEx"] |
这些 AE2 界面不装 NEI 拖拽处理(两者都是 Glodblock 的流体样板终端) |
由 appeng/AddonAppeng.init() 读取,注释原文为 "These Gui won't have the NEI drag item handler from NEI addon."。匹配方式是 AppEngGuiHandler.checkBlacklist 里对 gui.getClass().getName() 做全等字符串比较,不是子串匹配——所以自定义子类类名不会被黑名单命中。
分类 Botany
| 键 | 类型 | 默认值 | 控制 |
|---|---|---|---|
Show Flower Mutations |
boolean | true |
是否注册 FlowerBreedingHandler 配方页 |
Load blacklisted |
boolean | false |
是否把 Forestry 种质黑名单里的花种/等位基因也纳入;注释原文 "Set to true to load blacklisted species and alleles, it's dangerous and (mostly) useless" |
AddonBotany 另有 checkSide(side) { return side.isClient(); },服务端根本不会注册进 addon 列表。
分类 Forestry
| 键 | 类型 | 默认值 | 控制 |
|---|---|---|---|
Show Bee Mutations |
boolean | true |
注册 BeeBreedingHandler |
Show Bee Products |
boolean | true |
注册 BeeProduceHandler |
Show Tree Mutations |
boolean | true |
注册 TreeBreedingHandler |
Show Tree Products |
boolean | true |
注册 TreeProduceHandler |
Show Butterfly Mutations |
boolean | true |
注册 ButterflyBreedingHandler |
Show Secret Mutations |
boolean | false |
是否收录 mutation.isSecret() 为真的隐性突变(默认隐藏) |
Show Mutation Requirements |
boolean | true |
是否绘制并响应 hover 特殊条件提示 |
Add Bees to Search |
boolean | true |
把蜂种/树种/蝴蝶种注入 NEI 搜索索引 |
Add Combs to Search |
boolean | false |
把蜂蜡子物品的每个 metadata 变体注入 NEI 搜索 |
Add Saplings to Search |
boolean | true |
把树苗注入 NEI 搜索 |
Add Pollen to Search |
boolean | true |
把花粉注入 NEI 搜索 |
Load blacklisted |
boolean | false |
是否加载黑名单种质/等位基因 |
两处值得注意:
Add Bees to Search这一个开关同时控制蜂、蝴蝶、树的注入。ButterflyHelper.setup()里复用了AddonForestry.addBees来决定是否注入BUTTERFLY/CATERPILLAR/SERUM三种形态——名字与实际作用范围不符。Show Butterfly Products在AddonForestry.init()里是被注释掉的(源码 91-92 行),所以它既不出现在.cfg里也没有对应字段;蝴蝶只有育种页,没有产物页。
开关到具体功能的完整映射
| 开关 | 关掉之后消失的东西 |
|---|---|
Show Bee Mutations |
Bee Breeding 配方页 + Usage 页 + HandlerInfo |
Show Bee Products |
Bee Produce 配方页 + Usage 页 + HandlerInfo |
Show Tree Mutations |
Tree Breeding 配方页 + Usage 页 + HandlerInfo |
Show Tree Products |
Tree Produce 配方页 + Usage 页 + HandlerInfo |
Show Butterfly Mutations |
Butterfly Breeding 配方页 + Usage 页 + HandlerInfo |
Show Secret Mutations |
隐性突变条目(其它不变) |
Show Mutation Requirements |
概率数字的红色高亮 + hover 条件提示(概率数字仍在,只是变正常色) |
Add Bees to Search |
蜂/蝶的 NEI 搜索条目(搜索里搜不到带基因的物品) |
Add Combs to Search |
蜂蜡子物品变体的 NEI 搜索条目 |
Add Saplings to Search |
树苗的 NEI 搜索条目 |
Add Pollen to Search |
花粉的 NEI 搜索条目 |
Load blacklisted |
黑名单种质(正常玩家永远用不到的那些) |
Blacklist Gui Class Name |
对应 AE2 界面的 NEI 拖拽填装 |
没有独立配置分类的 addon
Crafting Tables 与 Developer Tools 两个 addon 的 init() 里不读任何配置项,Crafting Tables 只依赖「注册到的工作台数量 > 0」这一条件自动决定 active,Developer Tools 则无条件 active = true。
配置文件里没有的东西
- 5 个
ColorResource(utils/ColorUtils)不在.cfg里,它们由 GTNHLibColorResource.Factory("neiaddons")走资源包assets/<ns>/<ns>_at.cfg覆盖,见 叠加层与 GUI 挂钩。 mcmod.info里列出的 Extra Bees 与 Misc Peripherals addon 没有任何配置项也没有任何源码,见 Addon 架构与加载顺序。
相关条目
- Addon 架构与加载顺序 -
Addons分类键名是怎么来的 - NEI 接口实现总表 - 每个开关门控哪个 handler
- Forestry 集成 - 12 个 Forestry 开关的落地效果
- Applied Energistics 2 集成 - 黑名单配置的消费点
- Mutation 转储工具 - 由开关间接影响的调试功能