Search in sources :

Example 1 with FluidToFluidRecipe

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

the class FluidToFluidRecipeMapper method handleRecipe.

@Override
public boolean handleRecipe(IMappingCollector<NormalizedSimpleStack, Long> mapper, IRecipe<?> iRecipe, INSSFakeGroupManager groupManager) {
    if (!(iRecipe instanceof FluidToFluidRecipe)) {
        // Double check that we have a type of recipe we know how to handle
        return false;
    }
    boolean handled = false;
    FluidToFluidRecipe recipe = (FluidToFluidRecipe) iRecipe;
    for (FluidStack representation : recipe.getInput().getRepresentations()) {
        FluidStack 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 : FluidStack(net.minecraftforge.fluids.FluidStack) FluidToFluidRecipe(mekanism.api.recipes.FluidToFluidRecipe) IngredientHelper(mekanism.common.integration.projecte.IngredientHelper)

Aggregations

FluidToFluidRecipe (mekanism.api.recipes.FluidToFluidRecipe)1 IngredientHelper (mekanism.common.integration.projecte.IngredientHelper)1 FluidStack (net.minecraftforge.fluids.FluidStack)1