Jump to content

[SOLVED][1.6.4] Can't get GameRegistry.findItem to work :/


Titanium237458

Recommended Posts

Hi,

I'm new to Forge Modding and wanted to make a Thaumcraft Addon which add new wand rods and caps.

Everything is working fine except one thing: I can't access the items from Thaumcraft, but I need to do that for

my recipes.

I try it with

public static Item thaumResource = GameRegistry.findItem("Thaumcraft", "ItemResource");
AWLog.AWLogger.log(Level.INFO, "ItemResource: " + thaumcraftItem.thaumResource); //Just prints out messages for debugging

//ItemResource: thaumcraft.common.items.ItemResource@59ec437 (This it what appears in the console)

But when I the want to make a recipe with that like that:

GameRegistry.addShapelessRecipe(new ItemStack(thaumcraftItem.thaumResource, 1, 0), new Object[]{Item.diamond});

It crashes with this report:

 

---- Minecraft Crash Report ----

// There are four lights!

 

Time: 01.03.14 16:15

Description: There was a severe problem during mod loading that has caused the game to fail

 

cpw.mods.fml.common.LoaderException: java.lang.ExceptionInInitializerError

at cpw.mods.fml.common.LoadController.transition(LoadController.java:156)

at cpw.mods.fml.common.Loader.initializeMods(Loader.java:700)

at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:249)

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

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

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

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:131)

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

Caused by: java.lang.ExceptionInInitializerError

at titanium.Advanced_Wandcraft.Recipes.Crafting(Recipes.java:73)

at titanium.Advanced_Wandcraft.Advanced_Wandcraft.init(Advanced_Wandcraft.java:158)

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:545)

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.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:201)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:181)

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.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:112)

at cpw.mods.fml.common.Loader.initializeMods(Loader.java:699)

... 10 more

Caused by: java.lang.NullPointerException

at net.minecraft.item.ItemStack.<init>(ItemStack.java:77)

at titanium.Advanced_Wandcraft.thaumcraftItem.<clinit>(thaumcraftItem.java:12)

... 39 more

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- System Details --

Details:

Minecraft Version: 1.6.4

Operating System: Windows 8 (amd64) version 6.2

Java Version: 1.7.0_45, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 787266696 bytes (750 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

Suspicious classes: FML and Forge are installed

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP v8.11 FML v6.4.49.965 Minecraft Forge 9.11.1.965 6 mods loaded, 6 mods active

mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized

FML{6.4.49.965} [Forge Mod Loader] (bin) Unloaded->Constructed->Pre-initialized->Initialized

Forge{9.11.1.965} [Minecraft Forge] (bin) Unloaded->Constructed->Pre-initialized->Initialized

CodeChickenCore{0.9.0.7}

[CodeChicken Core] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
Thaumcraft{4.1.0} [Thaumcraft] (Thaumcraft4.1.0.zip) Unloaded->Constructed->Pre-initialized->Initialized
Advanced_Wandcraft{0.0.1} [Advanced Wandcraft for Thaumcraft] (bin) Unloaded->Constructed->Pre-initialized->Errored[/spoiler]

And when I make an ItemStack with that directly:
public static ItemStack thaumResource = new ItemStack(GameRegistry.findItem("Thaumcraft", "ItemResource"));

It returns this in the console:

ItemResource: 1xitem.ItemResource@0

But when I try to make recipe with that:

GameRegistry.addShapelessRecipe(thaumcraftItem.thaumResource, new Object[]{Item.diamond});

It crashes with this error:

 

---- Minecraft Crash Report ----

// Hey, that tickles! Hehehe!

 

Time: 01.03.14 16:22

Description: There was a severe problem during mod loading that has caused the game to fail

 

cpw.mods.fml.common.LoaderException: java.lang.ExceptionInInitializerError

at cpw.mods.fml.common.LoadController.transition(LoadController.java:156)

at cpw.mods.fml.common.Loader.initializeMods(Loader.java:700)

at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:249)

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

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

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

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:131)

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

Caused by: java.lang.ExceptionInInitializerError

at titanium.Advanced_Wandcraft.Recipes.Crafting(Recipes.java:73)

at titanium.Advanced_Wandcraft.Advanced_Wandcraft.init(Advanced_Wandcraft.java:158)

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:545)

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.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:201)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:181)

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.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:112)

at cpw.mods.fml.common.Loader.initializeMods(Loader.java:699)

... 10 more

Caused by: java.lang.NullPointerException

at net.minecraft.item.ItemStack.<init>(ItemStack.java:77)

at titanium.Advanced_Wandcraft.thaumcraftItem.<clinit>(thaumcraftItem.java:12)

... 39 more

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- System Details --

Details:

Minecraft Version: 1.6.4

Operating System: Windows 8 (amd64) version 6.2

Java Version: 1.7.0_45, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 795461936 bytes (758 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

Suspicious classes: FML and Forge are installed

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP v8.11 FML v6.4.49.965 Minecraft Forge 9.11.1.965 6 mods loaded, 6 mods active

mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized

FML{6.4.49.965} [Forge Mod Loader] (bin) Unloaded->Constructed->Pre-initialized->Initialized

Forge{9.11.1.965} [Minecraft Forge] (bin) Unloaded->Constructed->Pre-initialized->Initialized

CodeChickenCore{0.9.0.7} [CodeChicken Core] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized

Thaumcraft{4.1.0} [Thaumcraft] (Thaumcraft4.1.0.zip) Unloaded->Constructed->Pre-initialized->Initialized

Advanced_Wandcraft{0.0.1} [Advanced Wandcraft for Thaumcraft] (bin) Unloaded->Constructed->Pre-initialized->Errored

 

(I think both are the same messages).

I just can't get it to work, what am I doing wrong? I really appreciate any help I get :)

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.