use of crazypants.enderio.machine.transceiver.Channel in project LogisticsPipes by RS485.
the class EnderIOProxy method getConnectedTransceivers.
@Override
public List<TileEntity> getConnectedTransceivers(TileEntity tile) {
TileTransceiver transceiver = (TileTransceiver) tile;
List<TileEntity> tiles = new ArrayList<>();
Object channel = transceiver.getRecieveChannels(ChannelType.ITEM).toArray()[0];
for (TileTransceiver t : ServerChannelRegister.instance.getIterator((Channel) channel)) {
if (t == transceiver) {
continue;
}
Set<Channel> receiveChannels = t.getRecieveChannels(ChannelType.ITEM);
Set<Channel> sendChannels = t.getSendChannels(ChannelType.ITEM);
if (receiveChannels.size() == 1 && sendChannels.size() == 1 && channel.equals(receiveChannels.toArray()[0]) && channel.equals(sendChannels.toArray()[0])) {
tiles.add(t);
}
}
return tiles;
}
Aggregations