Config Handler

基本信息

属性 值
类 com.chaosthedude.naturescompass.config.ConfigHandler
配置文件 <minecraft>/config/naturescompass.cfg
加载时机 preInit 阶段(NaturesCompass.preInit 第一行)

行为

读取/写入所有 NaturesCompass 的 Forge 配置项;配置变化通过 ConfigChangedEvent.OnConfigChangedEvent 重新初始化(ChangeListener)。所有字段静态持有,可被 worker / 渲染逻辑直接访问。

General 分类(搜索参数)

配置键 类型 默认值 说明
naturescompass.distanceModifier int 10000 最大搜索距离;值越大搜索越精确但更耗资源
naturescompass.sampleSpaceModifier int 32 螺旋采样步长;值越小越精确但更耗资源
naturescompass.maxSamples int 150000 单次搜索最大采样数;超限按 NOT_FOUND 结束
naturescompass.biomeBlacklist String[] [] 不可搜索的群系;可填群系名(如 Ocean)或 ID(如 0)

Client 分类(GUI / HUD)

配置键 类型 默认值 说明
naturescompass.displayWithChatOpen boolean true 打开聊天框时是否仍渲染 HUD 文字
naturescompass.fixBiomeNames boolean true 自动给群系名插入空格(ForestHills → Forest Hills)
naturescompass.lineOffset int 1 HUD 文字行距偏移
naturescompass.overlaySide String BOTTOMRIGHT HUD 文字落点(TOPLEFT/TOPRIGHT/BOTTOMLEFT/BOTTOMRIGHT)

数值

数值 默认值
最大搜索距离 10000
采样步长 32
最大采样数 150000
黑名单 []
聊天时显示 HUD true
修复群系名 true
行距偏移 1
HUD 落点 BOTTOMRIGHT

派生行为

  • loadInt() 会拒绝任何负数,自动恢复为默认值。
  • biomeBlacklist 由 getBiomeBlacklist() 返回新 List 以避免外部修改污染缓存。
  • HUD 渲染通过 RenderTickHandler + RenderUtils 间接读取 lineOffset、overlaySide、displayWithChatOpen。

相关条目