Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

Where do you specify your recipes?

  • Author

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.)

Ok, I'll pick through your code some more. :)

  • Author

Thanks ^-^  I checked the load orders, but that did not seem to be a problem :/ It's probably a very minor typo or something like that, knowing myself, but I just can't figure it out :/

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.

  • Author

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~

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.