BiomePainter.RegionUtil.RenderRegionChunkstobePopulated C# (CSharp) Method

RenderRegionChunkstobePopulated() public static method

public static RenderRegionChunkstobePopulated ( RegionFile region, Bitmap b, bool clip = true ) : void
region Minecraft.RegionFile
b System.Drawing.Bitmap
clip bool
return void
        public static void RenderRegionChunkstobePopulated(RegionFile region, Bitmap b, bool clip = true)
        {
            using (Graphics g = Graphics.FromImage(b))
            {
                if (clip)
                    g.SetClip(CLIP);
                g.Clear(Color.Transparent);
            }

            RenderRegionChunkstobePopulated(region, 0, 31, 0, 31, OFFSETX, OFFSETY, b);
        }

Same methods

RegionUtil::RenderRegionChunkstobePopulated ( RegionFile region, int chunkStartX, int chunkEndX, int chunkStartZ, int chunkEndZ, int offsetX, int offsetY, Bitmap populate ) : void

Usage Example

Example #1
0
        private void setChunksInSelectionToBePopulatedToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (world == null || region == null)
            {
                return;
            }

            if (!warnedAboutPopulating)
            {
                DialogResult res = MessageBox.Show(this, String.Format("Setting a chunk to be popluated by Minecraft means the next time that chunk is loaded in Minecraft it will be filled with trees, snow cover, water, lava, and ores depending on the biome(s) the chunk is in.{0}{0}If that chunk has already been populated or already has player-made structures in it, you may find it clogged with more foliage than you wanted. Also smooth stone in your structures may be replaced with ores, dirt, or gravel. I strongly suggest you make a backup copy of your world before using this feature.{0}{0}Are you sure you want to proceed? As always, changes can be undone and won't take effect until you save the region.", Environment.NewLine), "DANGER", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);
                if (res == DialogResult.Cancel)
                {
                    return;
                }
                warnedAboutPopulating = true;
            }

            if (!chkShowPopulate.Checked)
            {
                chkShowPopulate.Checked = true;
            }

            RegionUtil.SetChunkstobePopulated(region, imgRegion.Layers[SELECTIONLAYER].Image, imgRegion.SelectionColor, 0);
            RegionUtil.RenderRegionChunkstobePopulated(region, imgRegion.Layers[POPULATELAYER].Image);
            imgRegion.Redraw();
            history.RecordPopulateState(region, "Set Populate Flags");
        }
All Usage Examples Of BiomePainter.RegionUtil::RenderRegionChunkstobePopulated