/
JeiRuntime.java
48 lines (39 loc) · 1.18 KB
/
JeiRuntime.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
package mezz.jei;
import mezz.jei.api.IJeiRuntime;
import mezz.jei.gui.ItemListOverlay;
import mezz.jei.gui.recipes.RecipesGui;
public class JeiRuntime implements IJeiRuntime {
private final RecipeRegistry recipeRegistry;
private final ItemListOverlay itemListOverlay;
private final RecipesGui recipesGui;
private final IngredientRegistry ingredientRegistry;
public JeiRuntime(RecipeRegistry recipeRegistry, ItemListOverlay itemListOverlay, RecipesGui recipesGui, IngredientRegistry ingredientRegistry) {
this.recipeRegistry = recipeRegistry;
this.itemListOverlay = itemListOverlay;
this.recipesGui = recipesGui;
this.ingredientRegistry = ingredientRegistry;
}
public void close() {
if (itemListOverlay.isOpen()) {
itemListOverlay.close();
}
if (recipesGui.isOpen()) {
recipesGui.close();
}
}
@Override
public RecipeRegistry getRecipeRegistry() {
return recipeRegistry;
}
@Override
public ItemListOverlay getItemListOverlay() {
return itemListOverlay;
}
@Override
public RecipesGui getRecipesGui() {
return recipesGui;
}
public IngredientRegistry getIngredientRegistry() {
return ingredientRegistry;
}
}