M - The type of the machine.I - The type of the recipe input of all recipes associated with the machine.O - The type of the recipe output of all recipes associated with the machine.P - The type of the recipe properties of all recipes associated with the machine.public class RecipeRegistry<M extends IMachine<M,I,O,P>,I extends IRecipeInput,O extends IRecipeOutput,P extends IRecipeProperties> extends java.lang.Object implements IRecipeRegistry<M,I,O,P>
IRecipeRegistry.| Constructor and Description |
|---|
RecipeRegistry(M machine)
Make a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<IRecipe<I,O,P>> |
allRecipes()
Returns a list of all recipes that are associated with the current machine.
|
IRecipe<I,O,P> |
findRecipe(IRecipeMatcher<M,IRecipe<I,O,P>> recipeMatcher)
Returns the first recipe for which the matches() method of the given RecipeMatcher returns true.
|
IRecipe<I,O,P> |
findRecipeByInput(I input)
Returns the first recipe whose input matches the given recipe input.
|
IRecipe<I,O,P> |
findRecipeByNamedId(java.lang.String namedId)
Returns the first recipe whose named id matches the given named id.
|
IRecipe<I,O,P> |
findRecipeByOutput(O output)
Returns the first recipe whose output matches the given recipe output.
|
java.util.List<IRecipe<I,O,P>> |
findRecipes(IRecipeMatcher<M,IRecipe<I,O,P>> recipeMatcher)
Returns a list of recipes for which the matches() method of the given RecipeMatcher return true.
|
java.util.List<IRecipe<I,O,P>> |
findRecipesByInput(I input)
Returns a list of recipes whose input match the given recipe input.
|
java.util.List<IRecipe<I,O,P>> |
findRecipesByOutput(O output)
Returns a list of recipes whose output match the given recipe output.
|
void |
registerRecipe(I input,
O output,
P properties)
Registers a new recipe with the given properties with this registry.
|
void |
registerRecipe(IRecipe<I,O,P> recipe)
Registers the given recipe with this registry.
|
void |
registerRecipe(java.lang.String namedId,
I input,
O output,
P properties)
Registers a new recipe with the given properties with this registry.
|
public RecipeRegistry(M machine)
machine - The machine this registry is for.public void registerRecipe(IRecipe<I,O,P> recipe)
IRecipeRegistryregisterRecipe in interface IRecipeRegistry<M extends IMachine<M,I,O,P>,I extends IRecipeInput,O extends IRecipeOutput,P extends IRecipeProperties>recipe - A recipe that should be registered.public void registerRecipe(java.lang.String namedId,
I input,
O output,
P properties)
IRecipeRegistryregisterRecipe in interface IRecipeRegistry<M extends IMachine<M,I,O,P>,I extends IRecipeInput,O extends IRecipeOutput,P extends IRecipeProperties>namedId - A unique name for the given recipe.input - The input of the recipe.output - The output of the recipe.properties - Additional properties of the recipe.public void registerRecipe(I input, O output, P properties)
IRecipeRegistryregisterRecipe in interface IRecipeRegistry<M extends IMachine<M,I,O,P>,I extends IRecipeInput,O extends IRecipeOutput,P extends IRecipeProperties>input - The input of the recipe.output - The output of the recipe.properties - Additional properties of the recipe.public IRecipe<I,O,P> findRecipeByNamedId(java.lang.String namedId)
IRecipeRegistryfindRecipeByNamedId in interface IRecipeRegistry<M extends IMachine<M,I,O,P>,I extends IRecipeInput,O extends IRecipeOutput,P extends IRecipeProperties>namedId - The unique named id of the recipe.public IRecipe<I,O,P> findRecipeByInput(I input)
IRecipeRegistryfindRecipeByInput in interface IRecipeRegistry<M extends IMachine<M,I,O,P>,I extends IRecipeInput,O extends IRecipeOutput,P extends IRecipeProperties>input - The input of the recipe.public java.util.List<IRecipe<I,O,P>> findRecipesByInput(I input)
IRecipeRegistryfindRecipesByInput in interface IRecipeRegistry<M extends IMachine<M,I,O,P>,I extends IRecipeInput,O extends IRecipeOutput,P extends IRecipeProperties>input - The input of the recipe.public IRecipe<I,O,P> findRecipeByOutput(O output)
IRecipeRegistryfindRecipeByOutput in interface IRecipeRegistry<M extends IMachine<M,I,O,P>,I extends IRecipeInput,O extends IRecipeOutput,P extends IRecipeProperties>output - The output of the recipe.public java.util.List<IRecipe<I,O,P>> findRecipesByOutput(O output)
IRecipeRegistryfindRecipesByOutput in interface IRecipeRegistry<M extends IMachine<M,I,O,P>,I extends IRecipeInput,O extends IRecipeOutput,P extends IRecipeProperties>output - The output of the recipe.public IRecipe<I,O,P> findRecipe(IRecipeMatcher<M,IRecipe<I,O,P>> recipeMatcher)
IRecipeRegistryfindRecipe in interface IRecipeRegistry<M extends IMachine<M,I,O,P>,I extends IRecipeInput,O extends IRecipeOutput,P extends IRecipeProperties>recipeMatcher - Defines the criteria for finding recipes.public java.util.List<IRecipe<I,O,P>> findRecipes(IRecipeMatcher<M,IRecipe<I,O,P>> recipeMatcher)
IRecipeRegistryfindRecipes in interface IRecipeRegistry<M extends IMachine<M,I,O,P>,I extends IRecipeInput,O extends IRecipeOutput,P extends IRecipeProperties>recipeMatcher - Defines the criteria for finding recipes.public java.util.List<IRecipe<I,O,P>> allRecipes()
IRecipeRegistryallRecipes in interface IRecipeRegistry<M extends IMachine<M,I,O,P>,I extends IRecipeInput,O extends IRecipeOutput,P extends IRecipeProperties>