Java 类net.minecraft.world.gen.feature.WorldGenLiquids 实例源码

项目:MidgarCrusade    文件:BiomeDecoratorMagic.java   
@Override
protected void genDecorations(BiomeGenBase biom)
{
    this.generateOres();
       int i;
       int j;
       int k;

       i = this.treesPerChunk;

       if (this.randomGenerator.nextInt(10) == 0)
       {
           ++i;
       }

       int l;
       int i1;

       for (j = 0; j < i; ++j)
       {
           k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
           l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
           i1 = this.currentWorld.getHeightValue(k, l);
           WorldGenAbstractTree worldgenabstracttree = biom.func_150567_a(this.randomGenerator);
           worldgenabstracttree.setScale(1.0D, 1.0D, 1.0D);

           if (worldgenabstracttree.generate(this.currentWorld, this.randomGenerator, k, i1, l))
           {
               worldgenabstracttree.func_150524_b(this.currentWorld, this.randomGenerator, k, i1, l);
           }
       }

       for (j = 0; j < this.berry_per_chunk; ++j)
       {
           k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
           l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
           i1 = nextInt(this.currentWorld.getHeightValue(k, l) + 32);
           if (this.randomGenerator.nextInt(2) == 0)
            this.gen_red_berry.generate(this.currentWorld, this.randomGenerator, k, i1, l);
           else
            this.gen_yellow_berry.generate(this.currentWorld, this.randomGenerator, k, i1, l);
       }

       k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
       l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
       i1 = 10;
       while (this.currentWorld.getBlock(k, i1, l) == Blocks.air && i1 < 120)
        i1++;

       for (j = 0; j < this.grassPerChunk; ++j)
       {
           k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
           l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
           i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2);
           WorldGenerator worldgenerator = biom.getRandomWorldGenForGrass(this.randomGenerator);
           worldgenerator.generate(this.currentWorld, this.randomGenerator, k, i1, l);
       }

       if (this.generateLakes)
       {
           for (j = 0; j < 50; ++j)
           {
               k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
               l = this.randomGenerator.nextInt(this.randomGenerator.nextInt(248) + 8);
               i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
               (new WorldGenLiquids(Blocks.flowing_water)).generate(this.currentWorld, this.randomGenerator, k, l, i1);
           }

           for (j = 0; j < 20; ++j)
           {
               k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
               l = this.randomGenerator.nextInt(this.randomGenerator.nextInt(this.randomGenerator.nextInt(240) + 8) + 8);
               i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
               (new WorldGenLiquids(Blocks.flowing_lava)).generate(this.currentWorld, this.randomGenerator, k, l, i1);
           }
       }

       MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z));
   }