配置项

基本信息

属性 值
配置框架 GTNHLib 的 @Config 注解(com.gtnewhorizon.gtnhlib.config.Config)
注册入口 configs/ConfigRegister.java:8-12 init()
子目录 configSubDirectory = "InfoHUD"
配置文件 4 个
配置项总数 69
语言包 只有 en_US.lang,无 zh_CN.lang

本 mod 不用 Forge 原生 Configuration,而是 GTNHLib 的注解式配置—— 字段用 @Config.DefaultInt / @Config.DefaultBoolean / @Config.DefaultString / @Config.DefaultFloat 标注默认值,类与嵌套类用 @Config.LangKey 指定界面标题。 默认值全部来自源码注解,不是猜的。

4 个配置文件

类 filename category 落盘文件 项数
HudConfig HudConfig hud config/InfoHUD/HudConfig.cfg 65
GeneralConfig GeneralConfig (无) config/InfoHUD/GeneralConfig.cfg 1
LightOverlayConfig LightOverlayConfig light config/InfoHUD/LightOverlayConfig.cfg 1
ClassicBarConfig ⚠️ LightOverlayConfig classicbar ⚠️ config/InfoHUD/LightOverlayConfig.cfg 2

⚠️ 源码缺陷:ClassicBarConfig 与 LightOverlayConfig 抢同一个文件

configs/ClassicBarConfig.java:7:

@Config(modid = MODID, category = "classicbar", configSubDirectory = "InfoHUD", filename = "LightOverlayConfig")

filename 写的是 "LightOverlayConfig",应为 "ClassicBarConfig"。

项 值
位置 configs/ClassicBarConfig.java:7
后果 两个配置类写同一个 config/InfoHUD/LightOverlayConfig.cfg。经典条的 ClassicBarEnable / ClassicBarScale 与光照层的 DisableFollowNumber 互相覆盖
症状 关掉经典条再开光照层(或反之)时设置丢失;category 不同(classicbar vs light)可能让两段内容在同一文件里互相清掉
界面仍可打开 @Config.LangKey("infohud.config.classic_bar.name") 与 category = "classicbar" 都正确,所以配置界面正常,只有落盘文件名错

HudConfig(65 项,5 个嵌套类)

configs/HudConfig.java:7: @Config(modid = MODID, category = "hud", configSubDirectory = "InfoHUD", filename = "HudConfig") @Config.LangKey("infohud.config.hud.name") → §cHUD Settings

5 个嵌套类通过 public static final 单例暴露(HudConfig.java:11-15):

public static final HudGeneral hudGeneral = new HudGeneral();
public static final HudOrder hudOrder = new HudOrder();
public static final HudItems hudItems = new HudItems();
public static final HudEnabled hudEnabled = new HudEnabled();
public static final HudPotion hudPotion = new HudPotion();

HudGeneral(4 项,HudConfig.java:18-36)

@Config.LangKey("infohud.config.hud.hud_general.name") → §aHUD General

字段 类型 默认 范围 Order 行
HudX int 0 — 1 20-22
HudY int 0 — 2 24-26
HudScale float 1.0F 0.5F–2.0F 3 28-31
HudDisable boolean false — 4 33-35

HUD 默认在屏幕左上角(0, 0),缩放 1.0。

HudPotion(3 项,HudConfig.java:39-52)

@Config.LangKey("infohud.config.hud.hud_potion.name") → §aHUD Potion

字段 默认 Order 行
PotionEnable true 1 41-43
TimeEnable true 2 45-47
LevelEnable true 3 49-51

控制 HUD 上自定义的药水效果显示(时长 / 等级)。 与之配套的还有 GeneralConfig.DisablePotionEffect(默认 true)—— 后者关掉原版药水图标,两者配合是「用 HUD 的替代原版的」。

HudOrder(19 项,HudConfig.java:55-…)

@Config.LangKey("infohud.config.hud.hud_order.name") → §aHUD Order

全部 19 项都是 @Config.RangeInt(min = 1, max = 100)(范围 1–100)。 默认值恰好是 1–19 的一个完整排列,无重复、无空缺。

⚠️ @Config.Order(GUI 显示顺序)与默认值(实际排序权重)刻意不同:

@Config.Order 字段 默认值
1 FpsOrder 1
2 MemoryOrder 4
3 ServerMemoryOrder 5
4 PingOrder 2
5 PositionOrder 6
6 TpsOrder 3
7 LpOrder 7
8 WarpOrder 8
9 DimensionOrder 9
10 BiomeOrder 10
11 DirectionOrder 11
12 OreChunkOrder 12
13 SlimeChunkOrder 13
14 WorldTimeOrder 14
15 PlayTimeOrder 15
16 SessionTimeOrder 16
17 JumpOrder 17
18 ForestryOrder 18
19 NutrientOrder 19

按默认值排序后的实际 HUD 顺序(这才是屏幕上从上到下的次序):

Fps(1) → Ping(2) → Tps(3) → Memory(4) → ServerMemory(5) → Position(6)
→ Lp(7) → Warp(8) → Dimension(9) → Biome(10) → Direction(11) → OreChunk(12)
→ SlimeChunk(13) → WorldTime(14) → PlayTime(15) → SessionTime(16)
→ Jump(17) → Forestry(18) → Nutrient(19)

即 @Config.Order 只是配置界面里的行序,与 HUD 实际排列无关—— 排版时必须看默认值,不要照 @Config.Order 写。

⚠️ 无 CountItem 对应的顺序项——InfoCountItem 的 order 在 Hud.java:72 硬编码为 0,不可配置。 因此 HudOrder 19 项 + 硬编码的 1 项 = 20 个实例。

HudItems(19 项,HudConfig.java 的 hud_icons 段)

