AgriCraft

AgriCraft

30M Downloads

Recipes takes too much space on JEI

ArukaAlter opened this issue ยท 12 comments

commented

When a supported mod like Forestry is present, a single block gets 460 recipes registered, which results in 150~230 pages when viewing usage of items such as the lever (used in the valve).

commented

Ok... I'm really not sure as how to handle this. I don't know the proper JEI methods to do this...

commented

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
commented

Wow. Thanks a bunch @mezz!

FYI: JEI is awesome!

commented

I can look into collapsing AgriCraft recipes in JEI.

I wonder what @mezz would say about this...

commented

What about just use oreDictionary in the recipes?

commented

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).

commented

Using oreDictionary would fix this issue, wouldnt it?

commented

With a custom recipe type, you could have the inputs and outputs cycle through each valid result

commented

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.

commented

I meant custom recipe handler, sorry

commented

Yeah, it doesn't look like minecraft supports bundling multiple recipe variants into a single recipe. Will have to condense via JEI interface.

commented

Closing since we are moving to 1.16.