public void AddBlock(Vector3i position, BlockSnapshot snapshot, bool overrideBlocks)
        {
            var chunkPosition      = position >> Chunk.WorldPositionShift;
            var chunkWorldPosition = chunkPosition << Chunk.WorldPositionShift;

            if (_generations.TryGetValue(chunkPosition, out var generation))
            {
                generation.AddBlock(position - chunkWorldPosition, snapshot, overrideBlocks);
                return;
            }


            var newGeneration = new UnloadedChunkGeneration();

            newGeneration.AddBlock(position - chunkWorldPosition, snapshot, overrideBlocks);

            _generations.TryAdd(chunkPosition, newGeneration);
        }
        public void Load()
        {
            var file = _world.Folder + Path.DirectorySeparatorChar + FileName;

            if (!File.Exists(file))
            {
                return;
            }

            var stream    = new DeflateStream(File.Open(file, FileMode.Open, FileAccess.Read), CompressionMode.Decompress);
            var formatter = new BinaryFormatter();
            var version   = (uint)formatter.Deserialize(stream);

            while ((bool)formatter.Deserialize(stream))
            {
                var position = (Vector3i)formatter.Deserialize(stream);
                var value    = new UnloadedChunkGeneration();
                value.Load(stream, formatter);
                _generations.TryAdd(position, value);
            }

            stream.Close();
        }