Наследование: IEnumerable
Пример #1
0
        public Seed(World world)
        {
            this.world = world;
            InitializeComponent();

            lblOriginalSeed.Text = world.OriginalSeed.ToString();
            txtNewSeed.Text = world.Seed.ToString();
            this.CancelButton = btnCancel;
        }
Пример #2
0
        private void OpenWorld(String path)
        {
            ResetControls();

            try
            {
                world = new World(path);
            }
            catch (FileNotFoundException)
            {
                MessageBox.Show(this, String.Format("The file \"{0}\" could not be found. Unable to open world.", path), "Open", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                world = null;
                return;
            }
            catch (Exception)
            {
                MessageBox.Show(this, String.Format("The file \"{0}\" could not be parsed. Please be sure that it is a valid Minecraft level.dat.", path), "Open", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                world = null;
                return;
            }

            lastPath = Path.GetDirectoryName(path);

            String[] regions = world.GetRegionPaths();
            if (regions.Length == 0)
            {
                MessageBox.Show(this, "No region files (*.mca) found in the main, overworld dimension. If the world is older than March 2012 open it in Minecraft 1.2 or later to convert to the Anvil format. Otherwise try switching dimensions from the file menu.", "Open", MessageBoxButtons.OK);
                this.Text = "Biome Painter";
            }
            else
            {
                foreach (String r in regions)
                    lstRegions.Items.Add(RegionFile.ToString(r));
            }

            Settings.AddRecentWorld(path, world.WorldName);
            FillRecentWorldsList();
            this.Text = world.WorldName + " - Biome Painter";
        }
Пример #3
0
        private void closeWorldToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!SaveIfNecessary())
                return;

            world = null;
            this.Text = "Biome Painter";
            ResetControls();
        }
Пример #4
0
 public static World LoadWorld(string worldPath)
 {
     World world = new World(worldPath);
     Parallel.ForEach(Directory.GetFiles(worldPath + "\\region", "*.mca"), regionFilePath => world.Regions.Add(McRegion.LoadRegion(regionFilePath)));
     return world;
 }
Пример #5
0
 public WorldRenderer(World world, string colorPalettePath = "Config/ColorPalette.xml")
 {
     World = world;
     _loadColorPalette(colorPalettePath);
 }