Jump to content

1.7.10 Ore Dictionary?


Elite_Forges

Recommended Posts

I've tried numerous times to register my items / blocks into the Ore Dictionary with no success. My game just crashes when I run it.

 

Just to get this cleared up right away, isn't this the code you use to add an ore to the dictionary?

OreDictionary.registerOre("oreCopper", oreCopper);

 

Crash Report:

 

 

---- Minecraft Crash Report ----

// But it works on my machine.

 

Time: 8/9/14 9:49 PM

Description: Initializing game

 

java.lang.NullPointerException: Initializing game

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 net.raccoon.stuffplus.core.Stuff.add(Stuff.java:101)

at net.raccoon.stuffplus.core.Main.preInit(Main.java:13)

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.preinitializeMods(Loader.java:513)

at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:239)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:532)

at net.minecraft.client.Minecraft.run(Minecraft.java:941)

at net.minecraft.client.main.Main.main(Main.java:164)

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 net.minecraft.launchwrapper.Launch.launch(Launch.java:134)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

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 GradleStart.bounce(GradleStart.java:108)

at GradleStart.startClient(GradleStart.java:101)

at GradleStart.main(GradleStart.java:56)

 

Errors I've noticed:

at net.raccoon.stuffplus.core.Stuff.add(Stuff.java:101)

 

OreDictionary.registerOre("oreCopper", oreCopper);

 

at net.raccoon.stuffplus.core.Main.preInit(Main.java:13)

 

Stuff.add();    <-- Under FMLPreInitialization

 

 

 

Link to comment
Share on other sites

I've tried it as itemstack just now

OreDictionary.registerOre("oreCopper", new ItemStack(oreCopper, 1, 0));

 

Still crashed for some reason.. Not sure what's going on.

 

Here's the new crash report if you want it:

http://pastebin.com/ZsrZpmzw

 

 

EDIT:  To make things even weirder I've run one of my older 1.6.4 mods with oredictionary and it works just fine.

OreDictionary.registerOre("nuggetIron", new ItemStack(ironNugget));

Link to comment
Share on other sites

Item.getItemFromBlock seems to be returning null.

 

Try registering to the OreDictionary in the init method (the one with the FMLInitializationEvent, rather than the FMLPreInitializationEvent).

 

BEFORE ASKING FOR HELP READ THE EAQ!

 

I'll help if I can. Apologies if I do something obviously stupid. :D

 

If you don't know basic Java yet, go and follow these tutorials.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.