In top of double boiler, stir together rice and sugar, then stir in eggs and half-and-half. Place over 1 inch simmering water and cook, whisking constantly, until mixture thickens and reaches 160 degrees on instant-read thermometer, 5 to 7 minutes. Remove bowl from heat and whisk in chocolate until melted. Serve warm or refrigerate until cold, stirring occasionally, about 2 hours. Garnish with pistachios and chocolate shavings.