Man pleads guilty in weapons case, sentenced to eight years