I see, so you're not using transformation matrices, you basically have a multi-dimension array to store the pieces. That is something entirely different than what I thought.
In that case, just make your own rotate functions. It should be fairly simple, just indexing in a different order. I found this code which looks like it should work, but I didn't test it. In any case, it's just a matter of looping through the array and creating a new array with a different order of elements.
https://godotengine.org/qa/92697/how-can-i-rotate-an-array-of-array