
Just Enough Calculation cannot read GregTech Recipes from JEI
whizzball1 opened this issue ยท 3 comments
Checked for existing issues
- I have checked for existing issues, and have found none.
Tested latest version
- I have checked that this occurs on the latest version.
GregTech CEu Version
gtceu-1.20.1-1.2.0.a
Recipe Viewer Installed
JEI
Environment
Singleplayer
Cross-Mod Interaction
Yes
Other Installed Mods
Just Enough Calculation
Expected Behavior
Just Enough Calculation (JEC) is a mod similar to EMI with its own 'recipe calculator'. It uses JEI's recipe transfer system (the + button) to add recipes to its calculator. I expect to be able to add GregTech recipes to the JEC recipe calculator using the + button.
Actual Behavior
When in the JEC recipe calculator, if I open up a GT recipe in JEI, the + button does not appear. Additionally, JEC throws an error: class com.gregtechceu.gtceu.integration.jei.recipe.GTRecipeWrapper cannot be cast to class net.minecraft.world.item.crafting.Recipe
. JEC assumes all JEI recipes somehow trace back to Minecraft's Recipe
type. GregTech's GTRecipe
does trace back to Recipe
. GTRecipeWrapper
does not.
Steps to Reproduce
- Create an instance which has only GregTech, JEI, and Just Enough Calculation.
- Enter a world with cheat mode so you can summon a recipe calculator easily.
- Open up the recipe calculator.
- In JEI, press R on a recipe that can be made in a GregTech machine.
- The + button will not appear, and the error I mentioned above will appear in the logs.
Additional Information
I've thoroughly investigated the code of various mods to determine what's going on here. The best I can understand, this is a problem with LDLib, to whom I've also submitted a bug report here. The problem is that GregTech uses LDLib to add JEI IRecipeCategory
s here, and to do so, it gives LDLib the class GTRecipeWrapper
, which does not in any way extend Minecraft's Recipe
type (this is also because of LDLib, since its class ModularWrapper
does not extend Recipe
). Because of this, any GT recipes in JEI act like they have nothing to do with Minecraft's Recipe
class, at least for the purposes of any mods that use JEI's recipe feature.
I'm not sure what to do. I haven't coded for Minecraft since 1.12. I assume, however, that if LDLib fixes this, it will break GregTech's JEI integration, and GregTech will need to change how it interacts with LDLib. So I thought I would bring my bug report to LDLib to your attention so that you won't be caught off guard if LDLib changes something, or so that you can work together with LDLib, or in case you can fix it on your own.
Thanks so much, very sorry for the inconvenience.
LDLib is our in-house (practically) library mod, made by the lead developer.
and we kind of can't? fix it as I don't think JER would work either way, as it sounds like they only take the inputs & outputs the Recipe
class gives, which are empty for GT recipes.
Gotcha! That's good to know. I notice LDLib has specific EMI compatibility. Alright, suppose JEC got access to a GTRecipeWrapper
and I wanted to implement a compatibility function that grabs the inputs and outputs of a GT recipe. I assume I could take GTRecipeWrapper.recipe
, but then if inputs and outputs are empty, what functions should I call to get the lists of fluid and item inputs and outputs?