So, you can get the registry instance in the RegistryEvent.Register<Biome> event. Even if you're not registering your own biome you can handle it. The event.getRegistry().getValues() returns a List<Biome> that can be stored in your own field for later reference. However, there is no guarantee that another mod isn't going to register more biomes after your chance to handle the event. So probably better to store the registry itself and grab the values later (maybe in the init loading phase) or if you're only looking up biomes occasionally performance probably isn't big concern and you can look it up whenever it makes sense.
So, the steps would be:
1) make a class that is registered as an event handler, and have a method that subscribes to the event bus that handles the RegistryEvent.Register<Biome> case.
2) In that event handling method you would assign the registry to a public static field that you can access from elsewhere in your code.
So something like this:
/**
/* This class would probably also be the one where you register your own biomes, if you
/* do that in your mod. Otherwise can be its own class dedicated for this purpose.
**/
@ObjectHolder(MainMod.MODID) // in case you're actually also registering biomes
public class ModBiomes
{
// field to contain registry for later reference
public final static IForgeRegistry<Biome> registry = null;
@Mod.EventBusSubscriber(modid = MainMod.MODID)
public static class RegistrationHandler
{
/**
* Register this mod's {@link Biome}s.
*
* @param event The event
*/
@SubscribeEvent
public static void onEvent(final RegistryEvent.Register<Biome> event)
{
System.out.println("Storing biome registry");
registry = event.getRegistry();
// Register any of your own biomes here as well
// example: registry.register(new BiomeCloud().setRegistryName(MainMod.MODID, ModWorldGen.CLOUD_NAME));
// DEBUG
System.out.println("Registry key set = " + registry.getKeys());
System.out.println("Registry value list = " + registry.getValues());
}
}
}
Then later, you can just get the List<Biome> by referring to ModBiomes.registry.getValues(). Again I suggest you grab this in the init phase of your mod loading (where you'll be guaranteed that all other mods have added their biomes). You can put that list also into a public static field or not depending on how you intend to use the values.