예제 #1
0
        public void populate(IChunkProvider ichunkprovider, int i, int j)
        {
            BlockSand.fallInstantly = true;
            int k = i * 16;
            int l = j * 16;

            for (int i1 = 0; i1 < 8; i1++)
            {
                int k1 = k + hellRNG.nextInt(16) + 8;
                int i3 = hellRNG.nextInt(120) + 4;
                int k4 = l + hellRNG.nextInt(16) + 8;
                (new WorldGenHellLava(Block.lavaStill.blockID)).generate(field_4235_n, hellRNG, k1, i3, k4);
            }

            int j1 = hellRNG.nextInt(hellRNG.nextInt(10) + 1) + 1;

            for (int l1 = 0; l1 < j1; l1++)
            {
                int j3 = k + hellRNG.nextInt(16) + 8;
                int l4 = hellRNG.nextInt(120) + 4;
                int i6 = l + hellRNG.nextInt(16) + 8;
                (new WorldGenFire()).generate(field_4235_n, hellRNG, j3, l4, i6);
            }

            j1 = hellRNG.nextInt(hellRNG.nextInt(10) + 1);
            for (int i2 = 0; i2 < j1; i2++)
            {
                int k3 = k + hellRNG.nextInt(16) + 8;
                int i5 = hellRNG.nextInt(120) + 4;
                int j6 = l + hellRNG.nextInt(16) + 8;
                (new WorldGenLightStone1()).generate(field_4235_n, hellRNG, k3, i5, j6);
            }

            for (int j2 = 0; j2 < 10; j2++)
            {
                int l3 = k + hellRNG.nextInt(16) + 8;
                int j5 = hellRNG.nextInt(128);
                int k6 = l + hellRNG.nextInt(16) + 8;
                (new WorldGenLightStone2()).generate(field_4235_n, hellRNG, l3, j5, k6);
            }

            if (hellRNG.nextInt(1) == 0)
            {
                int k2 = k + hellRNG.nextInt(16) + 8;
                int i4 = hellRNG.nextInt(128);
                int k5 = l + hellRNG.nextInt(16) + 8;
                (new WorldGenFlowers(Block.mushroomBrown.blockID)).generate(field_4235_n, hellRNG, k2, i4, k5);
            }
            if (hellRNG.nextInt(1) == 0)
            {
                int l2 = k + hellRNG.nextInt(16) + 8;
                int j4 = hellRNG.nextInt(128);
                int l5 = l + hellRNG.nextInt(16) + 8;
                (new WorldGenFlowers(Block.mushroomRed.blockID)).generate(field_4235_n, hellRNG, l2, j4, l5);
            }
            BlockSand.fallInstantly = false;
        }
    /**
     * Populates chunk with ores etc etc
     */
    public void populate(IChunkProvider chunkProvider, int x, int z)
    {
        Chunk chunk = provideChunk(x, z);

        if (serverChunkGenerator != null)
        {
            serverChunkGenerator.populate(chunkProvider, x, z);
        }
    }
예제 #3
0
 public ChunkProvider(World par1World, IChunkLoader par2IChunkLoader, IChunkProvider par3IChunkProvider)
 {
     droppedChunksSet = new List <long>();
     chunkMap         = new LongHashMap();
     chunkList        = new List <Chunk>();
     emptyChunk       = new EmptyChunk(par1World, 0, 0);
     worldObj         = par1World;
     chunkLoader      = par2IChunkLoader;
     chunkProvider    = par3IChunkProvider;
 }
예제 #4
0
 public ChunkProviderServer(WorldServer worldserver, IChunkLoader ichunkloader, IChunkProvider ichunkprovider)
 {
     field_725_a = new HashSet();
     id2ChunkMap = new HashMap();
     field_727_f = new ArrayList();
     field_724_b = new EmptyChunk(worldserver, new byte[32768], 0, 0);
     world       = worldserver;
     field_729_d = ichunkloader;
     field_730_c = ichunkprovider;
 }
예제 #5
0
 public ChunkProviderLoadOrGenerate(World world, IChunkLoader ichunkloader, IChunkProvider ichunkprovider)
 {
     chunks = new Chunk[1024];
     lastQueriedChunkXPos = unchecked ((int)0xc4653601);
     lastQueriedChunkZPos = unchecked ((int)0xc4653601);
     blankChunk           = new EmptyChunk(world, new byte[32768], 0, 0);
     worldObj             = world;
     chunkLoader          = ichunkloader;
     chunkProvider        = ichunkprovider;
 }
예제 #6
0
 public ChunkProviderServer(WorldServer worldserver, IChunkLoader ichunkloader, IChunkProvider ichunkprovider)
 {
     field_725_a = new HashSet();
     id2ChunkMap = new HashMap();
     field_727_f = new ArrayList();
     field_724_b = new EmptyChunk(worldserver, new byte[32768], 0, 0);
     world = worldserver;
     field_729_d = ichunkloader;
     field_730_c = ichunkprovider;
 }
예제 #7
0
        ///<summary>
        /// Populates chunk with ores etc etc
        ///</summary>
        public void Populate(IChunkProvider par1IChunkProvider, int par2, int par3)
        {
            BlockSand.FallInstantly = true;
            int          i            = par2 * 16;
            int          j            = par3 * 16;
            BiomeGenBase biomegenbase = endWorld.GetBiomeGenForCoords(i + 16, j + 16);

            biomegenbase.Decorate(endWorld, endWorld.Rand, i, j);
            BlockSand.FallInstantly = false;
        }
