private void checkClassAndSync(Class<? extends IPacket> clazz){
  if (!registeredClasses.contains(clazz)) {
    throw new RuntimeException("NetworkHelper got unknown Packet type " + clazz + " to send, critical error");
  }
  while (isCurrentlySendingSemaphor) {
    Thread.yield();
  }
  isCurrentlySendingSemaphor=true;
}

private void checkClassAndSync ( Class < ? extends IPacket > clazz ) { if ( ! registeredClasses . contains ( clazz ) ) { throw new RuntimeException ( "NetworkHelper got unknown Packet type " + clazz + " to send, critical error" ) ; } while ( isCurrentlySendingSemaphor ) { Thread . yield ( ) ; } isCurrentlySendingSemaphor = true ; }
since the crash that happens if we dont do this is complete garbage
