Jump to content

[1.7.10] NullPointerException: Ticking block entity


J3FF97

Recommended Posts

Hey everyone~

 

Whilst making an infuser block (2 inputs, 1 output, no fuel) I stumbled upon this crash:

 

http://pastebin.com/xztWZ7KH

 

The code that goes with the mod is here:

 

https://github.com/J3FF97/Elemental-Melons/blob/1.7.10/src/main/java/j3ff97/elementalmelons/tileentity/TileEntitySeedInfuser.java

 

The line that apparantly gives a NullPointer is: ItemStack stack = SeedInfuserRecipes.instance().getInfusingResult(slots[0].getItem(), slots[1].getItem());

I've checked and that line should only be null if I would not have specified any recipes, which I did. In another mod this (almost exact) same code is working. Anyone who can enlighten me?

 

~J

Link to comment
Share on other sites

I specify it in a class called CraftingHandler and register it in my commonproxy.

 

SeedInfuserRecipes.addInfusing(Items.melon_seeds, Items.magma_cream, new ItemStack(ModItems.fireMelonSeeds));

 

That's the line that registers it. I forgot to tell but the crash occurs whenever I place this recipe into the gui. (This is the only recipe I've registered for the block as a test.)

Link to comment
Share on other sites

If you checked the load orders then I don't know. The only thing I could think about is that you might be loading your items after the recipes get initialized, but I don't think you did that. I'm pretty sure you did that right. I'll think some more, if I think of something I will get back to you.

Link to comment
Share on other sites

I see what you mean, Weird thing is that I do exactly the same thing in another mod of mine and it works. I should probably get rid of the loop though since as far as I know it does not add anything except for just another crash possibility.

 

Thanks anyways :) Now I just gotta fix shift clicking and this block is done~

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.