配置文件白/黑名单(ConfigHandler)
基本信息
| 属性 | 值 |
|---|---|
| 类型 | Forge Configuration General 段 |
| 加载入口 | AkashicTome.preInit → ConfigHandler.init(event.getSuggestedConfigurationFile()) |
| GUI 入口 | client.GuiFactory.ConfigGui(Mod 配置界面) |
| 重载机制 | ConfigChangedEvent.OnConfigChangedEvent 监听 modid 匹配后调用 load() |
行为
ConfigHandler.load() 一次性加载 7 个配置项:
Allow all items to be added—— 全局开关Whitelisted Items—— 精确白名单Blacklisted Items—— 精确黑名单Whitelisted Names—— 名称子串白名单Whitelisted Duplicates Items—— 重名书重复附加白名单(含通配符:*)Blacklisted Mods—— 整 mod 黑名单Mod Aliases——from=to形式的 modid 重定向
数值
| 数值 | 默认值 |
|---|---|
allItems |
false |
whitelistedItems 长度 |
19(精确白名单:roots:runedtablet、OpenComputers:item:98、ImmersiveEngineering:tool:3、integrateddynamics:on_the_dynamics_of_integration、theoneprobe:probenote、evilcraft:originsOfDarkness、DraconicEvolution:infoTablet、witchery:ingredient:46..49/81/106/107/127、witchery:vampirebook:9、Thaumcraft:ItemEldritchObject:1、BiblioCraft:item.StockroomCatalog、BiblioCraft:item.AtlasBook、structurelib:item.structurelib.constructableTrigger) |
blacklistedItems 长度 |
26(典型:Automagy:blockBookshelfEnchanted、Automagy:blockReqTome、BiblioCraft:item.BigBook、BiblioCraft:BookcaseFilled、BiblioWoodsBoP/Foresetry/Natura:BiblioWoodBookcase、HardcoreEnderExpansion:knowledge_note、Natura:Natura.bookshelf、OpenBlocks:guide、OpenBlocks:builder_guide、chisel:bookshelf、gadomancy:BlockKnowledgeBook、thaumicenergistics:thaumicenergistics.block.knowledge.inscriber、thaumicenergistics:knowledge.core、witchery:bookbiomes2、witchery:vampirebook:0..8) |
whitelistedNames |
book, tome, lexicon, nomicon, manual, knowledge, pedia, compendium, guide, codex, journal(11 个关键字,子串匹配) |
whitelistedDuplicatesItems |
gregtech:gt.multiitem.books:* |
blacklistedMods |
空(默认无) |
aliases 大小 |
13(默认值见下表) |
默认 Mod Aliases(来源 ConfigHandler.load)
| 源 modid | 别名为 |
|---|---|
nautralpledge |
botania |
incorporeal |
botania |
thermalexpansion |
thermalfoundation |
thermaldynamics |
thermalfoundation |
thermalcultivation |
thermalfoundation |
redstonearsenal |
thermalfoundation |
rftoolsdim |
rftools |
ae2stuff |
appliedenergistics2 |
animus |
bloodmagic |
integrateddynamics |
integratedtunnels |
mekanismgenerators |
mekanism |
mekanismtools |
mekanism |
questbook |
betterquesting |
别名在
MorphingHandler.getModFromBlock/getModFromStack解析时通过getModOrAlias生效,所有键值都会toLowerCase后才匹配。
限制
Whitelisted Duplicates Items的通配符仅识别:*形式,匹配registryName + ":" + damage。- 配置修改后必须重新启动或触发 GUI 重新打开才会生效(
ChangeListener.onConfigChanged在 modid 匹配时调用load())。 - 配置写入由 Forge
Configuration自动管理;调用config.save()仅在hasChanged()为 true 时执行。
相关条目
- Akashic Tome - 物品使用这些配置决定哪些目标可被附加
- Attachement Recipe 配方行为说明 - isTarget 决策树
- Morphing Handler 变形核心 - 使用
aliases解析 modid