Posted August 14, 201411 yr Hello! I have been trying to register my ore into the ore dictionary. When I try to run minecraft, the following stacktrace for the error appears: Stacktrace: at net.minecraft.item.ItemStack.getItemDamage(ItemStack.java:267) at net.minecraftforge.oredict.OreDictionary.registerOreImpl(OreDictionary.java:454) at net.minecraftforge.oredict.OreDictionary.registerOre(OreDictionary.java:432) at net.minecraftforge.oredict.OreDictionary.registerOre(OreDictionary.java:431) at bcwadsworth.bcwadsworthWorld.BcwadsworthWorld.dictRegistration(BcwadsworthWorld.java:168) at bcwadsworth.bcwadsworthWorld.BcwadsworthWorld.init(BcwadsworthWorld.java:65) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:691) at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:288) at net.minecraft.client.Minecraft.startGame(Minecraft.java:596) The code I use to register into the dictionary is OreDictionary.registerOre("oreGemEnd", ORef.oreGemEnd); ORef is where I keep all the references to my items. I think this is a forge error, but I cannot be certain.
August 14, 201411 yr Ore dictionary has to go in your init method, not your pre-init. This is not a forge bug. I believe it's because registering blocks actually registers an ItemStack, which uses Item.getItemFromBlock which returns null during the Pre-Initialisation stage of Minecraft. BEFORE ASKING FOR HELP READ THE EAQ! I'll help if I can. Apologies if I do something obviously stupid. If you don't know basic Java yet, go and follow these tutorials.
August 14, 201411 yr Author My registration to the dictionary goes in init. It is in the correct place unless it needs to go into post-init. EDIT: I tried using ore dictionary in post-init, this gave the same error.
August 14, 201411 yr My bad, I skimmed over the crash log. When do you initialise and register oreGemEnd to the GameRegistry? BEFORE ASKING FOR HELP READ THE EAQ! I'll help if I can. Apologies if I do something obviously stupid. If you don't know basic Java yet, go and follow these tutorials.
August 15, 201411 yr Could we see the ORef file and BcwadsworthWorld.java? It looks like your ItemStack you're registering might be wrong.
August 15, 201411 yr Author For no apparent reason, the problem has fixed itself! Thanks to all of you who tried!
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.