Former UFC champion Conor McGregor has appeared at a court in Brooklyn following an altercation at a UFC event in April.