Ejemplo n.º 1
0
 private void WriteChangedChunk(RefreshChunk chunk)
 {
     WriteInt(chunk.chunk.worldPos.x);
     WriteInt(chunk.chunk.worldPos.y);
     WriteInt(chunk.chunk.worldPos.z);
     WriteInt(chunk.refreshList.Count);
     for (int i = 0; i < chunk.refreshList.Count; i++)
     {
         writeChangedBlock(chunk.refreshList[i]);
     }
 }
Ejemplo n.º 2
0
        private RefreshChunk readChangedChunk()
        {
            int                x     = ReadInt();
            int                y     = ReadInt();
            int                z     = ReadInt();
            int                count = ReadInt();
            RefreshChunk       chunk = new RefreshChunk(World.world.GetChunk(x, y, z));
            List <UpdateBlock> list  = new List <UpdateBlock>(count);

            for (int i = 0; i < count; i++)
            {
                list.Add(readChangedBlock());
            }
            chunk.refreshList = list;
            return(chunk);
        }