    001package net.minecraft.world.gen;
    002
    003import java.util.Random;
    004import net.minecraft.world.World;
    005import net.minecraft.world.chunk.IChunkProvider;
    006
    007public class MapGenBase
    008{
    009    /** The number of Chunks to gen-check in any given direction. */
    010    protected int range = 8;
    011
    012    /** The RNG used by the MapGen classes. */
    013    protected Random rand = new Random();
    014
    015    /** This world object. */
    016    protected World worldObj;
    017
    018    public void generate(IChunkProvider par1IChunkProvider, World par2World, int par3, int par4, byte[] par5ArrayOfByte)
    019    {
    020        int k = this.range;
    021        this.worldObj = par2World;
    022        this.rand.setSeed(par2World.getSeed());
    023        long l = this.rand.nextLong();
    024        long i1 = this.rand.nextLong();
    025
    026        for (int j1 = par3 - k; j1 <= par3 + k; ++j1)
    027        {
    028            for (int k1 = par4 - k; k1 <= par4 + k; ++k1)
    029            {
    030                long l1 = (long)j1 * l;
    031                long i2 = (long)k1 * i1;
    032                this.rand.setSeed(l1 ^ i2 ^ par2World.getSeed());
    033                this.recursiveGenerate(par2World, j1, k1, par3, par4, par5ArrayOfByte);
    034            }
    035        }
    036    }
    037
    038    /**
    039     * Recursively called by generate() (generate) and optionally by itself.
    040     */
    041    protected void recursiveGenerate(World par1World, int par2, int par3, int par4, int par5, byte[] par6ArrayOfByte) {}
    042}