-
Notifications
You must be signed in to change notification settings - Fork 305
Recipe Categories
A recipe category defines everything that's common across entire categories of recipes.
The recipe categories add by plugins in JEI are Crafting
, Smelting
, Fuel
, Brewing
, and Description
.
See VanillaRecipeCraftingUid
for more information about these recipe categories.
- Define a category
- The category's UID
- Localized Title
- Background Image
- Set recipe layouts based on the given recipe wrapper.
- Fill out which ingredients are visible on the screen and their location.
- Draw extra elements and animations on the screen.
- Some categories may need to draw extra slots or other elements not drawn by the background.
Fill out the required methods for the UID and Title.
There are helpful methods in IGuiHelper
for drawing cropped resources on the screen.
The way the recipe lays out on the screen depends on the background's size.
- The less height the background has, the more recipes fit on one screen.
- Backgrounds may need extra padding to fit text without running into the next recipe.
- Be sure to check how your recipe looks at different GUI scales in Minecraft. JEI will try to display more recipes when the GUI scale is smaller.
For a better understanding of this process, follow along with one of the IRecipeCategory
implementations in the List of Plugin Implementations.
In IRecipeCategory.setRecipe
, the category will define the layout of ingredients for a single IRecipeWrapper
.
The IRecipeLayout
is set up here to display ingredients, that each have tooltips and can be clicked to navigate to other recipes.
- From the
IRecipeLayout
, get theItemStack
,FluidStack
, or otherIGuiIngredientGroup
that you want to place. - Init the
IGuiIngredientGroup
with the locations the ingredients should be drawn. - Set the ingredients in the
IGuiIngredientGroup
using the various set methods.
See IRecipeCategory
.
- Setup
- Item Ingredients
- Essential Extras
- Advanced
List of Plugin Implementations
- Setup
- Item Ingredients
- Working with Recipes
- Other