GenericRecipesManager
This recipe manager allows you to perform removal actions over all recipe managers.
You can access this manager by using the recipes
global keyword.
Importing the class
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
Enum Constants
GenericRecipesManager is an enum. It has 1 enum constants. They are accessible using the code below.
Methods
Add a new recipe based on the given recipe in a valid DataPack JSON format.
Unlike the addJSONRecipe method in IRecipeManager<T> you must set the type of the recipe within the JSON yourself.
Parameter | Type | Description |
---|---|---|
Parameter name | Type string | Description The recipe’s resource path |
Parameter data | Type MapData | Description The recipe in JSON format |
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: stdlib.List<IRecipeManager>
Return Type: stdlib.List<Recipe>
Return Type: Recipe
Parameter | Type |
---|---|
Parameter name | Type string |
Returns a map of all known recipes.
Returns: A Map of recipe name to recipe of all known recipes.
Return Type: Recipe[ResourceLocation]
Return Type: stdlib.List<Recipe>
Parameter | Type |
---|---|
Parameter output | Type IIngredient |
Removes recipes by output
Parameter | Type | Description |
---|---|---|
Parameter output | Type IIngredient | Description The recipe result |
Removes all recipes from all managers.
Removes all recipes from the provided mod. Chooses the recipes based on their full recipe name, not based on output item!
Parameter | Type | Description |
---|---|---|
Parameter modId | Type string | Description The mod’s modId |
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!
Parameter | Type | Description |
---|---|---|
Parameter modId | Type string | Description The mod’s modid |
Parameter exclude | Type Predicate<string> | Description Function that returns true if the recipe should remain in the registry. |
Remove recipes based on Registry names
Parameter | Type | Description |
---|---|---|
Parameter names | Type string[] | Description registry names of recipes to remove |
Remove recipe based on regex
Parameter | Type | Description |
---|---|---|
Parameter regex | Type string | Description regex to match against |
Removes recipes by output
Parameter | Type | Description |
---|---|---|
Parameter output | Type IIngredient | Description The recipe result |
Properties
Name | Type | Has Getter | Has Setter | Description |
---|---|---|---|---|
Name allManagers | Type stdlib.List<IRecipeManager> | Has Getter true | Has Setter false | Description 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. |
Name allRecipes | Type stdlib.List<Recipe> | Has Getter true | Has Setter false | Description |
Name recipeMap | Type Recipe[ResourceLocation] | Has Getter true | Has Setter false | Description Returns a map of all known recipes. |