Skip to content
ErdbeerbaerLP edited this page Jul 19, 2019 · 5 revisions

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:

  1. 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:

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