use of forestry.api.recipes.IVariableFermentable in project ForestryMC by ForestryMC.
the class FermenterRecipeWrapper method getIngredients.
@Override
public void getIngredients(IIngredients ingredients) {
List<ItemStack> fuelInputs = new ArrayList<>();
for (FermenterFuel fuel : FuelManager.fermenterFuel.values()) {
fuelInputs.add(fuel.getItem());
}
ingredients.setInputLists(ItemStack.class, Arrays.asList(Collections.singletonList(fermentable), fuelInputs));
FluidStack fluidInput = getRecipe().getFluidResource().copy();
fluidInput.amount = getRecipe().getFermentationValue();
ingredients.setInput(FluidStack.class, fluidInput);
int amount = Math.round(getRecipe().getFermentationValue() * getRecipe().getModifier());
if (fermentable.getItem() instanceof IVariableFermentable) {
amount *= ((IVariableFermentable) fermentable.getItem()).getFermentationModifier(fermentable);
}
FluidStack fluidOutput = new FluidStack(getRecipe().getOutput(), amount);
ingredients.setOutput(FluidStack.class, fluidOutput);
}
Aggregations