Towdium / JustEnoughCalculation

A simple minecraft mod help you calculate the cost for recipes
Other
53 stars 38 forks source link

Mekanism Gas JEI Crush #68

Closed Krutoy242 closed 3 years ago

Krutoy242 commented 4 years ago

MC 1.12.2

Trying to pull Mekanism's Gas from JEI crush client with error:

Description: Updating screen events

java.lang.RuntimeException: Unrecognized ingredient type: class mekanism.api.gas.GasStack
    at me.towdium.jecalculation.data.label.ILabel$Converter.from(ILabel.java:245)
    at me.towdium.jecalculation.jei.JecaPlugin.getLabelUnderMouse(JecaPlugin.java:36)
    at me.towdium.jecalculation.gui.JecaGui.onMouse(JecaGui.java:108)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_1048_JecaGui_onMouse_Pre.invoke(.dynamic)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
    at com.github.terminatornl.laggoggles.tickcentral.EventBusTransformer.redirectEvent(EventBusTransformer.java:67)
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
    at net.minecraft.client.gui.GuiScreen.func_146269_k(GuiScreen.java:500)
    at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1759)
    at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1098)
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:398)
    at net.minecraft.client.main.Main.main(SourceFile:123)

Steps lead me to crush:

  1. I open new recipe UI pressing [+] in one of Mekanism's recipes including gas as input
  2. Gas was missing, so i try to pull it from JEI left panal (that created by pressing "A" on items)
  3. Clicking on gas caused crush
Krutoy242 commented 3 years ago

Same behaviour also happens with Thaumcraft's Aspects. Had crush again.

java.lang.RuntimeException: Unrecognized ingredient type: class thaumcraft.api.aspects.AspectList
    at me.towdium.jecalculation.data.label.ILabel$Converter.from(ILabel.java:245)
    at me.towdium.jecalculation.jei.JecaPlugin.getLabelUnderMouse(JecaPlugin.java:36)
    at me.towdium.jecalculation.gui.JecaGui.onMouse(JecaGui.java:108)
Towdium commented 3 years ago

Thanks for report! But let me explain a little.

For [+] transfer, I'm currently only extracting ItemStack and FluidStack from Jei recipes. Jei actually supports other types of ingredients. If these mods are handling correctly, I should be able to extract these things.

But another problem, as you have seen, I have to convert ingredients into JECa built-in types for them to support calculation and serialization. I have several built-in types: ItemStack, FluidStack, Placeholders and other OreDict ones. For less-used ingredient types, to save me some time, I will convert them into Placeholders with special names, rather than creating new built-in types, although I agree that using specialized built-in types will improve the appearance.

The above behavior is implemented half-way for 1.14+. 1.12 might also have an update in the future. But for now, you can simply use placeholders to get around it.

Krutoy242 commented 3 years ago

Thank you for answer! If new behavior would not be implemented soon, please at least disable [+] action for non-standart types. I usually accidentally clicking on [+] button and got crush, when just not noticed weird item in ingredient list.

Towdium commented 3 years ago

For 1.15+, I'm doing a quite shabby, but working solution for such things. The amount also get transferred correctly. 2020-09-12_23 38 29 For 1.12, I will soon make a simpler change to get rid of crashes, since I don't want to mach too much change to it.