Exemplo n.º 1
0
        protected override IEnumerable <Block> GetBlocks()
        {
            if (_blockIds.Length != 0)
            {
                for (int i = 0; i < BLOCK_COUNT; i++)
                {
                    var blockId = _addBlocks == null || _addBlocks.Length != BLOCK_COUNT
                        ? _blockIds[i]
                        : (_addBlocks[i] << 8) + _blockIds[i];

                    int x = XWorld + (i % 16);
                    int y = (YOrder * 16) + (i / 256);
                    int z = ZWorld + ((i / 16) % 16);

                    byte biomeId     = _biomeIds[i % 256];
                    var  blockEntity = _parentColumn.BlockEntities.FirstOrDefault(e => e.X == x && e.Y == y && e.Z == z);

                    yield return(BlockFactory.CreateFromId(blockId, y, z, x, biomeId, _data[i], _blockLight[i],
                                                           _skylight[i], blockEntity));
                }
            }
        }