Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Furnace recipe handler NullPointer #358

Closed
chazwarp923 opened this issue Jul 13, 2016 · 12 comments
Closed

Furnace recipe handler NullPointer #358

chazwarp923 opened this issue Jul 13, 2016 · 12 comments
Labels

Comments

@chazwarp923
Copy link

I was testing my furnace recipes with JEI installed in my dev environment and i noticed that for some odd reason the furnace module of the vanilla integration fails to load due to a NullPointerException in vanilla code. I'm not sure if this is due to how you're calling it or if it truly is a Forge/Vanilla bug but I figured I'd report it. I first discovered it on JEI version 3.7.5.229 but i have tested it to still fail on 230, my dev environment is using Forge 1.10.2-12.18.1.2011 which as of July 13th, 2016 is the latest recommended version. You can find the stacktrace here: http://pastebin.com/RkHzJzgT and i have also attached a compiled version of my mod to see if that helps. Thanks for your time.

UnifiedItems.zip

@KnightMiner
Copy link

Looks like someone added a recipe without setting the experience value, if you are adding the recipes make sure you are setting that (such as by using the Forge method)

@chazwarp923
Copy link
Author

GameRegistry.addSmelting(block.getValue(), new ItemStack(UIItems.ingots.get(block.getKey())), 0.5f);
Thats one of my lines that adds a smelting recipe, i have the 0.5f in the function call

@mezz
Copy link
Owner

mezz commented Jul 14, 2016

Looks like your stack.getItem() is returning null, so you are not creating a valid itemstack.
This may be because your block has no associated Item when you register its smelting recipe.

@chazwarp923
Copy link
Author

How would that work though? Cause when I test the recipe it works just fine

@mezz
Copy link
Owner

mezz commented Jul 14, 2016

Are you testing the right recipe? How many do you add?

@chazwarp923
Copy link
Author

I'm loading up mc right now to test them all, but if one works they should all work since i add them all through one for loop

@mezz
Copy link
Owner

mezz commented Jul 14, 2016

Testing myself, I already found a smelting recipe that looks like

item.dustIron -> null

@mezz
Copy link
Owner

mezz commented Jul 14, 2016

https://github.com/chazwarp923/Unified-Items/blob/master/src/main/java/tech/chazwarp923/unifieditems/crafting/Smelting.java

In here you should check that your UIItems.ingots.get result is not null before making the recipe.

@chazwarp923
Copy link
Author

chazwarp923 commented Jul 14, 2016

Okay, after testing that one i see what i did wrong, but i still think that you should maybe add a case so that it doesn't fail to load the whole module if it gets a null ItemStack

@mezz
Copy link
Owner

mezz commented Jul 14, 2016

Yes, I am now

@chazwarp923
Copy link
Author

Well if thats all sorted ill just close this

@mezz
Copy link
Owner

mezz commented Jul 14, 2016

Fixed in JEI version 3.7.6.
Now it will log errors like this instead of crashing the module:

[19:22:57] [Client thread/ERROR] [JEI]: Found a broken recipe: mezz.jei.plugins.vanilla.furnace.SmeltingRecipe@1597087b
Output ItemStacks: Found an itemStack with a null item. This is an error from another mod.
Output Fluids: []
Input ItemStacks: [[1xitem.dustIron@0 unifieditems:dustIron]
]
Input Fluids: []

[19:22:57] [Client thread/ERROR] [JEI]: Found a broken recipe: mezz.jei.plugins.vanilla.furnace.SmeltingRecipe@17586565
Output ItemStacks: Found an itemStack with a null item. This is an error from another mod.
Output Fluids: []
Input ItemStacks: [[1xitem.dustGold@0 unifieditems:dustGold]
]
Input Fluids: []

...

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants