数字机车中继器

基本信息

属性 值
注册名 computronics:locomotiveRelay
方块类 pl.asie.computronics.integration.railcraft.block.BlockLocomotiveRelay
TileEntity pl.asie.computronics.integration.railcraft.tile.TileLocomotiveRelay
前置 Railcraft 9.10.0.0+
开启配置 enable.railcraft.locomotiveRelay,默认 true(IntegrationRailcraft.java:59)
AE2 空间 IO 已加入白名单(IntegrationRailcraft.java:62)
BuildCraft 蓝图 注册为 Base Schematic(IntegrationRailcraft.java:63)
创造标签 tabComputronics

功能

架设在轨道旁的中继方块,配合数字中继传感器把 Railcraft 电力机车变成可被计算机寻址的对象。中继器与机车通过传感器双向绑定:

  • 潜行时右击中继器 → 绑定(tooltip.computronics.sensor.desc1)
  • 潜行时左击电力机车 → 安装传感器(tooltip.computronics.sensor.desc2)

外设方法共 5 个(TileLocomotiveRelay.java:263-265):

方法 作用
getDestination 读取引擎设置的目的地
setDestination 设置目的地
getCharge 读取机车电荷量
getMode 读取当前模式
getName 读取机车名

外设会返回一整组带解释文本的错误信息,而不是抛 Lua 异常(TileLocomotiveRelay.java:144、147、150、154、157、161、177):

提示 触发条件
relay is not bound to a locomotive 中继器未绑定
locomotive is currently not detectable 机车当前不可探测
relay and locomotive are in different dimensions 跨位面
locomotive is too far away 超出 locomotiveRelayRange
locomotive is locked 机车被锁
locomotive out of energy 机车无电
not enough energy 中继器自身能量不足

LocomotiveManager 随中继器一同注册到 MinecraftForge.EVENT_BUS(IntegrationRailcraft.java:68-70),负责跨维度的机车定位与缓存。

数值

数值名 值 范围 来源
railcraft.locomotiveRelayRange 128 0–512 Config.java:447-453
power.railcraft.locomotiveRelayBasePower 20 RF 0–10000 Config.java:311-318
railcraft.locomotiveRelayConsumeCharge true 布尔 Config.java:454-459

后两项仅在 OpenComputers 加载时才从配置读入(Config.java:310-319 位于 if (Mods.isLoaded(Mods.OpenComputers)) 分支内);locomotiveRelayRange 与 locomotiveRelayConsumeCharge 则在独立的 if (Mods.isLoaded(Mods.Railcraft)) 分支中读取(Config.java:446-465)。

交互

触发 行为
潜行 + 右击 与机车绑定
普通右击 打开/使用外设(无 GUI)
解绑 发送 chat.computronics.relay.unbound
机车不在范围内 发送 chat.computronics.relay.notBound / noRelay / tooFarAway / wrongLoco / wrongDim

合成配方

ModRecipes.java:499-514:

srs
geg
scs
字符 物品
s Railcraft 石质板(part.plate meta 2;取不到时回退 minecraft:stonebrick)
r Railcraft 接收器电路(part.circuit.receiver)
e Railcraft 控制器电路(part.circuit.controller)
c Railcraft 电力表(ItemElectricMeter)
g Railcraft 电力轨(rail meta = ELECTRIC)

相关条目