1

Tree Generation

TheUnexpectables 11/26/12 6:40 am
109
11/27/2012 3:24 pm
Im trying to add 2 trees to my mod and the first spawns but the second dosn't so if theres something wrong with the coding could you tell me what. I also have a feeling i know where its coming from but dont know how to fix it.

public void generateSurface(World world, Random rand, int chunkX, int chunkZ)
{
BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(chunkX, chunkZ);
WorldGenButterTree tree = new WorldGenButterTree(); //Change this to the World Gens or your tree and make sure that the parameters match if you get errors!
if(biome instanceof BiomeGenButter)
{
for(int c = 0; c < 3; c++)
{
int Xcoord = chunkX + rand.nextInt(16);
int Zcoord = chunkZ + rand.nextInt(16);
int i = world.getHeightValue(Xcoord, Zcoord);
tree.generate(world, rand, Xcoord, i, Zcoord);
//Dead Tree
BiomeGenBase biome1 = world.getWorldChunkManager().getBiomeGenAt(chunkX, chunkZ);
WorldGenDeadTree tree1 = new WorldGenDeadTree(); //Change this to the World Gens or your tree and make sure that the parameters match if you get errors!
if(biome1 instanceof BiomeGenGraveyard)
{
for(int c1 = 0; c1 < 3; c1++)
{
int Xcoord1 = chunkX + rand.nextInt(16);
int Zcoord1 = chunkZ + rand.nextInt(16);
int i1 = world.getHeightValue(Xcoord1, Zcoord1);
tree1.generate(world, rand, Xcoord1, i1, Zcoord1);
}
}
}
Posted by
TheUnexpectables
Level 1 : New Explorer
2

  Have something to say?

JoinSign in

3

Donutcash
11/26/2012 7:00 am
Level 3 : Apprentice Explorer
I don't get coding.
1
Willsr71
11/26/2012 6:43 am
Level 53 : Grandmaster Programmer
Butter? Are you trying to get sky to do it?
1
TheUnexpectables
11/27/2012 3:24 pm
Level 1 : New Explorer
Sort of. I took suggestions from a other forum and did it and only did I look to find that there was a popular youtuber, so that was just a bonus
1

Welcome