public static void registerWorldGen(ResourceLocation id,WorldGenerator generator){
  AutomaticNamespacedRegistry<ResourceLocation,WorldGenerator> registry=Registries.get(WorldGenerator.class);
  if (generator == null) {
    throw new NullPointerException("Attempted to register a null world generator");
  }
 else   if (id == null) {
    throw new NullPointerException("Attempted to register a world generator with a null ID");
  }
 else   if (registry.containsKey(id)) {
    throw new IllegalArgumentException(String.format("The world generator ID \"%s\" has already been registered",id));
  }
  registry.register(id,generator);
}

public static void registerWorldGen ( ResourceLocation id , WorldGenerator generator ) { AutomaticNamespacedRegistry < ResourceLocation , WorldGenerator > registry = Registries . get ( WorldGenerator . class ) ; if ( generator == null ) { throw new NullPointerException ( "Attempted to register a null world generator" ) ; } else if ( id == null ) { throw new NullPointerException ( "Attempted to register a world generator with a null ID" ) ; } else if ( registry . containsKey ( id ) ) { throw new IllegalArgumentException ( String . format ( "The world generator ID \"%s\" has already been registered" , id ) ) ; } registry . register ( id , generator ) ; }
registers a world generator .
