@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); }
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; }
@Deprecated @Override public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, IBlockState state, BlockPos pos, EnumFacing face) { EnumFacing st = state.getValue(FACING); if (st == face) return BlockFaceShape.CENTER; EnumFacing op = face.getOpposite(); if (st == op) return BlockFaceShape.SOLID; return BlockFaceShape.UNDEFINED; }
@Override public boolean canPlaceBlockAt(World world, BlockPos pos) { //get the block 1 lower IBlockState state = world.getBlockState(pos.down()); Block block = state.getBlock(); if (block == null) { return false; } else{ //FUTURE maybe tweak to use the oredict to allow other types of glass return state.getBlockFaceShape(world, pos, EnumFacing.UP)==BlockFaceShape.SOLID || block == Blocks.GLASS; } }
@Override public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, BlockPos pos, EnumFacing facing) { return delegate.getBlockFaceShape(worldIn, pos, facing); }
@SuppressWarnings("deprecation") public BlockFaceShape getBlockFaceShape(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_) { return p_193383_4_ != EnumFacing.UP && p_193383_4_ != EnumFacing.DOWN ? BlockFaceShape.MIDDLE_POLE : BlockFaceShape.CENTER; }
@SuppressWarnings("deprecation") @Override public BlockFaceShape getBlockFaceShape(IBlockAccess world, IBlockState blockState, BlockPos pos, EnumFacing face) { return BlockFaceShape.UNDEFINED; }
@Override public BlockFaceShape getBlockFaceShape(IBlockAccess world, IBlockState state, BlockPos pos, EnumFacing facing) { return BlockFaceShape.UNDEFINED; }
@Override public BlockFaceShape getBlockFaceShape(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_) { return BlockFaceShape.UNDEFINED; }
public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, IBlockState state, BlockPos pos, EnumFacing face) { return BlockFaceShape.UNDEFINED; }
public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, IBlockState state, BlockPos pos, EnumFacing face) { return face == EnumFacing.DOWN ? BlockFaceShape.SOLID : BlockFaceShape.UNDEFINED; }
@Override public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, IBlockState state, BlockPos pos, EnumFacing face) { return BlockFaceShape.UNDEFINED; }
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; }
@Override public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, IBlockState state, BlockPos pos, EnumFacing face) { return face == EnumFacing.DOWN ? BlockFaceShape.SOLID : BlockFaceShape.UNDEFINED; }
@Override public BlockFaceShape getBlockFaceShape(IBlockAccess world, IBlockState state, BlockPos pos, EnumFacing facing) { return state.getValue(BlockDirectional.FACING) == facing ? BlockFaceShape.SOLID : BlockFaceShape.UNDEFINED; }
@Override public BlockFaceShape getBlockFaceShape(IBlockAccess blockAccess, IBlockState state, BlockPos pos, EnumFacing side) { return side == EnumFacing.DOWN ? BlockFaceShape.SOLID : BlockFaceShape.UNDEFINED; }
@SuppressWarnings("deprecation") @Override public BlockFaceShape getBlockFaceShape(IBlockAccess world, IBlockState state, BlockPos pos, EnumFacing face) { return BlockFaceShape.UNDEFINED; }