I have lava on one side and water on the other side of a piston. The piston is one block lower than water and lava. When piston is down the water and lava meet and make a block of cobblestone. The piston then extends upwards pushing the block of cobblestone up. When it goes down again water and lava meet and create another block of cobblestone. The piston can push a total of 12 blocks of cobblestone. So if any block is broken the piston will automatically replace it until there are 12 again. I can make a video and post it later. It can go horizontal or vertical.