    001package net.minecraft.world.gen.feature;
    002
    003import java.util.Random;
    004import net.minecraft.block.Block;
    005import net.minecraft.util.Direction;
    006import net.minecraft.util.Facing;
    007import net.minecraft.world.World;
    008
    009public class WorldGenVines extends WorldGenerator
    010{
    011    public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
    012    {
    013        int l = par3;
    014
    015        for (int i1 = par5; par4 < 128; ++par4)
    016        {
    017            if (par1World.isAirBlock(par3, par4, par5))
    018            {
    019                for (int j1 = 2; j1 <= 5; ++j1)
    020                {
    021                    if (Block.vine.canPlaceBlockOnSide(par1World, par3, par4, par5, j1))
    022                    {
    023                        par1World.setBlockAndMetadataWithNotify(par3, par4, par5, Block.vine.blockID, 1 << Direction.vineGrowth[Facing.faceToSide[j1]], 2);
    024                        break;
    025                    }
    026                }
    027            }
    028            else
    029            {
    030                par3 = l + par2Random.nextInt(4) - par2Random.nextInt(4);
    031                par5 = i1 + par2Random.nextInt(4) - par2Random.nextInt(4);
    032            }
    033        }
    034
    035        return true;
    036    }
    037}