當前位置: 首頁>>代碼示例>>Java>>正文


Java Blocks.sand方法代碼示例

本文整理匯總了Java中net.minecraft.init.Blocks.sand方法的典型用法代碼示例。如果您正苦於以下問題:Java Blocks.sand方法的具體用法?Java Blocks.sand怎麽用?Java Blocks.sand使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.init.Blocks的用法示例。


在下文中一共展示了Blocks.sand方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: canPlaceBlockAt

import net.minecraft.init.Blocks; //導入方法依賴的package包/類
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;
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:26,代碼來源:BlockReed.java

示例2: canPlaceBlockAt

import net.minecraft.init.Blocks; //導入方法依賴的package包/類
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;
	}
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:19,代碼來源:BlockReed.java

示例3: canBlockStay

import net.minecraft.init.Blocks; //導入方法依賴的package包/類
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;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:14,代碼來源:BlockCactus.java

示例4: canBlockStay

import net.minecraft.init.Blocks; //導入方法依賴的package包/類
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;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:15,代碼來源:BlockCactus.java

示例5: canPlaceBlockAt

import net.minecraft.init.Blocks; //導入方法依賴的package包/類
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;
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:28,代碼來源:BlockReed.java

示例6: canBlockStay

import net.minecraft.init.Blocks; //導入方法依賴的package包/類
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;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:16,代碼來源:BlockCactus.java

示例7: func_175793_a

import net.minecraft.init.Blocks; //導入方法依賴的package包/類
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))))))));
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:5,代碼來源:MapGenCaves.java

示例8: canPlaceBlockOn

import net.minecraft.init.Blocks; //導入方法依賴的package包/類
/**
 * 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;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:8,代碼來源:BlockDeadBush.java


注:本文中的net.minecraft.init.Blocks.sand方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。