Skip to content
mezz edited this page Oct 26, 2016 · 9 revisions

Vanilla Recipes

JEI has built-in handling for recipes from the following classes:
ShapedOreRecipe, ShapedRecipes, ShapelessOreRecipe, ShapelessRecipes,
VanillaBrewingRecipe, BrewingRecipe, BrewingOreRecipe
as well as anything registered with FurnaceRecipes and any fuels that satisfy TileEntityFurnace.isItemFuel.

Support for all of these is added in the VanillaPlugin, and using the same API as any other mod plugin.

If your recipe is not one of those listed above, it is a Modded Recipe.

Modded Recipes

To add support for your Modded Recipes to JEI, you have to create a plugin.
Next, fill out your plugin's register method.
In register, the plugin is passed the IModRegistry which can be used to add recipes to JEI.

There are three important classes for recipes:

  1. Recipe Wrappers
  • Represents a single recipe in a format that JEI can understand.
  • Draws recipe-specific information on the screen.
  1. Recipe Handlers
  • Ties a recipe class to a recipe category.
  • Turns normal recipes into recipe wrappers.
  • Checks that recipes are valid.
  1. Recipe Categories
  • Represents a category of recipe, like "Crafting" or "Smelting".
  • Draws the recipe background and any category-specific information on the screen.
  • Sets recipe layout information for clickable ingredients on the screen.

Implementation

If you have a unique category of recipes, you will have to implement all three of the above classes and register them with JEI.

If you are adding Modded Recipes to an existing category, you will only have to create a wrapper and a handler. The UIDs for recipe categories added by JEI are listed in VanillaRecipeCategoryUid.

To add Modded Recipes to the Vanilla Crafting category, your recipe wrapper must implement ICraftingRecipeWrapper or IShapedCraftingRecipeWrapper.

Clone this wiki locally