use of mcjty.xnet.multiblock.NetworkChecker in project XNet by McJty.
the class TileEntityController method getNetworkChecker.
@Nonnull
public NetworkChecker getNetworkChecker() {
if (networkChecker == null) {
networkChecker = new NetworkChecker();
networkChecker.add(networkId);
WorldBlob worldBlob = XNetBlobData.getBlobData(getWorld()).getWorldBlob(getWorld());
LogicTools.routers(getWorld(), networkId).forEach(router -> {
networkChecker.add(worldBlob.getNetworksAt(router.getPos()));
// We're only interested in one network. The other router networks are all same topology
NetworkId routerNetwork = worldBlob.getNetworkAt(router.getPos());
if (routerNetwork != null) {
LogicTools.routers(getWorld(), routerNetwork).filter(r -> router != r).forEach(r -> LogicTools.connectors(getWorld(), r.getPos()).forEach(connectorPos -> networkChecker.add(worldBlob.getNetworkAt(connectorPos))));
}
});
// networkChecker.dump();
}
return networkChecker;
}
Aggregations