getRotatedPos

fun getRotatedPos(blockPos: BlockPos, rotation: Int): BlockPos

Rotates the given blockPos for a room with rotation to rotation 0.

rotation is the rotation of the room in degrees. It has to be a multiple of 90 within the range of -360 to +360. For any other value blockPos is returned.

If you have coordinates in the rooms coordinate system this function will rotate them into real world coordinates. The coordinates will still be offset by the position of the rooms center afterwards.

To rotate coordinates from absolute world coordinates into the coordinate system of the room use this method with minus the rotation of the room as argument.

See also