集成电路 (Integrated Circuit)
基本信息
| 属性 | 值 |
|---|---|
| 关联方块 | IC Machine(Workbench、Printer) |
| 关联 Multipart | pr_icgate(CircuitGatePart) |
功能
ProjectRed Fabrication 模块的核心数据结构,存储完整的 IC 设计(元件、连线、IO 状态)。可通过蓝图保存与共享。
数据结构(IntegratedCircuit 类)
| 字段 | 类型 | 含义 |
|---|---|---|
| network | WorldCircuit | 同步网络 |
| name | String | 电路名(默认 “untitled”) |
| size | Size | 电路尺寸 |
| parts | MMap | 元件表 |
| errors | Map | 错误信息 |
| scheduledTicks | MMap[(x,y), Long] | 调度 tick |
| iostate | ArrayInt |
4 面的 IO 状态(高 16 位 world→IC 输出,低 16 位 IC→world 输入) |
元件类型(CircuitPartDefs 枚举)
| ID | 名称 | 工厂 |
|---|---|---|
| 0 | Torch | new TorchICPart |
| 1 | Lever | new LeverICPart |
| 2 | Button | new ButtonICPart |
| 3 | AlloyWire | new AlloyWireICPart |
| 4 | InsulatedWire | new InsulatedWireICPart |
| 5 | BundledCable | new BundledCableICPart |
| 6 | IOGate | new IOGateICPart |
| 7 | SimpleGate | new ComboGateICPart |
| 8 | ComplexGate | new SequentialGateICPart |
| 9 | ArrayGate | new ArrayGateICPart |
网络协议(read packet key)
| Key | 含义 |
|---|---|
| 0 | readDesc |
| 1 | addPart |
| 2 | removePart |
| 3 | CircuitOp |
| 4 | client packet |
| 5 | IO update |
| 6 | setInput |
| 7 | setOutput |
Tick 循环
- 处理
scheduledTicks(调用scheduledTick) - 遍历
parts.update()
通用特性
bind/unbind元件生命周期writeDesc/readDesc全量同步TClientNetCircuitPart客户端→服务端往返IErrorCircuitPart错误报告(红色:不可达;黄色:无用)IGuiCircuitPartGUI 接口IPoweredCircuitPart红石输出
配方成本(IC Printer)
- TorchICPart → redstone_torch 0.25
- LeverICPart → lever 0.25
- ButtonICPart → stone_button 0.25
- AlloyWireICPart → WireDef.RED_ALLOY 0.25
- InsulatedWireICPart → WireDef.INSULATED_WIRES(colour) 0.25
- BundledCableICPart → WireDef.BUNDLED_WIRES((colour+1)&0xff) 0.25
- GateICPart → gold_nugget + PLATE + CONDUCTIVEPLATE/BUNDLEDPLATE 0.25/项
相关条目
- IC Blueprint
- IC Chip
- [IC Machine](block/ic-machine