use of betterwithaddons.interaction.jei.wrapper.InfuserRecipeWrapper in project BetterWithAddons by DaedalusGame.
the class InfuserRecipeCategory method setRecipe.
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
guiItemStacks.init(craftOutputSlot, false, 107, 29);
for (int y = 0; y < 3; ++y) {
for (int x = 0; x < 3; ++x) {
int index = craftInputSlot1 + x + (y * 3);
guiItemStacks.init(index, true, 13 + x * 18, 11 + y * 18);
}
}
if (recipeWrapper instanceof InfuserRecipeWrapper) {
IRecipeWrapper innerWrapper = ((InfuserRecipeWrapper) recipeWrapper).getInner();
if (innerWrapper instanceof ICustomCraftingRecipeWrapper) {
ICustomCraftingRecipeWrapper customWrapper = (ICustomCraftingRecipeWrapper) innerWrapper;
customWrapper.setRecipe(recipeLayout, ingredients);
return;
}
List<List<ItemStack>> inputs = ingredients.getInputs(ItemStack.class);
List<List<ItemStack>> outputs = ingredients.getOutputs(ItemStack.class);
if (innerWrapper instanceof IShapedCraftingRecipeWrapper) {
IShapedCraftingRecipeWrapper wrapper = (IShapedCraftingRecipeWrapper) innerWrapper;
craftingGridHelper.setInputs(guiItemStacks, inputs, wrapper.getWidth(), wrapper.getHeight());
} else {
craftingGridHelper.setInputs(guiItemStacks, inputs);
recipeLayout.setShapeless();
}
guiItemStacks.set(craftOutputSlot, outputs.get(0));
}
}
Aggregations