ThaumcraftDepLoaderNuker
基本信息
| 属性 | 值 |
|---|---|
| 路径 | baubles.nuker.ThaumcraftDepLoaderNuker |
| 类型 | class |
| 包名 | baubles.nuker |
| 实现 | IFMLLoadingPlugin |
SortingIndex |
-1(必须在 Thaumcraft 的插件之前运行) |
MCVersion |
1.7.10 |
coreModClass |
nuker.ThaumcraftDepLoaderNuker(来自 gradle.properties) |
行为
- 在 FML 加载阶段(preinit 之前的
injectData),遍历Launch.blackboard中Tweaks列表 - 找到所有
CoreModManager$FMLPluginWrapper实例 - 用反射读取每个 wrapper 的
coreModInstance字段 - 如果实例是
thaumcraft.codechicken.core.launch.DepLoader,则把 wrapper 的coreModInstance字段替换为本 nuker 自身
目的
Thaumcraft 的 IFMLLoadingPlugin 会在启动时检测 Baubles 是否存在;如果不存在,会自动从网络下载 Baubles。
这对 Baubles-Expanded 来说是有害的,因为 Thaumcraft 下载到的会是官方 Baubles 而非本扩展版本。
本 nuker 让 Thaumcraft 的 IFMLLoadingPlugin 的方法0 次运行(虽然实例仍会被构造,但实际方法被替换为 nuker 的方法),从而阻止 Thaumcraft 自动下载官方 Baubles。
副作用
- Thaumcraft 的
IFMLLoadingPlugin方法完全不执行(被替换为本类) - 本类自身的方法会执行两次(FML 通常为每个 wrapper 调用一次方法;原 Thaumcraft 的一次被劫持到本类)
相关条目
- mcmod.info 配置中的
parent- 本 mod 注册为 Thaumcraft 子 mod(parent 字段) - Baubles - 实际承担饰品栏实现的 mod