Correct. However, most of the time you don't need to use getX() because the Block returned by getBlock() already represents the whole coordinates, so you can just save the Block directly, rather than separating getX().
Something: -Save it in file.yml ( one part of my plugin) -Set map protection ( if $x >100 $event->setCancelled(true) for exemple)