Java Code Examples for net.minecraft.init.Blocks.sand()

The following are Jave code examples for showing how to use sand() of the net.minecraft.init.Blocks class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: DecompiledMinecraft   File: BlockReed.java   View Source Code Vote up 6 votes
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
{
    Block block = worldIn.getBlockState(pos.down()).getBlock();

    if (block == this)
    {
        return true;
    }
    else if (block != Blocks.grass && block != Blocks.dirt && block != Blocks.sand)
    {
        return false;
    }
    else
    {
        for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL)
        {
            if (worldIn.getBlockState(pos.offset(enumfacing).down()).getBlock().getMaterial() == Material.water)
            {
                return true;
            }
        }

        return false;
    }
}
 
Example 2
Project: DecompiledMinecraft   File: BlockReed.java   View Source Code Vote up 6 votes
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
{
    Block block = worldIn.getBlockState(pos.down()).getBlock();

    if (block == this)
    {
        return true;
    }
    else if (block != Blocks.grass && block != Blocks.dirt && block != Blocks.sand)
    {
        return false;
    }
    else
    {
        for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL)
        {
            if (worldIn.getBlockState(pos.offset(enumfacing).down()).getBlock().getMaterial() == Material.water)
            {
                return true;
            }
        }

        return false;
    }
}
 
Example 3
Project: BaseClient   File: BlockReed.java   View Source Code Vote up 6 votes
public boolean canPlaceBlockAt(World worldIn, BlockPos pos) {
	Block block = worldIn.getBlockState(pos.down()).getBlock();

	if (block == this) {
		return true;
	} else if (block != Blocks.grass && block != Blocks.dirt && block != Blocks.sand) {
		return false;
	} else {
		for (Object enumfacing0 : EnumFacing.Plane.HORIZONTAL) {
			EnumFacing enumfacing = (EnumFacing) enumfacing0;
			if (worldIn.getBlockState(pos.offset(enumfacing).down()).getBlock().getMaterial() == Material.water) {
				return true;
			}
		}

		return false;
	}
}
 
Example 4
Project: DecompiledMinecraft   File: BlockCactus.java   View Source Code Vote up 5 votes
public boolean canBlockStay(World worldIn, BlockPos pos)
{
    for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL)
    {
        if (worldIn.getBlockState(pos.offset(enumfacing)).getBlock().getMaterial().isSolid())
        {
            return false;
        }
    }

    Block block = worldIn.getBlockState(pos.down()).getBlock();
    return block == Blocks.cactus || block == Blocks.sand;
}
 
Example 5
Project: DecompiledMinecraft   File: BlockCactus.java   View Source Code Vote up 5 votes
public boolean canBlockStay(World worldIn, BlockPos pos)
{
    for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL)
    {
        if (worldIn.getBlockState(pos.offset(enumfacing)).getBlock().getMaterial().isSolid())
        {
            return false;
        }
    }

    Block block = worldIn.getBlockState(pos.down()).getBlock();
    return block == Blocks.cactus || block == Blocks.sand;
}
 
Example 6
Project: BaseClient   File: BlockCactus.java   View Source Code Vote up 5 votes
public boolean canBlockStay(World worldIn, BlockPos pos)
{
    for (Object enumfacing0 : EnumFacing.Plane.HORIZONTAL)
    {
    	EnumFacing enumfacing = (EnumFacing) enumfacing0;
        if (worldIn.getBlockState(pos.offset(enumfacing)).getBlock().getMaterial().isSolid())
        {
            return false;
        }
    }

    Block block = worldIn.getBlockState(pos.down()).getBlock();
    return block == Blocks.cactus || block == Blocks.sand;
}
 
Example 7
Project: BaseClient   File: BlockReed.java   View Source Code Vote up 5 votes
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
{
    Block block = worldIn.getBlockState(pos.down()).getBlock();

    if (block == this)
    {
        return true;
    }
    else if (block != Blocks.grass && block != Blocks.dirt && block != Blocks.sand)
    {
        return false;
    }
    else
    {
        for (Object enumfacing0 : EnumFacing.Plane.HORIZONTAL)
        {
            EnumFacing enumfacing = (EnumFacing) enumfacing0;

            if (worldIn.getBlockState(pos.offset(enumfacing).down()).getBlock().getMaterial() == Material.water)
            {
                return true;
            }
        }

        return false;
    }
}
 
Example 8
Project: BaseClient   File: BlockCactus.java   View Source Code Vote up 5 votes
public boolean canBlockStay(World worldIn, BlockPos pos)
{
    for (Object enumfacing0 : EnumFacing.Plane.HORIZONTAL)
    {
        EnumFacing enumfacing = (EnumFacing) enumfacing0;

        if (worldIn.getBlockState(pos.offset(enumfacing)).getBlock().getMaterial().isSolid())
        {
            return false;
        }
    }

    Block block = worldIn.getBlockState(pos.down()).getBlock();
    return block == Blocks.cactus || block == Blocks.sand;
}
 
