    001    package net.minecraft.world.gen;
    002
    003    import java.util.Random;
    004    import net.minecraft.world.World;
    005    import net.minecraft.world.chunk.IChunkProvider;
    006
    007    public 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 var6 = this.range;
    021            this.worldObj = par2World;
    022            this.rand.setSeed(par2World.getSeed());
    023            long var7 = this.rand.nextLong();
    024            long var9 = this.rand.nextLong();
    025
    026            for (int var11 = par3 - var6; var11 <= par3 + var6; ++var11)
    027            {
    028                for (int var12 = par4 - var6; var12 <= par4 + var6; ++var12)
    029                {
    030                    long var13 = (long)var11 * var7;
    031                    long var15 = (long)var12 * var9;
    032                    this.rand.setSeed(var13 ^ var15 ^ par2World.getSeed());
    033                    this.recursiveGenerate(par2World, var11, var12, 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    }