private void FillWithRandomBlocks() { Random random = new Random(); for (int z = 0; z < 512; z += size) { for (int x = 0; x < 512; x += size) { for (int y = 0; y < size * 4; y += size) { string block = BlockList.blocks[random.Next(0, BlockList.blocks.Length)]; for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { for (int k = 0; k < size; k++) { if (region.IsWithinBoundaries(x + i, y + j, z + k)) { region.SetBlock(x + i, y + j, z + k, block); } } } } } } } }
static void CopyBlockColumn(Region dst, Region source, int x, int z) { for (int y = 0; y < 256; y++) { BlockState block = source.GetBlockState(x, y, z); if (block != null) { dst.SetBlock(x, y, z, block); //Also copy any tile entities associated with this block var te = source.GetTileEntity(x, y, z); if (te != null) { dst.SetTileEntity(x, y, z, te); } } } }