Exemplo n.º 1
0
  private void generateMarsh(Random rand, int x, int z, World world) {
    for (int i = 0; i < 127; i++) {
      final int x1 = x + rand.nextInt(16) + 8;
      final int z1 = z + rand.nextInt(16) + 8;
      genMarsh.generate(world, rand, x1, 0, z1);
    }

    for (int i = 0; i < 256; i++) {
      final int x1 = x + rand.nextInt(1) + 8;
      final int z1 = z + rand.nextInt(1) + 8;
      genDirtBed.generate(world, rand, x1, 0, z1);
    }
  }
Exemplo n.º 2
0
  private void runGenerator(
      WorldGenerator generator,
      World world,
      Random rand,
      int chunk_X,
      int chunk_Z,
      int chanceToSpawn,
      int minHeight,
      int maxHeight) {

    if (minHeight < 0 || maxHeight > 256 || minHeight > maxHeight)
      throw new IllegalArgumentException("FUUUUUUUUUCK YOU STEVEN!!!");
    /*"Illegal Height Arguments for WorldGenerator" side note: who's steven?*/

    int heightDiff = maxHeight - minHeight + 1;
    for (int i = 0; i < chanceToSpawn; i++) {
      int x = chunk_X * 16 + rand.nextInt(16);
      int y = minHeight + rand.nextInt(heightDiff);
      int z = chunk_Z * 16 + rand.nextInt(16);
      // generator.generate(world, rand, new BlockPos(x, y, z));
      if (world
          .getBiomeGenForCoords(new BlockPos(x, y, z))
          .equals(biomeCrystal.getBiome(configFile.BIOMECRYSTALBLACK))) {
        generator.generate(world, rand, new BlockPos(x, y, z));
      }
    }
  }
  @Override
  public void generate(
      Random rand,
      int chunkX,
      int chunkZ,
      World world,
      IChunkProvider chunkGenerator,
      IChunkProvider chunkProvider) {
    chunkX = chunkX << 4;
    chunkZ = chunkZ << 4;
    final BiomeGenBase biome = world.getBiomeGenForCoords(chunkX, chunkZ);

    if (BiomeSettings.GREENSWAMP.getBiome().isPresent()
            && biome == BiomeSettings.GREENSWAMP.getBiome().get()
        || BiomeSettings.MOUNTAINRIDGE.getBiome().isPresent()
            && biome == BiomeSettings.MOUNTAINRIDGE.getBiome().get()
        || BiomeSettings.REDWOODLUSH.getBiome().isPresent()
            && biome == BiomeSettings.REDWOODLUSH.getBiome().get()
        || BiomeSettings.WOODLANDS.getBiome().isPresent()
            && biome == BiomeSettings.WOODLANDS.getBiome().get())
      for (int i = 0; i < 2; i++) {
        final int x = chunkX + rand.nextInt(16) + 8;
        final int y = rand.nextInt(128);
        final int z = chunkZ + rand.nextInt(16) + 8;
        leafPileGen.generate(world, rand, x, y, z);
      }
  }
Exemplo n.º 4
0
  private void runGenerator(
      WorldGenerator generator,
      World world,
      Random rand,
      int chunk_X,
      int chunk_Z,
      float chancesToSpawn,
      int numberOfBlocks,
      int minHeight,
      int maxHeight) {
    if (minHeight < 0 || maxHeight > 256 || minHeight > maxHeight)
      throw new IllegalArgumentException("Illegal Height Arguments for WorldGenerator");

    int temp = 0;
    int heightDiff = maxHeight - minHeight + 1;
    if (chancesToSpawn > rand.nextFloat()) {
      for (int i = 0; i < numberOfBlocks; i++) {
        // middle of chunk
        int x = chunk_X * 16 + 8;
        int y = minHeight + rand.nextInt(heightDiff);
        int z = chunk_Z * 16 + 8;
        if (generator.generate(world, rand, new BlockPos(x, y, z))) {
          countGems++;
          temp++;
        }
      }
      //			System.out.println("In chunk number " + countChunks + " with (" + chunk_X + "," + chunk_Z
      // + ") generated " + temp + " gems (Total: " + countGems + ").");
    }
    countChunks++;
  }
 void genOre(int amountPerChunk, WorldGenerator worldGenerator, int minY, int maxY) {
   for (int var5 = 0; var5 < amountPerChunk; ++var5) {
     final int var6 = this.chunkX + this.randomGenerator.nextInt(16);
     final int var7 = this.randomGenerator.nextInt(maxY - minY) + minY;
     final int var8 = this.chunkZ + this.randomGenerator.nextInt(16);
     worldGenerator.generate(this.worldObj, this.randomGenerator, var6, var7, var8);
   }
 }
 protected void genStandardOre1(int par1, WorldGenerator par2WorldGenerator, int par3, int par4) {
   for (int var5 = 0; var5 < par1; ++var5) {
     final int var6 = this.chunk_X + this.randomGenerator.nextInt(16);
     final int var7 = this.randomGenerator.nextInt(par4 - par3) + par3;
     final int var8 = this.chunk_Z + this.randomGenerator.nextInt(16);
     par2WorldGenerator.generate(this.currentWorld, this.randomGenerator, var6, var7, var8);
   }
 }
 protected void generateOre(
     int amountPerChunk, WorldGenerator worldGenerator, int minY, int maxY) {
   for (int var5 = 0; var5 < amountPerChunk; ++var5) {
     final int var6 = this.chunkX + this.rand.nextInt(16);
     final int var7 = this.rand.nextInt(maxY - minY) + minY;
     final int var8 = this.chunkZ + this.rand.nextInt(16);
     worldGenerator.generate(this.currentWorld, this.rand, var6, var7, var8);
   }
 }
Exemplo n.º 8
0
  @Override
  public void func_149853_b(World world, Random rand, int x, int y, int z) {
    if (rand.nextBoolean()) return;
    int meta = world.getBlockMetadata(x, y, z);
    Object object = null;

    switch (meta) {
      case 0:
        if (rand.nextBoolean()) {
          object = new WorldGenPaintedTree(true, rand.nextBoolean());
        } else {
          object = new WorldGenLargePaintedTree(true, rand.nextInt(3) + 4, 10);
        }
        break;
      case 1:
        object = new WorldGenBleachedOakTree(true, true);
        break;
      case 2:
        object = new WorldGenAshenTree(true);
        break;
      case 3:
        object = new WorldGenHallowedTree(true);
        break;
      case 4:
        object = new WorldGenDarkForestTree();
        break;
      default:
        return;
    }

    world.setBlockToAir(x, y, z);

    if (object instanceof WorldGenerator) {
      WorldGenerator worldGen = (WorldGenerator) object;
      if (!worldGen.generate(world, rand, x, y - 1, z)) {
        world.setBlock(x, y, z, this, meta, 2);
      }
    }
  }
 /**
  * Standard ore generation helper. Generates Lapis Lazuli.
  *
  * @see net.minecraft.world.biome.BiomeDecorator
  */
 protected void genStandardOre2(
     int numBlocks,
     WorldGenerator oreGen,
     int minY,
     int maxY,
     World worldObj,
     Random rand,
     int chunkX,
     int chunkZ) {
   for (int l = 0; l < numBlocks; ++l) {
     int i1 = chunkX + rand.nextInt(16);
     int j1 = rand.nextInt(maxY) + rand.nextInt(maxY) + (minY - maxY);
     int k1 = chunkZ + rand.nextInt(16);
     oreGen.generate(worldObj, rand, i1, j1, k1);
   }
 }
