Recipe Wrappers - mezz/JustEnoughItems GitHub Wiki
Recipe Wrappers
A recipe wrapper takes a recipe and "wraps" it, and exposes properties that JEI needs in order to understand the recipe.
Responsibilities of a recipe wrapper:
IRecipeWrapper.getIngredients
fills out a list of ingredients with a standard format.
- This is used by JEI to figure out what the recipe's inputs and outputs are, for ingredient lookups.
- Normally a wrapper has a recipe as a field internally, and the wrapper's job is to fill out the standard ingredient format by using information from the recipe.
Optional Abilities of a recipe wrapper:
- Draws information that is specific to the recipe.
- Examples:
- draw the number of brewing steps to reach the brewing products in the recipe
- draw the time taken to burn a fuel in the recipe
- draw the description of the item in the recipe
- Defines tooltips for specific areas on the recipe.
- One example is the ability to hover over the resource graph from JustEnoughResources to see more detailed information.
- Handles clicks for specific areas on the recipe.
- May be used for buttons or other functions.
Implementation
There are several @Deprecated
methods that don't need to be filled out. To avoid those and other optional methods, make sure your implementation extends BlankRecipeWrapper
. Then it can just override the methods that are important and ignore the others.
The implementation here is centered around filling out IRecipeWrapper.getIngredients
.
Take a look at recipe wrappers from the List of Plugin Implementations for a better understanding of how it works.
Full Documentation
See IRecipeWrapper
.