@Override
protected void onIndexUpdate(int index, IFabricatorRecipe recipe) {
selectedElement.add(new TankElement(1, 33, null, () -> new FluidTankInfo(recipe.getLiquid(), 2000), FABRICATOR_TANK_OVERLAY, 16, 16));
NonNullList<NonNullList<ItemStack>> ingredients = recipe.getIngredients();
for (int x = 0; x < 3; x++) {
for (int y = 0; y < 3; y++) {
int ingredientIndex = y * 3 + x;
if (ingredientIndex >= ingredients.size()) {
continue;
}
NonNullList<ItemStack> items = ingredients.get(ingredientIndex);
selectedElement.add(new IngredientElement(21 + x * 19, 1 + y * 19, Ingredient.fromStacks(items.toArray(new ItemStack[items.size()]))));
}
}
ItemStack plan = recipe.getPlan();
if (!plan.isEmpty()) {
selectedElement.item(91, 1, plan);
}
selectedElement.item(91, 39, recipe.getRecipeOutput());
NonNullList<ItemStack> smeltingInput = NonNullList.create();
Fluid recipeFluid = recipe.getLiquid().getFluid();
for (IFabricatorSmeltingRecipe s : getSmeltingInputs().get(recipeFluid)) {
smeltingInput.add(s.getResource());
}
if (!smeltingInput.isEmpty()) {
selectedElement.add(new IngredientElement(1, 6, smeltingInput));
}
}