@Override
public void getIngredients(@Nonnull IIngredients ingredients) {
final ItemStack outputStack = recipe.getOutputStack();
final List<ResourceLocation> supportedSouls = recipe.getSupportedSouls();
final ItemStack inputStack = recipe.getInputStack();
final List<ItemStack> inputItemList = new NNList<>();
if (Prep.isValid(inputStack)) {
inputItemList.add(inputStack);
if (itemBrokenSpawner.getItem() == inputStack.getItem()) {
CapturedMob resultMob = CapturedMob.create(outputStack);
for (CapturedMob soul : CapturedMob.getAllSouls()) {
if (resultMob == null || !resultMob.isSameType(soul)) {
inputItemList.add(soul.toStack(itemBrokenSpawner.getItemNN(), 0, 1));
}
}
}
}
NNList<CapturedMob> souls = CapturedMob.getSouls(supportedSouls);
final List<ItemStack> soulStacks = new ArrayList<ItemStack>();
final List<ItemStack> outputs = new ArrayList<ItemStack>();
for (CapturedMob soul : souls) {
soulStacks.add(soul.toStack(itemSoulVial.getItemNN(), 1, 1));
outputs.add(recipe.getOutputStack(inputStack, soul));
}
ingredients.setInputLists(ItemStack.class, new NNList<List<ItemStack>>(soulStacks, inputItemList));
ingredients.setOutputLists(ItemStack.class, new NNList<List<ItemStack>>(Collections.singletonList(new ItemStack(itemSoulVial.getItemNN())), outputs));
ingredients.setInput(EnergyIngredient.class, new EnergyIngredient(recipe.getEnergyRequired()));
}