Exemplo n.º 10
0
  private void addOre(
      WorldGenerator generator,
      World world,
      Random rand,
      int chunk_X,
      int chunk_Z,
      int chancesToSpawn,
      int minHeight,
      int maxHeight) {
    if (minHeight < 0 || maxHeight > 256 || minHeight > maxHeight)
      throw new IllegalArgumentException("Illegal Height Arguments for WorldGenerator");

    int heightDiff = maxHeight - minHeight + 1;
    for (int i = 0; i < chancesToSpawn; i++) {
      int x = chunk_X * 16 + rand.nextInt(16);
      int y = minHeight + rand.nextInt(heightDiff);
      int z = chunk_Z * 16 + rand.nextInt(16);
      generator.generate(world, rand, new BlockPos(x, y, z));
    }
  }
Exemplo n.º 11
0
  @Override
  public boolean generateFeature(Random random, int chunkX, int chunkZ, World world) {

    int blockX = chunkX * 16;
    int blockZ = chunkZ * 16;

    boolean generated = false;
    for (int i = 0; i < count; i++) {
      int x = blockX + random.nextInt(16);
      int y =
          maxVar <= 1 ? meanY : (random.nextInt(maxVar) + random.nextInt(maxVar) + meanY - maxVar);
      int z = blockZ + random.nextInt(16);
      if (!canGenerateInBiome(world, x, z, random)) {
        continue;
      }

      generated |= worldGen.generate(world, random, x, y, z);
    }
    return generated;
  }
  @Override
  public void rDecorate(
      World world,
      Random rand,
      int chunkX,
      int chunkY,
      OpenSimplexNoise simplex,
      CellNoise cell,
      float strength,
      float river) {

    /**
     * Using rDecorateSeedBiome() to partially decorate the biome? If so, then comment out this
     * method.
     */
    rOreGenSeedBiome(world, rand, chunkX, chunkY, simplex, cell, strength, river, baseBiome);

    // boulders
    for (int l = 0; l < 3f * strength; ++l) {
      int i1 = chunkX + rand.nextInt(16) + 8;
      int j1 = chunkY + rand.nextInt(16) + 8;
      int k1 = world.getHeightValue(i1, j1);

      if (k1 < 95 && rand.nextInt(16) == 0) {
        (new WorldGenBlob(Blocks.mossy_cobblestone, 0, rand)).generate(world, rand, i1, k1, j1);
      }
    }

    // trees
    float l = simplex.noise2(chunkX / 100f, chunkY / 100f) * 6f + 0.8f;
    for (int b1 = 0; b1 < l * 4f * strength; b1++) {
      int j6 = chunkX + rand.nextInt(16) + 8;
      int k10 = chunkY + rand.nextInt(16) + 8;
      int z52 = world.getHeightValue(j6, k10);

      if (rand.nextInt(24) == 0) {
        // WorldGenerator worldgenerator = new WorldGenTreeSpruceSmall(1 + rand.nextInt(2));
        WorldGenerator worldgenerator = new WorldGenTreePineEuro();
        worldgenerator.setScale(1.0D, 1.0D, 1.0D);
        worldgenerator.generate(world, rand, j6, z52, k10);
      }
    }

    if (l > 0f && rand.nextInt(6) == 0) {
      int x22 = chunkX + rand.nextInt(16) + 8;
      int z22 = chunkY + rand.nextInt(16) + 8;
      int y22 = world.getHeightValue(x22, z22);
      (new WorldGenLog(1, 3 + rand.nextInt(4), false)).generate(world, rand, x22, y22, z22);
    }

    for (int b = 0; b < 2f * strength; b++) {
      int i1 = chunkX + rand.nextInt(16) + 8;
      int j1 = chunkY + rand.nextInt(16) + 8;
      int k1 = world.getHeightValue(i1, j1);
      if (rand.nextInt(10) == 0) {
        (new WorldGenTreeShrub(rand.nextInt(5) + 4, rand.nextInt(2), rand.nextInt(2)))
            .generate(world, rand, i1, k1, j1);
      } else {
        (new WorldGenTreeShrub(rand.nextInt(4) + 1, rand.nextInt(2), rand.nextInt(2)))
            .generate(world, rand, i1, k1, j1);
      }
    }

    if (rand.nextInt((int) (3f / strength)) == 0) {
      int k15 = chunkX + rand.nextInt(16) + 8;
      int k17 = rand.nextInt(64) + 64;
      int k20 = chunkY + rand.nextInt(16) + 8;

      if (rand.nextBoolean()) {
        (new WorldGenFlowers(Blocks.brown_mushroom)).generate(world, rand, k15, k17, k20);
      } else {
        (new WorldGenFlowers(Blocks.red_mushroom)).generate(world, rand, k15, k17, k20);
      }
    }

    if (rand.nextInt((int) (20f / strength)) == 0) {
      int j16 = chunkX + rand.nextInt(16) + 8;
      int j18 = rand.nextInt(128);
      int j21 = chunkY + rand.nextInt(16) + 8;
      (new WorldGenPumpkin()).generate(world, rand, j16, j18, j21);
    }

    for (int l14 = 0; l14 < 10f * strength; l14++) {
      int l19 = chunkX + rand.nextInt(16) + 8;
      int k22 = rand.nextInt(128);
      int j24 = chunkY + rand.nextInt(16) + 8;
      (new WorldGenGrass(Blocks.tallgrass, 1)).generate(world, rand, l19, k22, j24);
    }
  }
  @Override
  public void rDecorate(
      World world,
      Random rand,
      int chunkX,
      int chunkY,
      OpenSimplexNoise simplex,
      CellNoise cell,
      float strength,
      float river) {

    /**
     * Using rDecorateSeedBiome() to partially decorate the biome? If so, then comment out this
     * method.
     */
    // rOreGenSeedBiome(world, rand, chunkX, chunkY, simplex, cell, strength, river, baseBiome);

    float l = simplex.noise2(chunkX / 80f, chunkY / 80f) * 60f - 15f;
    // float l = simplex.noise3(chunkX / 80f, chunkY / 80f, simplex.noise2(chunkX / 60f, chunkY /
    // 60f)) * 60f - 15f;

    for (int l1 = 0; l1 < 2f * strength; ++l1) {
      int i1 = chunkX + rand.nextInt(16) + 8;
      int j1 = chunkY + rand.nextInt(16) + 8;
      int k1 = world.getHeightValue(i1, j1);

      if (k1 < 80 && rand.nextInt(20) == 0) {
        if (rand.nextInt(8) != 0) {
          (new WorldGenBlob(Blocks.mossy_cobblestone, 0, rand)).generate(world, rand, i1, k1, j1);
        } else {
          (new WorldGenBlob(Blocks.web, 0, rand)).generate(world, rand, i1, k1, j1);
        }
      }
    }

    if (l > 0f) {
      for (int b2 = 0; b2 < 24f * strength; b2++) {
        int j6 = chunkX + rand.nextInt(16) + 8;
        int k10 = chunkY + rand.nextInt(16) + 8;
        int z52 = world.getHeightValue(j6, k10);

        if (z52 < 120) {
          WorldGenerator worldgenerator =
              new WorldGenTreeMangrove(
                  Blocks.log2,
                  1,
                  Blocks.leaves2,
                  1,
                  9 + rand.nextInt(5),
                  3 + rand.nextInt(2),
                  13f,
                  3,
                  0.32f,
                  0.1f);
          worldgenerator.setScale(1.0D, 1.0D, 1.0D);
          worldgenerator.generate(world, rand, j6, z52, k10);
        }
      }
    }

    if (rand.nextInt((int) (10f / strength)) == 0) {
      int x22 = chunkX + rand.nextInt(16) + 8;
      int z22 = chunkY + rand.nextInt(16) + 8;
      int y22 = world.getHeightValue(x22, z22);
      if (y22 < 100) {
        (new WorldGenLog(Blocks.log2, 1, Blocks.leaves2, -1, 9 + rand.nextInt(5)))
            .generate(world, rand, x22, y22, z22);
      }
    }

    for (int f24 = 0; f24 < strength; f24++) {
      int i1 = chunkX + rand.nextInt(16) + 8;
      int j1 = chunkY + rand.nextInt(16) + 8;
      int k1 = world.getHeightValue(i1, j1);
      if (k1 < 110) {
        (new WorldGenTreeShrub(rand.nextInt(4) + 1, 0, rand.nextInt(3)))
            .generate(world, rand, i1, k1, j1);
      }
    }

    if (TerrainGen.decorate(world, rand, chunkX, chunkY, GRASS)) {

      for (int l14 = 0; l14 < 10f * strength; l14++) {
        int l19 = chunkX + rand.nextInt(16) + 8;
        int k22 = rand.nextInt(128);
        int j24 = chunkY + rand.nextInt(16) + 8;
        int grassMeta;

        if (rand.nextInt(16) == 0) {
          grassMeta = 0;
        } else {
          grassMeta = 1;
        }

        (new WorldGenGrass(Blocks.tallgrass, grassMeta)).generate(world, rand, l19, k22, j24);
      }

      for (int l14 = 0; l14 < 8f * strength; l14++) {
        int l19 = chunkX + rand.nextInt(16) + 8;
        int k22 = rand.nextInt(128);
        int j24 = chunkY + rand.nextInt(16) + 8;

        if (rand.nextInt(6) == 0) {
          (new WorldGenGrass(Blocks.double_plant, RandomUtil.getRandomInt(rand, 2, 3)))
              .generate(world, rand, l19, k22, j24);
        }
      }

      for (int l14 = 0; l14 < 4f * strength; l14++) {
        int l19 = chunkX + rand.nextInt(16) + 8;
        int k22 = rand.nextInt(128);
        int j24 = chunkY + rand.nextInt(16) + 8;
        int grassMeta;

        if (rand.nextInt(16) == 0) {
          grassMeta = 0;
        } else {
          grassMeta = RandomUtil.getRandomInt(rand, 1, 2);
        }

        (new WorldGenGrass(Blocks.tallgrass, grassMeta)).generate(world, rand, l19, k22, j24);
      }
    }

    rDecorateSeedBiome(world, rand, chunkX, chunkY, simplex, cell, strength, river, baseBiome);

    int k15 = chunkX + rand.nextInt(16) + 8;
    int k20 = chunkY + rand.nextInt(16) + 8;
    int k17 = world.getHeightValue(k15, k20);

    if (rand.nextBoolean()) {
      (new WorldGenFlowers(Blocks.brown_mushroom)).generate(world, rand, k15, k17, k20);
    } else {
      (new WorldGenFlowers(Blocks.red_mushroom)).generate(world, rand, k15, k17, k20);
    }
  }
  @Override
  protected void genDecorations(BiomeGenBase p_150513_1_) {
    MinecraftForge.EVENT_BUS.post(
        new DecorateBiomeEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z));
    this.generateOres();
    int i;
    int j;
    int k;

    boolean doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SAND);
    for (i = 0; doGen && i < this.sandPerChunk2; ++i) {
      j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
      k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
      this.sandGen.generate(
          this.currentWorld,
          this.randomGenerator,
          j,
          this.currentWorld.getTopSolidOrLiquidBlock(j, k),
          k);
    }

    doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, CLAY);
    for (i = 0; doGen && i < this.clayPerChunk; ++i) {
      j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
      k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
      this.clayGen.generate(
          this.currentWorld,
          this.randomGenerator,
          j,
          this.currentWorld.getTopSolidOrLiquidBlock(j, k),
          k);
    }

    doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SAND_PASS2);
    for (i = 0; doGen && i < this.sandPerChunk; ++i) {
      j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
      k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
      this.gravelAsSandGen.generate(
          this.currentWorld,
          this.randomGenerator,
          j,
          this.currentWorld.getTopSolidOrLiquidBlock(j, k),
          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;

      for (i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2);
          i1 > 0 && this.currentWorld.isAirBlock(k, i1 - 1, l);
          --i1) {;
      }

      // if(randomGenerator.nextInt() == 0) {
      WorldGenTrees worldGenTree = new WorldGenTrees(false, 6, 0, 0, true);
      worldGenTree.setScale(1.0D, 1.0D, 1.0D);

      worldGenTree.generate(this.currentWorld, this.randomGenerator, k, i1, l);
      /*} else {
          treeGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
      }*/
    }

    /*
     * doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X,
     * chunk_Z, TREE); for (j = 0; doGen && 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 =
     * p_150513_1_.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); } }
     */

    /*
     * doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X,
     * chunk_Z, BIG_SHROOM); for (j = 0; doGen && j <
     * this.bigMushroomsPerChunk; ++j) { k = this.chunk_X +
     * this.randomGenerator.nextInt(16) + 8; l = this.chunk_Z +
     * this.randomGenerator.nextInt(16) + 8;
     * this.bigMushroomGen.generate(this.currentWorld, this.randomGenerator,
     * k, this.currentWorld.getHeightValue(k, l), l); }
     */

    /*
     * doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X,
     * chunk_Z, FLOWERS); for (j = 0; doGen && j < this.flowersPerChunk;
     * ++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); String s =
     * p_150513_1_.func_150572_a(this.randomGenerator, k, i1, l);
     * BlockFlower blockflower = BlockFlower.func_149857_e(s);
     *
     * if (blockflower.getMaterial() != Material.air) {
     * this.yellowFlowerGen.func_150550_a(blockflower,
     * BlockFlower.func_149856_f(s));
     * this.yellowFlowerGen.generate(this.currentWorld,
     * this.randomGenerator, k, i1, l); } }
     */

    if (this.randomGenerator.nextInt(4) == 0) {
      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 = new WorldGenShrub(0, 0);
      worldgenerator.generate(this.currentWorld, this.randomGenerator, k, i1, l);
    }

    doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, LILYPAD);
    for (j = 0; doGen && j < this.waterlilyPerChunk; ++j) {
      k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
      l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;

      for (i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2);
          i1 > 0 && this.currentWorld.isAirBlock(k, i1 - 1, l);
          --i1) {;
      }

      this.waterlilyGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
    }

    doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SHROOM);
    for (j = 0; doGen && j < 2; ++j) {
      if (this.randomGenerator.nextInt(4) == 0) {
        k = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
        l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
        i1 = this.currentWorld.getHeightValue(k, l);
        this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
      }

      if (this.randomGenerator.nextInt(8) == 0) {
        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);
        this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
      }
    }

    if (doGen && this.randomGenerator.nextInt(4) == 0) {
      j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
      k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
      l = nextInt(this.currentWorld.getHeightValue(j, k) * 2);
      this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, j, l, k);
    }

    if (doGen && this.randomGenerator.nextInt(8) == 0) {
      j = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
      k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
      l = nextInt(this.currentWorld.getHeightValue(j, k) * 2);
      this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, j, l, k);
    }

    doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, REED);
    for (j = 0; doGen && j < this.reedsPerChunk; ++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);
      this.reedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
    }

    for (j = 0; doGen && j < 10; ++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);
      this.reedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
    }

    /*
     * doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X,
     * chunk_Z, PUMPKIN); if (doGen && this.randomGenerator.nextInt(32) ==
     * 0) { j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; k =
     * this.chunk_Z + this.randomGenerator.nextInt(16) + 8; l =
     * nextInt(this.currentWorld.getHeightValue(j, k) * 2); (new
     * WorldGenPumpkin()).generate(this.currentWorld, this.randomGenerator,
     * j, l, k); }
     */

    doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, CACTUS);
    for (j = 0; doGen && j < this.cactiPerChunk; ++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);
      this.cactusGen.generate(this.currentWorld, this.randomGenerator, k, i1, l);
    }

    doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, LAKE);
    if (doGen && 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(ZombieModpackWorld.finiteWaterSolid))
            .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);
      }
    }

    doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, GRASS);
    for (j = 0; doGen && j < 10; ++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);

      if (this.randomGenerator.nextInt(4) == 0) {
        new WorldGenGrass().generate(currentWorld, randomGenerator, k, i1, l);
      }
    }

    doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, GRASS);
    for (j = 0; doGen && j < 10; ++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 = p_150513_1_.getRandomWorldGenForGrass(this.randomGenerator);
      worldgenerator.generate(this.currentWorld, this.randomGenerator, k, i1, l);
    }

    MinecraftForge.EVENT_BUS.post(
        new DecorateBiomeEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z));
  }
  @Override
  public void rDecorate(
      World world,
      Random rand,
      int chunkX,
      int chunkY,
      PerlinNoise perlin,
      CellNoise cell,
      float strength,
      float river) {
    if (rand.nextInt((int) (15f / strength)) == 0) {
      int i2 = chunkX + rand.nextInt(16) + 8;
      int i8 = chunkY + rand.nextInt(16) + 8;
      int l4 = world.getHeightValue(i2, i8);
      if (l4 > 63 && l4 < 105) {
        (new WorldGenLakes(Blocks.water)).generate(world, rand, i2, l4, i8);
      }
    }

    for (int l = 0; l < 6f * strength; ++l) {
      int i1 = chunkX + rand.nextInt(16) + 8;
      int j1 = chunkY + rand.nextInt(16) + 8;
      int k1 = world.getHeightValue(i1, j1);
      if (k1 < 95 && (k1 < 64 || rand.nextInt(15) == 0)) {
        (new DecoBlob(Blocks.mossy_cobblestone, 0)).generate(world, rand, i1, k1, j1);
      }
    }

    if (rand.nextInt((int) (25f / strength)) == 0) {
      int j16 = chunkX + rand.nextInt(16) + 8;
      int j18 = rand.nextInt(128);
      int j21 = chunkY + rand.nextInt(16) + 8;
      (new WorldGenPumpkin()).generate(world, rand, j16, j18, j21);
    }

    for (int f23 = 0; f23 < 2f * strength; f23++) {
      int j15 = chunkX + rand.nextInt(16) + 8;
      int j17 = rand.nextInt(128);
      int j20 = chunkY + rand.nextInt(16) + 8;
      (new DecoFlowers(new int[] {9, 0, 3})).generate(world, rand, j15, j17, j20);
    }

    for (int l14 = 0; l14 < 3f * strength; l14++) {
      int l19 = chunkX + rand.nextInt(16) + 8;
      int k22 = rand.nextInt(128);
      int j24 = chunkY + rand.nextInt(16) + 8;
      (new DecoGrass(Blocks.tallgrass, 1)).generate(world, rand, l19, k22, j24);
    }

    // trees
    float l = perlin.noise2(chunkX / 100f, chunkY / 100f) * 5f - 0.5f;
    for (int b1 = 0; b1 < l * 2f * strength; b1++) {
      int j6 = chunkX + rand.nextInt(16) + 8;
      int k10 = chunkY + rand.nextInt(16) + 8;
      int z52 = world.getHeightValue(j6, k10);

      if (z52 < 75) {
        WorldGenerator worldgenerator =
            rand.nextInt(8) != 0
                ? new DecoSmallSpruce(1 + rand.nextInt(2))
                : new DecoSmallPine(1 + rand.nextInt(3), 2 + rand.nextInt(4));
        worldgenerator.setScale(1.0D, 1.0D, 1.0D);
        worldgenerator.generate(world, rand, j6, z52, k10);
      } else if (z52 < 110) {
        WorldGenerator worldgenerator =
            rand.nextInt(4) != 0
                ? new DecoSmallSpruce(rand.nextInt(2))
                : new DecoSmallPine(2 + rand.nextInt(2), 4 + rand.nextInt(5));
        worldgenerator.setScale(1.0D, 1.0D, 1.0D);
        worldgenerator.generate(world, rand, j6, z52, k10);
      }
    }

    if (l > -0.4f) {
      for (int b = 0; b < 2f * strength; b++) {
        int i1 = chunkX + rand.nextInt(16) + 8;
        int j1 = chunkY + rand.nextInt(16) + 8;
        int k1 = world.getHeightValue(i1, j1);
        if (k1 < 110) {
          if (rand.nextInt(10) == 0) {
            (new DecoShrub(rand.nextInt(5) + 4, rand.nextInt(2), rand.nextInt(2)))
                .generate(world, rand, i1, k1, j1);
          } else {
            (new DecoShrub(rand.nextInt(4) + 1, rand.nextInt(2), rand.nextInt(2)))
                .generate(world, rand, i1, k1, j1);
          }
        }
      }
    }
  }
  @Override
  public void populate(IChunkProvider ichunkprovider, int chunkX, int chunkZ) {
    BlockSand.fallInstantly = true;
    int i = chunkX * 16;
    int j = chunkZ * 16;

    if (dimension == Dimension.nether) {
      // this.genNetherBridge.generateStructuresInChunk(worldObj, rand, chunkX, chunkZ);
    }

    BiomeGenBase biomegenbase = worldObj.getBiomeGenForCoords(i + 16, j + 16);
    rand.setSeed(worldObj.getSeed());
    long l = (rand.nextLong() / 2L) * 2L + 1L;
    long l1 = (rand.nextLong() / 2L) * 2L + 1L;
    rand.setSeed((long) chunkX * l + (long) chunkZ * l1 ^ worldObj.getSeed());
    boolean flag = false;

    if (!(biomegenbase instanceof BiomeGenMainDimension)) {
      System.out.println("Illegal biome generated at " + i + ", " + j);
      BlockSand.fallInstantly = false;
      return;
    }
    BiomeGenMainDimension biome = (BiomeGenMainDimension) biomegenbase;
    Iterator<Map.Entry<WorldGenerator, Integer>> iterator;
    WorldGenerator worldgenerator;
    int count;
    Map.Entry entry;
    int x;
    int y;
    int z;
    for (HashMap<WorldGenerator, Integer> map : biome.worldGen) {
      iterator = map.entrySet().iterator();
      while (iterator.hasNext()) {
        entry = iterator.next();
        worldgenerator = (WorldGenerator) entry.getKey();
        count = (Integer) entry.getValue();
        if (worldgenerator != null && count != 0) {
          if (count < 0) {
            if (rand.nextInt(-count) == 0) {
              x = i + rand.nextInt(16) + 8;
              y = rand.nextInt(dimension.heightLimit);
              z = j + rand.nextInt(16) + 8;
              worldgenerator.generate(worldObj, rand, x, y, z);
            }
          } else {
            for (int count1 = 0; count1 < count; count1++) {
              x = i + rand.nextInt(16) + 8;
              y = rand.nextInt(dimension.heightLimit);
              z = j + rand.nextInt(16) + 8;
              worldgenerator.generate(worldObj, rand, x, y, z);
            }
          }
        }
      }
    }

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

    BlockSand.fallInstantly = false;
  }
  public void growTree(World world, int x, int y, int z, Random rand) {
    final int metadata = unmarkedMetadata(world.getBlockMetadata(x, y, z));
    WorldGenerator tree = null;
    int x1 = 0;
    int z1 = 0;
    boolean isHuge = false;

    final boolean isForestryFarmed = world.getBlockId(x, y - 1, z) == forestrySoilID;

    if (metadata == BlockType.BROWN.metadata()) {
      if (rand.nextInt(20) == 0) tree = new WorldGenBigAutumnTree(true, AutumnTreeType.BROWN);
      else tree = new WorldGenAutumnTree(true, AutumnTreeType.BROWN);
    } else if (metadata == BlockType.ORANGE.metadata()) {
      if (rand.nextInt(20) == 0) tree = new WorldGenBigAutumnTree(true, AutumnTreeType.ORANGE);
      else tree = new WorldGenAutumnTree(true, AutumnTreeType.ORANGE);
    } else if (metadata == BlockType.PURPLE.metadata()) {
      if (rand.nextInt(20) == 0) tree = new WorldGenBigAutumnTree(true, AutumnTreeType.PURPLE);
      else tree = new WorldGenAutumnTree(true, AutumnTreeType.PURPLE);
    } else if (metadata == BlockType.YELLOW.metadata()) {
      if (rand.nextInt(20) == 0) tree = new WorldGenBigAutumnTree(true, AutumnTreeType.YELLOW);
      else tree = new WorldGenAutumnTree(true, AutumnTreeType.YELLOW);
    } else if (metadata == BlockType.ACACIA.metadata()) tree = new WorldGenAcacia(true);
    else {
      // Check for 2x2 firs and redwoods
      for (x1 = 0; x1 >= -1; --x1) {
        for (z1 = 0; z1 >= -1; --z1)
          if (isSameSapling(world, x + x1, y, z + z1, metadata)
              && isSameSapling(world, x + x1 + 1, y, z + z1, metadata)
              && isSameSapling(world, x + x1, y, z + z1 + 1, metadata)
              && isSameSapling(world, x + x1 + 1, y, z + z1 + 1, metadata)) {
            if (metadata == BlockType.FIR.metadata()) tree = new WorldGenFirTreeHuge(true);
            else tree = new WorldGenRedwood(true);
            isHuge = true;
            break;
          }
        if (tree != null) break;
      }
      if (tree == null && metadata == BlockType.FIR.metadata()) {
        // Single fir sapling generates 1x1 tree
        z1 = 0;
        x1 = 0;
        tree = new WorldGenFirTree(true);
      }
    }

    if (tree != null) {
      if (isHuge) {
        world.setBlock(x + x1, y, z + z1, 0);
        world.setBlock(x + x1 + 1, y, z + z1, 0);
        world.setBlock(x + x1, y, z + z1 + 1, 0);
        world.setBlock(x + x1 + 1, y, z + z1 + 1, 0);
      } else world.setBlock(x, y, z, 0);

      final int offset = isHuge ? 1 : 0;

      if (!tree.generate(world, rand, x + x1 + offset, y, z + z1 + offset)) {
        if (isHuge) {
          world.setBlockAndMetadata(x + x1, y, z + z1, blockID, metadata);
          world.setBlockAndMetadata(x + x1 + 1, y, z + z1, blockID, metadata);
          world.setBlockAndMetadata(x + x1, y, z + z1 + 1, blockID, metadata);
          world.setBlockAndMetadata(x + x1 + 1, y, z + z1 + 1, blockID, metadata);
        } else world.setBlockAndMetadata(x, y, z, blockID, metadata);
      } else if (isForestryFarmed)
        if (isHuge) {
          world.setBlock(x + x1, y - 1, z + z1, Block.sand.blockID);
          world.setBlock(x + x1 + 1, y - 1, z + z1, Block.sand.blockID);
          world.setBlock(x + x1, y - 1, z + z1 + 1, Block.sand.blockID);
          world.setBlock(x + x1 + 1, y - 1, z + z1 + 1, Block.sand.blockID);
        } else world.setBlock(x, y - 1, z, Block.sand.blockID);
    }
  }
  @Override
  public void rDecorate(
      World world,
      Random rand,
      int chunkX,
      int chunkY,
      OpenSimplexNoise simplex,
      CellNoise cell,
      float strength,
      float river) {

    for (int i23 = 0; i23 < 1; i23++) {
      int i1 = chunkX + rand.nextInt(16) + 8;
      int j1 = chunkY + rand.nextInt(16) + 8;
      int k1 = world.getHeightValue(i1, j1);

      if (k1 < 80) {
        (new WorldGenBlockBlob(Blocks.cobblestone, 0)).generate(world, rand, i1, k1, j1);
      }
    }

    if (river > 0.7f) {
      if (river > 0.86f) {
        for (int b33 = 0; b33 < 10f * strength; b33++) {
          int j6 = chunkX + rand.nextInt(16) + 8;
          int k10 = chunkY + rand.nextInt(16) + 8;
          int z52 = world.getHeightValue(j6, k10);

          if (z52 < 100f || (z52 < 120f && rand.nextInt(10) == 0)) {
            WorldGenerator worldgenerator =
                rand.nextInt(4) != 0 ? new WorldGenShrub(0, 0) : new WorldGenTreeSavanna(1);
            worldgenerator.setScale(1.0D, 1.0D, 1.0D);
            worldgenerator.generate(world, rand, j6, z52, k10);
          }
        }
      }

      for (int k18 = 0; k18 < 12f * strength; k18++) {
        int k21 = chunkX + rand.nextInt(16) + 8;
        int j23 = rand.nextInt(160);
        int k24 = chunkY + rand.nextInt(16) + 8;
        if (j23 < 120f) {
          (new WorldGenCacti(false)).generate(world, rand, k21, j23, k24);
        }
      }

      for (int f25 = 0; f25 < 2f * strength; f25++) {
        int i18 = chunkX + rand.nextInt(16) + 8;
        int i23 = chunkY + rand.nextInt(16) + 8;
        (new WorldGenReed()).generate(world, rand, i18, 60 + rand.nextInt(8), i23);
      }

      if (rand.nextInt(28) == 0) {
        int j16 = chunkX + rand.nextInt(16) + 8;
        int j18 = rand.nextInt(128);
        int j21 = chunkY + rand.nextInt(16) + 8;
        (new WorldGenPumpkin()).generate(world, rand, j16, j18, j21);
      }

      for (int f23 = 0; f23 < 3; f23++) {
        int j15 = chunkX + rand.nextInt(16) + 8;
        int j17 = rand.nextInt(128);
        int j20 = chunkY + rand.nextInt(16) + 8;
        (new WorldGenFlowers(new int[] {9, 9, 9, 9, 3, 3, 3, 3, 3, 2, 2, 2, 11, 11, 11}))
            .generate(world, rand, j15, j17, j20);
      }

      for (int l14 = 0; l14 < 15; l14++) {
        int l19 = chunkX + rand.nextInt(16) + 8;
        int k22 = rand.nextInt(128);
        int j24 = chunkY + rand.nextInt(16) + 8;

        if (rand.nextInt(3) == 0) {
          (new WorldGenGrass(Blocks.double_plant, 2)).generate(world, rand, l19, k22, j24);
        } else {
          (new WorldGenGrass(Blocks.tallgrass, 1)).generate(world, rand, l19, k22, j24);
        }
      }
    } else {
      int a = 6 - (int) (simplex.noise2(chunkX / 100f, chunkY / 100f) * 10);
      if (a < 1 || rand.nextInt(a) == 0) {
        int j6 = chunkX + rand.nextInt(16) + 8;
        int k10 = chunkY + rand.nextInt(16) + 8;
        int z52 = world.getHeightValue(j6, k10);

        if (z52 < 100f || (z52 < 120f && rand.nextInt(10) == 0)) {
          WorldGenerator worldgenerator =
              rand.nextInt(14) != 0 ? new WorldGenShrub(0, 0) : new WorldGenTreeSavanna(1);
          worldgenerator.setScale(1.0D, 1.0D, 1.0D);
          worldgenerator.generate(world, rand, j6, z52, k10);
        }
      }

      for (int k18 = 0; k18 < 70; k18++) {
        int k21 = chunkX + rand.nextInt(16) + 8;
        int j23 = 64 + rand.nextInt(64);
        int k24 = chunkY + rand.nextInt(16) + 8;
        if (j23 < 120f) {
          (new WorldGenCacti(false)).generate(world, rand, k21, j23, k24);
        }
      }

      if (rand.nextInt((int) (3f / strength)) == 0) {
        int i18 = chunkX + rand.nextInt(16) + 8;
        int i23 = chunkY + rand.nextInt(16) + 8;
        (new WorldGenReed()).generate(world, rand, i18, 60 + rand.nextInt(8), i23);
      }

      if (rand.nextInt(28) == 0) {
        int j16 = chunkX + rand.nextInt(16) + 8;
        int j18 = rand.nextInt(128);
        int j21 = chunkY + rand.nextInt(16) + 8;
        (new WorldGenPumpkin()).generate(world, rand, j16, j18, j21);
      }

      for (int f23 = 0; f23 < 3; f23++) {
        int j15 = chunkX + rand.nextInt(16) + 8;
        int j17 = rand.nextInt(128);
        int j20 = chunkY + rand.nextInt(16) + 8;
        (new WorldGenFlowers(new int[] {9, 9, 9, 9, 3, 3, 3, 3, 3, 2, 2, 2, 11, 11, 11}))
            .generate(world, rand, j15, j17, j20);
      }

      for (int l14 = 0; l14 < 15; l14++) {
        int l19 = chunkX + rand.nextInt(16) + 8;
        int k22 = rand.nextInt(128);
        int j24 = chunkY + rand.nextInt(16) + 8;

        if (rand.nextInt(3) == 0) {
          (new WorldGenGrass(Blocks.double_plant, 2)).generate(world, rand, l19, k22, j24);
        } else {
          (new WorldGenGrass(Blocks.tallgrass, 1)).generate(world, rand, l19, k22, j24);
        }
      }
    }
  }
