Enum Class GenericRecipesManager
java.lang.Object
java.lang.Enum<GenericRecipesManager>
com.blamejared.crafttweaker.api.recipe.manager.GenericRecipesManager
- All Implemented Interfaces:
Serializable,Comparable<GenericRecipesManager>,Constable
This recipe manager allows you to perform removal actions over all recipe managers.
You can access this manager by using the `recipes` global keyword.
- DocParam:
- this recipes
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionvoidaddJsonRecipe(String name, MapData data) Add a new recipe based on the given recipe in a valid DataPack JSON format.List<IRecipeManager<?>>Returns a list of all known recipe managers.List<net.minecraft.world.item.crafting.Recipe<?>>net.minecraft.world.item.crafting.Recipe<?>getRecipeByName(String name) Map<net.minecraft.resources.ResourceLocation,net.minecraft.world.item.crafting.Recipe<?>> Returns a map of all known recipes.List<net.minecraft.world.item.crafting.Recipe<?>>getRecipesByOutput(IIngredient output) voidremove(IIngredient output) Removes recipes by outputvoidRemoves all recipes from all managers.voidremoveByModid(String modId) Removes all recipes from the provided mod.voidremoveByModid(String modId, Predicate<String> exclude) Removes all recipes from the provided mod.voidremoveByName(String name) Deprecated, for removal: This API element is subject to removal in a future version.voidremoveByName(String... names) Remove recipes based on Registry namesvoidremoveByRegex(String regex) Remove recipe based on regexvoidremoveRecipe(IIngredient output) Deprecated, for removal: This API element is subject to removal in a future version.use remove(IIngredient output)static GenericRecipesManagerReturns the enum constant of this class with the specified name.static GenericRecipesManager[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
addJsonRecipe
Add a new recipe based on the given recipe in a valid DataPack JSON format. Unlike the addJSONRecipe method inIRecipeManageryou **must** set the type of the recipe within the JSON yourself.- Parameters:
name- The recipe's resource pathdata- The recipe in JSON format- DocParam:
- name "recipe_name", data { type: "minecraft:smoking", ingredient: <item:minecraft:gold_ore>, result: <item:minecraft:cooked_porkchop>, experience: 0.35 as float, cookingtime: 100 }
-
getRecipeByName
-
getRecipesByOutput
-
getAllRecipes
-
getRecipeMap
public Map<net.minecraft.resources.ResourceLocation,net.minecraft.world.item.crafting.Recipe<?>> getRecipeMap()Returns a map of all known recipes.- Returns:
- A Map of recipe name to recipe of all known recipes.
-
removeRecipe
Deprecated, for removal: This API element is subject to removal in a future version.use remove(IIngredient output)Removes recipes by output- Parameters:
output- The recipe result- DocParam:
- output <item:minecraft:iron_ingot>
-
remove
Removes recipes by output- Parameters:
output- The recipe result- DocParam:
- output <item:minecraft:iron_ingot>
-
removeByName
Deprecated, for removal: This API element is subject to removal in a future version.UseremoveByName(String...)insteadRemoves all recipes with this name.- Parameters:
name- The recipe name to remove
-
removeByName
Remove recipes based on Registry names- Parameters:
names- registry names of recipes to remove- DocParam:
- name "minecraft:furnace", "minecraft:bow"
-
removeByModid
Removes all recipes from the provided mod. Chooses the recipes based on their full recipe name, not based on output item!- Parameters:
modId- The mod's modId- DocParam:
- modId "crafttweaker"
-
removeByModid
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- The mod's modidexclude- Function that returns `true` if the recipe should remain in the registry.- DocParam:
- modId "minecraft", exclude (recipeName as string) => recipeName == "white_bed"
-
removeByRegex
Remove recipe based on regex- Parameters:
regex- regex to match against- DocParam:
- regex "\\d_\\d"
-
removeAll
public void removeAll()Removes all recipes from all managers. -
getAllManagers
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.
-
removeByName(String...)instead