/// <summary> /// BitmapをSchematicに変換 /// </summary> /// <param name="bitmap"></param> /// <returns></returns> public TagCompound ToSchematic(Bitmap bitmap) { var schematic = new Schematic(bitmap.Width, 1, bitmap.Height); var result = Convert(bitmap); for (var y = 0; y < bitmap.Height; y++) { for (var x = 0; x < bitmap.Width; x++) { var blockColor = result[x, y]; try { var block = AnvilImprovedDataProvider.Instance.GetBlock("minecraft:" + blockColor.BlockName); schematic.SetBlock(x, 0, y, block.DefaultBlockSet); } catch (Exception) { MessageBox.Show(blockColor.BlockName); } } convertFile.Complete++; } return(schematic.BuildTag()); }