blob: 848041fb4a2edd73473f7d97ae8e164bff59c6dc [file] [log] [blame] [raw]
package li.cil.oc.util
import net.minecraftforge.common.ForgeDirection
object RotationHelper {
def fromYaw(yaw: Float) = {
(yaw / 360 * 4).round & 3 match {
case 0 => ForgeDirection.SOUTH
case 1 => ForgeDirection.WEST
case 2 => ForgeDirection.NORTH
case 3 => ForgeDirection.EAST
}
}
}