Class IngredientCalculation
-
- All Implemented Interfaces:
public final class IngredientCalculation
balugaq
-
-
Field Summary
Fields Modifier and Type Field Description private final List<Container>
inputs
private final List<Container>
intermediates
private Double
outputAmount
-
Method Summary
Modifier and Type Method Description final List<Container>
getInputs()
final List<Container>
getIntermediates()
final Double
getOutputAmount()
Output amount: In basic recipe calculation -> the amount of main product output per recipe cycle
In final calculation results -> the total amount of main product to be produced (after scaling)
final Unit
setOutputAmount(Double outputAmount)
Output amount: In basic recipe calculation -> the amount of main product output per recipe cycle
In final calculation results -> the total amount of main product to be produced (after scaling)
final Unit
mergeSubCalculation(IngredientCalculation other)
Merge sub-recipe calculation results (only merge raw materials and along products, without affecting main product amount) Used in recursive calculation to integrate inputs and along products from sub-recipes final IngredientCalculation
scaleBy(Double multiplier)
Scale raw materials, along products and main product amounts by multiplier final IngredientCalculation
flat()
Merge all the similar components and return a clone final static IngredientCalculation
empty()
Create an empty calculation result (empty raw materials and along products, output amount is 0) final static IngredientCalculation
asIngredient(ItemStack stack)
Directly convert an item stack to a basic raw material (for items without recipes) -
-
Method Detail
-
getIntermediates
final List<Container> getIntermediates()
-
getOutputAmount
final Double getOutputAmount()
Output amount:
In basic recipe calculation -> the amount of main product output per recipe cycle
In final calculation results -> the total amount of main product to be produced (after scaling)
-
setOutputAmount
final Unit setOutputAmount(Double outputAmount)
Output amount:
In basic recipe calculation -> the amount of main product output per recipe cycle
In final calculation results -> the total amount of main product to be produced (after scaling)
-
mergeSubCalculation
final Unit mergeSubCalculation(IngredientCalculation other)
Merge sub-recipe calculation results (only merge raw materials and along products, without affecting main product amount) Used in recursive calculation to integrate inputs and along products from sub-recipes
-
scaleBy
final IngredientCalculation scaleBy(Double multiplier)
Scale raw materials, along products and main product amounts by multiplier
- Parameters:
multiplier
- Scaling multiplier (must be greater than 0)- Returns:
Scaled calculation result
-
flat
final IngredientCalculation flat()
Merge all the similar components and return a clone
-
empty
final static IngredientCalculation empty()
Create an empty calculation result (empty raw materials and along products, output amount is 0)
-
asIngredient
final static IngredientCalculation asIngredient(ItemStack stack)
Directly convert an item stack to a basic raw material (for items without recipes)
- Parameters:
stack
- Target item stack- Returns:
Calculation result with this item as raw material
-
-
-