Add adjacency check to pipepainter