use of mekanism.api.recipes.MetallurgicInfuserRecipe in project Mekanism by mekanism.
the class MetallurgicInfuserRecipeMapper method handleRecipe.
@Override
public boolean handleRecipe(IMappingCollector<NormalizedSimpleStack, Long> mapper, IRecipe<?> iRecipe, INSSFakeGroupManager groupManager) {
if (!(iRecipe instanceof MetallurgicInfuserRecipe)) {
// Double check that we have a type of recipe we know how to handle
return false;
}
boolean handled = false;
MetallurgicInfuserRecipe recipe = (MetallurgicInfuserRecipe) iRecipe;
List<@NonNull InfusionStack> infuseTypeRepresentations = recipe.getChemicalInput().getRepresentations();
List<@NonNull ItemStack> itemRepresentations = recipe.getItemInput().getRepresentations();
for (InfusionStack infuseTypeRepresentation : infuseTypeRepresentations) {
NormalizedSimpleStack nssInfuseType = NSSInfuseType.createInfuseType(infuseTypeRepresentation);
for (ItemStack itemRepresentation : itemRepresentations) {
ItemStack output = recipe.getOutput(itemRepresentation, infuseTypeRepresentation);
if (!output.isEmpty()) {
IngredientHelper ingredientHelper = new IngredientHelper(mapper);
ingredientHelper.put(nssInfuseType, infuseTypeRepresentation.getAmount());
ingredientHelper.put(itemRepresentation);
if (ingredientHelper.addAsConversion(output)) {
handled = true;
}
}
}
}
return handled;
}
Aggregations