예제 #8
0
 public ChunkProviderLoadOrGenerate(World world, IChunkLoader ichunkloader, IChunkProvider ichunkprovider)
 {
     chunks = new Chunk[1024];
     lastQueriedChunkXPos = unchecked((int) 0xc4653601);
     lastQueriedChunkZPos = unchecked((int) 0xc4653601);
     blankChunk = new EmptyChunk(world, new byte[32768], 0, 0);
     worldObj = world;
     chunkLoader = ichunkloader;
     chunkProvider = ichunkprovider;
 }
예제 #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SurvivalKit.Events.Misc.UnknownChunkProviderEvent"/> class.
 /// </summary>
 /// <param name="args">
 /// An object array of data to pass to the event.
 /// args[0] (ChunkCluster) the ChunkCluster that fired the event.
 /// args[1] (bool) indicates whether the event is cancelled (false by default).
 /// args[2] (int) the unknown chunkProviderId.
 /// args[3] (IChunkProvider) the chunk provider (null by default).
 /// </param>
 public UnknownChunkProviderEvent(Object[] args)
 {
     if (args == null || args.Length < 4)
     {
         throw new ArgumentNullException();
     }
     cluster         = (ChunkCluster)args[0];
     cancelled       = (bool)args[1];
     chunkProviderId = (int)args[2];
     chunkProvider   = (IChunkProvider)args[3];
 }
 public bool func_177460_a(IChunkProvider chunkProvider, Chunk chunk, int x, int z)
 {
     if (serverChunkGenerator != null && serverChunkGenerator.func_177460_a(chunkProvider, chunk, x, z))
     {
         Chunk newChunk = provideChunk(x, z);
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #11
0
 public void populate(IChunkProvider ichunkprovider, int i, int j)
 {
     Chunk chunk = provideChunk(i, j);
     if (!chunk.isTerrainPopulated)
     {
         chunk.isTerrainPopulated = true;
         if (chunkProvider != null)
         {
             chunkProvider.populate(ichunkprovider, i, j);
             chunk.setChunkModified();
         }
     }
 }
예제 #12
0
        /// <summary>
        /// Populates chunk with ores etc etc
        /// </summary>
        public void Populate(IChunkProvider par1IChunkProvider, int par2, int par3)
        {
            Random.SetSeed((int)WorldObj.GetSeed());
            long l  = (Random.Next() / 2L) * 2L + 1L;
            long l1 = (Random.Next() / 2L) * 2L + 1L;

            Random.SetSeed(par2 * (int)l + par3 * (int)l1 ^ (int)WorldObj.GetSeed());

            if (UseStructures)
            {
                VillageGen.GenerateStructuresInChunk(WorldObj, Random, par2, par3);
            }
        }
예제 #13
0
        public void populate(IChunkProvider ichunkprovider, int i, int j)
        {
            Chunk chunk = provideChunk(i, j);

            if (!chunk.isTerrainPopulated)
            {
                chunk.isTerrainPopulated = true;
                if (field_730_c != null)
                {
                    field_730_c.populate(ichunkprovider, i, j);
                    chunk.setChunkModified();
                }
            }
        }
예제 #14
0
 public virtual void func_667_a(IChunkProvider ichunkprovider, World world, int i, int j, byte[] abyte0)
 {
     int k = field_947_a;
     rand.setSeed(world.func_22079_j());
     long l = (rand.nextLong()/2L)*2L + 1L;
     long l1 = (rand.nextLong()/2L)*2L + 1L;
     for (int i1 = i - k; i1 <= i + k; i1++)
     {
         for (int j1 = j - k; j1 <= j + k; j1++)
         {
             rand.setSeed(i1*l + j1*l1 ^ world.func_22079_j());
             func_666_a(world, i1, j1, i, j, abyte0);
         }
     }
 }
예제 #15
0
        /// <summary>
        /// Populates chunk with ores etc etc
        /// </summary>
        public virtual void Populate(IChunkProvider par1IChunkProvider, int par2, int par3)
        {
            Chunk chunk = ProvideChunk(par2, par3);

            if (!chunk.IsTerrainPopulated)
            {
                chunk.IsTerrainPopulated = true;

                if (ChunkProvider != null)
                {
                    ChunkProvider.Populate(par1IChunkProvider, par2, par3);
                    chunk.SetChunkModified();
                }
            }
        }
예제 #16
0
    void Start()
    {
        IChunkProvider chunkGenerator = null;

        if (this.generationType == WorldGenerationType.Flat)
        {
            chunkGenerator = new ChunkProviderGenratorFlat();
        }
        else if (this.generationType == WorldGenerationType.Noise)
        {
            chunkGenerator = new ChunkProviderGeneratorNoise(new System.Random().Next(0, int.MaxValue), this.blocks);
        }
        this.world         = new World(chunkGenerator, this.worldSaver);
        this.worldRenderer = new WorldRenderer(this.world, this.blocks, this.gameObject, new Material[] { this.opaqueMaterial, this.transparentMaterial });
        this.world.setWorldAccess(this.worldRenderer);
    }
예제 #17
0
        public virtual void func_667_a(IChunkProvider ichunkprovider, World world, int i, int j, byte[] abyte0)
        {
            int k = field_947_a;

            rand.setSeed(world.func_22079_j());
            long l  = (rand.nextLong() / 2L) * 2L + 1L;
            long l1 = (rand.nextLong() / 2L) * 2L + 1L;

            for (int i1 = i - k; i1 <= i + k; i1++)
            {
                for (int j1 = j - k; j1 <= j + k; j1++)
                {
                    rand.setSeed(i1 * l + j1 * l1 ^ world.func_22079_j());
                    func_666_a(world, i1, j1, i, j, abyte0);
                }
            }
        }
예제 #18
0
        public ClientGame(
            ILogger logger,
            GameSettings gameSettings,
            IShaderFactory shaderFactory,
            IChunkProvider chunkProvider)
            : base(logger, gameSettings, shaderFactory)
        {
            _shaderFactory = shaderFactory;
            _chunkProvider = chunkProvider;
            Window.Title   = "Ashoka";

            _clearColor = new Color4(0.1f, 0.1f, 0.1f, 1.0f);

            _inputLayoutFactory = new InputLayoutFactory();
            _textureAtlas       = new TextureAtlas(32, "Content/Textures/LandAtlas.png");
            _chunkMeshFactory   = new ChunkMeshFactory(_textureAtlas);
            _meshFactory        = new MeshFactory();
        }
예제 #19
0
        public virtual void Generate(IChunkProvider par1IChunkProvider, World par2World, int par3, int par4, byte[] par5ArrayOfByte)
        {
            int i = Range;

            WorldObj = par2World;
            Rand.SetSeed((int)par2World.GetSeed());
            int l  = Rand.Next();
            int l1 = Rand.Next();

            for (int j = par3 - i; j <= par3 + i; j++)
            {
                for (int k = par4 - i; k <= par4 + i; k++)
                {
                    int l2 = j * l;
                    int l3 = k * l1;
                    Rand.SetSeed(l2 ^ l3 ^ (int)par2World.GetSeed());
                    RecursiveGenerate(par2World, j, k, par3, par4, par5ArrayOfByte);
                }
            }
        }
예제 #20
0
    public void generate(IChunkProvider chunkProviderIn, World worldIn, int x, int z, ChunkPrimer chunkPrimerIn)
    {
        int i = this.range;

        this.worldObj = worldIn;
        this.rand     = new System.Random(worldIn.getSeed());
        int j = this.rand.Next();
        int k = this.rand.Next();

        for (int l = x - i; i <= x + i; ++l)
        {
            for (int i1 = z - i; i1 <= z + i; ++i1)
            {
                int j1 = l * j;
                int k1 = i1 * k;

                this.rand = new System.Random(j1 ^ k1 ^ worldIn.getSeed());
                this.recursiveGenerate(worldIn, l, i1, x, z, chunkPrimerIn);
            }
        }
    }
예제 #21
0
    private static void testGetBiome(List <string> _params)
    {
        /* Using World.ChunkCache.ChunkProvider.GetBiomeProvider().GetBiomeAt
         *  Instead of World.getbiome */
        int x = int.Parse(_params[0]);
        int y = int.Parse(_params[1]);

        Printer.Print("testGetBiome at", x, y);
        World        w  = GameManager.Instance.World;
        ChunkCluster cc = w.ChunkCache;

        Printer.Print("testGetBiome ChunkCluster", cc);
        IChunkProvider icp = w.ChunkCache.ChunkProvider;

        Printer.Print("testGetBiome IChunkProvider", icp);
        IBiomeProvider bp = w.ChunkCache.ChunkProvider.GetBiomeProvider();

        Printer.Print("testGetBiome IBiomeProvider", bp);
        BiomeDefinition bd = w.ChunkCache.ChunkProvider.GetBiomeProvider().GetBiomeAt(x, y);

        Printer.Print("testGetBiome BiomeDefinition", bd);
    }
예제 #22
0
        public virtual void PopulateChunk(IChunkProvider par1IChunkProvider, IChunkProvider par2IChunkProvider, int par3, int par4)
        {
            if (!IsTerrainPopulated && par1IChunkProvider.ChunkExists(par3 + 1, par4 + 1) && par1IChunkProvider.ChunkExists(par3, par4 + 1) && par1IChunkProvider.ChunkExists(par3 + 1, par4))
            {
                par1IChunkProvider.Populate(par2IChunkProvider, par3, par4);
            }

            if (par1IChunkProvider.ChunkExists(par3 - 1, par4) && !par1IChunkProvider.ProvideChunk(par3 - 1, par4).IsTerrainPopulated&& par1IChunkProvider.ChunkExists(par3 - 1, par4 + 1) && par1IChunkProvider.ChunkExists(par3, par4 + 1) && par1IChunkProvider.ChunkExists(par3 - 1, par4 + 1))
            {
                par1IChunkProvider.Populate(par2IChunkProvider, par3 - 1, par4);
            }

            if (par1IChunkProvider.ChunkExists(par3, par4 - 1) && !par1IChunkProvider.ProvideChunk(par3, par4 - 1).IsTerrainPopulated&& par1IChunkProvider.ChunkExists(par3 + 1, par4 - 1) && par1IChunkProvider.ChunkExists(par3 + 1, par4 - 1) && par1IChunkProvider.ChunkExists(par3 + 1, par4))
            {
                par1IChunkProvider.Populate(par2IChunkProvider, par3, par4 - 1);
            }

            if (par1IChunkProvider.ChunkExists(par3 - 1, par4 - 1) && !par1IChunkProvider.ProvideChunk(par3 - 1, par4 - 1).IsTerrainPopulated&& par1IChunkProvider.ChunkExists(par3, par4 - 1) && par1IChunkProvider.ChunkExists(par3 - 1, par4))
            {
                par1IChunkProvider.Populate(par2IChunkProvider, par3 - 1, par4 - 1);
            }
        }
예제 #23
0
파일: World.cs 프로젝트: riverar/Crafty
        public World(ISaveHandler isavehandler, string s, long l, WorldProvider worldprovider)
        {
            scheduledUpdatesAreImmediate = false;
            field_821_y = new ArrayList();
            loadedEntityList = new ArrayList();
            unloadedEntityList = new ArrayList();
            scheduledTickTreeSet = new TreeSet();
            scheduledTickSet = new HashSet();
            loadedTileEntityList = new ArrayList();
            playerEntities = new ArrayList();
            field_6159_E = 0xffffffL;
            skylightSubtracted = 0;
            distHashCounter = (new Random()).nextInt();
            DIST_HASH_MAGIC = 0x3c6ef35f;
            editingBlocks = false;
            lockTimestamp = java.lang.System.currentTimeMillis();
            autosavePeriod = 40;
            rand = new Random();
            field_9212_p = false;
            worldAccesses = new ArrayList();
            field_9207_I = new ArrayList();
            field_4265_J = 0;
            spawnHostileMobs = true;
            spawnPeacefulMobs = true;
            activeChunkSet = new HashSet();
            ambientTickCountdown = rand.nextInt(12000);
            field_778_L = new ArrayList();
            singleplayerWorld = false;
            worldFile = isavehandler;
            worldInfo = isavehandler.func_22096_c();
            field_9212_p = worldInfo == null;
            if (worldprovider != null)
            {
                worldProvider = worldprovider;
            }
            else if (worldInfo != null && worldInfo.func_22178_h() == -1)
            {
                worldProvider = new WorldProviderHell();
            }
            else
            {
                worldProvider = new WorldProvider();
            }
            bool flag = false;
            if (worldInfo == null)
            {
                worldInfo = new WorldInfo(l, s);
                flag = true;
            }
            else
            {
                worldInfo.setLevelName(s);
            }
            worldProvider.registerWorld(this);
            chunkProvider = func_22086_b();
            if (flag)
            {
                field_9209_x = true;
                int i = 0;
                byte byte0 = 64;
                int j;
                for (j = 0; !worldProvider.canCoordinateBeSpawn(i, j); j += rand.nextInt(64) - rand.nextInt(64))
                {
                    i += rand.nextInt(64) - rand.nextInt(64);
                }

                worldInfo.setSpawnPosition(i, byte0, j);
                field_9209_x = false;
            }
            calculateInitialSkylight();
        }
예제 #24
0
 public World(string name, int seed, IChunkProvider chunkProvider) : this(name, chunkProvider) => Seed = seed;
예제 #25
0
 internal Planet(IChunkProvider chunkProvider, Guid id)
     : this(id)
 {
     _chunkProvider = chunkProvider;
 }
예제 #26
0
 public World(string name, IChunkProvider chunkProvider) : this(name)
 {
     ChunkProvider = chunkProvider;
     ChunkProvider.Initialize(this);
 }
 public ChunkProvider(IChunkProvider childProvider)
 {
     this.childProvider = childProvider;
 }
        ///<summary>
        /// Populates chunk with ores etc etc
        ///</summary>
        public void Populate(IChunkProvider par1IChunkProvider, int par2, int par3)
        {
            BlockSand.FallInstantly = true;
            int          i            = par2 * 16;
            int          j            = par3 * 16;
            BiomeGenBase biomegenbase = worldObj.GetBiomeGenForCoords(i + 16, j + 16);

            rand.SetSeed((int)worldObj.GetSeed());
            long l  = (rand.Next() / 2L) * 2L + 1L;
            long l1 = (rand.Next() / 2L) * 2L + 1L;

            rand.SetSeed(par2 * (int)l + par3 * (int)l1 ^ (int)worldObj.GetSeed());
            bool flag = false;

            if (mapFeaturesEnabled)
            {
                mineshaftGenerator.GenerateStructuresInChunk(worldObj, rand, par2, par3);
                flag = villageGenerator.GenerateStructuresInChunk(worldObj, rand, par2, par3);
                strongholdGenerator.GenerateStructuresInChunk(worldObj, rand, par2, par3);
            }

            if (!flag && rand.Next(4) == 0)
            {
                int k  = i + rand.Next(16) + 8;
                int i2 = rand.Next(128);
                int i3 = j + rand.Next(16) + 8;
                (new WorldGenLakes(Block.WaterStill.BlockID)).Generate(worldObj, rand, k, i2, i3);
            }

            if (!flag && rand.Next(8) == 0)
            {
                int i1 = i + rand.Next(16) + 8;
                int j2 = rand.Next(rand.Next(120) + 8);
                int j3 = j + rand.Next(16) + 8;

                if (j2 < 63 || rand.Next(10) == 0)
                {
                    (new WorldGenLakes(Block.LavaStill.BlockID)).Generate(worldObj, rand, i1, j2, j3);
                }
            }

            for (int j1 = 0; j1 < 8; j1++)
            {
                int k2 = i + rand.Next(16) + 8;
                int k3 = rand.Next(128);
                int i4 = j + rand.Next(16) + 8;

                if (!(new WorldGenDungeons()).Generate(worldObj, rand, k2, k3, i4))
                {
                    ;
                }
            }

            biomegenbase.Decorate(worldObj, rand, i, j);
            SpawnerAnimals.PerformWorldGenSpawning(worldObj, biomegenbase, i + 8, j + 8, 16, 16, rand);
            i += 8;
            j += 8;

            for (int k1 = 0; k1 < 16; k1++)
            {
                for (int l2 = 0; l2 < 16; l2++)
                {
                    int l3 = worldObj.GetPrecipitationHeight(i + k1, j + l2);

                    if (worldObj.IsBlockHydratedDirectly(k1 + i, l3 - 1, l2 + j))
                    {
                        worldObj.SetBlockWithNotify(k1 + i, l3 - 1, l2 + j, Block.Ice.BlockID);
                    }

                    if (worldObj.CanSnowAt(k1 + i, l3, l2 + j))
                    {
                        worldObj.SetBlockWithNotify(k1 + i, l3, l2 + j, Block.Snow.BlockID);
                    }
                }
            }

            BlockSand.FallInstantly = false;
        }
예제 #29
0
파일: World.cs 프로젝트: Luigifan/TrueCraft
 public World(string name, int seed, IChunkProvider chunkProvider)
     : this(name, chunkProvider)
 {
     Seed = seed;
     BiomeDiagram = new BiomeMap(Seed);
 }
예제 #30
0
 public World(string name, IChunkProvider chunkProvider) : this(name)
 {
     ChunkProvider = chunkProvider;
 }
예제 #31
0
        ///<summary>
        ///Populates chunk with ores etc etc
        ///</summary>
        public void Populate(IChunkProvider par1IChunkProvider, int par2, int par3)
        {
            BlockSand.FallInstantly = true;
            int i = par2 * 16;
            int j = par3 * 16;

            GenNetherBridge.GenerateStructuresInChunk(worldObj, hellRNG, par2, par3);

            for (int k = 0; k < 8; k++)
            {
                int i1 = i + hellRNG.Next(16) + 8;
                int k2 = hellRNG.Next(120) + 4;
                int i4 = j + hellRNG.Next(16) + 8;
                (new WorldGenHellLava(Block.LavaMoving.BlockID)).Generate(worldObj, hellRNG, i1, k2, i4);
            }

            int l = hellRNG.Next(hellRNG.Next(10) + 1) + 1;

            for (int j1 = 0; j1 < l; j1++)
            {
                int l2 = i + hellRNG.Next(16) + 8;
                int j4 = hellRNG.Next(120) + 4;
                int k5 = j + hellRNG.Next(16) + 8;
                (new WorldGenFire()).Generate(worldObj, hellRNG, l2, j4, k5);
            }

            l = hellRNG.Next(hellRNG.Next(10) + 1);

            for (int k1 = 0; k1 < l; k1++)
            {
                int i3 = i + hellRNG.Next(16) + 8;
                int k4 = hellRNG.Next(120) + 4;
                int l5 = j + hellRNG.Next(16) + 8;
                (new WorldGenGlowStone1()).Generate(worldObj, hellRNG, i3, k4, l5);
            }

            for (int l1 = 0; l1 < 10; l1++)
            {
                int j3 = i + hellRNG.Next(16) + 8;
                int l4 = hellRNG.Next(128);
                int i6 = j + hellRNG.Next(16) + 8;
                (new WorldGenGlowStone2()).Generate(worldObj, hellRNG, j3, l4, i6);
            }

            if (hellRNG.Next(1) == 0)
            {
                int i2 = i + hellRNG.Next(16) + 8;
                int k3 = hellRNG.Next(128);
                int i5 = j + hellRNG.Next(16) + 8;
                (new WorldGenFlowers(Block.MushroomBrown.BlockID)).Generate(worldObj, hellRNG, i2, k3, i5);
            }

            if (hellRNG.Next(1) == 0)
            {
                int j2 = i + hellRNG.Next(16) + 8;
                int l3 = hellRNG.Next(128);
                int j5 = j + hellRNG.Next(16) + 8;
                (new WorldGenFlowers(Block.MushroomRed.BlockID)).Generate(worldObj, hellRNG, j2, l3, j5);
            }

            BlockSand.FallInstantly = false;
        }
예제 #32
0
 public bool func_177460_a(IChunkProvider p_177460_1_, Chunk p_177460_2_, int p_177460_3_, int p_177460_4_)
 {
     return(false);
 }
예제 #33
0
//	/**
//     * Populates chunk with ores etc etc
//     */
//	public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_)
//	{
//		int i = p_73153_2_ * 16;
//		int j = p_73153_3_ * 16;
//		BlockPos blockpos = new BlockPos(i, 0, j);
//		BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(new BlockPos(i + 16, 0, j + 16));
//		boolean flag = false;
//		this.random.setSeed(this.worldObj.getSeed());
//		long k = this.random.nextLong() / 2L * 2L + 1L;
//		long l = this.random.nextLong() / 2L * 2L + 1L;
//		this.random.setSeed((long)p_73153_2_ * k + (long)p_73153_3_ * l ^ this.worldObj.getSeed());
//		ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(p_73153_2_, p_73153_3_);
//
//		for (MapGenStructure mapgenstructure : this.structureGenerators)
//		{
//			boolean flag1 = mapgenstructure.generateStructure(this.worldObj, this.random, chunkcoordintpair);
//
//			if (mapgenstructure instanceof MapGenVillage)
//			{
//				flag |= flag1;
//			}
//		}
//
//		if (this.waterLakeGenerator != null && !flag && this.random.nextInt(4) == 0)
//		{
//			this.waterLakeGenerator.generate(this.worldObj, this.random, blockpos.add(this.random.nextInt(16) + 8, this.random.nextInt(256), this.random.nextInt(16) + 8));
//		}
//
//		if (this.lavaLakeGenerator != null && !flag && this.random.nextInt(8) == 0)
//		{
//			BlockPos blockpos1 = blockpos.add(this.random.nextInt(16) + 8, this.random.nextInt(this.random.nextInt(248) + 8), this.random.nextInt(16) + 8);
//
//			if (blockpos1.getY() < this.worldObj.func_181545_F() || this.random.nextInt(10) == 0)
//			{
//				this.lavaLakeGenerator.generate(this.worldObj, this.random, blockpos1);
//			}
//		}
//
//		if (this.hasDungeons)
//		{
//			for (int i1 = 0; i1 < 8; ++i1)
//			{
//				(new WorldGenDungeons()).generate(this.worldObj, this.random, blockpos.add(this.random.nextInt(16) + 8, this.random.nextInt(256), this.random.nextInt(16) + 8));
//			}
//		}
//
//		if (this.hasDecoration)
//		{
//			biomegenbase.decorate(this.worldObj, this.random, blockpos);
//		}
//	}

    /**
     * Populates chunk with ores etc etc
     */
    public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_)
    {
    }
예제 #34
0
 public World()
 {
     this.seed          = 1;//new System.Random().Next(100000000);
     this.chunkProvider = new ChunkProvider(new MinecraftGenerator(this));
 }
예제 #35
0
        public void populate(IChunkProvider ichunkprovider, int i, int j)
        {
            BlockSand.fallInstantly = true;
            int k = i*16;
            int l = j*16;
            for (int i1 = 0; i1 < 8; i1++)
            {
                int k1 = k + hellRNG.nextInt(16) + 8;
                int i3 = hellRNG.nextInt(120) + 4;
                int k4 = l + hellRNG.nextInt(16) + 8;
                (new WorldGenHellLava(Block.lavaStill.blockID)).generate(field_4235_n, hellRNG, k1, i3, k4);
            }

            int j1 = hellRNG.nextInt(hellRNG.nextInt(10) + 1) + 1;
            for (int l1 = 0; l1 < j1; l1++)
            {
                int j3 = k + hellRNG.nextInt(16) + 8;
                int l4 = hellRNG.nextInt(120) + 4;
                int i6 = l + hellRNG.nextInt(16) + 8;
                (new WorldGenFire()).generate(field_4235_n, hellRNG, j3, l4, i6);
            }

            j1 = hellRNG.nextInt(hellRNG.nextInt(10) + 1);
            for (int i2 = 0; i2 < j1; i2++)
            {
                int k3 = k + hellRNG.nextInt(16) + 8;
                int i5 = hellRNG.nextInt(120) + 4;
                int j6 = l + hellRNG.nextInt(16) + 8;
                (new WorldGenLightStone1()).generate(field_4235_n, hellRNG, k3, i5, j6);
            }

            for (int j2 = 0; j2 < 10; j2++)
            {
                int l3 = k + hellRNG.nextInt(16) + 8;
                int j5 = hellRNG.nextInt(128);
                int k6 = l + hellRNG.nextInt(16) + 8;
                (new WorldGenLightStone2()).generate(field_4235_n, hellRNG, l3, j5, k6);
            }

            if (hellRNG.nextInt(1) == 0)
            {
                int k2 = k + hellRNG.nextInt(16) + 8;
                int i4 = hellRNG.nextInt(128);
                int k5 = l + hellRNG.nextInt(16) + 8;
                (new WorldGenFlowers(Block.mushroomBrown.blockID)).generate(field_4235_n, hellRNG, k2, i4, k5);
            }
            if (hellRNG.nextInt(1) == 0)
            {
                int l2 = k + hellRNG.nextInt(16) + 8;
                int j4 = hellRNG.nextInt(128);
                int l5 = l + hellRNG.nextInt(16) + 8;
                (new WorldGenFlowers(Block.mushroomRed.blockID)).generate(field_4235_n, hellRNG, l2, j4, l5);
            }
            BlockSand.fallInstantly = false;
        }
예제 #36
0
        public void populate(IChunkProvider ichunkprovider, int i, int j)
        {
            BlockSand.fallInstantly = true;
            int k = i*16;
            int l = j*16;
            MobSpawnerBase mobspawnerbase = worldObj.getWorldChunkManager().func_4067_a(k + 16, l + 16);
            rand.setSeed(worldObj.func_22079_j());
            long l1 = (rand.nextLong()/2L)*2L + 1L;
            long l2 = (rand.nextLong()/2L)*2L + 1L;
            rand.setSeed(i*l1 + j*l2 ^ worldObj.func_22079_j());
            double d = 0.25D;
            if (rand.nextInt(4) == 0)
            {
                int i1 = k + rand.nextInt(16) + 8;
                int l4 = rand.nextInt(128);
                int i8 = l + rand.nextInt(16) + 8;
                (new WorldGenLakes(Block.waterMoving.blockID)).generate(worldObj, rand, i1, l4, i8);
            }
            if (rand.nextInt(8) == 0)
            {
                int j1 = k + rand.nextInt(16) + 8;
                int i5 = rand.nextInt(rand.nextInt(120) + 8);
                int j8 = l + rand.nextInt(16) + 8;
                if (i5 < 64 || rand.nextInt(10) == 0)
                {
                    (new WorldGenLakes(Block.lavaMoving.blockID)).generate(worldObj, rand, j1, i5, j8);
                }
            }
            for (int k1 = 0; k1 < 8; k1++)
            {
                int j5 = k + rand.nextInt(16) + 8;
                int k8 = rand.nextInt(128);
                int i13 = l + rand.nextInt(16) + 8;
                (new WorldGenDungeons()).generate(worldObj, rand, j5, k8, i13);
            }

            for (int i2 = 0; i2 < 10; i2++)
            {
                int k5 = k + rand.nextInt(16);
                int l8 = rand.nextInt(128);
                int j13 = l + rand.nextInt(16);
                (new WorldGenClay(32)).generate(worldObj, rand, k5, l8, j13);
            }

            for (int j2 = 0; j2 < 20; j2++)
            {
                int l5 = k + rand.nextInt(16);
                int i9 = rand.nextInt(128);
                int k13 = l + rand.nextInt(16);
                (new WorldGenMinable(Block.dirt.blockID, 32)).generate(worldObj, rand, l5, i9, k13);
            }

            for (int k2 = 0; k2 < 10; k2++)
            {
                int i6 = k + rand.nextInt(16);
                int j9 = rand.nextInt(128);
                int l13 = l + rand.nextInt(16);
                (new WorldGenMinable(Block.gravel.blockID, 32)).generate(worldObj, rand, i6, j9, l13);
            }

            for (int i3 = 0; i3 < 20; i3++)
            {
                int j6 = k + rand.nextInt(16);
                int k9 = rand.nextInt(128);
                int i14 = l + rand.nextInt(16);
                (new WorldGenMinable(Block.oreCoal.blockID, 16)).generate(worldObj, rand, j6, k9, i14);
            }

            for (int j3 = 0; j3 < 20; j3++)
            {
                int k6 = k + rand.nextInt(16);
                int l9 = rand.nextInt(64);
                int j14 = l + rand.nextInt(16);
                (new WorldGenMinable(Block.oreIron.blockID, 8)).generate(worldObj, rand, k6, l9, j14);
            }

            for (int k3 = 0; k3 < 2; k3++)
            {
                int l6 = k + rand.nextInt(16);
                int i10 = rand.nextInt(32);
                int k14 = l + rand.nextInt(16);
                (new WorldGenMinable(Block.oreGold.blockID, 8)).generate(worldObj, rand, l6, i10, k14);
            }

            for (int l3 = 0; l3 < 8; l3++)
            {
                int i7 = k + rand.nextInt(16);
                int j10 = rand.nextInt(16);
                int l14 = l + rand.nextInt(16);
                (new WorldGenMinable(Block.oreRedstone.blockID, 7)).generate(worldObj, rand, i7, j10, l14);
            }

            for (int i4 = 0; i4 < 1; i4++)
            {
                int j7 = k + rand.nextInt(16);
                int k10 = rand.nextInt(16);
                int i15 = l + rand.nextInt(16);
                (new WorldGenMinable(Block.oreDiamond.blockID, 7)).generate(worldObj, rand, j7, k10, i15);
            }

            for (int j4 = 0; j4 < 1; j4++)
            {
                int k7 = k + rand.nextInt(16);
                int l10 = rand.nextInt(16) + rand.nextInt(16);
                int j15 = l + rand.nextInt(16);
                (new WorldGenMinable(Block.oreLapis.blockID, 6)).generate(worldObj, rand, k7, l10, j15);
            }

            d = 0.5D;
            var k4 = (int) ((mobSpawnerNoise.func_647_a(k*d, l*d)/8D + rand.nextDouble()*4D + 4D)/3D);
            int l7 = 0;
            if (rand.nextInt(10) == 0)
            {
                l7++;
            }
            if (mobspawnerbase == MobSpawnerBase.forest)
            {
                l7 += k4 + 5;
            }
            if (mobspawnerbase == MobSpawnerBase.rainforest)
            {
                l7 += k4 + 5;
            }
            if (mobspawnerbase == MobSpawnerBase.seasonalForest)
            {
                l7 += k4 + 2;
            }
            if (mobspawnerbase == MobSpawnerBase.taiga)
            {
                l7 += k4 + 5;
            }
            if (mobspawnerbase == MobSpawnerBase.desert)
            {
                l7 -= 20;
            }
            if (mobspawnerbase == MobSpawnerBase.tundra)
            {
                l7 -= 20;
            }
            if (mobspawnerbase == MobSpawnerBase.plains)
            {
                l7 -= 20;
            }
            for (int i11 = 0; i11 < l7; i11++)
            {
                int k15 = k + rand.nextInt(16) + 8;
                int j18 = l + rand.nextInt(16) + 8;
                WorldGenerator worldgenerator = mobspawnerbase.getRandomWorldGenForTrees(rand);
                worldgenerator.func_420_a(1.0D, 1.0D, 1.0D);
                worldgenerator.generate(worldObj, rand, k15, worldObj.getHeightValue(k15, j18), j18);
            }

            for (int j11 = 0; j11 < 2; j11++)
            {
                int l15 = k + rand.nextInt(16) + 8;
                int k18 = rand.nextInt(128);
                int i21 = l + rand.nextInt(16) + 8;
                (new WorldGenFlowers(Block.plantYellow.blockID)).generate(worldObj, rand, l15, k18, i21);
            }

            if (rand.nextInt(2) == 0)
            {
                int k11 = k + rand.nextInt(16) + 8;
                int i16 = rand.nextInt(128);
                int l18 = l + rand.nextInt(16) + 8;
                (new WorldGenFlowers(Block.plantRed.blockID)).generate(worldObj, rand, k11, i16, l18);
            }
            if (rand.nextInt(4) == 0)
            {
                int l11 = k + rand.nextInt(16) + 8;
                int j16 = rand.nextInt(128);
                int i19 = l + rand.nextInt(16) + 8;
                (new WorldGenFlowers(Block.mushroomBrown.blockID)).generate(worldObj, rand, l11, j16, i19);
            }
            if (rand.nextInt(8) == 0)
            {
                int i12 = k + rand.nextInt(16) + 8;
                int k16 = rand.nextInt(128);
                int j19 = l + rand.nextInt(16) + 8;
                (new WorldGenFlowers(Block.mushroomRed.blockID)).generate(worldObj, rand, i12, k16, j19);
            }
            for (int j12 = 0; j12 < 10; j12++)
            {
                int l16 = k + rand.nextInt(16) + 8;
                int k19 = rand.nextInt(128);
                int j21 = l + rand.nextInt(16) + 8;
                (new WorldGenReed()).generate(worldObj, rand, l16, k19, j21);
            }

            if (rand.nextInt(32) == 0)
            {
                int k12 = k + rand.nextInt(16) + 8;
                int i17 = rand.nextInt(128);
                int l19 = l + rand.nextInt(16) + 8;
                (new WorldGenPumpkin()).generate(worldObj, rand, k12, i17, l19);
            }
            int l12 = 0;
            if (mobspawnerbase == MobSpawnerBase.desert)
            {
                l12 += 10;
            }
            for (int j17 = 0; j17 < l12; j17++)
            {
                int i20 = k + rand.nextInt(16) + 8;
                int k21 = rand.nextInt(128);
                int k22 = l + rand.nextInt(16) + 8;
                (new WorldGenCactus()).generate(worldObj, rand, i20, k21, k22);
            }

            for (int k17 = 0; k17 < 50; k17++)
            {
                int j20 = k + rand.nextInt(16) + 8;
                int l21 = rand.nextInt(rand.nextInt(120) + 8);
                int l22 = l + rand.nextInt(16) + 8;
                (new WorldGenLiquids(Block.waterStill.blockID)).generate(worldObj, rand, j20, l21, l22);
            }

            for (int l17 = 0; l17 < 20; l17++)
            {
                int k20 = k + rand.nextInt(16) + 8;
                int i22 = rand.nextInt(rand.nextInt(rand.nextInt(112) + 8) + 8);
                int i23 = l + rand.nextInt(16) + 8;
                (new WorldGenLiquids(Block.lavaStill.blockID)).generate(worldObj, rand, k20, i22, i23);
            }

            generatedTemperatures = worldObj.getWorldChunkManager().getTemperatures(generatedTemperatures, k + 8, l + 8,
                                                                                    16, 16);
            for (int i18 = k + 8; i18 < k + 8 + 16; i18++)
            {
                for (int l20 = l + 8; l20 < l + 8 + 16; l20++)
                {
                    int j22 = i18 - (k + 8);
                    int j23 = l20 - (l + 8);
                    int k23 = worldObj.findTopSolidBlock(i18, l20);
                    double d1 = generatedTemperatures[j22*16 + j23] - ((k23 - 64)/64D)*0.29999999999999999D;
                    if (d1 < 0.5D && k23 > 0 && k23 < 128 && worldObj.isAirBlock(i18, k23, l20) &&
                        worldObj.getBlockMaterial(i18, k23 - 1, l20).getIsSolid() &&
                        worldObj.getBlockMaterial(i18, k23 - 1, l20) != Material.ice)
                    {
                        worldObj.setBlockWithNotify(i18, k23, l20, Block.snow.blockID);
                    }
                }
            }

            BlockSand.fallInstantly = false;
        }
 /// <summary>
 /// Custom constructor using a chunk provider and a chunk processor.
 /// </summary>
 /// <param name="chunkProvider"></param>
 /// <param name="chunkProcessor"></param>
 public ChunkOrientedTasklet(IChunkProvider <TI> chunkProvider, IChunkProcessor <TI> chunkProcessor)
 {
     _chunkProvider  = chunkProvider;
     _chunkProcessor = chunkProcessor;
 }
예제 #38
0
 public World(string name, int seed, IChunkProvider chunkProvider) : this(name, chunkProvider)
 {
     Seed         = seed;
     BiomeDiagram = new BiomeMap(Seed);
 }
예제 #39
0
파일: World.cs 프로젝트: Luigifan/TrueCraft
 public World(string name, IChunkProvider chunkProvider)
     : this(name)
 {
     ChunkProvider = chunkProvider;
 }