/
IRecipeRegistry.java
178 lines (152 loc) · 6.1 KB
/
IRecipeRegistry.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
package mezz.jei.api;
import javax.annotation.Nullable;
import java.util.Collection;
import java.util.List;
import mezz.jei.api.recipe.IFocus;
import mezz.jei.api.recipe.IRecipeCategory;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
/**
* The IRecipeManager offers several functions for retrieving and handling recipes.
* The IRecipeManager instance is provided in JEIManager.
* Get the instance from {@link IJeiRuntime#getRecipeRegistry()}.
*/
public interface IRecipeRegistry {
/**
* Returns the IRecipeHandler associated with the recipeClass or null if there is none
*/
@Nullable
<T> IRecipeHandler<T> getRecipeHandler(Class<? extends T> recipeClass);
/**
* Returns an unmodifiable list of all Recipe Categories
*/
List<IRecipeCategory> getRecipeCategories();
/**
* Returns an unmodifiable list of Recipe Categories
*/
List<IRecipeCategory> getRecipeCategories(List<String> recipeCategoryUids);
/**
* Returns a new focus.
*/
<V> IFocus<V> createFocus(IFocus.Mode mode, @Nullable V ingredient);
/**
* Returns a list of Recipe Categories for the focus.
*
* @since JEI 3.11.0
*/
<V> List<IRecipeCategory> getRecipeCategories(IFocus<V> focus);
/**
* Returns a list of Recipe Wrappers in the recipeCategory that have the focus.
*
* @since JEI 3.12.0
*/
<T extends IRecipeWrapper, V> List<T> getRecipeWrappers(IRecipeCategory<T> recipeCategory, IFocus<V> focus);
/**
* Returns a list of Recipe Wrappers in recipeCategory.
*
* @since JEI 3.12.0
*/
<T extends IRecipeWrapper> List<T> getRecipeWrappers(IRecipeCategory<T> recipeCategory);
/**
* Returns an unmodifiable collection of ItemStacks that can craft the recipes from recipeCategory.
* For instance, the crafting table ItemStack is returned here for Crafting recipe category.
* These are registered with {@link IModRegistry#addRecipeCategoryCraftingItem(ItemStack, String...)}.
* <p>
* This takes the current focus into account, so that if the focus mode is set to Input
* and the focus is included in the craftingItems, it is the only one returned.
*
* @since JEI 3.11.0
*/
Collection<ItemStack> getCraftingItems(IRecipeCategory recipeCategory, IFocus focus);
/**
* Add a new recipe while the game is running.
* This is only for things like gated recipes becoming available, like the ones in Thaumcraft.
* Use your IRecipeHandler.isValid to determine which recipes are hidden, and when a recipe becomes valid you can add it here.
* (note that IRecipeHandler.isValid must be true when the recipe is added here for it to work)
*/
void addRecipe(Object recipe);
// DEPRECATED METHODS BELOW
/**
* Returns an unmodifiable list of Recipes in recipeCategory that have the focus.
*
* @since JEI 3.11.0
* @deprecated since JEI 3.12.0. Use {@link #getRecipeWrappers(IRecipeCategory, IFocus)}
*/
@Deprecated
<V> List<Object> getRecipes(IRecipeCategory recipeCategory, IFocus<V> focus);
/**
* Returns an unmodifiable list of Recipes in recipeCategory
*
* @deprecated since JEI 3.12.0. Use {@link #getRecipeWrappers(IRecipeCategory)}
*/
@Deprecated
List<Object> getRecipes(IRecipeCategory recipeCategory);
/**
* Returns an unmodifiable collection of ItemStacks that can craft recipes from recipeCategory.
* For instance, the crafting table ItemStack is returned here for Crafting recipe category.
* These are registered with {@link IModRegistry#addRecipeCategoryCraftingItem(ItemStack, String...)}.
*
* @since JEI 3.3.0
* @deprecated since JEI 3.11.0. Use {@link #getCraftingItems(IRecipeCategory, IFocus)}.
*/
@Deprecated
Collection<ItemStack> getCraftingItems(IRecipeCategory recipeCategory);
/**
* Returns an unmodifiable list of Recipe Categories that have the ItemStack as an input.
*
* @deprecated since JEI 3.11.0. Use {@link #getRecipeCategories(IFocus)}
*/
@Deprecated
List<IRecipeCategory> getRecipeCategoriesWithInput(ItemStack input);
/**
* Returns an unmodifiable list of Recipe Categories that have the Fluid as an input.
*
* @deprecated since JEI 3.11.0. Use {@link #getRecipeCategories(IFocus)}
*/
@Deprecated
List<IRecipeCategory> getRecipeCategoriesWithInput(FluidStack input);
/**
* Returns an unmodifiable list of Recipe Categories that have the ItemStack as an output.
*
* @deprecated since JEI 3.11.0. Use {@link #getRecipeCategories(IFocus)}
*/
@Deprecated
List<IRecipeCategory> getRecipeCategoriesWithOutput(ItemStack output);
/**
* Returns an unmodifiable list of Recipe Categories that have the Fluid as an output.
*
* @deprecated since JEI 3.11.0. Use {@link #getRecipeCategories(IFocus)}
*/
@Deprecated
List<IRecipeCategory> getRecipeCategoriesWithOutput(FluidStack output);
/**
* Returns an unmodifiable list of Recipes of recipeCategory that have the ItemStack as an input.
*
* @deprecated since JEI 3.11.0. Use {@link #getRecipeWrappers(IRecipeCategory, IFocus)}
*/
@Deprecated
List<Object> getRecipesWithInput(IRecipeCategory recipeCategory, ItemStack input);
/**
* Returns an unmodifiable list of Recipes of recipeCategory that have the Fluid as an input.
*
* @deprecated since JEI 3.11.0. Use {@link #getRecipeWrappers(IRecipeCategory, IFocus)}
*/
@Deprecated
List<Object> getRecipesWithInput(IRecipeCategory recipeCategory, FluidStack input);
/**
* Returns an unmodifiable list of Recipes of recipeCategory that have the ItemStack as an output.
*
* @deprecated since JEI 3.11.0. Use {@link #getRecipeWrappers(IRecipeCategory, IFocus)}
*/
@Deprecated
List<Object> getRecipesWithOutput(IRecipeCategory recipeCategory, ItemStack output);
/**
* Returns an unmodifiable list of Recipes of recipeCategory that have the Fluid as an output.
*
* @deprecated since JEI 3.11.0. Use {@link #getRecipeWrappers(IRecipeCategory, IFocus)}
*/
@Deprecated
List<Object> getRecipesWithOutput(IRecipeCategory recipeCategory, FluidStack output);
}