Enum Class GenericRecipesManager

java.lang.Object
java.lang.Enum<GenericRecipesManager>
com.blamejared.crafttweaker.api.recipe.manager.GenericRecipesManager
All Implemented Interfaces:
Serializable, Comparable<GenericRecipesManager>, Constable

@ZenRegister public enum GenericRecipesManager extends Enum<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.
DocParam:
this recipes
  • Enum Constant Details

  • Method Details

    • values

      public static GenericRecipesManager[] 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

      public static GenericRecipesManager valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • addJsonRecipe

      public void addJsonRecipe(String name, MapData data)
      Add a new recipe based on the given recipe in a valid DataPack JSON format. Unlike the addJSONRecipe method in IRecipeManager you **must** set the type of the recipe within the JSON yourself.
      Parameters:
      name - The recipe's resource path
      data - 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

      public net.minecraft.world.item.crafting.Recipe<?> getRecipeByName(String name)
    • getRecipesByOutput

      public List<net.minecraft.world.item.crafting.Recipe<?>> getRecipesByOutput(IIngredient output)
    • getAllRecipes

      public List<net.minecraft.world.item.crafting.Recipe<?>> 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(forRemoval=true) public void removeRecipe(IIngredient output)
      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

      public void remove(IIngredient output)
      Removes recipes by output
      Parameters:
      output - The recipe result
      DocParam:
      output <item:minecraft:iron_ingot>
    • removeByInput

      public void removeByInput(IItemStack input)
      Removes all recipes where the input contains the given IItemStack.
      Parameters:
      input - The input IItemStack.
      DocParam:
      input <item:minecraft:iron_ingot>
    • removeByName

      @Deprecated(forRemoval=true) public void removeByName(String name)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Removes all recipes with this name.
      Parameters:
      name - The recipe name to remove
    • removeByName

      public void removeByName(String... names)
      Remove recipes based on Registry names
      Parameters:
      names - registry names of recipes to remove
      DocParam:
      name "minecraft:furnace", "minecraft:bow"
    • removeByModid

      public void removeByModid(String modId)
      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

      public void removeByModid(String modId, Predicate<String> exclude)
      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 modid
      exclude - Function that returns `true` if the recipe should remain in the registry.
      DocParam:
      modId "minecraft", exclude (recipeName as string) => recipeName == "white_bed"
    • removeByRegex

      public void removeByRegex(String regex)
      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

      public List<IRecipeManager<?>> 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.