    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 var6 = par3;
    014
    015        for (int var7 = par5; par4 < 128; ++par4)
    016        {
    017            if (par1World.isAirBlock(par3, par4, par5))
    018            {
    019                for (int var8 = 2; var8 <= 5; ++var8)
    020                {
    021                    if (Block.vine.canPlaceBlockOnSide(par1World, par3, par4, par5, var8))
    022                    {
    023                        par1World.setBlockAndMetadata(par3, par4, par5, Block.vine.blockID, 1 << Direction.vineGrowth[Facing.faceToSide[var8]]);
    024                        break;
    025                    }
    026                }
    027            }
    028            else
    029            {
    030                par3 = var6 + par2Random.nextInt(4) - par2Random.nextInt(4);
    031                par5 = var7 + par2Random.nextInt(4) - par2Random.nextInt(4);
    032            }
    033        }
    034
    035        return true;
    036    }
    037}