My suggestion is as follows: A machine that when picked lava or water uses cells of water/lava and acts as a sort of filler. The filler would fill the shape that is on its height, and the filler would fill the blocks from top to bottom beginning at the level below it and stopping at the floor. If a single block is empty on the floor and it leads to more empty blocks then it will continue to fill till reaching a level where it has a floor that fully completes the shape on the level of the filler.
level of filler-
Shape of fill-
Example if level is not fully complete-
result being it continues to fill lower levels
I greatly appreciate your viewing of my idea and hope y'all take this idea into consideration and indicate any flaws.