AngelicaModulesConfig(angelica-modules)
基本信息
| 属性 | 值 |
|---|---|
| 类 | com.gtnewhorizons.angelica.config.AngelicaConfig |
| 路径 | src/main/java/com/gtnewhorizons/angelica/config/AngelicaConfig.java |
| 行数 | 515 |
| 注解 | @Config(modid = "angelica", filename = "angelica-modules")(:7) |
| 配置文件 | config/angelica-modules.cfg |
| 字段数 | 88 个 public static 字段 + 1 个嵌套实例对象 transformerCompat(内含 8 个 boolean) |
字段数是怎么数出来的
直接 grep -c "public static" 会得到 92,其中 4 行不是字段:
| 行 | 内容 | 实际类型 |
|---|---|---|
:372 |
public static class TransformerCompat { |
嵌套类声明 |
:501 |
public static void applyGpuCullingMode() { |
方法 |
:505 |
public static boolean cubeInstancingEnabled() { |
方法 |
:509 |
public static GLProfile getEffectiveGlProfile() { |
方法 |
92 − 4 = 88 个配置字段。
字段类型分布
| 类型 | 数量 |
|---|---|
boolean |
66 |
int |
9 |
String[] |
5 |
float |
3 |
double |
2 |
枚举(GpuCullingMode / GLProfile) |
2 |
嵌套对象 TransformerCompat |
1 |
| 合计 | 88 |
没有任何
String标量字段。
五个 String[] 字段是清单型配置,需要重点注意:
| 字段 | 行 | 用途 |
|---|---|---|
blockCrackFixBlacklist |
:298 |
方块裂纹修复排除名单 |
blockCrackFixRenderPassWhitelist__ |
:312 |
裂纹修复渲染 pass 白名单(字段名以双下划线结尾,这是有意为之的内部标记) |
alwaysTranslucentSprites |
:319 |
恒半透明精灵 |
dynamicBoundsTileEntities |
:326 |
动态包围盒的 TileEntity 类名,被 ClientProxy.java:135 逐个注册到 TileEntityRenderBoundsRegistry |
naturalTextureBlocks |
:471 |
天然纹理方块清单,带默认值(new String[] {...}) |
关键开关默认值
以下默认值均取自 @Config.Default* 注解,不是推断:
| 字段 | 行 | 默认 | 注解 | 备注 |
|---|---|---|---|---|
enableThreadedChunkBuilding |
:12 |
true |
DefaultBoolean |
RequiresWorldRestart |
gpuCullingMode |
:20 |
CPU_ONLY |
DefaultEnum |
枚举 GpuCullingMode,取值 CPU_ONLY / COMPUTE |
chunkBuilderThreadCount |
:26 |
0 |
DefaultInt |
RangeInt(-1, 16);0 = 自动探测,-1 = 单线程回退 |
enableNotFineOptions |
:30 |
false |
DefaultBoolean |
关闭时视频设置走 Sodium 界面 |
enableReesesSodiumOptions |
:34 |
true |
DefaultBoolean |
默认走 Reese 界面 |
injectQPRendering |
:39 |
false |
DefaultBoolean |
RequiresMcRestart |
enableTestBlocks |
:44 |
false |
DefaultBoolean |
@Config.Ignore(),不写入配置文件 |
enableIris |
:49 |
true |
DefaultBoolean |
RequiresMcRestart |
enableMCPatcherForgeFeatures |
:54 |
true |
DefaultBoolean |
RequiresMcRestart,注释标注 still in Alpha |
enablePanoramaBlurShader |
:59 |
true |
DefaultBoolean |
RequiresMcRestart |
enableNotFineFeatures |
:83 |
— | — | NotFine 子开关 |
enableHudCaching |
:104 |
— | — | 见 HUDCaching |
hudCachingFPS |
:117 |
20 |
DefaultInt |
字段自带 = 20 初始值,与注解默认值并存 |
pinnedGLVersion |
:434 |
— | — | 与 disableGLVersionPinning(:439)配对 |
naturalTextureBlocks |
:471 |
— | @Config.Comment |
无 @Config.Default*,靠字段初始化 |
enableTestBlocks 是被 @Config.Ignore() 的字段
AngelicaConfig.java:41-44:
@Config.Comment("Enable Angelica's test blocks")
@Config.DefaultBoolean(false)
@Config.Ignore()
public static boolean enableTestBlocks;
@Config.Ignore() 意味着它不会出现在 angelica-modules.cfg 里,用户无法通过配置文件开启。运行时值由 AngelicaClientTweaker.java:83 从 SystemProperties.ENABLE_TEST_BLOCKS 赋值,而后者是 Boolean.getBoolean("angelica.debug.testBlocks")(glsm/.../SystemProperties.java:72)—— 只能靠 JVM 命令行开关。
TransformerCompat:嵌套实例对象
:370-372 声明了一个实例字段(不是 static):
@Config.Comment("ASM transformer exclusion narrowing for mod compatibility. Disable per-mod if narrowing causes class loading issues.")
public static TransformerCompat transformerCompat = new TransformerCompat();
其内部(:372-412)有 8 个 boolean,全部 DefaultBoolean(true) 且全部 RequiresMcRestart:
| 字段 | 行 | 对应第三方 mod |
|---|---|---|
narrowDragonAPI |
:376 |
DragonAPI |
narrowXaeros |
:381 |
Xaeros Minimap / Worldmap |
narrowAdvancedLightsabers |
:386 |
Advanced Lightsabers |
narrowAlfheim |
:391 |
Alfheim |
narrowEars |
:396 |
Ears |
narrowFiskHeroes |
:401 |
Fisk’s Superheroes |
narrowFoamFix |
:406 |
FoamFix(及其重打包的 Ears) |
narrowLegendsMod |
:411 |
Legends Mod |
这 8 个开关控制的是「收窄 ASM transformer 排除范围」——默认对每个 mod 都收窄,让 Angelica 的 GL 重定向能作用于它们;注释提示若收窄导致类加载异常可逐个关闭。
静态方法
| 方法 | 行 | 说明 |
|---|---|---|
applyGpuCullingMode() |
:501 |
把 gpuCullingMode 应用到 GpuCulling,由 ClientProxy.java:191 调用 |
cubeInstancingEnabled() |
:505 |
组合判断 cube instancing |
getEffectiveGlProfile() |
:509 |
结合 glProfile 与 disableGLVersionPinning 返回生效的 GL profile |
相关条目
- AngelicaMod - 唯一使用它的
@Mod类 - CompatConfig - 同 modid 的另一份配置
- FontConfig - 同 modid 的第三份配置
- McPatcherForgeConfig - 另一 modid 的 6 分类配置
- Proxy - 消费这些开关最多的类