use of blusunrize.immersiveengineering.api.IPostBlock in project ImmersiveEngineering by BluSunrize.
the class BlockConnector method onBlockPlaced.
@Override
public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) {
IBlockState ret = super.onBlockPlaced(world, pos, facing, hitX, hitY, hitZ, meta, placer);
if (meta == BlockTypes_Connector.TRANSFORMER.getMeta()) {
BlockPos pos2 = pos.offset(facing, -1);
IBlockState placedAgainst = world.getBlockState(pos2);
Block block = placedAgainst.getBlock();
if (block instanceof IPostBlock && ((IPostBlock) block).canConnectTransformer(world, pos2))
ret = ret.withProperty(IEProperties.BOOLEANS[1], true);
TileEntity tile = world.getTileEntity(pos2);
if (tile instanceof IPostBlock && ((IPostBlock) tile).canConnectTransformer(world, pos2))
ret = ret.withProperty(IEProperties.BOOLEANS[1], true);
}
return ret;
}
Aggregations