Search in sources :

Example 1 with ItemStackToGasRecipe

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

the class ItemStackToGasRecipeMapper method handleRecipe.

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

Aggregations

GasStack (mekanism.api.chemical.gas.GasStack)1 ItemStackToGasRecipe (mekanism.api.recipes.ItemStackToGasRecipe)1 IngredientHelper (mekanism.common.integration.projecte.IngredientHelper)1 ItemStack (net.minecraft.item.ItemStack)1