@Config.LangKey("infohud.config.hud.hud_icons.name") → §aHUD Icons

全部是 @Config.DefaultString("..."),值为物品 ID 字符串:

Order 字段 默认物品 ID Order 字段 默认物品 ID
1 FpsItem minecraft:emerald 11 DirectionItem minecraft:compass
2 MemoryItem minecraft:redstone 12 OreChunkItem minecraft:iron_ore
3 ServerMemoryItem minecraft:repeater 13 SlimeChunkItem minecraft:slime_ball
4 PingItem minecraft:stone 14 WorldTimeItem minecraft:clock
5 PositionItem minecraft:grass 15 PlayTimeItem minecraft:noteblock
6 TpsItem minecraft:command_block 16 SessionTimeItem minecraft:golden_apple/1
7 LpItem AWWayofTime:weakBloodOrb 17 JumpItem minecraft:slime_ball
8 WarpItem Thaumcraft:ItemEldritchObject 18 ForestryItem Forestry:beeDroneGE
9 DimensionItem minecraft:ender_eye 19 NutrientItem minecraft:milk_bucket
10 BiomeItem minecraft:sapling

⚠️ 两个跨 mod 物品 ID 的大小写陷阱: AWWayofTime:weakBloodOrb 与 Thaumcraft:ItemEldritchObject 都首字母大写, 与 GTNH 常见的全小写域不同。见 可选 mod 集成。

📌 SessionTimeItem 是唯一带 meta 后缀的(minecraft:golden_apple/1, meta 1);SlimeChunkItem 与 JumpItem 共用 minecraft:slime_ball。

⚠️ 无 CountItem 字段——InfoCountItem 没有图标(与 HudOrder 情况一致)。

HudEnabled(20 项,HudConfig.java:235-316)

@Config.LangKey("infohud.config.hud.hud_toggles.name") → §aHUD Toggles

全部 20 项 @Config.DefaultBoolean(true)——默认全开。

Order 字段 Order 字段 Order 字段 Order 字段
1 FpsEnable 6 TpsEnable 11 DirectionEnable 16 SessionTimeEnable
2 MemoryEnable 7 LpEnable 12 OreChunkEnable 17 CountItemEnable
3 ServerMemoryEnable 8 WarpEnable 13 SlimeChunkEnable 18 JumpEnable
4 PingEnable 9 DimensionEnable 14 WorldTimeEnable 19 ForestryEnable
5 PositionEnable 10 BiomeEnable 15 PlayTimeEnable 20 NutrientEnable

20 项开关 vs 19 项顺序 vs 19 项图标——差的那 1 项就是 CountItemEnable: 有开关、无顺序、无图标。

GeneralConfig(1 项)

configs/GeneralConfig.java:7,无 category(顶层):

字段 类型 默认 Order 行
DisablePotionEffect boolean true 1 11-13

作用:取消原版药水效果图标的渲染。 @Config.DefaultBoolean(true) 意味着默认就关闭原版图标。

@Inject(method = "func_147044_g", at = @At("HEAD"), cancellable = true)
private void cancelPotionEffectRendering(CallbackInfo ci) {
    if (GeneralConfig.DisablePotionEffect) {
        ci.cancel();
    }
}

(mixins/early/InventoryEffectRendererMixin.java:15-21, 目标 InventoryEffectRenderer,方法 func_147044_g)

📌 不是 bug:名字是 DisablePotionEffect = 「禁用(原版的)药水效果渲染」, 默认 true 是因为 InfoHUD 用 HudPotion 的 PotionEnable / TimeEnable / LevelEnable 替代它。两者配合:关掉 GeneralConfig.DisablePotionEffect 会让原版图标与 HUD 图标同时出现。

LightOverlayConfig(1 项)

configs/LightOverlayConfig.java:7,category = "light":

字段 类型 默认 Order 行
DisableFollowNumber boolean false 1 11-13

作用:光照覆盖层的数字是否跟随视角。 默认 false = 跟随(吸附到 4 个正方向);true = 固定朝 180。 见 光照等级覆盖层。

ClassicBarConfig(2 项)

configs/ClassicBarConfig.java:7,category = "classicbar" (⚠️ filename 写错,见上文缺陷):

字段 类型 默认 范围 Order 行
ClassicBarEnable boolean false — 1 11-13
ClassicBarScale float 1.0F 0.5F–2.0F 2 15-18

默认关闭。见 经典状态条。

语言包

文件 行数
assets/infohud/lang/en_US.lang 41(含 2 个空行)
assets/infohud/lang/zh_CN.lang ❌ 不存在

本 mod 没有任何中文翻译。

9 个 @Config.LangKey 全部能在 en_US.lang 的 1–9 行找到对应键:

键 值
infohud.config.hud.name §cHUD Settings
infohud.config.general.name §cGeneral Settings
infohud.config.light.name §cLight Overlay Settings
infohud.config.classic_bar.name §cClassic Bar Settings
infohud.config.hud.hud_general.name §aHUD General
infohud.config.hud.hud_order.name §aHUD Order
infohud.config.hud.hud_icons.name §aHUD Icons
infohud.config.hud.hud_toggles.name §aHUD Toggles
infohud.config.hud.hud_potion.name §aHUD Potion

其余 30 行是 HUD 行、光照模式与按键的文本(10–38)。

📌 HudPotion 的 lang 键是 infohud.config.hud.hud_potion.name(en_US.lang:9), 但它在 HudConfig.java 里的 @Config.LangKey 与 HudItems(hud_icons)、HudEnabled(hud_toggles)分开定义—— hud_potion 是第 5 个嵌套类,源码里定义在 HudPotion.java 段(39-52)。

关联