use of mezz.jei.api.recipe.IStackHelper in project HorsePower by GoryMoon.
the class ShapelessChoppingCraftingWrapper method getIngredients.
@Override
public void getIngredients(IIngredients ingredients) {
IStackHelper stackHelper = HorsePowerPlugin.jeiHelpers.getStackHelper();
List<List<ItemStack>> inputs = stackHelper.expandRecipeItemStackInputs(recipe.getIngredients());
ingredients.setInputLists(ItemStack.class, inputs);
if (!outputs.isEmpty())
ingredients.setOutputLists(ItemStack.class, outputs);
}
use of mezz.jei.api.recipe.IStackHelper in project HorsePower by GoryMoon.
the class ChoppingRecipeMaker method getChoppingRecipes.
public static List<ChoppingRecipeWrapper> getChoppingRecipes(IJeiHelpers helpers, boolean hand) {
IStackHelper stackHelper = helpers.getStackHelper();
Collection<ChoppingBlockRecipe> grindingRecipes = hand ? HPRecipes.instance().getManualChoppingRecipes() : HPRecipes.instance().getChoppingRecipes();
List<ChoppingRecipeWrapper> recipes = new ArrayList<>();
for (ChoppingBlockRecipe recipe : grindingRecipes) {
ItemStack input = recipe.getInput();
ItemStack output = recipe.getOutput();
List<ItemStack> inputs = stackHelper.getSubtypes(input);
ChoppingRecipeWrapper grindstoneRecipeWrapper = new ChoppingRecipeWrapper(inputs, output, recipe.getTime(), hand);
recipes.add(grindstoneRecipeWrapper);
}
return recipes;
}
use of mezz.jei.api.recipe.IStackHelper in project HorsePower by GoryMoon.
the class GrindingRecipeMaker method getGrindstoneRecipes.
public static List<GrindstoneRecipeWrapper> getGrindstoneRecipes(IJeiHelpers helpers, boolean hand) {
IStackHelper stackHelper = helpers.getStackHelper();
Collection<GrindstoneRecipe> grindingRecipes = hand ? HPRecipes.instance().getHandGrindstoneRecipes() : HPRecipes.instance().getGrindstoneRecipes();
List<GrindstoneRecipeWrapper> recipes = new ArrayList<>();
for (GrindstoneRecipe recipe : grindingRecipes) {
ItemStack input = recipe.getInput();
ItemStack output = recipe.getOutput();
ItemStack secondary = recipe.getSecondary();
List<ItemStack> inputs = stackHelper.getSubtypes(input);
GrindstoneRecipeWrapper grindstoneRecipeWrapper = new GrindstoneRecipeWrapper(inputs, output, secondary, recipe.getSecondaryChance(), recipe.getTime());
recipes.add(grindstoneRecipeWrapper);
}
return recipes;
}
use of mezz.jei.api.recipe.IStackHelper in project Binnie by ForestryMC.
the class DatabaseRecipeMaker method create.
public static List<DatabaseRecipeWrapper> create() {
List<DatabaseRecipeWrapper> recipes = new ArrayList<>();
ModuleItems items = Genetics.items();
{
ItemStack emptySerum = GeneticsItems.EMPTY_SERUM.get(1);
ItemStack resultSerum = new ItemStack(items.itemSerum, 1, OreDictionary.WILDCARD_VALUE);
IStackHelper stackHelper = GeneticsJeiPlugin.jeiHelpers.getStackHelper();
List<ItemStack> subtypes = stackHelper.toItemStackList(resultSerum);
List<ItemStack> resultSerums = new ArrayList<>();
for (ItemStack subtype : subtypes) {
subtype = subtype.copy();
subtype.setItemDamage(subtype.getMaxDamage());
resultSerums.add(subtype);
}
recipes.add(new DatabaseRecipeWrapper(emptySerum, resultSerums));
}
{
ItemStack emptySerumArray = GeneticsItems.EMPTY_GENOME.get(1);
ItemStack resultSerumArray = new ItemStack(items.itemSerumArray, 1, OreDictionary.WILDCARD_VALUE);
IStackHelper stackHelper = GeneticsJeiPlugin.jeiHelpers.getStackHelper();
List<ItemStack> subtypes = stackHelper.toItemStackList(resultSerumArray);
List<ItemStack> resultSerumArrays = new ArrayList<>();
for (ItemStack subtype : subtypes) {
subtype = subtype.copy();
subtype.setItemDamage(subtype.getMaxDamage());
resultSerumArrays.add(subtype);
}
recipes.add(new DatabaseRecipeWrapper(emptySerumArray, resultSerumArrays));
}
return recipes;
}
Aggregations