PneumaticCraft 模块(appeng.integration.modules.PneumaticCraft)
基本信息
| 属性 | 值 |
|---|---|
| 源码 | appeng/integration/modules/PneumaticCraft.java |
| 类声明 | 28,public class |
| 实现接口 | 只有 IIntegrationModule(不实现任何 abstraction 接口) |
| 静态单例 | public static PneumaticCraft instance |
| modID | PneumaticCraft(IntegrationType.java:58) |
| side | BOTH |
| 本 wiki 收录情况 | Pneumatic Craft 未被本 wiki 收录 —— 写全名 Pneumatic Craft |
生命周期
| 阶段 | 行号 | 动作 |
|---|---|---|
init() |
44 | 注册 LayerPressure(:49-51) |
postInit() |
56 | 2 项 P2P 调律(:57-58) |
注入内容 1:part layer
// PneumaticCraft.java:48-52
if (IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.PneumaticCraft)) {
partHelper.registerNewLayer(
appeng.parts.layers.LayerPressure.class.getName(),
pneumaticCraft.api.tileentity.ISidedPneumaticMachine.class.getName());
}
| AE2 侧 layer | PC 侧接口 |
|---|---|
appeng.parts.layers.LayerPressure |
pneumaticCraft.api.tileentity.ISidedPneumaticMachine |
⚠️ 本模块用 Class.getName() 取名字(:50-51),
而 IC2 / RF / GT / OpenComputers 用字符串字面量。
两种写法混用。好处是重命名时编译器会报错。
注入内容 2:2 项 P2P 调律
// PneumaticCraft.java:56-58
public void postInit() {
this.registerPressureAttunement("pressureTube");
this.registerPressureAttunement("advancedPressureTube");
}
| PC 方块名 | 行号 |
|---|---|
pressureTube |
57 |
advancedPressureTube |
58 |
即 pneumaticCraft 的两种压力管道都能当「压力隧道」的调律物。
⚠️ 这两个字符串不是 modID,是 PC 内部的方块/物品名。
IntegrationType.PneumaticCraft.modID = "PneumaticCraft"(大写 P、C)。
对应 AE2 侧的 part
parts/p2p/PartP2PPressure.java(存在)。
注册名 PartType.P2PTunnelPressure(core/api/definitions/ApiParts.java:113
的字段名是 p2pTunnelPneumaticCraft,但构造用的是 PartType.P2PTunnelPressure)。
对应条目:P2P 隧道(压力)、 AEFeature.P2PTunnelPressure。
mod 没装时是否安全跳过
是。PneumaticCraft 未装 → FAILED → 类不加载 →
pneumaticCraft.api.tileentity.* 不解析。
与 OpenComputers 的结构同构
| 阶段 | OpenComputers | PneumaticCraft |
|---|---|---|
| init | LayerSidedEnvironment |
LayerPressure |
| postInit | 8 项 COMPUTER_MESSAGE 调律 |
2 项压力调律 |
两者的函数体形状几乎一致,只是外部包名与物品数不同。