/
CampfireCategory.java
59 lines (48 loc) · 1.82 KB
/
CampfireCategory.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
package mezz.jei.plugins.vanilla.cooking;
import com.mojang.blaze3d.matrix.MatrixStack;
import mezz.jei.api.gui.drawable.IDrawableAnimated;
import net.minecraft.block.Blocks;
import net.minecraft.item.crafting.CampfireCookingRecipe;
import net.minecraft.util.ResourceLocation;
import mezz.jei.api.constants.VanillaRecipeCategoryUid;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.gui.drawable.IDrawable;
import mezz.jei.api.gui.ingredient.IGuiItemStackGroup;
import mezz.jei.api.helpers.IGuiHelper;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.config.Constants;
public class CampfireCategory extends AbstractCookingCategory<CampfireCookingRecipe> {
private final IDrawable background;
public CampfireCategory(IGuiHelper guiHelper) {
super(guiHelper, Blocks.CAMPFIRE, "gui.jei.category.campfire", 400);
background = guiHelper.drawableBuilder(Constants.RECIPE_GUI_VANILLA, 0, 186, 82, 34)
.addPadding(0, 10, 0, 0)
.build();
}
@Override
public ResourceLocation getUid() {
return VanillaRecipeCategoryUid.CAMPFIRE;
}
@Override
public Class<? extends CampfireCookingRecipe> getRecipeClass() {
return CampfireCookingRecipe.class;
}
@Override
public IDrawable getBackground() {
return background;
}
@Override
public void draw(CampfireCookingRecipe recipe, MatrixStack matrixStack, double mouseX, double mouseY) {
animatedFlame.draw(matrixStack, 1, 20);
IDrawableAnimated arrow = getArrow(recipe);
arrow.draw(matrixStack, 24, 8);
drawCookTime(recipe, matrixStack, 35);
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, CampfireCookingRecipe recipe, IIngredients ingredients) {
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
guiItemStacks.init(inputSlot, true, 0, 0);
guiItemStacks.init(outputSlot, false, 60, 8);
guiItemStacks.set(ingredients);
}
}