Just Enough Items (JEI)

Just Enough Items (JEI)

392M Downloads

My mod somehow causes JEI to fail to load

EnderiumSmith opened this issue ยท 19 comments

commented

Somehow when my mod CharcoalPit is present JEI will not load. Other mods dont appear to be affected. If i then remove CharcoalPit JEI will load and work fine. I dont know what i could possibly do to cause this. repo: https://github.com/EnderiumSmith/CharcoalPit2

commented

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

commented

To add some detail to this issue, I have been investigating what causes it. It appears to be explicitly caused by the bloomery recipes:
https://github.com/EnderiumSmith/CharcoalPit2/blob/master/src/main/java/charcoalPit/recipe/BloomeryRecipe.java
https://github.com/EnderiumSmith/CharcoalPit2/tree/master/src/main/resources/data/charcoal_pit/recipes/bloomery_recipes

As when I remove those from the datapack, I find JEI starts working again. Only for it to fail if any form of that recipe appears again (whether the original or custom).

commented

I make no promises here, but in BloomeryRecipe, you are, in some cases, returning null for an ItemStack. They should be ItemStack.EMPTY instead.

That said, getCraftingResult not returning an actual ItemStack feels really weird.

commented

any idea why? could it be because i read the ingredients as {} instead of [{}] like in crafting and [[{}]] like in alloys
if that were the case the new barrel recipes would also cause it

edit:nope. thats because those are lists. thats the correct format for reading a single ingredient

commented

it looks like that was the problem. those methods are junk to me so i left them as they were autocompleted.

but jei shouldnt just die without a trace when that happens. why does it even reads them. it doesnt know what to do with them anyway.

commented

Thanks for the report!
JEI should log a lot, have you checked the debug log?
I don't think I catch any exceptions without logging them.

commented

thers not a single thing other than forge listing the mods found.

can you just ignore this null since it seems likely that other mods could leave it null too?

commented

Surely the appropriate response to other mods doing it wrong is for the other mods to also fix their errors.

After all, ItemStack never being null comes from vanilla. IRecipe comes from the vanilla namespace. Even were JEI to just 'ignore it', there's no guarantee that others, or vanilla itself, will not hard crash.

commented

yes. i just not updated the github yet. its was the nulls. the other errors were unrelated

commented

Then might I respectfully suggest a "thank you for your time" to mezz, and close this issue?

commented

I think your mod completely breaks the vanilla recipe manager, so the event that JEI listens to (ForgeHooksClient.onRecipesUpdated at the end of net.minecraft.client.network.play.ClientPlayNetHandler#handleUpdateRecipes) is never fired and JEI never starts.

[07:55:42] [Render thread/FATAL] [minecraft/ThreadTaskExecutor]: Error executing task on Client
java.lang.NullPointerException: null
	at net.minecraft.client.Minecraft.lambda$null$15(Minecraft.java:681) ~[forge-1.16.5-36.0.42_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_275] {}
	at java.util.Collections$2.tryAdvance(Collections.java:4719) ~[?:1.8.0_275] {}
	at java.util.Collections$2.forEachRemaining(Collections.java:4727) ~[?:1.8.0_275] {}
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_275] {}
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_275] {}
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[?:1.8.0_275] {}
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[?:1.8.0_275] {}
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_275] {}
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485) ~[?:1.8.0_275] {}
	at net.minecraft.client.util.SearchTreeReloadable.index(SearchTreeReloadable.java:63) ~[forge-1.16.5-36.0.42_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.util.SearchTree.index(SearchTree.java:42) ~[forge-1.16.5-36.0.42_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.util.SearchTreeReloadable.func_217872_a(SearchTreeReloadable.java:50) ~[forge-1.16.5-36.0.42_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:408) ~[guava-21.0.jar:?] {}
	at net.minecraft.client.network.play.ClientPlayNetHandler.handleUpdateRecipes(ClientPlayNetHandler.java:1453) ~[forge-1.16.5-36.0.42_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.network.play.server.SUpdateRecipesPacket.processPacket(SUpdateRecipesPacket.java:30) ~[forge-1.16.5-36.0.42_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading}
	at net.minecraft.network.play.server.SUpdateRecipesPacket.processPacket(SUpdateRecipesPacket.java:16) ~[forge-1.16.5-36.0.42_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading}
	at net.minecraft.network.PacketThreadUtil.lambda$checkThreadAndEnqueue$0(PacketThreadUtil.java:19) ~[forge-1.16.5-36.0.42_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading}
	at net.minecraft.util.concurrent.ThreadTaskExecutor.run(ThreadTaskExecutor.java:139) ~[forge-1.16.5-36.0.42_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.util.concurrent.RecursiveEventLoop.run(RecursiveEventLoop.java:22) ~[forge-1.16.5-36.0.42_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading}
	at net.minecraft.util.concurrent.ThreadTaskExecutor.driveOne(ThreadTaskExecutor.java:109) ~[forge-1.16.5-36.0.42_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.util.concurrent.ThreadTaskExecutor.drainTasks(ThreadTaskExecutor.java:97) ~[forge-1.16.5-36.0.42_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:973) ~[forge-1.16.5-36.0.42_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.run(Minecraft.java:612) ~[forge-1.16.5-36.0.42_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.5-36.0.42_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_275] {}
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_275] {}
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_275] {}
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_275] {}
	at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.0.42_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {}
	at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.5-36.0.42_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {}
commented

There's also a ton of recipe errors in this log, please don't make me take the time to test stuff like this out myself. It would have been a lot easier for me if you told me there were some errors and just posted the log.

commented

i fixed the nulls and the errors in v2.4

commented

Is this resolved then? I worked from the code on the master branch from the project you linked.

commented

I made the same mistake with Advanced Rocketry where a recipe was returning a null item output. Just dropping by to say thanks @mezz! You saved me a ton of hours of debugging!

commented

Cool, glad to help!

commented

Well, as long as we're thanking people, thanks for Advanced Rocketry, @zmaster587 !

commented

We should thank Ommina instead as he found the problem. By the time mezz showed up i had already fixed it and uploaded a working version to curseforge.

commented

Thanks @Ommina !