2016-02-25 13:17:33 +00:00
|
|
|
package techreborn.compat.jei.grinder;
|
|
|
|
|
|
|
|
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;
|
2016-02-25 13:17:33 +00:00
|
|
|
import mezz.jei.api.recipe.BlankRecipeCategory;
|
2016-03-18 08:29:29 +00:00
|
|
|
import net.minecraft.util.text.translation.I18n;
|
2016-02-25 13:17:33 +00:00
|
|
|
import techreborn.client.gui.GuiGrinder;
|
|
|
|
import techreborn.compat.jei.RecipeCategoryUids;
|
|
|
|
import techreborn.compat.jei.RecipeUtil;
|
|
|
|
|
2016-10-08 20:46:16 +01:00
|
|
|
import javax.annotation.Nonnull;
|
|
|
|
|
|
|
|
public class GrinderRecipeCategory extends BlankRecipeCategory<GrinderRecipeWrapper> {
|
2016-03-25 09:47:34 +00:00
|
|
|
private static final int[] INPUT_SLOTS = { 0 };
|
|
|
|
private static final int[] OUTPUT_SLOTS = { 1 };
|
2016-02-25 13:17:33 +00:00
|
|
|
|
|
|
|
private final IDrawable background;
|
|
|
|
private final String title;
|
|
|
|
|
2016-10-08 20:46:16 +01:00
|
|
|
public GrinderRecipeCategory(IGuiHelper guiHelper) {
|
2016-02-25 13:17:33 +00:00
|
|
|
background = guiHelper.createDrawable(GuiGrinder.texture, 55, 30, 82, 26);
|
2016-03-18 08:29:29 +00:00
|
|
|
title = I18n.translateToLocal("tile.techreborn.grinder.name");
|
2016-02-25 13:17:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Nonnull
|
|
|
|
@Override
|
2016-10-08 20:46:16 +01:00
|
|
|
public String getUid() {
|
2016-02-25 13:17:33 +00:00
|
|
|
return RecipeCategoryUids.GRINDER;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Nonnull
|
|
|
|
@Override
|
2016-10-08 20:46:16 +01:00
|
|
|
public String getTitle() {
|
2016-02-25 13:17:33 +00:00
|
|
|
return title;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Nonnull
|
|
|
|
@Override
|
2016-10-08 20:46:16 +01:00
|
|
|
public IDrawable getBackground() {
|
2016-02-25 13:17:33 +00:00
|
|
|
return background;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-10-08 20:46:16 +01:00
|
|
|
public void setRecipe(
|
|
|
|
@Nonnull
|
|
|
|
IRecipeLayout recipeLayout,
|
|
|
|
@Nonnull
|
|
|
|
GrinderRecipeWrapper recipeWrapper) {
|
2016-02-25 13:17:33 +00:00
|
|
|
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 20:46:16 +01:00
|
|
|
public void setRecipe(
|
|
|
|
@Nonnull
|
|
|
|
IRecipeLayout recipeLayout,
|
|
|
|
@Nonnull
|
|
|
|
GrinderRecipeWrapper 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);
|
2016-02-25 13:17:33 +00:00
|
|
|
}
|
|
|
|
}
|