Recipes takes too much space on JEI
ArukaAlter opened this issue ยท 12 comments
Ok... I'm really not sure as how to handle this. I don't know the proper JEI methods to do this...
For the vanilla side, you can create a custom IRecipe
where the output depends on the input.
For JEI, displaying that type of recipe takes some extra work, there isn't simple support for it.
You must implement ICustomCraftingRecipeWrapper
and in setRecipe
you can check for what the player is focusing on.
If the IRecipeLayout#getFocus
is null, they are just browsing all recipes and you should display everything.
If the focus is not null, you will have to restrict the inputs and outputs you set in the recipe layout depending on what they are focusing on.
For example:
- a null focus will show all the recipes in rotation
- a focus on lever will show all the recipes in rotation
- a focus on forestry ipe planks as an input should only show the ipe plank barrel as an output
- a focus on a ipe plank barrel as an output should only show the ipe planks as an input
Wow. Thanks a bunch @mezz!
FYI: JEI is awesome!
I can look into collapsing AgriCraft recipes in JEI.
I wonder what @mezz would say about this...
The truth is the whole custom wood crafting recipe system is foreign to me, and a bit magical. It's one of the few areas of the code I've never gotten into, and remains from the 1.7.10 version.
I'm not even sure how @InfinityRaider got it to work in the first place, given that the minecraft recipe system is less than conducive to the concept of dynamic recipes like that (which is why I've stayed away from it).
With a custom recipe type, you could have the inputs and outputs cycle through each valid result
I'll have to look into creating a custom recipe type, as to get this working. At the moment it appears that we simply use the GameRegistry to add all the variants as separate recipes.
Yeah, it doesn't look like minecraft supports bundling multiple recipe variants into a single recipe. Will have to condense via JEI interface.