Made some changes to the Boreal Forest.

This commit is contained in:
Matt Caughey 2013-05-20 14:47:39 -04:00
parent ea79e20990
commit b514d4530c
2 changed files with 148 additions and 3 deletions

View file

@ -3,7 +3,8 @@ package biomesoplenty.biomes;
import java.util.Random;
import biomesoplenty.worldgen.WorldGenAutumn;
import biomesoplenty.worldgen.WorldGenTaiga5;
import biomesoplenty.worldgen.WorldGenRainforestTree1;
import biomesoplenty.worldgen.WorldGenTaiga10;
import net.minecraft.block.Block;
import net.minecraft.entity.passive.EntityWolf;
@ -24,7 +25,7 @@ public class BiomeGenBorealForest extends BiomeGenBase
this.spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 5, 4, 4));
this.theBiomeDecorator = new BiomeDecoratorBOP(this);
this.customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
this.customBiomeDecorator.treesPerChunk = 25;
this.customBiomeDecorator.treesPerChunk = 20;
this.customBiomeDecorator.grassPerChunk = 50;
}
@ -41,7 +42,8 @@ public class BiomeGenBorealForest extends BiomeGenBase
*/
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return (WorldGenerator)(par1Random.nextInt(2) == 0 ? this.worldGeneratorTrees : (par1Random.nextInt(5) == 0 ? new WorldGenShrub(0,0) : (par1Random.nextInt(3) == 0 ? new WorldGenAutumn(false) : (par1Random.nextInt(3) == 0 ? this.worldGeneratorForest : new WorldGenTaiga5(false)))));
return (WorldGenerator)(par1Random.nextInt(4) == 0 ? new WorldGenRainforestTree1(false) : (par1Random.nextInt(5) == 0 ? new WorldGenShrub(0,0) : (par1Random.nextInt(3) == 0 ? new WorldGenAutumn(false) : (par1Random.nextInt(3) == 0 ? this.worldGeneratorForest : new WorldGenTaiga10(false)))));
//return (WorldGenerator)(par1Random.nextInt(2) == 0 ? this.worldGeneratorTrees : (par1Random.nextInt(5) == 0 ? new WorldGenShrub(0,0) : (par1Random.nextInt(3) == 0 ? new WorldGenAutumn(false) : (par1Random.nextInt(3) == 0 ? this.worldGeneratorForest : new WorldGenTaiga10(false)))));
}
/**

View file

@ -0,0 +1,143 @@
package biomesoplenty.worldgen;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
public class WorldGenTaiga10 extends WorldGenerator
{
public WorldGenTaiga10(boolean par1)
{
super(par1);
}
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
{
int var6 = par2Random.nextInt(9) + 13;
int var7 = 4 + par2Random.nextInt(4);
int var8 = var6 - var7;
int var9 = 2;
boolean var10 = true;
if (par4 >= 1 && par4 + var6 + 1 <= 256)
{
int var11;
int var13;
int var15;
int var21;
for (var11 = par4; var11 <= par4 + 1 + var6 && var10; ++var11)
{
boolean var12 = true;
if (var11 - par4 < var7)
{
var21 = 0;
}
else
{
var21 = var9;
}
for (var13 = par3 - var21; var13 <= par3 + var21 && var10; ++var13)
{
for (int var14 = par5 - var21; var14 <= par5 + var21 && var10; ++var14)
{
if (var11 >= 0 && var11 < 256)
{
var15 = par1World.getBlockId(var13, var11, var14);
if (var15 != 0 && var15 != Block.leaves.blockID)
{
var10 = false;
}
}
else
{
var10 = false;
}
}
}
}
if (!var10)
{
return false;
}
else
{
var11 = par1World.getBlockId(par3, par4 - 1, par5);
if ((var11 == Block.grass.blockID || var11 == Block.dirt.blockID) && par4 < 256 - var6 - 1)
{
this.setBlock(par1World, par3, par4 - 1, par5, Block.dirt.blockID);
var21 = par2Random.nextInt(2);
var13 = 1;
byte var22 = 0;
int var17;
int var16;
for (var15 = 0; var15 <= var8; ++var15)
{
var16 = par4 + var6 - var15;
for (var17 = par3 - var21; var17 <= par3 + var21; ++var17)
{
int var18 = var17 - par3;
for (int var19 = par5 - var21; var19 <= par5 + var21; ++var19)
{
int var20 = var19 - par5;
if ((Math.abs(var18) != var21 || Math.abs(var20) != var21 || var21 <= 0) && !Block.opaqueCubeLookup[par1World.getBlockId(var17, var16, var19)])
{
this.setBlockAndMetadata(par1World, var17, var16, var19, Block.leaves.blockID, 1);
}
}
}
if (var21 >= var13)
{
var21 = var22;
var22 = 1;
++var13;
if (var13 > var9)
{
var13 = var9;
}
}
else
{
++var21;
}
}
var15 = par2Random.nextInt(3);
for (var16 = 0; var16 < var6 - var15; ++var16)
{
var17 = par1World.getBlockId(par3, par4 + var16, par5);
if (var17 == 0 || var17 == Block.leaves.blockID)
{
this.setBlockAndMetadata(par1World, par3, par4 + var16, par5, Block.wood.blockID, 1);
}
}
return true;
}
else
{
return false;
}
}
}
else
{
return false;
}
}
}