GenericRecipesManager
Importing the class
If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.
Description
This recipe manager allows you to perform removal actions over all recipe managers. You can access this manager by using therecipes
global keyword. Implements
Undocumented Interfaces
Comparable<Enum>
Enum Constants
GenericRecipesManager is an enum with 1 constant. It is accessible like so:
Members
addJsonRecipe(name as string, data as MapData)
Add a new recipe based on the given recipe in a valid DataPack JSON format.
Unlike the addJSONRecipe method in
Unlike the addJSONRecipe method in
IRecipeManager
you **must** set the type of the recipe within the JSON yourself. Getter
Returns a list of all known recipe managers. This includes managers added by mod integrations as well as wrapper managers added to provide simple support.
Return Type:
List<IRecipeManager<?>>
allManagers() as List<IRecipeManager<?>>
Returns a list of all known recipe managers. This includes managers added by mod integrations as well as wrapper managers added to provide simple support.
Return Type:
List<IRecipeManager<?>>
getRecipeByName(name as string) as Recipe<?>
Parameters:
name: string
Type: string
Return Type:
Recipe<?>
getRecipesByOutput(output as IIngredient) as List<Recipe<?>>
Parameters:
output: IIngredient
Type: IIngredient
Return Type:
List<Recipe<?>>
Getter
Returns a map of all known recipes.
Return Type:
Recipe<?>[ResourceLocation]
recipeMap() as Recipe<?>[ResourceLocation]
Returns a map of all known recipes.
Returns: A Map of recipe name to recipe of all known recipes.
Return Type:
Recipe<?>[ResourceLocation]
remove(output as IIngredient)
Removes recipes by output
Parameters:
removeAll()
Removes all recipes from all managers.
removeByInput(input as IItemStack)
Removes all recipes where the input contains the given IItemStack.
Parameters:
removeByModid(modId as string)
Removes all recipes from the provided mod. Chooses the recipes based on their full recipe name, not based on output item!
Parameters:
modId: string
Type: string
- The mod's modId removeByModid(modId as string, exclude as function(t as string) as bool)
Removes all recipes from the provided mod. Allows a function to exclude certain recipe names from being removed. In the example below, only the recipe for the white bed would remain. Since the recipe's namespace is already fixed based on the modId argument, the recipe filter will only check the resource path!
Parameters:
modId: string
Type: string
- The mod's modid exclude: function(t as string) as bool
Type: function(t as string) as bool
- Function that returns true
if the recipe should remain in the registry. removeByName(names as string[])
Remove recipes based on Registry names
Parameters:
names: string[]
Type: string[]
- registry names of recipes to remove removeByRegex(regex as string)
Remove recipe based on regex
Parameters:
regex: string
Type: string
- regex to match against removeRecipe(output as IIngredient)
Removes recipes by output
Parameters: