Fix tree rarity

This commit is contained in:
modmuss50 2016-02-20 00:58:04 +00:00
parent a76384504f
commit eaf82b68e8

View file

@ -23,13 +23,12 @@ public class TreeGenerator implements IWorldGenerator {
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(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;
}
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)));