use of mcjty.typed.Type in project XNet by McJty.
the class TileEntityRouter method addRoutedConnectors.
public void addRoutedConnectors(Map<SidedConsumer, IConnectorSettings> connectors, @Nonnull BlockPos controllerPos, int channel, IChannelType type) {
if (inError()) {
// We are in error. Don't do anything
return;
}
LocalChannelId id = new LocalChannelId(controllerPos, channel);
String publishedName = publishedChannels.get(id);
if (publishedName != null && !publishedName.isEmpty()) {
NetworkId networkId = findRoutingNetwork();
if (networkId != null) {
LogicTools.consumers(getWorld(), networkId).forEach(consumerPos -> LogicTools.routers(getWorld(), consumerPos).forEach(router -> router.addConnectorsFromConnectedNetworks(connectors, publishedName, type)));
} else {
// If there is no routing network that means we have a local network only
addConnectorsFromConnectedNetworks(connectors, publishedName, type);
}
}
}
Aggregations