Example 9
Project: DecompiledMinecraft   File: MapGenCaves.java   View Source Code Vote up 4 votes
protected boolean func_175793_a(IBlockState p_175793_1_, IBlockState p_175793_2_)
{
    return p_175793_1_.getBlock() == Blocks.stone ? true : (p_175793_1_.getBlock() == Blocks.dirt ? true : (p_175793_1_.getBlock() == Blocks.grass ? true : (p_175793_1_.getBlock() == Blocks.hardened_clay ? true : (p_175793_1_.getBlock() == Blocks.stained_hardened_clay ? true : (p_175793_1_.getBlock() == Blocks.sandstone ? true : (p_175793_1_.getBlock() == Blocks.red_sandstone ? true : (p_175793_1_.getBlock() == Blocks.mycelium ? true : (p_175793_1_.getBlock() == Blocks.snow_layer ? true : (p_175793_1_.getBlock() == Blocks.sand || p_175793_1_.getBlock() == Blocks.gravel) && p_175793_2_.getBlock().getMaterial() != Material.water))))))));
}
 
Example 10
Project: DecompiledMinecraft   File: BlockDeadBush.java   View Source Code Vote up 4 votes
/**
 * is the block grass, dirt or farmland
 */
protected boolean canPlaceBlockOn(Block ground)
{
    return ground == Blocks.sand || ground == Blocks.hardened_clay || ground == Blocks.stained_hardened_clay || ground == Blocks.dirt;
}
 
Example 11
Project: DecompiledMinecraft   File: MapGenCaves.java   View Source Code Vote up 4 votes
protected boolean func_175793_a(IBlockState p_175793_1_, IBlockState p_175793_2_)
{
    return p_175793_1_.getBlock() == Blocks.stone ? true : (p_175793_1_.getBlock() == Blocks.dirt ? true : (p_175793_1_.getBlock() == Blocks.grass ? true : (p_175793_1_.getBlock() == Blocks.hardened_clay ? true : (p_175793_1_.getBlock() == Blocks.stained_hardened_clay ? true : (p_175793_1_.getBlock() == Blocks.sandstone ? true : (p_175793_1_.getBlock() == Blocks.red_sandstone ? true : (p_175793_1_.getBlock() == Blocks.mycelium ? true : (p_175793_1_.getBlock() == Blocks.snow_layer ? true : (p_175793_1_.getBlock() == Blocks.sand || p_175793_1_.getBlock() == Blocks.gravel) && p_175793_2_.getBlock().getMaterial() != Material.water))))))));
}
 
Example 12
Project: DecompiledMinecraft   File: BlockDeadBush.java   View Source Code Vote up 4 votes
/**
 * is the block grass, dirt or farmland
 */
protected boolean canPlaceBlockOn(Block ground)
{
    return ground == Blocks.sand || ground == Blocks.hardened_clay || ground == Blocks.stained_hardened_clay || ground == Blocks.dirt;
}
 
Example 13
Project: BaseClient   File: MapGenCaves.java   View Source Code Vote up 4 votes
protected boolean func_175793_a(IBlockState p_175793_1_, IBlockState p_175793_2_)
{
    return p_175793_1_.getBlock() == Blocks.stone ? true : (p_175793_1_.getBlock() == Blocks.dirt ? true : (p_175793_1_.getBlock() == Blocks.grass ? true : (p_175793_1_.getBlock() == Blocks.hardened_clay ? true : (p_175793_1_.getBlock() == Blocks.stained_hardened_clay ? true : (p_175793_1_.getBlock() == Blocks.sandstone ? true : (p_175793_1_.getBlock() == Blocks.red_sandstone ? true : (p_175793_1_.getBlock() == Blocks.mycelium ? true : (p_175793_1_.getBlock() == Blocks.snow_layer ? true : (p_175793_1_.getBlock() == Blocks.sand || p_175793_1_.getBlock() == Blocks.gravel) && p_175793_2_.getBlock().getMaterial() != Material.water))))))));
}
 
Example 14
Project: BaseClient   File: BlockDeadBush.java   View Source Code Vote up 4 votes
/**
 * is the block grass, dirt or farmland
 */
protected boolean canPlaceBlockOn(Block ground)
{
    return ground == Blocks.sand || ground == Blocks.hardened_clay || ground == Blocks.stained_hardened_clay || ground == Blocks.dirt;
}
 
Example 15
Project: BaseClient   File: MapGenCaves.java   View Source Code Vote up 4 votes
protected boolean func_175793_a(IBlockState p_175793_1_, IBlockState p_175793_2_)
{
    return p_175793_1_.getBlock() == Blocks.stone ? true : (p_175793_1_.getBlock() == Blocks.dirt ? true : (p_175793_1_.getBlock() == Blocks.grass ? true : (p_175793_1_.getBlock() == Blocks.hardened_clay ? true : (p_175793_1_.getBlock() == Blocks.stained_hardened_clay ? true : (p_175793_1_.getBlock() == Blocks.sandstone ? true : (p_175793_1_.getBlock() == Blocks.red_sandstone ? true : (p_175793_1_.getBlock() == Blocks.mycelium ? true : (p_175793_1_.getBlock() == Blocks.snow_layer ? true : (p_175793_1_.getBlock() == Blocks.sand || p_175793_1_.getBlock() == Blocks.gravel) && p_175793_2_.getBlock().getMaterial() != Material.water))))))));
}
 
Example 16
Project: BaseClient   File: BlockDeadBush.java   View Source Code Vote up 4 votes
/**
 * is the block grass, dirt or farmland
 */
protected boolean canPlaceBlockOn(Block ground)
{
    return ground == Blocks.sand || ground == Blocks.hardened_clay || ground == Blocks.stained_hardened_clay || ground == Blocks.dirt;
}