BuildCraftCore 模块(appeng.integration.modules.BuildCraftCore)
基本信息
| 属性 | 值 |
|---|---|
| 源码 | appeng/integration/modules/BuildCraftCore.java |
| 类声明 | 29,public final class |
| 实现接口 | IBuildCraftCore(integration/abstraction/IBuildCraftCore.java:29)+ IIntegrationModule |
| 静态单例 | public static BuildCraftCore instance |
| modID | BuildCraft|Core(IntegrationType.java:21) |
| side | BOTH |
| 本 wiki 收录情况 | BuildCraft 未被本 wiki 收录 —— 写全名 BuildCraft |
生命周期
| 阶段 | 行号 | 动作 |
|---|---|---|
init() |
59 | 空 {} |
postInit() |
62 | this.registerPowerP2P()(:63) |
init 空,全部工作放在 postInit。
注入内容:3 项 P2P 调律
registerPowerP2P()(:66-72):
| AE2 侧行号 | 物品 | damage |
|---|---|---|
| 69 | new ItemStack(buildcraft.BuildCraftCore.engineBlock, 1, 0) |
0 |
| 70 | 同上 | 1 |
| 71 | 同上 | 2 |
全部指向 TunnelType.RF_POWER。
即 BuildCraft 的 3 种引擎方块(Steam / Electric / Combustion,
源码未给中文名,只给 damage 0/1/2)都能当 RF 隧道的调律物。
⚠️ 引用方式是 new ItemStack(静态字段, 1, damage) ——
读取对方静态字段,不是新增物品。
IBuildCraftCore 的 3 个方法(扳手)
抽象接口 integration/abstraction/IBuildCraftCore.java:29,59 行:
| 方法 | 接口行号 | 语义 |
|---|---|---|
isWrench(Item eq) |
35 | 该物品是不是 BC 扳手 |
canWrench(Item wrench, EntityPlayer wrencher, int x, int y, int z) |
47 | 能否在此处使用 |
wrenchUsed(Item wrench, EntityPlayer wrencher, int x, int y, int z) |
58 | 使用后回调 |
与 CoFHWrench 空壳的对比
IntegrationType.CoFHWrench(IntegrationType.java:30,
modID CoFHAPI)对应的 CoFHWrench.java 是完全空壳
(CoFHWrench.java:17 / :20)。
也就是说:BC 扳手接了,CoFH 扳手没接,
虽然两者共用 CoFHAPI 这个 modID。
mod 没装时是否安全跳过
是。BuildCraft|Core 未装 → FAILED → BuildCraftCore.class 不加载
→ buildcraft.BuildCraftCore 静态字段不解析。
⚠️ BuildCraft 三个 modID 独立判定。只装 BuildCraft|Transport
不装 BuildCraft|Core 时,本模块禁用但
BuildCraftTransport 启用。