Exemplo n.º 19
0
  @Override
  public void populate(int chunkX, int chunkZ) {
    BlockFalling.fallInstantly = true;

    int worldX = chunkX * 16;
    int worldZ = chunkZ * 16;
    BlockPos blockPos = new BlockPos(worldX, 0, worldZ);
    Biome biome = worldObj.getBiomeGenForCoords(blockPos.add(16, 0, 16));
    BiomeDecorator decorator = biome.theBiomeDecorator;
    int worldHeight = worldObj.provider.getActualHeight();

    ForgeEventFactory.onChunkPopulate(true, this, worldObj, rand, chunkX, chunkZ, false);

    int x, y, z;

    if (CavelandConfig.generateLakes) {
      if (TerrainGen.populate(this, worldObj, rand, chunkX, chunkZ, false, EventType.LAKE)) {
        x = rand.nextInt(16) + 8;
        y = rand.nextInt(worldHeight - 16);
        z = rand.nextInt(16) + 8;

        lakeWaterGen.generate(worldObj, rand, blockPos.add(x, y, z));
      }

      if (rand.nextInt(30) == 0
          && TerrainGen.populate(this, worldObj, rand, chunkX, chunkZ, false, EventType.LAVA)) {
        x = rand.nextInt(16) + 8;
        y = rand.nextInt(worldHeight / 2);
        z = rand.nextInt(16) + 8;

        lakeLavaGen.generate(worldObj, rand, blockPos.add(x, y, z));
      }
    }

    MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(worldObj, rand, blockPos));

    MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Pre(worldObj, rand, blockPos));

    for (CaveVein vein : CavelandConfig.veinManager.getCaveVeins()) {
      vein.generateVeins(worldObj, rand, blockPos);
    }

    MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Post(worldObj, rand, blockPos));

    for (int i = 0; i < 10; ++i) {
      x = rand.nextInt(16) + 8;
      y = rand.nextInt(worldHeight - 10);
      z = rand.nextInt(16) + 8;

      acresiaGen.generate(worldObj, rand, blockPos.add(x, y, z));
    }

    for (int i = 0; i < 15; ++i) {
      x = rand.nextInt(16) + 8;
      y = rand.nextInt(worldHeight / 2 - 10) + worldHeight / 2;
      z = rand.nextInt(16) + 8;

      acresiaGen.generate(worldObj, rand, blockPos.add(x, y, z));
    }

    if (TerrainGen.decorate(worldObj, rand, blockPos, Decorate.EventType.SHROOM)) {
      for (int i = 0; i < 5; ++i) {
        x = rand.nextInt(16) + 8;
        y = rand.nextInt(worldHeight - 10);
        z = rand.nextInt(16) + 8;

        decorator.mushroomBrownGen.generate(worldObj, rand, blockPos.add(x, y, z));
      }

      for (int i = 0; i < 5; ++i) {
        x = rand.nextInt(16) + 8;
        y = rand.nextInt(worldHeight - 10);
        z = rand.nextInt(16) + 8;

        decorator.mushroomRedGen.generate(worldObj, rand, blockPos.add(x, y, z));
      }
    }

    if (BiomeDictionary.isBiomeOfType(biome, Type.SANDY)) {
      if (TerrainGen.decorate(worldObj, rand, blockPos, Decorate.EventType.CACTUS)) {
        for (int i = 0; i < 80; ++i) {
          x = rand.nextInt(16) + 8;
          y = rand.nextInt(worldHeight - 5);
          z = rand.nextInt(16) + 8;

          decorator.cactusGen.generate(worldObj, rand, blockPos.add(x, y, z));
        }
      }

      if (TerrainGen.decorate(worldObj, rand, blockPos, Decorate.EventType.DEAD_BUSH)) {
        for (int i = 0; i < 10; ++i) {
          x = rand.nextInt(16) + 8;
          y = rand.nextInt(worldHeight - 5);
          z = rand.nextInt(16) + 8;

          deadBushGen.generate(worldObj, rand, blockPos.add(x, y, z));
        }
      }
    } else {
      if (TerrainGen.decorate(worldObj, rand, blockPos, Decorate.EventType.FLOWERS)) {
        for (int i = 0; i < 8; ++i) {
          x = rand.nextInt(16) + 8;
          y = rand.nextInt(worldHeight - 5);
          z = rand.nextInt(16) + 8;

          decorator.yellowFlowerGen.generate(worldObj, rand, blockPos.add(x, y, z));
        }
      }

      for (int i = 0; i < 18; ++i) {
        x = rand.nextInt(16) + 8;
        y = rand.nextInt(worldHeight - 5);
        z = rand.nextInt(16) + 8;

        biome.getRandomWorldGenForGrass(rand).generate(worldObj, rand, blockPos.add(x, y, z));
      }

      if (TerrainGen.decorate(worldObj, rand, blockPos, Decorate.EventType.TREE)) {
        WorldGenAbstractTree treeGen = null;

        if (BiomeDictionary.isBiomeOfType(biome, Type.JUNGLE)) {
          treeGen =
              new WorldGenTreesPerverted(
                  false, 4 + rand.nextInt(7), BlockPlanks.EnumType.JUNGLE, true);
        } else if (BiomeDictionary.isBiomeOfType(biome, Type.FOREST)
            || !BiomeDictionary.isBiomeOfType(biome, Type.PLAINS)
            || rand.nextInt(10) == 0) {
          if (BiomeDictionary.isBiomeOfType(biome, Type.COLD)) {
            treeGen = new WorldGenSpruceTreePerverted(false);
          } else if (rand.nextInt(3) == 0) {
            treeGen = new WorldGenBirchTreePerverted(false, false);
          } else {
            treeGen = new WorldGenTreesPerverted(false, 3, BlockPlanks.EnumType.OAK, true);
          }
        }

        if (treeGen != null) {
          for (int i = 0; i < 80; ++i) {
            x = rand.nextInt(16) + 8;
            y = rand.nextInt(worldHeight);
            z = rand.nextInt(16) + 8;

            BlockPos pos = blockPos.add(x, y, z);

            if (treeGen.generate(worldObj, rand, pos)) {
              treeGen.generateSaplings(worldObj, rand, pos);
            }
          }

          for (int i = 0; i < 60; ++i) {
            x = rand.nextInt(16) + 8;
            y = 8 + rand.nextInt(5);
            z = rand.nextInt(16) + 8;

            BlockPos pos = blockPos.add(x, y, z);

            if (treeGen.generate(worldObj, rand, pos)) {
              treeGen.generateSaplings(worldObj, rand, pos);
            }
          }
        }
      }

      if (decorator.generateLakes) {
        if (BiomeDictionary.isBiomeOfType(biome, Type.WATER)) {
          if (TerrainGen.decorate(worldObj, rand, blockPos, Decorate.EventType.LAKE_WATER)) {
            for (int i = 0; i < 150; ++i) {
              x = rand.nextInt(16) + 8;
              y = rand.nextInt(rand.nextInt(worldHeight - 16) + 10);
              z = rand.nextInt(16) + 8;

              liquidWaterGen.generate(worldObj, rand, blockPos.add(x, y, z));
            }
          }
        } else {
          if (TerrainGen.decorate(worldObj, rand, blockPos, Decorate.EventType.LAKE_WATER)) {
            for (int i = 0; i < 100; ++i) {
              x = rand.nextInt(16) + 8;
              y = rand.nextInt(rand.nextInt(worldHeight - 16) + 10);
              z = rand.nextInt(16) + 8;

              liquidWaterGen.generate(worldObj, rand, blockPos.add(x, y, z));
            }
          }

          if (TerrainGen.decorate(worldObj, rand, blockPos, Decorate.EventType.LAKE_LAVA)) {
            for (int i = 0; i < 20; ++i) {
              x = rand.nextInt(16) + 8;
              y = rand.nextInt(worldHeight / 2);
              z = rand.nextInt(16) + 8;

              liquidLavaGen.generate(worldObj, rand, blockPos.add(x, y, z));
            }
          }
        }
      }
    }

    MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(worldObj, rand, blockPos));

    ForgeEventFactory.onChunkPopulate(false, this, worldObj, rand, chunkX, chunkZ, false);

    BlockFalling.fallInstantly = false;
  }
  @Override
  public void rDecorate(
      World world,
      Random rand,
      int chunkX,
      int chunkY,
      OpenSimplexNoise simplex,
      CellNoise cell,
      float strength,
      float river) {

    /**
     * Using rDecorateSeedBiome() to partially decorate the biome? If so, then comment out this
     * method.
     */
    rOreGenSeedBiome(world, rand, chunkX, chunkY, simplex, cell, strength, river, baseBiome);

    for (int l = 0; l < 6f * strength; ++l) {
      int i1 = chunkX + rand.nextInt(16) + 8;
      int j1 = chunkY + rand.nextInt(16) + 8;
      int k1 = world.getHeightValue(i1, j1);

      if (k1 < 95 && rand.nextInt(16) == 0) {
        (new WorldGenBlob(Blocks.cobblestone, 0, rand)).generate(world, rand, i1, k1, j1);
      }
    }

    float l = simplex.noise2(chunkX / 100f, chunkY / 100f) * 12f + 4f;
    for (int b1 = 0; b1 < l * strength; b1++) {
      int j6 = chunkX + rand.nextInt(16) + 8;
      int k10 = chunkY + rand.nextInt(16) + 8;
      int z52 = world.getHeightValue(j6, k10);

      if (z52 < 90) {
        WorldGenerator worldgenerator =
            rand.nextInt(8) != 0
                ? new WorldGenTreePine(4, rand.nextInt(4) == 0 ? 1 : 0)
                : rand.nextInt(3) != 0
                    ? new WorldGenTreePineSmall(3 + rand.nextInt(6), 6 + rand.nextInt(8), 0)
                    : new WorldGenIceSpike();
        worldgenerator.setScale(1.0D, 1.0D, 1.0D);
        worldgenerator.generate(world, rand, j6, z52, k10);
      } else if (z52 < 120) {
        WorldGenerator worldgenerator =
            rand.nextInt(4) != 0
                ? new WorldGenTreePineSmall(
                    1 + rand.nextInt(3), 3 + rand.nextInt(5), rand.nextInt(2))
                : new WorldGenIceSpike();
        worldgenerator.setScale(1.0D, 1.0D, 1.0D);
        worldgenerator.generate(world, rand, j6, z52, k10);
      }
    }

    if (rand.nextInt((int) (12f / strength)) == 0) {
      int x22 = chunkX + rand.nextInt(16) + 8;
      int z22 = chunkY + rand.nextInt(16) + 8;
      int y22 = world.getHeightValue(x22, z22);
      if (y22 < 100) {
        (new WorldGenLog(1, 3 + rand.nextInt(4), false)).generate(world, rand, x22, y22, z22);
      }
    }
  }
  @Override
  public void rDecorate(
      World world,
      Random rand,
      int chunkX,
      int chunkY,
      PerlinNoise perlin,
      CellNoise cell,
      float strength,
      float river) {
    if (rand.nextInt((int) (2f / strength)) == 0) {
      int i1 = chunkX + rand.nextInt(16) + 8;
      int j1 = chunkY + rand.nextInt(16) + 8;
      int k1 = world.getHeightValue(i1, j1);
      if (k1 < 85) {
        (new DecoBlob(Blocks.cobblestone, 0)).generate(world, rand, i1, k1, j1);
      }
    }

    float t = perlin.noise2(chunkX / 30f, chunkY / 30f) * 8f;
    t = t > 4f ? 4f : t;

    if (t > 0f) {
      if (rand.nextInt((int) ((10f - t) / strength)) == 0) {
        int j6 = chunkX + rand.nextInt(16) + 8;
        int k10 = chunkY + rand.nextInt(16) + 8;
        int z52 = world.getHeightValue(j6, k10);

        if (z52 < 82) {
          WorldGenerator worldgenerator =
              new DecoJungleTall(
                  Blocks.log,
                  2,
                  Blocks.leaves,
                  2,
                  6 + rand.nextInt(4),
                  3 + rand.nextInt(2),
                  9f + rand.nextFloat() * 4f,
                  3,
                  0.32f,
                  0.1f);
          worldgenerator.setScale(1.0D, 1.0D, 1.0D);
          worldgenerator.generate(world, rand, j6, z52, k10);
        }
      }
    }

    if (river > 0.8f) {
      for (int b33 = 0; b33 < 8f * strength; b33++) {
        int j6 = chunkX + rand.nextInt(16) + 8;
        int k10 = chunkY + rand.nextInt(16) + 8;
        int z52 = world.getHeightValue(j6, k10);

        if (z52 < 82) {
          WorldGenerator worldgenerator =
              rand.nextInt(2) != 0 ? new WorldGenShrub(0, 0) : new DecoSavannah(1, false);
          worldgenerator.setScale(1.0D, 1.0D, 1.0D);
          worldgenerator.generate(world, rand, j6, z52, k10);
        }
      }
    } else {
      for (int b33 = 0; b33 < (1f + t) * strength; b33++) {
        int j6 = chunkX + rand.nextInt(16) + 8;
        int k10 = chunkY + rand.nextInt(16) + 8;
        int z52 = world.getHeightValue(j6, k10);

        if (z52 < 82) {
          WorldGenerator worldgenerator =
              rand.nextInt(6) != 0 ? new WorldGenShrub(0, 0) : new DecoSavannah(1, false);
          worldgenerator.setScale(1.0D, 1.0D, 1.0D);
          worldgenerator.generate(world, rand, j6, z52, k10);
        }
      }
    }

    if (rand.nextInt((int) (3f / strength)) == 0) {
      int i18 = chunkX + rand.nextInt(16) + 8;
      int i23 = chunkY + rand.nextInt(16) + 8;
      (new WorldGenReed()).generate(world, rand, i18, 60 + rand.nextInt(8), i23);
    }

    if (rand.nextInt(28) == 0) {
      int j16 = chunkX + rand.nextInt(16) + 8;
      int j18 = rand.nextInt(128);
      int j21 = chunkY + rand.nextInt(16) + 8;
      (new WorldGenPumpkin()).generate(world, rand, j16, j18, j21);
    }

    for (int f23 = 0; f23 < 3; f23++) {
      int j15 = chunkX + rand.nextInt(16) + 8;
      int j17 = rand.nextInt(128);
      int j20 = chunkY + rand.nextInt(16) + 8;
      (new DecoFlowers(new int[] {9, 9, 9, 9, 3, 3, 3, 3, 3, 2, 2, 2, 11, 11, 11}))
          .generate(world, rand, j15, j17, j20);
    }

    for (int k18 = 0; k18 < 26f * strength; k18++) {
      int k21 = chunkX + rand.nextInt(16) + 8;
      int j23 = 66 + rand.nextInt(20);
      int k24 = chunkY + rand.nextInt(16) + 8;
      (new DecoCacti(false)).generate(world, rand, k21, j23, k24);
    }

    for (int l14 = 0; l14 < 8f * strength; l14++) {
      int l19 = chunkX + rand.nextInt(16) + 8;
      int k22 = 60 + rand.nextInt(40);
      int j24 = chunkY + rand.nextInt(16) + 8;

      if (rand.nextInt(3) == 0) {
        (new DecoGrass(Blocks.double_plant, 2)).generate(world, rand, l19, k22, j24);
      } else {
        (new DecoGrass(Blocks.tallgrass, 1)).generate(world, rand, l19, k22, j24);
      }
    }
  }
  @Override
  public void rDecorate(
      World world,
      Random rand,
      int chunkX,
      int chunkY,
      OpenSimplexNoise simplex,
      CellNoise cell,
      float strength,
      float river) {

    /**
     * Using rDecorateSeedBiome() to partially decorate the biome? If so, then comment out this
     * method.
     */
    rOreGenSeedBiome(world, rand, chunkX, chunkY, simplex, cell, strength, river, baseBiome);

    float l = simplex.noise2(chunkX / 80f, chunkY / 80f) * 60f - 15f;

    for (int b1 = 0; b1 < 2 * strength; b1++) {
      if (rand.nextInt(2) == 0) {
        int j6 = chunkX + rand.nextInt(16) + 8;
        int k10 = chunkY + rand.nextInt(16) + 8;
        int z52 = world.getHeightValue(j6, k10);

        if (z52 < 230) {
          if (rand.nextInt(32) == 0) {
            WorldGenerator worldgenerator = TreeGen.greatOak(rand);
            worldgenerator.setScale(1.0D, 1.0D, 1.0D);
            worldgenerator.generate(world, rand, j6, z52, k10);
          } else {
            WorldGenerator worldgenerator = TreeGen.birch();
            worldgenerator.setScale(1.0D, 1.0D, 1.0D);
            worldgenerator.generate(world, rand, j6, z52, k10);
          }
        }
      }
    }

    if (l > 5f) {
      for (int b2 = 0; b2 < 4f * strength; b2++) {
        int j6 = chunkX + rand.nextInt(16) + 8;
        int k10 = chunkY + rand.nextInt(16) + 8;
        int z52 = world.getHeightValue(j6, k10);

        if (z52 < 220) {
          WorldGenerator worldgenerator =
              rand.nextInt(2) == 0
                  ? TreeGen.birch()
                  : rand.nextInt(10) != 0
                      ? new WorldGenTrees(false)
                      : new WorldGenForest(false, false);
          worldgenerator.setScale(1.0D, 1.0D, 1.0D);
          worldgenerator.generate(world, rand, j6, z52, k10);
        }
      }
    }

    if (rand.nextInt((int) (32f / strength)) == 0) {
      int x22 = chunkX + rand.nextInt(16) + 8;
      int z22 = chunkY + rand.nextInt(16) + 8;
      int y22 = world.getHeightValue(x22, z22);
      if (y22 < 100) {
        if (rand.nextBoolean()) {
          (new WorldGenLog(Blocks.log, 0, Blocks.leaves, -1, 3 + rand.nextInt(4)))
              .generate(world, rand, x22, y22, z22);
        } else {
          (new WorldGenLog(Blocks.log, 2, Blocks.leaves, -1, 3 + rand.nextInt(4)))
              .generate(world, rand, x22, y22, z22);
        }
      }
    }

    for (int f24 = 0; f24 < 3f * strength; f24++) {
      int i1 = chunkX + rand.nextInt(16) + 8;
      int j1 = chunkY + rand.nextInt(16) + 8;
      int k1 = world.getHeightValue(i1, j1);
      if (k1 < 110) {
        (new WorldGenTreeShrub(rand.nextInt(4) + 1, 0, rand.nextInt(3)))
            .generate(world, rand, i1, k1, j1);
      }
    }

    for (int f23 = 0; f23 < 8f * strength; f23++) {
      int j15 = chunkX + rand.nextInt(16) + 8;
      int j17 = rand.nextInt(128);
      int j20 = chunkY + rand.nextInt(16) + 8;
      (new WorldGenFlowers(new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}))
          .generate(world, rand, j15, j17, j20);
    }

    for (int l14 = 0; l14 < 12f * strength; l14++) {
      int l19 = chunkX + rand.nextInt(16) + 8;
      int k22 = rand.nextInt(128);
      int j24 = chunkY + rand.nextInt(16) + 8;
      (new WorldGenGrass(Blocks.tallgrass, 1)).generate(world, rand, l19, k22, j24);
    }
  }