BiomesOPlenty/common/biomesoplenty/worldgen/WorldGenIvy.java

42 lines
1.2 KiB
Java
Raw Normal View History

2013-08-10 07:03:21 +00:00
package biomesoplenty.worldgen;
import java.util.Random;
2013-08-16 10:00:45 +00:00
2013-08-10 07:03:21 +00:00
import net.minecraft.block.Block;
import net.minecraft.util.Direction;
import net.minecraft.util.Facing;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.Blocks;
public class WorldGenIvy extends WorldGenerator
{
2013-08-16 10:00:45 +00:00
@Override
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
2013-08-10 07:03:21 +00:00
{
int l = par3;
for (int i1 = par5; par4 < 128; ++par4)
{
if (par1World.isAirBlock(par3, par4, par5))
{
for (int j1 = 2; j1 <= 5; ++j1)
{
if (Block.vine.canPlaceBlockOnSide(par1World, par3, par4, par5, j1))
{
par1World.setBlock(par3, par4, par5, Blocks.ivy.get().blockID, 1 << Direction.facingToDirection[Facing.oppositeSide[j1]], 2);
break;
}
}
}
else
{
par3 = l + par2Random.nextInt(4) - par2Random.nextInt(4);
par5 = i1 + par2Random.nextInt(4) - par2Random.nextInt(4);
}
}
return true;
}
}