1
Tree Generation
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);
}
}
}
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);
}
}
}
3
I don't get coding.
Butter? Are you trying to get sky to do it?
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
