Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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!

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.