Allow pipes to determine whether they will allow gas transfer based on the tile before

This allows support for the new Galacticraft feature of colored pipes not connecting to each other to function properly.