See Level->setBlock($pos, $block, $direct, $update), where $pos is a Vector3 object (the position to update the block), $block is a Block object, $direct is a bool where if true it will immediately send the block update instead of queue it for the next tick, and $update is a bool where if true the surrounding blocks will be checked to be updated.