模组配置(Translocator.cfg)

基本信息

属性 值
配置文件 config/Translocator.cfg(new ConfigFile(new File(CommonUtils.getMinecraftDir() + "/config", "Translocator.cfg"))
配置库 CodeChickenLib 的 codechicken.lib.config.ConfigFile
创建时机 preInit(FMLPreInitializationEvent)
文件头注释 “Deleting any element will restore it to it’s default value / Block ID’s will be automatically generated the first time it’s run”(删掉任一项即恢复默认;方块 ID 首次运行自动生成)

本 mod 没有指令、没有成就、没有维度、没有附魔、没有群系、没有结构, 游戏设定全部集中在这一个配置文件里。

配置项

键 类型 默认值 注释 作用
disable-crafting-grid-key boolean false “Set to true to disable placement of crafting grids by keyboard shortcut.” 为 true 时不注册 C 键,且 BlockCraftingGrid.placeBlock 直接 return false——网格彻底无法放置
checkUpdates boolean true (无注释) 仅客户端(TranslocatorClientProxy.init)调用 CCUpdateChecker.updateCheck("Translocator") 检查新版本

读取方式分别是 config.getTag(...).getBooleanValue(false) 与 config.getTag("checkUpdates").getBooleanValue(true), 即删除配置项后重启会自动按默认值重建。

配方注册门控

与配置无关但同属"mod 行为开关"的一项逻辑:所有合成配方都包在 if (!Loader.isModLoaded("dreamcraft")) 里(TranslocatorProxy.init)。 DreamCraft 加载时,本 mod 的 4 条配方全部不注册:

配方 产物
3×3 有序 2 × 物品传送器(metadata 0)
3×3 有序 2 × 液体传送器(metadata 1)
无序 9 × 钻石粒 ← 1 钻石
无序 1 钻石 → 9 × 钻石粒

这样整合包里不会出现与 GT 配方系统冲突的重复配方。

NEI 行为

TranslocatorProxy.init 最后一行 API.hideItem(new ItemStack(blockCraftingGrid)) —— 合成网格 的物品形式在 NEI 里不可见(NEI 是本 mod 的硬依赖 required-after:NotEnoughItems)。

相关条目

  • C 键 - 被 disable-crafting-grid-key 控制
  • 合成网格 - 被 disable-crafting-grid-key 控制
  • GT 泵盖兼容层 - 启用由 Loader.isModLoaded("gregtech_nh") 决定,与本配置无关