配置项(ARIConfig)
基本信息
| 属性 | 值 |
|---|---|
| 类型 | 游戏设定(客户端配置文件) |
| 源码类 | com.gtnewhorizons.aspectrecipeindex.util.ARIConfig |
| 注解 | GTNHLib 的 @Config(modid = "aspectrecipeindex") |
| 配置文件 | config/aspectrecipeindex.cfg(由 GTNHLib ConfigurationManager 生成) |
| 选项数量 | 5(全部为 boolean) |
| 注册时机 | FMLInitializationEvent(仅客户端,见下) |
配置框架来自 GTNHLib,不是 Forge 原生 Configuration。全部 5 个选项都是布尔开关,没有数值型或字符串型选项。
注册时机(重要)
ConfigurationManager.registerConfig(ARIConfig.class) 只写在 ClientProxy.init(FMLInitializationEvent) 里;ServerProxy 继承 CommonProxy 的空实现。
推论:服务端不会生成、也不会读取这个配置文件。 本模组的全部功能都发生在客户端 NEI 界面里,服务端不需要这些开关。
注册失败时(ConfigException)直接抛 RuntimeException,即启动崩溃,不会静默降级。
选项表
| 选项 | 类型 | 默认值 | 门控什么 |
|---|---|---|---|
showLockedRecipes |
boolean | false |
研究未完成的配方是否照常显示 |
showInstabilityNumber |
boolean | true |
灌注不稳定性用数字还是文字显示 |
showResearchKey |
boolean | true |
各 handler 顶部的"研究"控件是否绘制、tooltip 是否响应 |
showUndiscoveredAspectNames |
boolean | false |
未发现元素的名称是否可见 |
showUndiscoveredAspectRecipes |
boolean | false |
未发现元素的组合 / 包含物品是否可见 |
源码中的注释原文(GTNHLib 会把它写进配置文件):
showLockedRecipes— “Show recipes even if the research is not completed”showInstabilityNumber— “Show the instability of infusion recipes as a number”showResearchKey— “Show the required research for recipes on all handlers”showUndiscoveredAspectNames— “Show names of undiscovered aspects when hovered in NEI”showUndiscoveredAspectRecipes— “Show combination recipes of undiscovered aspects in NEI”
每个选项的判定链路
showLockedRecipes
唯一判定入口是 Util.shouldShowRecipe(String researchKey),返回 showLockedRecipes || isResearchComplete(当前用户名, researchKey)。
被以下代码路径调用:
- 坩埚 handler:逐条
CrucibleRecipe的recipe.key - 灌注 handler:
InfusionRecipe.getResearch() - 有序 / 无序奥法合成:
ShapedArcaneRecipe/ShapelessArcaneRecipe的getResearch() - 魔杖 handler:杖柄 / 杖帽 /
SCEPTRE三个研究键分别判定 - Runic 强化配方:固定研究键
RUNICAUGMENTATION
关闭时,handler 仍会生成配方对象,但 CachedThaumRecipe.getIngredients() 返回空列表,并在界面上绘制"你尚未完成合成此物品所需的研究"。
showInstabilityNumber
只影响 InfusionRecipeHandler.drawInstability 的文本内容,不影响配方是否显示:
true:文本为tc.inst+ 数字,颜色按不稳定性分档(档位 = 数值除以 2,上限 5)。false:文本为tc.inst.0~tc.inst.5(Thaumcraft 的分级文案),颜色统一用instabilityOff。
showResearchKey
同时控制两处:
TemplateThaumHandler.drawExtras— 是否绘制"Research"标题与研究图标列表。TemplateThaumHandler.handleTooltip— 是否对研究图标做悬停命中检测(关闭后直接返回父类行为)。
注意它不影响 showLockedRecipes:即使关掉研究控件,未完成研究的配方依然会被隐藏。
showUndiscoveredAspectNames
ItemAspect.getItemStackDisplayName:未发现元素的名字显示为「%s (Undiscovered)」而不是"未知"。ItemAspect.addInformation:tooltip 追加元素描述而不是"未知"。
showUndiscoveredAspectRecipes
唯一判定入口是 Util.shouldShowAspect(Aspect),返回 showUndiscoveredAspectRecipes || hasDiscoveredAspect(当前用户名, aspect)。
被以下路径调用:
- Aspect Combination handler:输出侧与输入侧都过滤
- Items Containing Aspect handler:按 overlay 全量加载时逐元素过滤;按单个元素物品查询时过滤
- Aspect 物品不会因此自动可见,它只影响配方可见性
潜在坑:用户名
Util.getUsername() 在 thePlayer == null 时返回三个空格 " "(源码注释写明是"无效用户名")。因此所有判定在极端时机(尚未进入世界)都会落到"未发现 / 未完成"分支,即默认隐藏。
不属于本配置的"颜色"
Util.ColorUtils 里的 8 个 ColorResource 不是本配置的选项,也不出现在这个配置文件里。它们的默认值硬编码在源码中,只能通过资源包 lang 条目覆盖,详见 颜色常量。
相关条目
- 颜色常量 - 8 个 UI 颜色与不稳定性分档
- 元素配方索引机制 -
shouldShowRecipe/shouldShowAspect在索引链路中的位置 - 兼容性 - GTNHLib 是本配置框架的提供者
- Access Transformer - 为客户端 GUI 字段开放访问