Search in sources :

Example 1 with GasToGasRecipe

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

the class GasToGasRecipeMapper method handleRecipe.

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

Aggregations

GasStack (mekanism.api.chemical.gas.GasStack)1 GasToGasRecipe (mekanism.api.recipes.GasToGasRecipe)1 IngredientHelper (mekanism.common.integration.projecte.IngredientHelper)1