SanityCheckConfig

基本信息

属性 值
类名 io.github.legacymoddingmc.unimixins.common.sanitycheck.SanityCheckConfig
文件 module-common/src/main/java/…/sanitycheck/SanityCheckConfig.java
行数 8
启用版本 Minecraft 1.7.10

内容

全类只有一个配置项:

@AnnotatedProperties.ConfigString(def = "true",
    com = "Throw an error if an invalid combination of modules is detected. Only disable this if you know what you're doing.",
    cat = "_common")
public static boolean enableIntegrityChecks;
属性 值
键 enableIntegrityChecks
类型 boolean
默认 true
分组 _common(下划线前缀,表示跨模块共享组)

实现要点

⚠️ 注释说「Throw an error」,实际只 warn。 SanityCheckHelper 的 showBigWarning 源码注释明确: 「Any throwables we throw here will get caught, so all we can do be warn.」 所以不会真的抛错,只是打印警告。把 enableIntegrityChecks 描述成「关闭后模块组合错误会崩溃」是错的。

⚠️ 配置项用 @AnnotatedProperties.ConfigString 注解声明, 不是 Forge 的 @Config。整个 UniMixins 仓用的是 module-common 自研的 annotatedproperties 格式 (文件为 config/unimixins.properties),与 Forge cfg 体系无关。

⚠️ 分组名 _common 的下划线前缀是约定:表示该组被 relocate 到 每个模块的私有副本后仍共享同一语义。说「各模块有独立配置项」是错的 —— 本项被所有模块共用。

相关条目