package techreborn.world;

import net.minecraft.init.Blocks;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.fml.common.IWorldGenerator;
import net.minecraftforge.fml.common.Mod;
import techreborn.init.ModBlocks;

import java.util.Random;

/**
 * Created by Mark on 19/02/2016.
 */
public class TreeGenerator implements IWorldGenerator {

    RubberTreeGenerator treeGenerator = new RubberTreeGenerator(false, 10, ModBlocks.rubberLog.getDefaultState(), ModBlocks.rubberLeaves.getDefaultState(), false);

    @Override
    public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
        int chance = 0;
        BiomeGenBase biomeGenBase = world.getBiomeGenForCoords( new BlockPos(chunkX * 16 + 16, 72, chunkZ * 16 + 16));
//        if(BiomeDictionary.isBiomeOfType(biomeGenBase, BiomeDictionary.Type.SWAMP)){
//            chance += random.nextInt(10) + 5;
//        }
//        if(BiomeDictionary.isBiomeOfType(biomeGenBase, BiomeDictionary.Type.FOREST) || BiomeDictionary.isBiomeOfType(biomeGenBase, BiomeDictionary.Type.JUNGLE)){
//            chance += random.nextInt(5) + 1;
//        }
        chance = 10;
        if(world.provider.isSurfaceWorld()){
            if(random.nextInt(100) + 1 <= chance * 2){
                treeGenerator.generate(world, random, new BlockPos(chunkX * 16 + random.nextInt(16), 72, chunkZ * 16 + random.nextInt(16)));
            }

        }
    }
}

@@ -988,18 +988,16 @@
 + 16));%0A
-//
         
@@ -1069,26 +1069,24 @@
 pe.SWAMP))%7B%0A
-//
             
@@ -1119,18 +1119,16 @@
 0) + 5;%0A
-//
         
@@ -1129,18 +1129,16 @@
       %7D%0A
-//
         
@@ -1291,18 +1291,16 @@
 NGLE))%7B%0A
-//
         
@@ -1340,10 +1340,8 @@
  1;%0A
-//
     
@@ -1350,29 +1350,8 @@
   %7D%0A
-        chance = 10;%0A
     

Fix tree rarity