Replace() 개인적인 정적인 메소드

private static Replace ( RegionFile region, Bitmap selection, Color selectionColor, byte search, BiomeUtil replace ) : void
region Minecraft.RegionFile
selection System.Drawing.Bitmap
selectionColor Color
search byte
replace Minecraft.BiomeUtil
리턴 void
예제 #1
0
        private void Run()
        {
            String[] paths  = Directory.GetFiles(regionDir, "*.mca", SearchOption.TopDirectoryOnly);
            String   format = String.Format("{{0}} region {{1}} of {0}", paths.Length);
            int      count  = 0;

            foreach (String path in paths)
            {
                UpdateStatus(String.Format(format, "Reading", count));
                UpdateProgress(count, paths.Length);
                RegionFile region = new RegionFile(path);
                UpdateStatus(String.Format(format, replace ? "Replacing" : "Filling", count));
                if (!replace)
                {
                    RegionUtil.Fill(region, null, Color.Black, biome1, worldSeed);
                }
                else
                {
                    RegionUtil.Replace(region, null, Color.Black, ((BiomeType)biome1).ID, biome2, worldSeed);
                }
                UpdateStatus(String.Format(format, "Saving", count));
                mutex.WaitOne();
                region.Write(true);
                mutex.ReleaseMutex();
                count++;
            }
            UpdateProgress(paths.Length, paths.Length);
            UpdateStatus("Done");
        }
예제 #2
0
        private void btnReplace_Click(object sender, EventArgs e)
        {
            if (world == null || region == null)
            {
                return;
            }

            UpdateStatus("Replacing in selected area");
            RegionUtil.Replace(region, imgRegion.Layers[SELECTIONLAYER].Image, imgRegion.SelectionColor, ((BiomeType)cmbReplace1.SelectedItem).ID, cmbReplace2.SelectedItem, world.Seed);
            if (Settings.RedrawTerrainMap)
            {
                UpdateStatus("Generating terrain map");
                RegionUtil.RenderRegionTerrain(region, imgRegion.Layers[MAPLAYER].Image);
            }
            UpdateStatus("Generating biome map");
            RegionUtil.RenderRegionBiomes(region, imgRegion.Layers[BIOMELAYER].Image, imgRegion.ToolTips);
            UpdateStatus("");
            imgRegion.Redraw();
            history.RecordBiomeState(region, "Replace Biomes");
        }