Just Enough Items (JEI)

Just Enough Items (JEI)

387M Downloads

[Crash]: Clicking on Integrated Terminals energy: java.lang.IllegalArgumentException: Unknown ingredient class: class java.lang.Long

DasBrain opened this issue ยท 4 comments

commented

Steps to Reproduce the Crash

  1. Make an Integrated Dynamics Network with at least 1 Energy Battery + 1 Storage Terminal
  2. Add some energy to to the Energy Battery
  3. Open the Storage Terminal
  4. Go to the Energy Tab
  5. Click on the stored energy.
  6. CRASH

Mod Pack URL (Optional)

https://www.curseforge.com/minecraft/modpacks/encrypted_

Mod Pack Version (Optional)

R-2.1.3

Extra Notes (Optional)

While the actions required talk about Integrated Dynamics/Integrated Terminals - the stack trace points to JEI.

Crash Report

https://gist.github.com/DasBrain/9ce4776307c8cbc53ed099a4b592d776

commented

Thanks for the report!
It looks like the GUI handler from Integrated Dynamics is handing a Long (number) to JEI when it is expecting an ingredient.
Please report this to them and link back to this issue.

commented

Can you please show me where IntegratedTerminals passes a Long to JEI?
IntegratedTerminals doesn't appear in the stack trace.

I believe the error is that JEI expects items holding (when clicking on an item in the Inventory, you hold that item) to be an Ingredient - which may not be true.

commented

The causal chain here is a little more complicated than the stack trace, let me explain.

The crash happens here:

return TypedIngredient.create(registeredIngredients, ingredient)

This is because it is passed something that is not an ingredient. Where is that ingredient parameter coming from? Let's look up the stack.

Further up we see it called here:

.map(i -> createClickedIngredient(i, guiContainer))

So the ingredient is called i here and comes from the previous part of the stream.

Here is the source of the i ingredient:

return Stream.concat(
this.guiContainerHandlers.getActiveGuiHandlerStream(guiContainer)
.map(a -> a.getIngredientUnderMouse(guiContainer, mouseX, mouseY)),
this.globalGuiHandlers.stream()
.map(a -> a.getIngredientUnderMouse(mouseX, mouseY))
)

This code calls all JEI plugins with GUI handlers and asks them "what ingredient is under the mouse". They hand JEI a raw Object, it could be anything. It's up to them to hand JEI the correct data or it will crash.
In this case, some handler from an addon mod is handing JEI a Long, which is not a valid type of ingredient, and JEI crashes.
Since the current GUI belongs to IntegratedTerminals, it seems very likely that they have added a handler to JEI for their own GUI, and that handler is giving JEI a Long.

Hope that makes sense, let me know if you have any questions.