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:

  • Crafting:
  • ShapedOreRecipe, ShapedRecipes,
  • ShapelessOreRecipe, ShapelessRecipes
  • Brewing
  • VanillaBrewingRecipe,
  • BrewingRecipe, BrewingOreRecipe
  • Items that satisfy PotionHelper.isReagent
  • Smelting
  • Anything registered in FurnaceRecipes
  • Fuels
  • Items that satisfy TileEntityFurnace.isItemFuel.

Support for all of these is added in the VanillaPlugin, 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, it's time to 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 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.
  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.

Modded Recipe Implementation

Adding a description page for an item:

  1. JEI has built-in support for recipes that serve as item descriptions.
    Simply register your item and its description with IModRegistry.addDescription.

Adding Modded Recipes to a new recipe category:

  1. Implement a Recipe Category, Recipe Wrapper, and Recipe Handler.

  2. Register your Recipe Category using IModRegistry.addRecipeCategories and register your Recipe Handler with IModRegistry.addRecipeHandlers.

  3. Add your regular recipes with IModRegistry.addRecipes. They will be converted to Recipe Wrapper by your Recipe Handler at runtime by calling IRecipeHandler.getRecipeWrapper.

Adding Modded Recipes to an existing category:

  1. Only implement a Recipe Wrapper and a Recipe Handler.
  • Use an existing UID for the recipe category UID in your Recipe Handler.
    The UIDs for recipe categories added by JEI are listed in VanillaRecipeCategoryUid. Other mods should list their usable category UIDs in their own API somewhere.
  • If you are adding to the Vanilla Crafting Recipe Category in particular, your Recipe Wrapper must implement ICraftingRecipeWrapper or IShapedCraftingRecipeWrapper.
  1. Register your Recipe Handler by using IModRegistry.addRecipeHandlers.

  2. Add your regular recipes with IModRegistry.addRecipes. They will be converted to Recipe Wrapper by your Recipe Handler at runtime by a call to IRecipeHandler.getRecipeWrapper.

Clone this wiki locally