TechReborn/1.11/jei/scrapbox/ScrapboxRecipeCategory.java

76 lines
2 KiB
Java
Raw Normal View History

package techreborn.compat.jei.scrapbox;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
2016-09-27 18:03:57 +02:00
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.BlankRecipeCategory;
import net.minecraft.util.text.translation.I18n;
import techreborn.client.gui.GuiCompressor;
import techreborn.compat.jei.RecipeCategoryUids;
import techreborn.compat.jei.RecipeUtil;
2016-10-08 21:46:16 +02:00
import javax.annotation.Nonnull;
public class ScrapboxRecipeCategory extends BlankRecipeCategory<ScrapboxRecipeWrapper> {
2016-03-25 10:47:34 +01:00
private static final int[] INPUT_SLOTS = { 0 };
private static final int[] OUTPUT_SLOTS = { 1 };
private final IDrawable background;
private final String title;
2016-10-08 21:46:16 +02:00
public ScrapboxRecipeCategory(IGuiHelper guiHelper) {
background = guiHelper.createDrawable(GuiCompressor.texture, 55, 30, 82, 26);
title = I18n.translateToLocal("jei.techreborn.scrapbox.name");
}
@Nonnull
@Override
2016-10-08 21:46:16 +02:00
public String getUid() {
return RecipeCategoryUids.SCRAPBOX;
}
@Nonnull
@Override
2016-10-08 21:46:16 +02:00
public String getTitle() {
return title;
}
@Nonnull
@Override
2016-10-08 21:46:16 +02:00
public IDrawable getBackground() {
return background;
}
@Override
2016-10-08 21:46:16 +02:00
public void setRecipe(
@Nonnull
IRecipeLayout recipeLayout,
@Nonnull
ScrapboxRecipeWrapper recipeWrapper) {
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4);
2016-09-27 18:03:57 +02:00
RecipeUtil.setRecipeItems(recipeLayout, recipeWrapper, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
}
@Override
2016-10-08 21:46:16 +02:00
public void setRecipe(
@Nonnull
IRecipeLayout recipeLayout,
@Nonnull
ScrapboxRecipeWrapper recipeWrapper,
@Nonnull
IIngredients ingredients) {
2016-09-27 18:03:57 +02:00
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);
}
}