Combine sugar, cocoa, and flour in a heavy saucepan; stir to remove lumps. Combine eggs, milk, and water in a mixing bowl. Gradually add milk mixture to cocoa mixture, stirring until well blended. Cook over medium heat, stirring constantly, until mixture thickens and comes to a boil. Cook 1 minute, stirring constantly. Remove from heat; add butter and vanilla, stirring until butter melts. Pour into pastry shell. Chill. Garnish with whipped cream.