Search in sources :

Example 1 with ItemStackToInfuseTypeRecipe

use of mekanism.api.recipes.ItemStackToInfuseTypeRecipe in project Mekanism by mekanism.

the class ItemStackToInfuseTypeRecipeMapper method handleRecipe.

@Override
public boolean handleRecipe(IMappingCollector<NormalizedSimpleStack, Long> mapper, IRecipe<?> iRecipe, INSSFakeGroupManager groupManager) {
    if (!(iRecipe instanceof ItemStackToInfuseTypeRecipe)) {
        // Double check that we have a type of recipe we know how to handle
        return false;
    }
    boolean handled = false;
    ItemStackToInfuseTypeRecipe recipe = (ItemStackToInfuseTypeRecipe) iRecipe;
    for (ItemStack representation : recipe.getInput().getRepresentations()) {
        InfusionStack output = recipe.getOutput(representation);
        if (!output.isEmpty()) {
            IngredientHelper ingredientHelper = new IngredientHelper(mapper);
            ingredientHelper.put(representation);
            if (ingredientHelper.addAsConversion(output)) {
                handled = true;
            }
        }
    }
    return handled;
}
Also used : InfusionStack(mekanism.api.chemical.infuse.InfusionStack) ItemStackToInfuseTypeRecipe(mekanism.api.recipes.ItemStackToInfuseTypeRecipe) ItemStack(net.minecraft.item.ItemStack) IngredientHelper(mekanism.common.integration.projecte.IngredientHelper)

Aggregations

InfusionStack (mekanism.api.chemical.infuse.InfusionStack)1 ItemStackToInfuseTypeRecipe (mekanism.api.recipes.ItemStackToInfuseTypeRecipe)1 IngredientHelper (mekanism.common.integration.projecte.IngredientHelper)1 ItemStack (net.minecraft.item.ItemStack)1