Jump to content

World generation problems.


hotrods20

Recommended Posts

public boolean generate(World world, Random random, int x, int y, int z)
    {
        int carrotBlock = mod_Carrots.carrotBlock.blockID;
        int grass = Block.grass.blockID;

        if(world.getBlockId(x, y, z) == grass && world.getBlockId(x, y + 1, z) == 0)
        {
        //world.setBlockAndMetadataWithNotify(x, y + 1, z, carrotBlock, random.nextInt(7));
        
            for (int l = x -1; l <= x + 1; l++) {
                for (int m = z - 1; m <= z + 1; m++) {
                    world.setBlockWithNotify(l, y + 1, m, carrotBlock);
                }
            }
            
            for (int l = x - 2; l <= x + 2; l++) {
                for (int m = z - 2; m <= x + 2; m++) {
                    world.setBlockWithNotify(l, y, m, carrotBlock);
                }
            }
            
            for (int i = 0; i < 10; i++) {
                world.setBlockWithNotify(x, y + i, z, carrotBlock);
            }
                
        return true;
        }
        else
            return false;
    }

 

As you can see, the code is to generate a step like structure.  My problem is it can screw up and creates really long straight paths.  Could I be doing something wrong with the code?

width=320 height=64http://www.slothygaming.com/img/ota.png[/img]

If your grammar is shit and you blatantly don't know what you're doing, I will not help you.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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