75 lines
2 KiB
Java
75 lines
2 KiB
Java
package techreborn.compat.jei.vacuumFreezer;
|
|
|
|
import mezz.jei.api.IGuiHelper;
|
|
import mezz.jei.api.gui.IDrawable;
|
|
import mezz.jei.api.gui.IGuiItemStackGroup;
|
|
import mezz.jei.api.gui.IRecipeLayout;
|
|
import mezz.jei.api.ingredients.IIngredients;
|
|
import mezz.jei.api.recipe.BlankRecipeCategory;
|
|
import net.minecraft.util.text.translation.I18n;
|
|
import techreborn.client.gui.GuiVacuumFreezer;
|
|
import techreborn.compat.jei.RecipeCategoryUids;
|
|
import techreborn.compat.jei.RecipeUtil;
|
|
|
|
import javax.annotation.Nonnull;
|
|
|
|
public class VacuumFreezerRecipeCategory extends BlankRecipeCategory<VacuumFreezerRecipeWrapper> {
|
|
private static final int[] INPUT_SLOTS = { 0 };
|
|
private static final int[] OUTPUT_SLOTS = { 1 };
|
|
|
|
private final IDrawable background;
|
|
private final String title;
|
|
|
|
public VacuumFreezerRecipeCategory(IGuiHelper guiHelper) {
|
|
background = guiHelper.createDrawable(GuiVacuumFreezer.texture, 55, 30, 82, 26);
|
|
title = I18n.translateToLocal("tile.techreborn.vacuumfreezer.name");
|
|
}
|
|
|
|
@Nonnull
|
|
@Override
|
|
public String getUid() {
|
|
return RecipeCategoryUids.VACUUM_FREEZER;
|
|
}
|
|
|
|
@Nonnull
|
|
@Override
|
|
public String getTitle() {
|
|
return title;
|
|
}
|
|
|
|
@Nonnull
|
|
@Override
|
|
public IDrawable getBackground() {
|
|
return background;
|
|
}
|
|
|
|
@Override
|
|
public void setRecipe(
|
|
@Nonnull
|
|
IRecipeLayout recipeLayout,
|
|
@Nonnull
|
|
VacuumFreezerRecipeWrapper recipeWrapper) {
|
|
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
|
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
|
|
|
guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4);
|
|
|
|
RecipeUtil.setRecipeItems(recipeLayout, recipeWrapper, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
|
}
|
|
|
|
@Override
|
|
public void setRecipe(
|
|
@Nonnull
|
|
IRecipeLayout recipeLayout,
|
|
@Nonnull
|
|
VacuumFreezerRecipeWrapper recipeWrapper,
|
|
@Nonnull
|
|
IIngredients ingredients) {
|
|
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
|
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
|
|
|
|
guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4);
|
|
|
|
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
|
|
}
|
|
}
|