本文整理匯總了Java中net.minecraft.block.state.IBlockState.getBlockFaceShape方法的典型用法代碼示例。如果您正苦於以下問題:Java IBlockState.getBlockFaceShape方法的具體用法?Java IBlockState.getBlockFaceShape怎麽用?Java IBlockState.getBlockFaceShape使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.block.state.IBlockState
的用法示例。
在下文中一共展示了IBlockState.getBlockFaceShape方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ejectFailure
import net.minecraft.block.state.IBlockState; //導入方法依賴的package包/類
@Nullable
public void ejectFailure(World world, BlockPos pos, ItemStack failure, EnumFacing[] directions)
{
int ioff = 0;
for(int i = 0; i < directions.length; i++)
{
EnumFacing direction = directions[(i + ioff) % directions.length];
BlockPos ejectPos = pos.offset(direction);
IBlockState state = world.getBlockState(ejectPos);
if(state.getBlockFaceShape(world,ejectPos,direction.getOpposite()) == BlockFaceShape.UNDEFINED)
{
ejectFailure(world,pos,failure,direction);
return;
}
}
ejectFailure(world,pos,failure,EnumFacing.UP);
}
示例2: canConnectTo
import net.minecraft.block.state.IBlockState; //導入方法依賴的package包/類
public boolean canConnectTo(IBlockAccess worldIn, BlockPos pos, EnumFacing p_176524_3_) {
IBlockState iblockstate = worldIn.getBlockState(pos);
BlockFaceShape blockfaceshape = iblockstate.getBlockFaceShape(worldIn, pos, p_176524_3_);
Block block = iblockstate.getBlock();
boolean flag = blockfaceshape == BlockFaceShape.MIDDLE_POLE && (iblockstate.getMaterial() == this.blockMaterial || block instanceof BlockFenceGate);
return !isExcepBlockForAttachWithPiston(block) && blockfaceshape == BlockFaceShape.SOLID || flag;
}
示例3: canAttachToBlock
import net.minecraft.block.state.IBlockState; //導入方法依賴的package包/類
private static boolean canAttachToBlock(World world, BlockPos pos, EnumFacing facing)
{
IBlockState state = world.getBlockState(pos);
return facing.getHorizontalIndex() != -1 && !isExceptBlockForAttachWithPiston(state.getBlock()) && state.getBlockFaceShape(world, pos, facing) == BlockFaceShape.SOLID;
}