public void registerSpaceObject(ISpaceObject object,int dimId,int stationId){
  object.setId(stationId);
  stationLocations.put(stationId,object);
  int radius=(int)Math.floor(Math.ceil(Math.sqrt(stationId + 1)) / 2);
  int ringIndex=(int)(stationId - Math.pow((radius * 2) - 1,2));
  int x, z;
  if (ringIndex < (radius * 2 + 1) * 2) {
    x=ringIndex % (radius * 2 + 1) - radius;
    if (ringIndex < (radius * 2 + 1))     z=-radius;
 else     z=radius;
  }
 else {
    int newIndex=ringIndex - (radius * 2 + 1) * 2;
    z=newIndex % ((radius - 1) * 2 + 1) - (radius - 1);
    if (newIndex < ((radius - 1) * 2 + 1))     x=-radius;
 else     x=radius;
  }
  object.setPos(2 * x,2 * z);
  if (!object.hasCustomSpawnLocation())   object.setSpawnLocation(2 * Configuration.stationSize * x + Configuration.stationSize / 2,128,2 * Configuration.stationSize * z + Configuration.stationSize / 2);
  object.setOrbitingBody(dimId);
  moveStationToBody(object,dimId,false);
}

public void registerSpaceObject ( ISpaceObject object , int dimId , int stationId ) { object . setId ( stationId ) ; stationLocations . put ( stationId , object ) ; int radius = ( int ) Math . floor ( Math . ceil ( Math . sqrt ( stationId + 1 ) ) / 2 ) ; int ringIndex = ( int ) ( stationId - Math . pow ( ( radius * 2 ) - 1 , 2 ) ) ; int x , z ; if ( ringIndex < ( radius * 2 + 1 ) * 2 ) { x = ringIndex % ( radius * 2 + 1 ) - radius ; if ( ringIndex < ( radius * 2 + 1 ) ) z = - radius ; else z = radius ; } else { int newIndex = ringIndex - ( radius * 2 + 1 ) * 2 ; z = newIndex % ( ( radius - 1 ) * 2 + 1 ) - ( radius - 1 ) ; if ( newIndex < ( ( radius - 1 ) * 2 + 1 ) ) x = - radius ; else x = radius ; } object . setPos ( 2 * x , 2 * z ) ; if ( ! object . hasCustomSpawnLocation ( ) ) object . setSpawnLocation ( 2 * Configuration . stationSize * x + Configuration . stationSize / 2 , 128 , 2 * Configuration . stationSize * z + Configuration . stationSize / 2 ) ; object . setOrbitingBody ( dimId ) ; moveStationToBody ( object , dimId , false ) ; }
registers a space object with this manager , the class must have been registered prior to this with registerspaceobjecttype !
