bcwadsworth Posted August 14, 2014 Share Posted August 14, 2014 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. Quote Link to comment Share on other sites More sharing options...
shieldbug1 Posted August 14, 2014 Share Posted August 14, 2014 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. Quote 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. Link to comment Share on other sites More sharing options...
bcwadsworth Posted August 14, 2014 Author Share Posted August 14, 2014 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. Quote Link to comment Share on other sites More sharing options...
shieldbug1 Posted August 14, 2014 Share Posted August 14, 2014 My bad, I skimmed over the crash log. When do you initialise and register oreGemEnd to the GameRegistry? Quote 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. Link to comment Share on other sites More sharing options...
TehSeph Posted August 15, 2014 Share Posted August 15, 2014 Could we see the ORef file and BcwadsworthWorld.java? It looks like your ItemStack you're registering might be wrong. Quote Link to comment Share on other sites More sharing options...
bcwadsworth Posted August 15, 2014 Author Share Posted August 15, 2014 For no apparent reason, the problem has fixed itself! Thanks to all of you who tried! Quote Link to comment Share on other sites More sharing options...
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.