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