/
IRecipeCategory.java
70 lines (61 loc) · 2.43 KB
/
IRecipeCategory.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package mezz.jei.api.recipe;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IDrawableAnimated;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.ingredients.IIngredients;
import net.minecraft.client.Minecraft;
/**
* Defines a category of recipe, (i.e. Crafting Table Recipe, Furnace Recipe).
* Handles setting up the GUI for its recipe category in {@link #setRecipe(IRecipeLayout, IRecipeWrapper)}.
* Also draws elements that are common to all recipes in the category like the background.
*
* @see BlankRecipeCategory
*/
public interface IRecipeCategory<T extends IRecipeWrapper> {
/**
* Returns a unique ID for this recipe category.
* Referenced from recipes to identify which recipe category they belong to.
*
* @see IRecipeHandler#getRecipeCategoryUid(Object)
* @see VanillaRecipeCategoryUid
*/
String getUid();
/**
* Returns the localized name for this recipe type.
* Drawn at the top of the recipe GUI pages for this category.
*/
String getTitle();
/**
* Returns the drawable background for a single recipe in this category.
*/
IDrawable getBackground();
/**
* Draw any extra elements that might be necessary, icons or extra slots.
* @see IDrawable for a simple class for drawing things.
* @see IGuiHelper for useful functions.
*/
void drawExtras(Minecraft minecraft);
/**
* Draw any animations like progress bars or flashy effects.
* Essentially the same as {@link #drawExtras(Minecraft)} but these can be disabled in the config.
* @see IDrawableAnimated for a simple class for drawing animated things.
* @see IGuiHelper for useful functions.
*/
void drawAnimations(Minecraft minecraft);
/**
* Set the {@link IRecipeLayout} properties from the {@link IRecipeWrapper}.
* @deprecated since JEI 3.11.0. use {@link #setRecipe(IRecipeLayout, IRecipeWrapper, IIngredients)}
*/
@Deprecated
void setRecipe(IRecipeLayout recipeLayout, T recipeWrapper);
/**
* Set the {@link IRecipeLayout} properties from the {@link IRecipeWrapper} and {@link IIngredients}.
*
* @param recipeLayout the layout that needs its properties set.
* @param recipeWrapper the recipeWrapper, for extra information.
* @param ingredients the ingredients, already set by the recipeWrapper
* @since JEI 3.11.0
*/
void setRecipe(IRecipeLayout recipeLayout, T recipeWrapper, IIngredients ingredients);
}