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


Java World.isBlockNormalCube方法代碼示例

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


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

示例1: onBlockPlaced

import net.minecraft.world.World; //導入方法依賴的package包/類
/**
 * Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
 * IBlockstate
 */
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
{
    if (this.canPlaceAt(worldIn, pos, facing))
    {
        return this.getDefaultState().withProperty(FACING, facing);
    }
    else
    {
        for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL)
        {
            if (worldIn.isBlockNormalCube(pos.offset(enumfacing.getOpposite()), true))
            {
                return this.getDefaultState().withProperty(FACING, enumfacing);
            }
        }

        return this.getDefaultState();
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:24,代碼來源:BlockTorch.java

示例2: onBlockPlaced

import net.minecraft.world.World; //導入方法依賴的package包/類
/**
 * Called by ItemBlocks just before a block is actually set in the world, to
 * allow for adjustments to the IBlockstate
 */
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ,
		int meta, EntityLivingBase placer) {
	if (this.canPlaceAt(worldIn, pos, facing)) {
		return this.getDefaultState().withProperty(FACING, facing);
	} else {
		for (Object enumfacing0 : EnumFacing.Plane.HORIZONTAL) {
			EnumFacing enumfacing = (EnumFacing) enumfacing0;
			if (worldIn.isBlockNormalCube(pos.offset(enumfacing.getOpposite()), true)) {
				return this.getDefaultState().withProperty(FACING, enumfacing);
			}
		}

		return this.getDefaultState();
	}
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:20,代碼來源:BlockTorch.java

示例3: onNeighborChangeInternal

import net.minecraft.world.World; //導入方法依賴的package包/類
protected boolean onNeighborChangeInternal(World worldIn, BlockPos pos, IBlockState state) {
	if (!this.checkForDrop(worldIn, pos, state)) {
		return true;
	} else {
		EnumFacing enumfacing = (EnumFacing) state.getValue(FACING);
		EnumFacing.Axis enumfacing$axis = enumfacing.getAxis();
		EnumFacing enumfacing1 = enumfacing.getOpposite();
		boolean flag = false;

		if (enumfacing$axis.isHorizontal() && !worldIn.isBlockNormalCube(pos.offset(enumfacing1), true)) {
			flag = true;
		} else if (enumfacing$axis.isVertical() && !this.canPlaceOn(worldIn, pos.offset(enumfacing1))) {
			flag = true;
		}

		if (flag) {
			this.dropBlockAsItem(worldIn, pos, state, 0);
			worldIn.setBlockToAir(pos);
			return true;
		} else {
			return false;
		}
	}
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:25,代碼來源:BlockTorch.java

示例4: onBlockPlaced

import net.minecraft.world.World; //導入方法依賴的package包/類
/**
 * Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
 * IBlockstate
 */
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
{
    if (this.canPlaceAt(worldIn, pos, facing))
    {
        return this.getDefaultState().withProperty(FACING, facing);
    }
    else
    {
        for (Object enumfacing0 : EnumFacing.Plane.HORIZONTAL)
        {
            EnumFacing enumfacing = (EnumFacing) enumfacing0;

            if (worldIn.isBlockNormalCube(pos.offset(enumfacing.getOpposite()), true))
            {
                return this.getDefaultState().withProperty(FACING, enumfacing);
            }
        }

        return this.getDefaultState();
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:26,代碼來源:BlockTorch.java

示例5: onNeighborChangeInternal

import net.minecraft.world.World; //導入方法依賴的package包/類
protected boolean onNeighborChangeInternal(World worldIn, BlockPos pos, IBlockState state)
{
    if (!this.checkForDrop(worldIn, pos, state))
    {
        return true;
    }
    else
    {
        EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
        EnumFacing.Axis enumfacing$axis = enumfacing.getAxis();
        EnumFacing enumfacing1 = enumfacing.getOpposite();
        boolean flag = false;

        if (enumfacing$axis.isHorizontal() && !worldIn.isBlockNormalCube(pos.offset(enumfacing1), true))
        {
            flag = true;
        }
        else if (enumfacing$axis.isVertical() && !this.canPlaceOn(worldIn, pos.offset(enumfacing1)))
        {
            flag = true;
        }

        if (flag)
        {
            this.dropBlockAsItem(worldIn, pos, state, 0);
            worldIn.setBlockToAir(pos);
            return true;
        }
        else
        {
            return false;
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:35,代碼來源:BlockTorch.java

示例6: canPlaceAt

import net.minecraft.world.World; //導入方法依賴的package包/類
private boolean canPlaceAt(World worldIn, BlockPos pos, EnumFacing facing)
{
    BlockPos blockpos = pos.offset(facing.getOpposite());
    boolean flag = facing.getAxis().isHorizontal();
    return flag && worldIn.isBlockNormalCube(blockpos, true) || facing.equals(EnumFacing.UP) && this.canPlaceOn(worldIn, blockpos);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:7,代碼來源:BlockTorch.java

示例7: canPlaceAt

import net.minecraft.world.World; //導入方法依賴的package包/類
private boolean canPlaceAt(World worldIn, BlockPos pos, EnumFacing facing) {
	BlockPos blockpos = pos.offset(facing.getOpposite());
	boolean flag = facing.getAxis().isHorizontal();
	return flag && worldIn.isBlockNormalCube(blockpos, true)
			|| facing.equals(EnumFacing.UP) && this.canPlaceOn(worldIn, blockpos);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:7,代碼來源:BlockTorch.java


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