It is possible; I've confirmed that this code has the desired effect:
public void notifyBlockUpdate(World worldIn, BlockPos pos, IBlockState oldState, IBlockState newState, int flags){
if (oldState.getBlock() != Blocks.FLOWING_LAVA) return;
if (newState.getBlock() != Blocks.COBBLESTONE) return;
boolean adjacentToWater = false;
if (worldIn.getBlockState(pos.north()).getMaterial() == Material.WATER) adjacentToWater = true;
if (worldIn.getBlockState(pos.south()).getMaterial() == Material.WATER) adjacentToWater = true;
if (worldIn.getBlockState(pos.east() ).getMaterial() == Material.WATER) adjacentToWater = true;
if (worldIn.getBlockState(pos.west() ).getMaterial() == Material.WATER) adjacentToWater = true;
if (worldIn.getBlockState(pos.down() ).getMaterial() == Material.WATER) adjacentToWater = true;
if (worldIn.getBlockState(pos.up() ).getMaterial() == Material.WATER) adjacentToWater = true;
if(!adjacentToWater) return;
worldIn.setBlockState(pos, Blocks.DIAMOND_BLOCK.getDefaultState());
}
But like you said, I'm using guess-work.
I would still be interested in submitting a PR - if my technical knowledge extended to all that "@@ -452,4 +452,29 @@" stuff in BlockLiquid.java.patch. I don't suppose anyone has suggestions for topics to google?