Fixed palm trees not generating in spaces with foliage/flowers. Made sunflowers not generate unless both spaces are empty.

This commit is contained in:
Matt Caughey 2013-09-30 05:16:08 -04:00
parent 23cc2df6ed
commit ed600efd33
3 changed files with 3 additions and 3 deletions

View File

@ -29,7 +29,7 @@ public class WorldGenSunflower extends WorldGenerator
int j1 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4); int j1 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4);
int k1 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8); int k1 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8);
if (par1World.isAirBlock(i1, j1, k1) && (!par1World.provider.hasNoSky || j1 < 127) && (par1World.getFullBlockLightValue(i1, j1, k1) >= 8 || par1World.canBlockSeeTheSky(i1, j1, k1)) if (par1World.isAirBlock(i1, j1, k1) && par1World.isAirBlock(i1, j1 + 1, k1) && (!par1World.provider.hasNoSky || j1 < 127) && (par1World.getFullBlockLightValue(i1, j1, k1) >= 8 || par1World.canBlockSeeTheSky(i1, j1, k1))
&& Block.blocksList[plantBlockId].canPlaceBlockOnSide(par1World, i1, j1, k1, 1, new ItemStack(plantBlockId, 1, plantBlockMeta))) && Block.blocksList[plantBlockId].canPlaceBlockOnSide(par1World, i1, j1, k1, 1, new ItemStack(plantBlockId, 1, plantBlockMeta)))
{ {
par1World.setBlock(i1, j1, k1, Blocks.flowers.get().blockID, 13, 2); par1World.setBlock(i1, j1, k1, Blocks.flowers.get().blockID, 13, 2);

View File

@ -101,7 +101,7 @@ public class WorldGenPalmTree1 extends WorldGenerator
public void buildBlock(World world, int x, int y, int z, int id, int meta) public void buildBlock(World world, int x, int y, int z, int id, int meta)
{ {
Material m = world.getBlockMaterial(x, y, z); Material m = world.getBlockMaterial(x, y, z);
if(m == Material.air || m == Material.leaves) if(m == Material.air || m == Material.leaves || m == Material.vine || m == Material.plants)
{ {
world.setBlock(x, y, z, id, meta, 2); world.setBlock(x, y, z, id, meta, 2);
} }

View File

@ -101,7 +101,7 @@ public class WorldGenPalmTree3 extends WorldGenerator
public void buildBlock(World world, int x, int y, int z, int id, int meta) public void buildBlock(World world, int x, int y, int z, int id, int meta)
{ {
Material m = world.getBlockMaterial(x, y, z); Material m = world.getBlockMaterial(x, y, z);
if(m == Material.air || m == Material.leaves) if(m == Material.air || m == Material.leaves || m == Material.vine || m == Material.plants)
{ {
world.setBlock(x, y, z, id, meta, 2); world.setBlock(x, y, z, id, meta, 2);
} }