Jump to content

[1.6.4]Surface Block Generation Help Needed


RetsuWolf

Recommended Posts

Greetings! I've been working on a mod and I'm trying to generate random snow blocks on the surface of a custom biome. I've made it generate although not the way I intended. When I use the following code.

 

public void decorate(World par1World, Random par2Random, int chunk_X, int chunk_Z)
{
super.decorate(par1World, par2Random, chunk_X, chunk_Z);
WorldGenFlowers snow = new WorldGenFlowers(Block.blockSnow.blockID);

boolean doGen = TerrainGen.decorate(par1World, par2Random, chunk_X, chunk_Z, FLOWERS);
    for (int j = 0; doGen && j < 10; ++j)
    {
        int k = chunk_X + par2Random.nextInt(16);
        int l = par2Random.nextInt(128);
        int i1 = chunk_Z + par2Random.nextInt(16);
        
        int i = par1World.getBlockId(k, l, i1);
        if( i == Main.blockSulfur.blockID)
        {
        par1World.setBlock(k, l, i1, i);
        }
    }
}

 

It just generates snow blocks in groups on top of the surface block. I'd like to make it so it will generate snow blocks randomly replacing random surface blocks. Anyone have any ideas or suggestions? Any help is greatly appreciated!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.