Bektor Posted February 9, 2019 Posted February 9, 2019 (edited) Hi, whenever I'm trying to register my biomes and later call BiomeDictionary.addTypes I'm getting the following problem: Caused by: java.lang.IllegalArgumentException: Cannot add types to unregistered biome null @ObjectHolder(Constants.MOD_ID) public class ModBiomes { public static final BiomeDeepForest deepForest = null; @Mod.EventBusSubscriber(modid = Constants.MOD_ID) public static class RegistrationHandler { @SubscribeEvent public static void registerBiomes(final RegistryEvent.Register<Biome> event) { final IForgeRegistry<Biome> registry = event.getRegistry(); System.out.println("Registering biomes..."); // this line is called registry.register(new BiomeDeepForest().setRegistryName(Constants.MOD_ID, ModWorldGen.BIOME_NAME)); } } // Called at the end of FMLInitializationEvent public static void initBiomeManagerAndDictionary() { System.out.println("Init Biome Manager and Dictionary..."); // this line is called BiomeManager.addBiome(BiomeType.WARM, new BiomeEntry(deepForest, 10)); BiomeManager.addSpawnBiome(deepForest); BiomeDictionary.addTypes(deepForest, // Exception occurs here! BiomeDictionary.Type.FOREST, BiomeDictionary.Type.DENSE); } } Crash log: Reveal hidden contents Caused by: java.lang.IllegalArgumentException: Cannot add types to unregistered biome null at com.google.common.base.Preconditions.checkArgument(Preconditions.java:191) at net.minecraftforge.common.BiomeDictionary.addTypes(BiomeDictionary.java:185) at testmod.world.ModBiomes.initBiomeManagerAndDictionary(ModBiomes.java:50) at testmod.TestMod.init(TestMod.java:71) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:626) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136) at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:744) at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:336) at net.minecraft.client.Minecraft.init(Minecraft.java:582) at net.minecraft.client.Minecraft.run(Minecraft.java:422) at net.minecraft.client.main.Main.main(Main.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:25) Edited February 9, 2019 by Bektor Quote Developer of Primeval Forest.
Bektor Posted February 9, 2019 Author Posted February 9, 2019 On 2/9/2019 at 5:56 PM, diesieben07 said: Your biome field is not getting injected by @ObjectHolder, because it's name must match the registry name exactly. I doubt your registry name is deepForest, since registry names must be all lowercase. Expand Ah, ok. Thx. Quote Developer of Primeval Forest.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.